DecodeString returns the bytes represented by the base64 string s.
package main import ( "encoding/base64" "fmt" ) func main() { str := "c29tZSBkYXRhIHdpdGggACBhbmQg77u/" data, err := base64.StdEncoding.DecodeString(str) if err != nil { fmt.Println("error:", err) return } fmt.Printf("%q\n", data) }