diff --git a/staging/src/k8s.io/apimachinery/pkg/util/duration/duration.go b/staging/src/k8s.io/apimachinery/pkg/util/duration/duration.go index 1bc1e3c81ff..c31b2a0cb52 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/duration/duration.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/duration/duration.go @@ -27,9 +27,9 @@ func ShortHumanDuration(d time.Duration) string { // Allow deviation no more than 2 seconds(excluded) to tolerate machine time // inconsistence, it can be considered as almost now. if seconds := int(d.Seconds()); seconds < -1 { - return fmt.Sprintf("") + return "" } else if seconds < 0 { - return fmt.Sprintf("0s") + return "0s" } else if seconds < 60 { return fmt.Sprintf("%ds", seconds) } else if minutes := int(d.Minutes()); minutes < 60 { @@ -49,9 +49,9 @@ func HumanDuration(d time.Duration) string { // Allow deviation no more than 2 seconds(excluded) to tolerate machine time // inconsistence, it can be considered as almost now. if seconds := int(d.Seconds()); seconds < -1 { - return fmt.Sprintf("") + return "" } else if seconds < 0 { - return fmt.Sprintf("0s") + return "0s" } else if seconds < 60*2 { return fmt.Sprintf("%ds", seconds) } diff --git a/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/upgrade.go b/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/upgrade.go index f17eb09e960..d30ae2fa3dc 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/upgrade.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/upgrade.go @@ -94,7 +94,7 @@ func (u responseUpgrader) UpgradeResponse(w http.ResponseWriter, req *http.Reque hijacker, ok := w.(http.Hijacker) if !ok { - errorMsg := fmt.Sprintf("unable to upgrade: unable to hijack response") + errorMsg := "unable to upgrade: unable to hijack response" http.Error(w, errorMsg, http.StatusInternalServerError) return nil } diff --git a/staging/src/k8s.io/apimachinery/pkg/util/json/json_test.go b/staging/src/k8s.io/apimachinery/pkg/util/json/json_test.go index cc5e24b86dd..9464eb7f3f7 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/json/json_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/json/json_test.go @@ -352,8 +352,8 @@ func TestEvaluateTypes(t *testing.T) { t.Run(fmt.Sprintf("%d_raw", i), func(t *testing.T) { // decode the input as a standalone object - inputJSON := fmt.Sprintf(`%s`, tc.In) - expectedJSON := fmt.Sprintf(`%s`, tc.Out) + inputJSON := tc.In + expectedJSON := tc.Out var m interface{} err := Unmarshal([]byte(inputJSON), &m) if tc.Err && err != nil { diff --git a/staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go b/staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go index 9f834fa538d..d738725caf0 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go @@ -142,7 +142,7 @@ func GetCaller() string { runtime.Callers(3, pc[:]) f := runtime.FuncForPC(pc[0]) if f == nil { - return fmt.Sprintf("Unable to find caller") + return "Unable to find caller" } return f.Name() }