[x] Upgraded golangci, updated the config and set it for only new issues. Now we can enable more lints without having to fix the whole codebase immediatly (also this makes linting way faster)
Right now this golangci version reports the following issues:
tools/pluginmeta/main.go:39:2: G104: Errors unhandled. (gosec)
flags.Parse(os.Args[1:])
^
tools/pluginmeta/main.go:63:8: G301: Expect directory permissions to be 0750 or less (gosec)
err = os.MkdirAll(filepath.Dir(output), 0o755)
^
tools/pluginmeta/main.go:96:12: G304: Potential file inclusion via variable (gosec)
f, err := os.Open(plugin)
^
tools/pluginmeta/main.go:111:12: G304: Potential file inclusion via variable (gosec)
f, err := os.Open(output)
^
tools/pluginmeta/main.go:125:12: G304: Potential file inclusion via variable (gosec)
f, err := os.Open(configFile)
^
pkg/circularRefDetector/circularRefs.go:24:15: G103: Use of unsafe calls should be audited (gosec)
detector.add(unsafe.Pointer(ptr), refRange)
^
pkg/circularRefDetector/circularRefs.go:29:24: G103: Use of unsafe calls should be audited (gosec)
return detector.check(unsafe.Pointer(ptr))
^
pkg/circularRefDetector/circularRefs.go:36:18: G103: Use of unsafe calls should be audited (gosec)
detector.remove(unsafe.Pointer(ptr), diags)
^
plugin/resolver/source_remote.go:365:3: G104: Errors unhandled. (gosec)
os.Remove(binaryPath)
^
plugin/resolver/source_remote.go:366:3: G104: Errors unhandled. (gosec)
os.Remove(checksumPath)
^
plugin/resolver/source_remote.go:445:12: G301: Expect directory permissions to be 0750 or less (gosec)
if err := os.MkdirAll(filepath.Dir(binaryPath), 0o755); err != nil {
^
cmd/internal/telemetry/telemetry.go:92:9: G301: Expect directory permissions to be 0750 or less (gosec)
err := os.MkdirAll(dir, 0o755)
^
We can fix/nolint them, or ignore until some PR would touch those files
Resolves #195
Right now this golangci version reports the following issues:
We can fix/nolint them, or ignore until some PR would touch those files