Created
March 5, 2023 13:08
-
-
Save zboralski/07ac259e82c0ee00bf7a3deb3435afae to your computer and use it in GitHub Desktop.
no-copy conversion from []byte to string #25484
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// no-copy conversion from []byte to string #25484 | |
// https://github.com/golang/go/issues/25484#issuecomment-391415660 | |
func ByteSlice2String(bs []byte) string { | |
return *(*string)(unsafe.Pointer(&bs)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment