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 #25971

Closed
alingse opened this issue May 27, 2024 · 1 comment · Fixed by #26409 or #26410
Closed

[BUG] miss makezero in slice init #25971

alingse opened this issue May 27, 2024 · 1 comment · Fixed by #26409 or #26410

Comments

@alingse
Copy link

alingse commented May 27, 2024

Agent Environment

Describe what happened:

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/9242970601/job/25426486285

====================================================================================================
append to slice `customContextTags` with non-zero initialized length at https://github.com/DataDog/datadog-agent/blob/main/pkg/util/profiling/profiling.go#L80:24
append to slice `readers` with non-zero initialized length at https://github.com/DataDog/datadog-agent/blob/main/pkg/network/usm/sharedlibraries/testutil/fmapper/fmapper.go#L36:13
====================================================================================================

the customContextTags := make([]string, len(settings.CustomAttributes)) should be customContextTags := make([]string, 0, len(settings.CustomAttributes))

the readers := make([]*mmap.ReaderAt, len(os.Args)-1) should be readers := make([]*mmap.ReaderAt, 0, len(os.Args)-1)

Describe what you expected:

Steps to reproduce the issue:

Additional environment details (Operating System, Cloud provider, etc):

@L3n41c
Copy link
Member

L3n41c commented Jun 12, 2024

Hello @alingse,

Thanks for bringing those bugs to our attention !
The fixes for the two of them have now been merged.

@L3n41c L3n41c closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants