-1

Here is the defination of the function at the file ns.pb.go

CreateMACCommandQueueItem(ctx context.Context, in *CreateMACCommandQueueItemRequest, opts ...grpc.CallOption) (*empty.Empty, error)

Here is the part of main.go code that I write:

resp, err := serviceClient.CreateMACCommandQueueItem(context.Background(), &ns.CreateMACCommandQueueItemRequest{
    DevEui:     devEUI[:],
    Cid:        uint32(lorawan.LinkADRReq),
    Commands:   [][]byte{b},
})

if err != nil {
        panic(err)
}

fmt.Printf("The MACCommand has been enqueued")

Here is the error:

.\main.go:62:2: resp declared but not used
Mattia Righetti
  • 1,265
  • 1
  • 18
  • 31

1 Answers1

1

You could write something like this:

if _, err := serviceClient.CreateMACCommandQueueItem(context.Background(), &ns.CreateMACCommandQueueItemRequest{
    DevEui:     devEUI[:],
    Cid:        uint32(lorawan.LinkADRReq),
    Commands:   [][]byte{b},

}): err != nil {
    panic(err)
}
Matteo
  • 37,680
  • 11
  • 100
  • 115