Standard library / encoding/base32
encoding/base32.Encoding.AppendEncode()
Append encoded bytes to the existing destination prefix and return the extended slice. Available in Go 1.22 and later. Expected stdout: 'id:I5XQ====\n'.
Formal Syntax & Structure
go syntaxgo
func (enc *Encoding) AppendEncode(dst, src []byte) []byteParameters & Attributes
| Name | Type | Description |
|---|---|---|
| dst | []byte | Destination byte slice; provide enough capacity for the operation or use an append API. |
| src | []byte | Input bytes in the format expected by the operation. |
Return Value
[]byte
Encoded or extended byte slice.
Working Example
Example Snippetgo
package main
import ( "encoding/base32" "fmt")
func must(e error) { if e != nil { panic(e) }}
func main() { v := base32.StdEncoding.AppendEncode([]byte("id:"), []byte("Go")) fmt.Println(string(v))}