status-go/vendor/github.com/anacrolix/torrent/bencode/misc.go

17 lines
283 B
Go
Raw Normal View History

2022-03-10 09:44:48 +00:00
package bencode
import (
"reflect"
"unsafe"
)
// Wow Go is retarded.
var (
marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
)
func bytesAsString(b []byte) string {
return *(*string)(unsafe.Pointer(&b))
}