cni icon indicating copy to clipboard operation
cni copied to clipboard

Review and address 'staticcheck' warnings

Open bboreham opened this issue 5 years ago • 2 comments

I ran staticcheck:

~/src/github.com/containernetworking/cni$ staticcheck ./...
libcni/api_test.go:855:33: should use make([]pluginInfo, 3) instead (S1019)
libcni/api_test.go:1288:15: this value of err is never used (SA4006)
libcni/conf.go:117:26: error strings should not be capitalized (ST1005)
libcni/conf.go:121:26: error strings should not be capitalized (ST1005)
pkg/invoke/args.go:32:7: receiver name should not be an underscore, omit the name if it is unused (ST1006)
pkg/types/args.go:39:20: error strings should not be capitalized (ST1005)
pkg/types/types.go:199:5: error var NotImplementedError should have name of the form ErrFoo (ST1012)
pkg/types/types.go:199:37: error strings should not be capitalized (ST1005)
plugins/test/noop/main.go:64:26: error strings should not end with punctuation or a newline (ST1005)

All seem plausible, though renaming NotImplementedError would be a breaking change.

Similar issue: #93 - this needed re-done after the repo split.

bboreham avatar Mar 15 '19 13:03 bboreham

staticcheck again,

libcni/api_test.go:855:33: should use make([]pluginInfo, 3) instead (S1019)
libcni/api_test.go:1288:15: this value of err is never used (SA4006)
libcni/conf.go:117:26: error strings should not be capitalized (ST1005)
libcni/conf.go:121:26: error strings should not be capitalized (ST1005)
pkg/invoke/args.go:35:7: receiver name should not be an underscore, omit the name if it is unused (ST1006)
pkg/types/args.go:39:20: error strings should not be capitalized (ST1005)
pkg/types/types.go:199:5: error var NotImplementedError should have name of the form ErrFoo (ST1012)
pkg/types/types.go:199:37: error strings should not be capitalized (ST1005)
plugins/test/noop/main.go:64:26: error strings should not end with punctuation or a newline (ST1005)

mars1024 avatar Jun 19 '19 11:06 mars1024

/assign @mars1024

mars1024 avatar Jun 19 '19 11:06 mars1024