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

[bug] miss makezero in slice init #3531

Closed
4 tasks
alingse opened this issue May 27, 2024 · 1 comment
Closed
4 tasks

[bug] miss makezero in slice init #3531

alingse opened this issue May 27, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@alingse
Copy link

alingse commented May 27, 2024

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/9243002484/job/25426560007

====================================================================================================
append to slice `svcNames` with non-zero initialized length at https://github.com/koderover/zadig/blob/main/pkg/microservice/aslan/core/environment/service/environment_update.go#L514:15
====================================================================================================
		svcNames := make([]string, len(services))
		for _, svc := range services {
			svcNames = append(svcNames, svc.ServiceName)
		}
		serviceNames = svcNames

the svcNames := make([]string, len(services)) should be svcNames := make([]string, 0, len(services))

What happened?

What did you expect to happen?

How To Reproduce it(as minimally and precisely as possible)

Install Methods

  • Helm
  • Script base on K8s
  • All in One
  • Offline

Versions Used
zadig:

kubernetes:

Environment

Cloud Provider:

Resources:

OS:

Services Status

kubectl version
kubectl get po -n `zadig-installed-namespace`
# paste output here

If there is abnormal service, please provide service log

kubectl describe pods `abnormal-pod`
kubectl logs --tail=500 `abnormal-pod`
# paste output here
@PetrusZ
Copy link
Contributor

PetrusZ commented Jun 5, 2024

Thank you!

@PetrusZ PetrusZ closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants