func main() {
	var data bool = true
	var prim = y3.NewPrimitivePacketEncoder(0x01)
	prim.SetBoolValue(data)
	buf := prim.Encode()
	res, _, _, _ := y3.DecodePrimitivePacket(buf)
	val, _ := res.ToBool()
	fmt.Printf("val=%v", val)
}
Example of encoding and decoding bool type by using PrimitivePacket.
package main
import (
	"fmt"
	"github.com/yomorun/y3-codec-golang"
)