opentelemetry-go icon indicating copy to clipboard operation
opentelemetry-go copied to clipboard

Replace ensureAttributesCapacity with slices.Grow

Open pellared opened this issue 7 months ago • 3 comments

Replace ensureAttributesCapacity with slices.Grow once we drop support for Go 1.20.

How about inlining the slices.Grow implementation instead of referencing golang.org/x/exp?

Originally posted by @pellared in https://github.com/open-telemetry/opentelemetry-go/pull/4818#discussion_r1446458963

pellared avatar Jan 10 '24 11:01 pellared

You also will, while you're in the same code, also want to change the if x > y { foo(x) } else { foo(y) } added in #4818 to a min() per go1.21.

lizthegrey avatar Jan 11 '24 00:01 lizthegrey

@pellared Mind if I take a stab at it ?

sumit1606 avatar Jan 26 '24 20:01 sumit1606

@pellared Mind if I take a stab at it ?

go1.22 is not yet out, so go1.20 is still supported. Feel free to prepare, but do not land, a PR that does the cleanup I suggested.

lizthegrey avatar Jan 26 '24 20:01 lizthegrey