Remove the tedious named return value (#2620)
Co-authored-by: thinkerou <thinkerou@gmail.com>
This commit is contained in:
parent
e899771392
commit
1bdf86b722
@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// StringToBytes converts string to byte slice without a memory allocation.
|
// StringToBytes converts string to byte slice without a memory allocation.
|
||||||
func StringToBytes(s string) (b []byte) {
|
func StringToBytes(s string) []byte {
|
||||||
return *(*[]byte)(unsafe.Pointer(
|
return *(*[]byte)(unsafe.Pointer(
|
||||||
&struct {
|
&struct {
|
||||||
string
|
string
|
||||||
|
Loading…
Reference in New Issue
Block a user