golint warnings in ipsec_controller.go
What would you like to be added: golint warnings in ipsec_controller.go needs to be fixed:
Why is this needed: to ensure the codebase follows Go best practices
weired @mdimado can you also take a look at golangci-lint config, we used it in CI.
hi @hzxuzhonghu it currently enables linters gofmt, goimports, govet, staticcheck, which i guess would catch common GO style and correctness. but it may not be catching all the issues in the IPsec controller code. and since I used golint, I have also listed the warnings encountered
@hzxuzhonghu encountered these 6 issues
but, since golangci-lint only lints that file, without pulling in the rest of the package for type checking, the undefined issues arise also, the import errors are OS specific.
so, I ran the command golangci-lint run --build-tags=linux ./pkg/controller/encryption/ipsec
and encountered these four issues:
for the undefined: gomonkey issue,
the test file isn't getting compiled, so its symbols appear “undefined.”
and for the too many arguments in conversion to Controller error, the actual constructor is NewController and not Controller, so I fixed that