mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-18 21:11:03 +01:00
added
This commit is contained in:
19
vendor/github.com/philhofer/fwd/writer_tinygo.go
generated
vendored
Normal file
19
vendor/github.com/philhofer/fwd/writer_tinygo.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
//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,
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user