e2e tests: enable golint

...and fix problems found therewith.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2021-11-23 11:12:34 -07:00
parent 3d19f1a7fa
commit b63d696405
48 changed files with 179 additions and 186 deletions

View File

@ -90,24 +90,24 @@ var _ = Describe("Common functions test", func() {
Entry("Command exist", "Fakecmd", false),
)
It("Test WriteJsonFile", func() {
type testJson struct {
It("Test WriteJSONFile", func() {
type testJSON struct {
Item1 int
Item2 []string
}
compareData := &testJson{}
compareData := &testJSON{}
testData := &testJson{
testData := &testJSON{
Item1: 5,
Item2: []string{"test"},
}
testByte, _ := json.Marshal(testData)
err := WriteJsonFile(testByte, "/tmp/testJson")
err := WriteJSONFile(testByte, "/tmp/testJSON")
Expect(err).To(BeNil(), "Failed to write JSON to file.")
read, err := os.Open("/tmp/testJson")
read, err := os.Open("/tmp/testJSON")
defer read.Close()
Expect(err).To(BeNil(), "Can not find the JSON file after we write it.")