mirror of
https://github.com/42wim/matterbridge.git
synced 2024-12-01 07:02:00 -08:00
d16645c952
* Update mattermost library * Fix linting
20 lines
313 B
Go
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,
|
|
}))
|
|
}
|