gosora/tmpl_client/stub.go

30 lines
561 B
Go
Raw Normal View History

2018-05-14 10:59:18 +00:00
package tmpl
import (
2022-02-21 03:53:13 +00:00
//"reflect"
//"runtime"
//"unsafe"
"git.tuxpa.in/a/gosora/uutils"
)
var GetFrag = func(name string) [][]byte {
2022-02-21 03:16:15 +00:00
return nil
}
type WriteString interface {
2022-02-21 03:16:15 +00:00
WriteString(s string) (n int, err error)
}
var StringToBytes = uutils.StringToBytes
/*
func StringToBytes(s string) (bytes []byte) {
2022-02-21 03:16:15 +00:00
str := (*reflect.StringHeader)(unsafe.Pointer(&s))
slice := (*reflect.SliceHeader)(unsafe.Pointer(&bytes))
slice.Data = str.Data
2022-02-21 03:32:53 +00:00
slice.Len = str.Len
slice.Cap = str.Len
runtime.KeepAlive(&s)
return bytes
}
*/