Hi, I have found the problem to the double PUT message being sent and have solve it. Thanks for the help.
A lot of lesson learnt from this exercise. On Sunday, March 21, 2021 at 1:47:07 PM UTC+2 Brian Candler wrote: > On Sunday, 21 March 2021 at 11:42:37 UTC Brian Candler wrote: > >> Also: somebody has to be responsible for closing the response. You're >> not explicitly returning an error from SendNFInstanceRegistration() to >> HandleNFInstanceRegistration(), so the only way you can indicate that the >> body is invalid is to return nil as the response pointer. >> >> > Sorry, I got that the wrong way round. SendNFInstanceRegistration calls > HandleNFInstanceRegistration, and you do return an error there. > > However, PutAndPatch calls SendNFInstanceRegistration, and you don't > return an error. The caller then checks resp.StatusCode, but doesn't > account for the fact that there might have been some error, and so resp is > nil. > > I would suggest that instead of returning a resp, you return bool "ok" > which just says whether the request was successful or not. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/68e6ba3c-df54-43b9-b7e1-f6574d3153cen%40googlegroups.com.