Use strings.Replace instead strings.ReplaceAll to have support for go >=1.10

Signed-off-by: Xabier Larrakoetxea <slok69@gmail.com>
This commit is contained in:
Xabier Larrakoetxea 2019-05-08 05:50:57 +02:00
parent bfd354e253
commit 79ede36653
No known key found for this signature in database
GPG Key ID: FDAD7FD8275E1B32
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ func durationSingleUnitPrettyFormat(d time.Duration, decimals int) string {
} }
func suffixDecimalFormat(decimals int, suffix string) string { func suffixDecimalFormat(decimals int, suffix string) string {
suffix = strings.ReplaceAll(suffix, "%", "%%") // safe `%` character for fmt. suffix = strings.Replace(suffix, "%", "%%", -1) // Safe `%` character for fmt.
return fmt.Sprintf("%%.%df%s", decimals, suffix) return fmt.Sprintf("%%.%df%s", decimals, suffix)
} }