Skip to content

Commit

Permalink
remove deprecated StringHeader call
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed Feb 12, 2024
1 parent 2151715 commit c9f57eb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/translator/skywalking/skywalkingproto_to_traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package skywalking // import "github.com/open-telemetry/opentelemetry-collector-
import (
"bytes"
"encoding/hex"
"reflect"
"strconv"
"time"
"unsafe"
Expand Down Expand Up @@ -358,7 +357,5 @@ func uuidTo8Bytes(uuid [16]byte) [8]byte {
}

func unsafeGetBytes(s string) []byte {
return (*[0x7fff0000]byte)(unsafe.Pointer(
(*reflect.StringHeader)(unsafe.Pointer(&s)).Data),
)[:len(s):len(s)]
return (*[0x7fff0000]byte)(unsafe.Pointer(unsafe.StringData(s)))[:len(s):len(s)]
}

0 comments on commit c9f57eb

Please sign in to comment.