1
0
mirror of https://github.com/moby/moby.git synced 2025-07-30 18:23:29 +03:00

Fix ineffassign linting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2018-07-09 19:40:34 +02:00
parent f0585d04d0
commit ddd8a6572d
20 changed files with 74 additions and 64 deletions

View File

@ -1012,10 +1012,6 @@ func (s *DockerSuite) TestBuildAddBadLinksVolume(c *check.C) {
ADD foo.txt /x/`
targetFile = "foo.txt"
)
var (
name = "test-link-absolute-volume"
dockerfile = ""
)
tempDir, err := ioutil.TempDir("", "test-link-absolute-volume-temp-")
if err != nil {
@ -1023,7 +1019,7 @@ func (s *DockerSuite) TestBuildAddBadLinksVolume(c *check.C) {
}
defer os.RemoveAll(tempDir)
dockerfile = fmt.Sprintf(dockerfileTemplate, tempDir)
dockerfile := fmt.Sprintf(dockerfileTemplate, tempDir)
nonExistingFile := filepath.Join(tempDir, targetFile)
ctx := fakecontext.New(c, "", fakecontext.WithDockerfile(dockerfile))
@ -1040,7 +1036,7 @@ func (s *DockerSuite) TestBuildAddBadLinksVolume(c *check.C) {
c.Fatal(err)
}
buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx))
buildImageSuccessfully(c, "test-link-absolute-volume", build.WithExternalBuildContext(ctx))
if _, err := os.Stat(nonExistingFile); err == nil || err != nil && !os.IsNotExist(err) {
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
}