Encodes a string in base64 format.
func (enc *Encoding) EncodeToString(src []byte) string
src - The String to be encoded
EncodeToString returns the base64 encoding of src.
package main
import b64 "encoding/base64"
func main() {
data := "base64 encoded string"
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
}