integration-cli: TestBuildAddBadLinks, TestBuildAddBadLinksVolume: simplify check

This fixes the following lint warning:

> integration-cli/docker_cli_build_test.go:1001:59: nilness: tautological condition: non-nil != nil (govet)
>	if _, err := os.Stat(nonExistingFile); err == nil || err != nil && !os.IsNotExist(err) {
>	                                                         ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Kir Kolyshkin 2019-08-05 17:41:46 -07:00 committed by Sebastiaan van Stijn
parent cbc3cfe101
commit 6aadd436a9
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 2 deletions

View File

@ -998,7 +998,7 @@ func (s *DockerSuite) TestBuildAddBadLinks(c *testing.T) {
}
buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx))
if _, err := os.Stat(nonExistingFile); err == nil || err != nil && !os.IsNotExist(err) {
if _, err := os.Stat(nonExistingFile); err == nil || !os.IsNotExist(err) {
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
}
@ -1039,7 +1039,7 @@ func (s *DockerSuite) TestBuildAddBadLinksVolume(c *testing.T) {
}
buildImageSuccessfully(c, "test-link-absolute-volume", build.WithExternalBuildContext(ctx))
if _, err := os.Stat(nonExistingFile); err == nil || err != nil && !os.IsNotExist(err) {
if _, err := os.Stat(nonExistingFile); err == nil || !os.IsNotExist(err) {
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
}