SyntaxFix
Write A Post
Hire A Developer
Questions
Besides the methods mentioned above, you can also do a trick as
s := "hello" b := *(*[]byte)(unsafe.Pointer((*reflect.SliceHeader)(unsafe.Pointer(&s))))
Go Play: http://play.golang.org/p/xASsiSpQmC
You should never use this :-)