Jelajahi Sumber

following 'go vet' in utils pkg.

Andrews Medina 12 tahun lalu
induk
melakukan
6cf493bea7
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      utils/utils.go

+ 2 - 2
utils/utils.go

@@ -87,7 +87,7 @@ func (r *progressReader) Read(p []byte) (n int, err error) {
 	}
 	}
 	if r.readProgress-r.lastUpdate > updateEvery || err != nil {
 	if r.readProgress-r.lastUpdate > updateEvery || err != nil {
 		if r.readTotal > 0 {
 		if r.readTotal > 0 {
-			fmt.Fprintf(r.output, r.template, HumanSize(int64(r.readProgress)), HumanSize(int64(r.readTotal)), fmt.Sprintf("%2.0f%%",float64(r.readProgress)/float64(r.readTotal)*100))
+			fmt.Fprintf(r.output, r.template, HumanSize(int64(r.readProgress)), HumanSize(int64(r.readTotal)), fmt.Sprintf("%2.0f%%", float64(r.readProgress)/float64(r.readTotal)*100))
 		} else {
 		} else {
 			fmt.Fprintf(r.output, r.template, r.readProgress, "?", "n/a")
 			fmt.Fprintf(r.output, r.template, r.readProgress, "?", "n/a")
 		}
 		}
@@ -133,7 +133,7 @@ func HumanDuration(d time.Duration) string {
 	} else if hours < 24*365*2 {
 	} else if hours < 24*365*2 {
 		return fmt.Sprintf("%d months", hours/24/30)
 		return fmt.Sprintf("%d months", hours/24/30)
 	}
 	}
-	return fmt.Sprintf("%d years", d.Hours()/24/365)
+	return fmt.Sprintf("%f years", d.Hours()/24/365)
 }
 }
 
 
 // HumanSize returns a human-readable approximation of a size
 // HumanSize returns a human-readable approximation of a size