Standard library / encoding/hex
encoding/hex.AppendEncode()
Appends lower-case hexadecimal digits to a destination slice. Expected stdout: '!476f\n'.
Formal Syntax & Structure
go syntaxgo
func AppendEncode(dst, src []byte) []byteParameters & Attributes
| Name | Type | Description |
|---|---|---|
| dst | []byte | Destination byte slice; append APIs preserve its existing prefix. |
| src | []byte | Source bytes to encode or decode. |
Return Value
[]byte
Resulting byte slice.
Working Example
Example Snippetgo
package main
import ( "encoding/hex" "fmt")
func must(e error) { if e != nil { panic(e) }}
func main() { fmt.Println(string(hex.AppendEncode([]byte("!"), []byte("Go")))) }