w est de type http.ResponseWriterchaîne passant golang contenant "%" à http.ResponseWriter provoque variable manquante
Cela est bien:
fmt.Fprintf(w, statusPercentage + " " + mostUpToDateStatusDownloaded + "/"+ mostUpToDateStatusOverallData)
sortie: 100 488 MB/488 MB
Cela pose un problème:
fmt.Fprintf(w, statusPercentage + "% " + mostUpToDateStatusDownloaded + "/"+ mostUpToDateStatusOverallData)
sortie: 100%! (MANQUANT) MB/488 Mo
Problème résolu! Il s'est avéré que je dois échapper au signe de pourcentage en utilisant double%. Reportez-vous à https://stackoverflow.com/questions/1860159/how-to-escape-the-percent-sign-in-cs-printf pour plus d'informations. – Bruce
Vous avez peut-être entendu parler de Println. – Volker