Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts byte slice to string without a memory allocation.
func StringToBytes ¶
StringToBytes converts string to byte slice without a memory allocation. 此版本不需要引入reflect BenchmarkBytesConvStrToBytes-4 1000000000 0.2451 ns/op 0 B/op 0 allocs/op
func StringToBytes0 ¶
此版本需要引入reflect 并且性能没有上面的方法高 BenchmarkBytesConvStrToBytes0-4 549816554 2.189 ns/op 0 B/op 0 allocs/op
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.