init commit

This commit is contained in:
sentriz
2019-03-29 17:14:33 +00:00
commit e9c0f09d0c
527 changed files with 477627 additions and 0 deletions

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
// +build !appengine
package fasttemplate
import (
"reflect"
"unsafe"
)
func unsafeBytes2String(b []byte) string {
return *(*string)(unsafe.Pointer(&b))
}
func unsafeString2Bytes(s string) []byte {
sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
bh := reflect.SliceHeader{
Data: sh.Data,
Len: sh.Len,
Cap: sh.Len,
}
return *(*[]byte)(unsafe.Pointer(&bh))
}