Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Commit

Permalink
Fix malformed create command
Browse files Browse the repository at this point in the history
`omitempty` doesn't cover sub-structs, so we were passing in:

{"name":"omgwtfapp","region":{}}

API recently changed the format for identifiers to be just a string
instead of a nested object. So it's now `"region": "eu"`.

Fixes #85.
  • Loading branch information
bgentry committed Oct 15, 2013
1 parent 0651293 commit ad8265c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions create.go
Expand Up @@ -22,11 +22,9 @@ func runCreate(cmd *Command, args []string) {
var app App
var v struct {
Name string `json:"name,omitempty"`
Region struct {
Name string `json:"name,omitempty"`
} `json:"region,omitempty"`
Region string `json:"region,omitempty"`
}
v.Region.Name = flagRegion
v.Region = flagRegion
if len(args) > 0 {
v.Name = args[0]
}
Expand Down

0 comments on commit ad8265c

Please sign in to comment.