Remove the tedious named return value

This commit is contained in:
Andy Pan 2021-01-23 20:22:02 +08:00 committed by GitHub
parent b01605bb5b
commit e15386feb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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