go-opendota
go-opendota copied to clipboard
PlayerParam Significant not working with a value of 0 because of omitempty
Ran into an issue that when I pass &opendota.PlayerParam{Significant:0}, omitempty causes 0 to be seen as an empty value.
type PlayerParam struct {
Limit int `url:"limit,omitempty"`
Offset int `url:"offset,omitempty"`
...
Significant int `url:"significant,omitempty"`
}
To get around this, I tested removing omitempty as well as passing the int value with a pointer which both worked. Happy to put in a pull request for whichever option.
On an unrelated note, awesome package! It's really handy.
Removing omitempty
would be fine in this case!