mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-27 17:10:20 +08:00
8
strUtil/str_to_byte.go
Normal file
8
strUtil/str_to_byte.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package strUtil
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// StrToBytes 字符串转字节数组
|
||||
func StrToBytes(v string) []byte {
|
||||
return *(*[]byte)(unsafe.Pointer(&v))
|
||||
}
|
||||
Reference in New Issue
Block a user