Skip to content

Commit

Permalink
Remove the tedious named return value (#2620)
Browse files Browse the repository at this point in the history
Co-authored-by: thinkerou <thinkerou@gmail.com>
  • Loading branch information
panjf2000 and thinkerou committed Feb 8, 2021
1 parent e899771 commit 1bdf86b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/bytesconv/bytesconv.go
Expand Up @@ -9,7 +9,7 @@ import (
)

// 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(
&struct {
string
Expand Down

0 comments on commit 1bdf86b

Please sign in to comment.