Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

ReportListFilter with false AtNull values #20

Open
nferch opened this issue Jan 14, 2019 · 0 comments
Open

ReportListFilter with false AtNull values #20

nferch opened this issue Jan 14, 2019 · 0 comments

Comments

@nferch
Copy link

nferch commented Jan 14, 2019

Hi,

If you create a ReportListFilter with a false ...AtNull attribute, the attribute is not passed to the API. For example, this does not work:

        filter := h1.ReportListFilter{
                BountyAwardedAtNull: false,
                Program:             []string{"spotify"},
        }

This is because go-querystring considers false values to be empty: https://github.com/google/go-querystring/blob/master/query/encode.go#L53

I worked around this by changing the bool values in ReportListFilter to pointer to bool, but this is pretty ugly especially since you can't create a literal pointer to false in Go.

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

No branches or pull requests

1 participant