We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 098ea3f commit 79fca40Copy full SHA for 79fca40
1 file changed
launcher/main.go
@@ -110,11 +110,9 @@ func str2slice(s string) (b []byte) {
110
// TODO: when we bump to go1.20 use unsafe.StringData and unsafe.Slice instead.
111
shdr := (*reflect.StringHeader)(unsafe.Pointer(&s))
112
bhdr := (*reflect.SliceHeader)(unsafe.Pointer(&b))
113
- *bhdr = reflect.SliceHeader{
114
- Data: shdr.Data,
115
- Len: shdr.Len,
116
- Cap: shdr.Len,
117
- }
+ bhdr.Data = shdr.Data
+ bhdr.Len = shdr.Len
+ bhdr.Cap = shdr.Len
118
runtime.KeepAlive(s)
119
return
120
}
0 commit comments