import ( "bytes" "github.com/tinylib/msgp/msgp" ) func main() { input := []byte{0x82, 0xA6, 0x6B, 0x65, 0x79, 0x01, 0xA6, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x82, 0x01, 0x02} reader := msgp.NewReader(bytes.NewBuffer(input)) var key *string var val int for { err := reader.ReadMapKeyPtr(&key) if err != nil { break } err = reader.ReadInt(&val) if err != nil { break } // Do something with key and val } }In this example, we create a messagepack byte array with a simple map containing two key-value pairs: {"key": 1} and {"value": [1, 2]}. We then create a new messagepack reader and loop through the map, reading each key-value pair with ReadMapKeyPtr and ReadInt. This example demonstrates how to use ReadMapKeyPtr to read map keys as pointers, rather than copying the data into a byte slice. It also shows how to use the msgp package to read messagepack data from a byte array and decode it into Go types.