mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2024-05-03 11:34:53 +08:00
e9cc195c39
example docs
9 lines
149 B
Go
9 lines
149 B
Go
package strUtil
|
|
|
|
import "unsafe"
|
|
|
|
// StrToBytes 字符串转字节数组
|
|
func StrToBytes(v string) []byte {
|
|
return *(*[]byte)(unsafe.Pointer(&v))
|
|
}
|