Files
lti-api/vendor/github.com/philhofer/fwd/writer_tinygo.go
T
GitLab Deploy Bot ad815b3412 .
2025-10-23 11:40:58 +07:00

20 lines
313 B
Go

//go:build tinygo
// +build tinygo
package fwd
import (
"reflect"
"unsafe"
)
// unsafe cast string as []byte
func unsafestr(b string) []byte {
l := uintptr(len(b))
return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{
Len: l,
Cap: l,
Data: (*reflect.StringHeader)(unsafe.Pointer(&b)).Data,
}))
}