Skip to content

Instantly share code, notes, and snippets.

@sthorne
Created June 3, 2015 17:14
Show Gist options
  • Save sthorne/e9f0284d074d0383b029 to your computer and use it in GitHub Desktop.
Save sthorne/e9f0284d074d0383b029 to your computer and use it in GitHub Desktop.
String to Byte Slice
import (
"fmt"
"bytes"
)
func main() {
s := bytes.NewBufferString("hello world").Bytes()
fmt.Printf("%#v", s)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment