Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlayerParam Significant not working with a value of 0 because of omitempty #7

Open
OperationalDev opened this issue Apr 3, 2020 · 1 comment

Comments

@OperationalDev
Copy link

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.

@jasonodonnell
Copy link
Owner

Removing omitempty would be fine in this case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants