diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-22 08:26:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 08:26:31 -0400 |
commit | 22500d797aba09eada894a69ad88f2699a560d02 (patch) | |
tree | 009b712a567ee4fd25fb4e8961e47cb0a4c8e684 /test/utils | |
parent | 04acbaa4b161b23e93b990321582b1586d86f2a8 (diff) | |
parent | 1514d5c933510228dfa8bb9b6c020af3f266060f (diff) | |
download | podman-22500d797aba09eada894a69ad88f2699a560d02.tar.gz podman-22500d797aba09eada894a69ad88f2699a560d02.tar.bz2 podman-22500d797aba09eada894a69ad88f2699a560d02.zip |
Merge pull request #13972 from Luap99/staticcheck
enable staticcheck linter
Diffstat (limited to 'test/utils')
-rw-r--r-- | test/utils/common_function_test.go | 3 | ||||
-rw-r--r-- | test/utils/utils.go | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/test/utils/common_function_test.go b/test/utils/common_function_test.go index 6323b44eb..a73d75490 100644 --- a/test/utils/common_function_test.go +++ b/test/utils/common_function_test.go @@ -110,9 +110,8 @@ var _ = Describe("Common functions test", func() { Expect(err).To(BeNil(), "Failed to write JSON to file.") read, err := os.Open("/tmp/testJSON") - defer read.Close() - Expect(err).To(BeNil(), "Can not find the JSON file after we write it.") + defer read.Close() bytes, _ := ioutil.ReadAll(read) json.Unmarshal(bytes, compareData) diff --git a/test/utils/utils.go b/test/utils/utils.go index 39a0ac875..9695835e5 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -439,10 +439,10 @@ func tagOutputToMap(imagesOutput []string) map[string]map[string]bool { // GetHostDistributionInfo returns a struct with its distribution Name and version func GetHostDistributionInfo() HostOS { f, err := os.Open(OSReleasePath) - defer f.Close() if err != nil { return HostOS{} } + defer f.Close() l := bufio.NewScanner(f) host := HostOS{} |