We should incorporate linters such as staticcheck or golangci-lint (which is an aggregation of linters which contains staticcheck) and go vet to our github CI actions
We should address the golangci-lint results below as well but I want to start this conversation instead of fixing those right now.
golangci-lint example
Here is an example of golangci-lint run ./....
⚠️ These are not currently covered by this PR
❯ golangci-lint run ./... 15:29:28
pkg/printer/print.go:121:4: S1038: should use fmt.Printf instead of fmt.Println(fmt.Sprintf(...)) (but don't forget the newline) (gosimple)
fmt.Println(fmt.Sprintf("· %s", change))
^
pkg/cmd/secrets.go:37:6: type `secretsResponse` is unused (unused)
type secretsResponse struct {
^
pkg/cmd/secrets.go:469:3: ineffectual assignment to enableFallback (ineffassign)
enableFallback = false
^
pkg/cmd/secrets.go:470:3: ineffectual assignment to enableCache (ineffassign)
enableCache = false
^
pkg/utils/random.go:29:11: Error return value of `rand.Read` is not checked (errcheck)
rand.Read(buffer) // #nosec G104
^
pkg/utils/util.go:165:23: Error return value of `cmd.Process.Signal` is not checked (errcheck)
cmd.Process.Signal(sig) // #nosec G104
^
pkg/utils/util.go:175:21: Error return value of `cmd.Process.Signal` is not checked (errcheck)
cmd.Process.Signal(os.Kill) // #nosec G104
^
Description
This PR addresses warnings and suggestions made by
staticcheck
as well asgo vet
staticcheck ./... ; go vet ./...
ioutil
package withio
andos
by following this blog post: https://go.dev/doc/go1.16#ioutilgolang.org/x/crypto/ssh/terminal
withgolang.org/x/term
instead Deprecation notice: https://pkg.go.dev/golang.org/x/crypto/ssh/terminal#pkg-overviewSuggestion / Recommendation
We should incorporate linters such as
staticcheck
orgolangci-lint
(which is an aggregation of linters which contains staticcheck) andgo vet
to our github CI actionsWe should address the
golangci-lint
results below as well but I want to start this conversation instead of fixing those right now.golangci-lint example
Here is an example of
golangci-lint run ./...
. ⚠️ These are not currently covered by this PR