We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug pcommon.Map.EnsureCapacity clears the map as a side effect
Steps to reproduce
package main import "go.opentelemetry.io/collector/pdata/pcommon" func main() { m := pcommon.NewMap() m.PutStr("foo", "bar") m.EnsureCapacity(2) if m.Len() != 1 { panic("?") } }
What did you expect to see? No panic – map should contain "foo".
"foo"
What did you see instead? Map is empty.
What version did you use? v0.79.0
Additional context
opentelemetry-collector/pdata/pcommon/map.go
Lines 35 to 44 in 0b88ff9
The copy will copy zero elements, because copy
copy
returns the number of elements copied, which will be the minimum of len(src) and len(dst).
The text was updated successfully, but these errors were encountered:
cc @dmitryax @bogdandrutu
Sorry, something went wrong.
Seems to be fixed by #8040
No branches or pull requests
Describe the bug
pcommon.Map.EnsureCapacity clears the map as a side effect
Steps to reproduce
What did you expect to see?
No panic – map should contain
"foo"
.What did you see instead?
Map is empty.
What version did you use?
v0.79.0
Additional context
opentelemetry-collector/pdata/pcommon/map.go
Lines 35 to 44 in 0b88ff9
The
copy
will copy zero elements, becausecopy
The text was updated successfully, but these errors were encountered: