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

require the user to manually decode structs #5

Merged
merged 1 commit into from
Oct 21, 2013
Merged

Conversation

technoweenie
Copy link
Member

This removes the SetError() junk and forces you to use *Response.Decode().

res := req.Get()
if res.IsError() {
  panic(res.Error())
} else if res.IsApiError() {
  apierr := &ApiError{}
  res.Decode(apierr)
  panic(apierr.Message)
} else {
  user := &User{}
  res.Decode(user)
  panic(user.Login)
}

/cc #3

@owenthereal
Copy link
Member

👍 👯

technoweenie added a commit that referenced this pull request Oct 21, 2013
require the user to manually decode structs
@technoweenie technoweenie merged commit 7933bb0 into master Oct 21, 2013
@technoweenie technoweenie deleted the manual-decoding branch October 21, 2013 21:53
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

Successfully merging this pull request may close these issues.

None yet

2 participants