Skip to content

Instantly share code, notes, and snippets.

@sidravic
Created May 5, 2013 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidravic/5521194 to your computer and use it in GitHub Desktop.
Save sidravic/5521194 to your computer and use it in GitHub Desktop.
// This will parse your JSON
type APIResponse struct{
StatusCode string `json:"status_code"`
OperationStatus bool `json:"status"`
Errors string `json:"error_messages, omitempty"`
ApplicationID string `json:"application_id, omitempty"`
QueueID int64 `json:"queue_id, omitempty"`
}
// 1 hour later I realized this won't return parsed values but defaults for the data types
type APIResponse struct{
StatusCode string `json: "status_code"`
OperationStatus bool `json: "status"`
Errors string `json: "error_messages, omitempty"`
ApplicationID string `json: "application_id, omitempty"`
QueueID int64 `json: "queue_id, omitempty"`
}
// The extra whitespace after the colon may seem trivial but its not.
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment