diff options
| author | WheresAlice <[email protected]> | 2024-04-08 19:55:46 +0100 |
|---|---|---|
| committer | WheresAlice <[email protected]> | 2024-04-08 19:55:46 +0100 |
| commit | e0d8bc4eafc6bbe17d62fd559110b842325d9931 (patch) | |
| tree | 9e73873ee2f818b000ec3f077034db9ed6f15847 /examples/mqtt/main.go | |
| parent | 0ad7cec6cccc1e5c70b67ae59042d6e683a84816 (diff) | |
fix go vet by avoiding copying messages
Diffstat (limited to 'examples/mqtt/main.go')
| -rw-r--r-- | examples/mqtt/main.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/mqtt/main.go b/examples/mqtt/main.go index 0ad9c5f..35058d4 100644 --- a/examples/mqtt/main.go +++ b/examples/mqtt/main.go @@ -44,11 +44,11 @@ func channelHandler(channel string) mqtt.HandlerFunc { var message pb.Data err = proto.Unmarshal(decodedMessage, &message) - log.Info(processMessage(message), "topic", m.Topic, "channel", channel, "portnum", message.Portnum.String()) + log.Info(processMessage(&message), "topic", m.Topic, "channel", channel, "portnum", message.Portnum.String()) } } -func processMessage(message pb.Data) string { +func processMessage(message *pb.Data) string { if message.Portnum == pb.PortNum_NODEINFO_APP { var user = pb.User{} proto.Unmarshal(message.Payload, &user) |
