diff --git a/integration-cli/docker_api_stats_test.go b/integration-cli/docker_api_stats_test.go index 6802cfbe2b..cd614a5e20 100644 --- a/integration-cli/docker_api_stats_test.go +++ b/integration-cli/docker_api_stats_test.go @@ -67,7 +67,7 @@ func (s *DockerSuite) TestAPIStatsStoppedContainerInGoroutines(c *testing.T) { id := strings.TrimSpace(out) getGoRoutines := func() int { - _, body, err := request.Get(fmt.Sprintf("/info")) + _, body, err := request.Get("/info") assert.NilError(c, err) info := types.Info{} err = json.NewDecoder(body).Decode(&info) @@ -78,7 +78,7 @@ func (s *DockerSuite) TestAPIStatsStoppedContainerInGoroutines(c *testing.T) { // When the HTTP connection is closed, the number of goroutines should not increase. routines := getGoRoutines() - _, body, err := request.Get(fmt.Sprintf("/containers/%s/stats", id)) + _, body, err := request.Get("/containers/" + id + "/stats") assert.NilError(c, err) body.Close() @@ -190,7 +190,7 @@ func (s *DockerSuite) TestAPIStatsNetworkStatsVersioning(c *testing.T) { func getNetworkStats(c *testing.T, id string) map[string]types.NetworkStats { var st *types.StatsJSON - _, body, err := request.Get(fmt.Sprintf("/containers/%s/stats?stream=false", id)) + _, body, err := request.Get("/containers/" + id + "/stats?stream=false") assert.NilError(c, err) err = json.NewDecoder(body).Decode(&st) @@ -207,7 +207,7 @@ func getNetworkStats(c *testing.T, id string) map[string]types.NetworkStats { func getVersionedStats(c *testing.T, id string, apiVersion string) map[string]interface{} { stats := make(map[string]interface{}) - _, body, err := request.Get(fmt.Sprintf("/%s/containers/%s/stats?stream=false", apiVersion, id)) + _, body, err := request.Get("/" + apiVersion + "/containers/" + id + "/stats?stream=false") assert.NilError(c, err) defer body.Close() @@ -284,7 +284,7 @@ func (s *DockerSuite) TestAPIStatsNoStreamConnectedContainers(c *testing.T) { ch := make(chan error, 1) go func() { - resp, body, err := request.Get(fmt.Sprintf("/containers/%s/stats?stream=false", id2)) + resp, body, err := request.Get("/containers/" + id2 + "/stats?stream=false") defer body.Close() if err != nil { ch <- err diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index c7dc934d62..968e1d67a0 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -4544,16 +4544,16 @@ func (s *DockerSuite) TestBuildBuildTimeArgEnv(c *testing.T) { ` result := buildImage("testbuildtimeargenv", cli.WithFlags( - "--build-arg", fmt.Sprintf("FOO1=fromcmd"), - "--build-arg", fmt.Sprintf("FOO2="), - "--build-arg", fmt.Sprintf("FOO3"), // set in env - "--build-arg", fmt.Sprintf("FOO4"), // not set in env - "--build-arg", fmt.Sprintf("FOO5=fromcmd"), + "--build-arg", "FOO1=fromcmd", + "--build-arg", "FOO2=", + "--build-arg", "FOO3", // set in env + "--build-arg", "FOO4", // not set in env + "--build-arg", "FOO5=fromcmd", // FOO6 is not set at all - "--build-arg", fmt.Sprintf("FOO7=fromcmd"), // should produce a warning - "--build-arg", fmt.Sprintf("FOO8="), // should produce a warning - "--build-arg", fmt.Sprintf("FOO9"), // should produce a warning - "--build-arg", fmt.Sprintf("FO10"), // not set in env, empty value + "--build-arg", "FOO7=fromcmd", // should produce a warning + "--build-arg", "FOO8=", // should produce a warning + "--build-arg", "FOO9", // should produce a warning + "--build-arg", "FO10", // not set in env, empty value ), cli.WithEnvironmentVariables(append(os.Environ(), "FOO1=fromenv", @@ -4665,7 +4665,7 @@ func (s *DockerSuite) TestBuildMultiStageGlobalArg(c *testing.T) { result := cli.BuildCmd(c, imgName, build.WithDockerfile(dockerfile), - cli.WithFlags("--build-arg", fmt.Sprintf("tag=latest"))) + cli.WithFlags("--build-arg", "tag=latest")) result.Assert(c, icmd.Success) result = cli.DockerCmd(c, "images", "-q", "-f", "label=multifromtest=1") @@ -4687,7 +4687,7 @@ func (s *DockerSuite) TestBuildMultiStageUnusedArg(c *testing.T) { result := cli.BuildCmd(c, imgName, build.WithDockerfile(dockerfile), - cli.WithFlags("--build-arg", fmt.Sprintf("baz=abc"))) + cli.WithFlags("--build-arg", "baz=abc")) result.Assert(c, icmd.Success) assert.Assert(c, strings.Contains(result.Combined(), "[Warning]")) assert.Assert(c, strings.Contains(result.Combined(), "[baz] were not consumed")) diff --git a/integration/plugin/graphdriver/external_test.go b/integration/plugin/graphdriver/external_test.go index eadcdc8e66..87ce1b82d7 100644 --- a/integration/plugin/graphdriver/external_test.go +++ b/integration/plugin/graphdriver/external_test.go @@ -129,7 +129,7 @@ func setupPlugin(t *testing.T, ec map[string]*graphEventsCounter, ext string, mu w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1+json") switch t := data.(type) { case error: - fmt.Fprintln(w, fmt.Sprintf(`{"Err": %q}`, t.Error())) + fmt.Fprintf(w, "{\"Err\": %q}\n", t.Error()) case string: fmt.Fprintln(w, t) default: @@ -318,7 +318,7 @@ func setupPlugin(t *testing.T, ec map[string]*graphEventsCounter, ext string, mu parent := r.URL.Query().Get("parent") if id == "" { - http.Error(w, fmt.Sprintf("missing id"), 409) + http.Error(w, "missing id", 409) } size, err := driver.ApplyDiff(id, parent, diff) diff --git a/pkg/devicemapper/devmapper.go b/pkg/devicemapper/devmapper.go index 41d7b65af7..688b7f9932 100644 --- a/pkg/devicemapper/devmapper.go +++ b/pkg/devicemapper/devmapper.go @@ -381,7 +381,7 @@ func CancelDeferredRemove(deviceName string) error { return fmt.Errorf("devicemapper: Can't set sector %s", err) } - if err := task.setMessage(fmt.Sprintf("@cancel_deferred_remove")); err != nil { + if err := task.setMessage("@cancel_deferred_remove"); err != nil { return fmt.Errorf("devicemapper: Can't set message %s", err) } diff --git a/pkg/jsonmessage/jsonmessage_test.go b/pkg/jsonmessage/jsonmessage_test.go index 2ce422687f..f1a7be2a7b 100644 --- a/pkg/jsonmessage/jsonmessage_test.go +++ b/pkg/jsonmessage/jsonmessage_test.go @@ -252,7 +252,7 @@ func TestDisplayJSONMessagesStream(t *testing.T) { // Without progress, with ID "{ \"id\": \"ID\",\"status\": \"status\" }": { "ID: status\n", - fmt.Sprintf("ID: status\n"), + "ID: status\n", }, // With progress "{ \"id\": \"ID\", \"status\": \"status\", \"progress\": \"ProgressMessage\" }": {