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

ci(lint): don't accidentally append to non-zero length slices #10317

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

alingse
Copy link
Contributor

@alingse alingse commented May 26, 2024

Checklist prior to review

I was running github actions to run linter makezero for top github golang repos.

see issues alingse/go-linter-runner#1

and the github actions output https://github.com/alingse/go-linter-runner/actions/runs/9242968813/job/25426482280

====================================================================================================
append to slice `orderedTags` with non-zero initialized length at https://github.com/kumahq/kuma/blob/master/api/common/v1alpha1/ref.go#L104:17
append to slice `combinedResources` with non-zero initialized length at https://github.com/kumahq/kuma/blob/master/app/kumactl/cmd/install/install_observability.go#L43:24
append to slice `combinedResources` with non-zero initialized length at https://github.com/kumahq/kuma/blob/master/app/kumactl/cmd/install/install_observability.go#L44:24
append to slice `combinedResources` with non-zero initialized length at https://github.com/kumahq/kuma/blob/master/app/kumactl/cmd/install/install_observability.go#L45:24
====================================================================================================
  • Link to relevant issue as well as docs and UI issues --
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
    • Don't forget ci/ labels to run additional/fewer tests
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label) --

Signed-off-by: alingse <alingse@foxmail.com>
@alingse alingse requested a review from a team as a code owner May 26, 2024 16:21
@alingse alingse requested review from jijiechen, jakubdyszkiewicz and lukidzi and removed request for a team May 26, 2024 16:21
@slonka slonka added ci/skip-test PR: Don't run unit and e2e tests (maybe this is just a doc change) ci/skip-e2e-test PR: Don't run e2e tests labels May 27, 2024
Copy link
Contributor

@slonka slonka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for your contribution, please add this linter to .golangci.yml - https://github.com/kumahq/kuma/blob/master/.golangci.yml#L2 - I would've done it myself but you did not allow maintainers to modify this PR.

@michaelbeaumont michaelbeaumont changed the title fix: fix miss makezero bug chore(kuma-cp): don't accidentally append to non-zero length slices May 27, 2024
@slonka slonka changed the title chore(kuma-cp): don't accidentally append to non-zero length slices ci(lint): don't accidentally append to non-zero length slices May 27, 2024
Signed-off-by: alingse <alingse@foxmail.com>
@alingse
Copy link
Contributor Author

alingse commented May 27, 2024

@slonka I have add makezero to .golangci.yaml ( but it may report some bad case in future)

@slonka slonka merged commit c502074 into kumahq:master Jun 3, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/skip-e2e-test PR: Don't run e2e tests ci/skip-test PR: Don't run unit and e2e tests (maybe this is just a doc change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants