Skip to content

Commit 27aa409

Browse files
committed
Fix error message on unmarshalling response
1 parent 3493bec commit 27aa409

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cmd/create.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7-
"strings"
87
"net/url"
8+
"strings"
9+
910
"github.com/MakeNowJust/heredoc"
1011
"github.com/cli/go-gh/v2/pkg/api"
1112
"github.com/spf13/cobra"
@@ -24,6 +25,7 @@ type createReq struct {
2425
}
2526

2627
type createResp struct {
28+
AppUrl string `json:"app_url"`
2729
}
2830

2931
func init() {
@@ -94,14 +96,14 @@ func init() {
9496
fmt.Println(err)
9597
return
9698
}
97-
var response string
99+
response := createResp{}
98100
err = client.Put(createUrl, bytes.NewReader(body), &response)
99101
if err != nil {
100102
fmt.Printf("Error creating app: %v\n", err)
101103
return
102104
}
103105

104-
fmt.Printf("App created: %s\n", response) // TODO pretty print details
106+
fmt.Printf("App created: %s\n", response.AppUrl) // TODO pretty print details
105107
},
106108
}
107109

0 commit comments

Comments
 (0)