2
0
mirror of synced 2025-02-24 22:58:28 +00:00
torrent/bencode/misc.go

17 lines
283 B
Go
Raw Normal View History

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))
}