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

Go idoms #10

Closed
sbinet opened this issue Feb 12, 2018 · 1 comment
Closed

Go idoms #10

sbinet opened this issue Feb 12, 2018 · 1 comment
Assignees

Comments

@sbinet
Copy link
Contributor

sbinet commented Feb 12, 2018

hi there,

I discovered OpenFoodFacts last week (via "Le Canard enchaîné") and learned it was a GSoC organization today :)
(and, obviously, had an API for my favorite language. yay!)

I have skimmed quickly the package and have a few suggestions about the API, to make it more Go-idiomatic:

  • rename HttpApi into Client
  • rename NewHttpApiOperator into NewClient
  • drop the DataProvider interface and make NewClient return a concrete *Client
  • error values are usually named ErrSomething and error types MyTypeError:
    • rename ProductRetrievalError into ErrNoProduct
    • rename AnonymousUserError into ErrUnauthorized
  • rename UrlString into URL
@teolemon
Copy link
Member

teolemon commented Feb 12, 2018

Go for it ;-)

sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
This CL renames HttpApi into a more Go-idiomatic Client.

Updates openfoodfacts#10.
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
This CL drops the unneeded DataProvider interface and renames exported
error variables into more Go-idiomatic variables.

Updates openfoodfacts#10.
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
This CL renames HttpApi into a more Go-idiomatic Client.

Updates openfoodfacts#10.
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
This CL drops the unneeded DataProvider interface and renames exported
error variables into more Go-idiomatic variables.

Updates openfoodfacts#10.
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Feb 12, 2018
@Areontar Areontar self-assigned this Dec 16, 2019
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Dec 16, 2019
This CL renames HttpApi into a more Go-idiomatic Client.

Updates openfoodfacts#10.
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Dec 16, 2019
This CL drops the unneeded DataProvider interface and renames exported
error variables into more Go-idiomatic variables.

Updates openfoodfacts#10.
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Dec 16, 2019
sbinet added a commit to sbinet-alt63/openfoodfacts-go that referenced this issue Dec 16, 2019
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

3 participants