mirror of
https://github.com/containers/podman.git
synced 2025-05-20 16:47:39 +08:00
enable errcheck linter
The errcheck linter makes sure that errors are always check and not ignored by accident. It spotted a lot of unchecked errors, mostly in the tests but also some real problem in the code. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -113,8 +113,10 @@ var _ = Describe("Common functions test", func() {
|
||||
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)
|
||||
bytes, err := ioutil.ReadAll(read)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
err = json.Unmarshal(bytes, compareData)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
Expect(reflect.DeepEqual(testData, compareData)).To(BeTrue(), "Data changed after we store it to file.")
|
||||
})
|
||||
|
Reference in New Issue
Block a user