Closed pennersr closed 4 years ago
@pennersr Are you recommending a comment in the README? I'm not sure if it's within the scope of this library to remind people of Golang's http.Response
behavior. I could potentially add a wiki article with this caveat if you think that will help.
Even if you are aware of Golang's http.Response
behavior, given the example/README it is simply not very obvious that we're dealing with such a struct here. The example nicely documents // TODO: Handle error
, I would suggest adding a similar TODO for the http.Response
.
I am using webpush-go over at https://gitlab.com/pennersr/shove -- thanks! One thing that I initially overlooked was the fact that
SendNotification()
returns anhttp.Response
, for which the following holds:The README/example contains this (it ignores the response):
So the fact that the caller is responsible for handling the caveat mentioned above is not very obvious.