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