From 048ffa1ff8038a38f69ebebbee43cf8be58b7085 Mon Sep 17 00:00:00 2001 From: Pika Date: Mon, 15 Oct 2018 21:04:24 -0400 Subject: [PATCH] pointers are important --- nspbuild.go => main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename nspbuild.go => main.go (96%) diff --git a/nspbuild.go b/main.go similarity index 96% rename from nspbuild.go rename to main.go index e3834cb..aae377e 100644 --- a/nspbuild.go +++ b/main.go @@ -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