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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user