package main import ( "fmt" ) type MACCommand_LinkADRReq struct { ChannelMask []bool `protobuf:"varint,3,rep,packed,name=channel_mask,json=channelMask,proto3" json:"channel_mask,omitempty"` } type MACCommand_LinkADRReq_ struct { LinkADRReq *MACCommand_LinkADRReq `protobuf:"bytes,6,opt,name=link_adr_req,json=linkAdrReq,proto3,oneof"` } // ChMaskCntlPair pairs a ChMaskCntl with a mask. type ChMaskCntlPair struct { Mask [16]bool } var desiredMasks []ChMaskCntlPair = []ChMaskCntlPair { ChMaskCntlPair{[16]bool{true, true, true, true, true, true, true, true},}, ChMaskCntlPair{[16]bool{false, false, false, false, false, false, false},}, ChMaskCntlPair{[16]bool{false, false, false, false, false, false, false},}, ChMaskCntlPair{[16]bool{false, false, false, false, false, false, false},}, } func test() { for _, m := range desiredMasks { pld := &MACCommand_LinkADRReq{ ChannelMask: m.Mask[:], } fmt.Printf("p = %p %p\r\n", pld.ChannelMask, &m.Mask[0]) } } func main() { test() }