feat: 添加 database - cache(redis)
This commit is contained in:
11
tool/string.go
Normal file
11
tool/string.go
Normal file
@ -0,0 +1,11 @@
|
||||
package tool
|
||||
|
||||
import "unsafe"
|
||||
|
||||
func BytesToString(b []byte) string {
|
||||
return unsafe.String(unsafe.SliceData(b), len(b))
|
||||
}
|
||||
|
||||
func StringToBytes(s string) []byte {
|
||||
return unsafe.Slice(unsafe.StringData(s), len(s))
|
||||
}
|
Reference in New Issue
Block a user