Skip to content

Commit

Permalink
Dep: Update gocoap from v2 to v3
Browse files Browse the repository at this point in the history
Signed-off-by: 1998-felix <[email protected]>
  • Loading branch information
felixgateru committed Apr 17, 2024
1 parent 9c5c0ab commit fc03222
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coap/api/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func handler(w mux.ResponseWriter, m *mux.Message) {
isObs, err = handleGet(context.Background(), m, w, msg, key)
case codes.POST:
resp.Code = codes.Created
err = nil
err = service.Publish(m.Context(), key, msg)
default:
err = svcerr.ErrNotFound
}
Expand Down
5 changes: 4 additions & 1 deletion coap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,8 @@ func (c *client) Handle(msg *messaging.Message) error {
for _, option := range opts {
pm.SetOptionBytes(option.ID, option.Value)
}
return c.client.Conn().WriteMessage(pm)
if err = c.client.Conn().WriteMessage(pm); err != nil {
return err
}
return nil
}

0 comments on commit fc03222

Please sign in to comment.