1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

fix some minor linting issues

libnetwork/firewall_linux.go:11:21: var-declaration: should drop = nil from declaration of var ctrl; it is the zero value (revive)
        ctrl *controller = nil
                           ^
    distribution/pull_v2_test.go:213:4: S1038: should use t.Fatalf(...) instead of t.Fatal(fmt.Sprintf(...)) (gosimple)
                t.Fatal(fmt.Sprintf("expected formatPlatform to show windows platform with a version, but got '%s'", result))
                ^
    integration-cli/docker_cli_build_test.go:5951:3: S1038: should use c.Skipf(...) instead of c.Skip(fmt.Sprintf(...)) (gosimple)
            c.Skip(fmt.Sprintf("Bug fixed in 18.06 or higher.Skipping it for %s", testEnv.DaemonInfo.ServerVersion))
            ^
    integration-cli/docker_cli_daemon_test.go:240:3: S1038: should use c.Skipf(...) instead of c.Skip(fmt.Sprintf(...)) (gosimple)
            c.Skip(fmt.Sprintf("New base device size (%v) must be greater than (%s)", units.HumanSize(float64(newBasesizeBytes)), units.HumanSize(float64(oldBasesizeBytes))))
            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-07-04 10:12:20 +02:00
parent 10c56efa97
commit 968ff5ab44
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
4 changed files with 3 additions and 10 deletions

View file

@ -3,7 +3,6 @@ package distribution // import "github.com/docker/docker/distribution"
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"fmt"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"net/url" "net/url"
@ -210,7 +209,7 @@ func TestFormatPlatform(t *testing.T) {
} }
matches, _ := regexp.MatchString("windows.* [0-9]", result) matches, _ := regexp.MatchString("windows.* [0-9]", result)
if !matches { if !matches {
t.Fatal(fmt.Sprintf("expected formatPlatform to show windows platform with a version, but got '%s'", result)) t.Fatalf("expected formatPlatform to show windows platform with a version, but got '%s'", result)
} }
} }
} }

View file

@ -5946,10 +5946,6 @@ func (s *DockerCLIBuildSuite) TestBuildMultiStageResetScratch(c *testing.T) {
} }
func (s *DockerCLIBuildSuite) TestBuildIntermediateTarget(c *testing.T) { func (s *DockerCLIBuildSuite) TestBuildIntermediateTarget(c *testing.T) {
//todo: need to be removed after 18.06 release
if strings.Contains(testEnv.DaemonInfo.ServerVersion, "18.05.0") {
c.Skip(fmt.Sprintf("Bug fixed in 18.06 or higher.Skipping it for %s", testEnv.DaemonInfo.ServerVersion))
}
dockerfile := ` dockerfile := `
FROM busybox AS build-env FROM busybox AS build-env
CMD ["/dev"] CMD ["/dev"]

View file

@ -237,7 +237,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithIncreasedBasesize(c *testing.T)
var newBasesizeBytes int64 = 53687091200 // 50GB in bytes var newBasesizeBytes int64 = 53687091200 // 50GB in bytes
if newBasesizeBytes < oldBasesizeBytes { if newBasesizeBytes < oldBasesizeBytes {
c.Skip(fmt.Sprintf("New base device size (%v) must be greater than (%s)", units.HumanSize(float64(newBasesizeBytes)), units.HumanSize(float64(oldBasesizeBytes)))) c.Skipf("New base device size (%v) must be greater than (%s)", units.HumanSize(float64(newBasesizeBytes)), units.HumanSize(float64(oldBasesizeBytes)))
} }
err := s.d.RestartWithError("--storage-opt", fmt.Sprintf("dm.basesize=%d", newBasesizeBytes)) err := s.d.RestartWithError("--storage-opt", fmt.Sprintf("dm.basesize=%d", newBasesizeBytes))

View file

@ -7,9 +7,7 @@ import (
const userChain = "DOCKER-USER" const userChain = "DOCKER-USER"
var ( var ctrl *controller
ctrl *controller = nil
)
func setupArrangeUserFilterRule(c *controller) { func setupArrangeUserFilterRule(c *controller) {
ctrl = c ctrl = c