Skip to content

Commit

Permalink
pointers are important
Browse files Browse the repository at this point in the history
  • Loading branch information
Pika committed Oct 16, 2018
1 parent 05dbe5f commit 048ffa1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nspbuild.go → main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ func printHelpAndExit() {
os.Exit(0)
}

func getRelease(repo string) (release, error) {
func getRelease(repo string) (*release, error) {
resp, err := http.Get(fmt.Sprintf("https://api.github.com/repos/%s/releases/latest", repo))
if err != nil {
return release{}, err
return nil, err
}

body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return release{}, err
return nil, err
}
resp.Body.Close()

r := release{}
err = json.Unmarshal(body, &r)
r := &release{}
err = json.Unmarshal(body, r)
if err != nil {
return release{}, err
return nil, err
}

return r, nil
Expand Down

0 comments on commit 048ffa1

Please sign in to comment.