From 6bd30fd58bf7a551ba658217d073046f88a26fc8 Mon Sep 17 00:00:00 2001 From: jackspirou Date: Mon, 11 Jan 2016 22:40:06 -0600 Subject: [PATCH] remove reduntant check in buildRelease and simplify --- main.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 76b36b9..e918f84 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ package main import ( - "errors" "fmt" "net/url" "os" @@ -116,13 +115,10 @@ func buildRelease(client *github.Client, owner string, repo string, tag string) // if not release was found by that tag, create a new one release, err = newRelease(client, owner, repo, tag) if err != nil { - return nil, err - } - if release != nil { - return release, nil + return nil, fmt.Errorf("Failed to retrieve or create a release: %s", err) } - return nil, errors.New("Failed to retrieve or create a release") + return release, nil } func getRelease(client *github.Client, owner string, repo string, tag string) (*github.RepositoryRelease, error) {