Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint failures spotted after upgrading to Go 1.23 #351

Open
jingyuanliang opened this issue Sep 4, 2024 · 0 comments
Open

Fix lint failures spotted after upgrading to Go 1.23 #351

jingyuanliang opened this issue Sep 4, 2024 · 0 comments

Comments

@jingyuanliang
Copy link
Member

pkg/metrics/collector/pod_ip_metrics.go:322:2: builtinShadow: shadowing of predeclared identifier: max (gocritic)
	max := uint64(1) << uint(bits-ones)
	^
pkg/metrics/collector/pod_ip_metrics.go:[235](https://github.com/GoogleCloudPlatform/netd/actions/runs/10693607402/job/29644029691?pr=350#step:3:236):3: ifElseChain: rewrite if-else to switch statement (gocritic)
		if !ok {
		^
pkg/metrics/collector/pod_ip_metrics_test.go:214:2: commentFormatting: put a space between `//` and comment text (gocritic)
	//Add a new file to the directory. Verify metrics
	^
pkg/metrics/collector/pod_ip_metrics_test.go:233:2: commentFormatting: put a space between `//` and comment text (gocritic)
	//Remove a file from the directory. Verify metrics
	^
pkg/metrics/collector/pod_ip_metrics_test.go:274:3: ifElseChain: rewrite if-else to switch statement (gocritic)
		if !ok {
		^
pkg/config/config_test.go:52:18: unused-parameter: parameter 'route' seems to be unused, consider removing or renaming it as _ (revive)
		RouteAdd: func(route *netlink.Route) error { return os.ErrExist },
		               ^
pkg/config/config_test.go:53:18: unused-parameter: parameter 'route' seems to be unused, consider removing or renaming it as _ (revive)
		RouteDel: func(route *netlink.Route) error { return syscall.ESRCH },
		               ^
pkg/config/config_test.go:84:18: unused-parameter: parameter 'family' seems to be unused, consider removing or renaming it as _ (revive)
		RuleList: func(family int) ([]netlink.Rule, error) { return ruleList, nil },
		               ^
jingyuanliang added a commit to jingyuanliang/netd that referenced this issue Sep 4, 2024
jingyuanliang added a commit to jingyuanliang/netd that referenced this issue Sep 4, 2024
jingyuanliang added a commit to jingyuanliang/netd that referenced this issue Sep 4, 2024
google-oss-prow bot added a commit that referenced this issue Sep 4, 2024
Fix some lint errors and mark nolint and TODO #351 on the rest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant