EncodeToString returns the base64 encoding of src.
package main import ( "encoding/base64" "fmt" ) func main() { data := []byte("any + old & data") str := base64.StdEncoding.EncodeToString(data) fmt.Println(str) }