0
0
mirror of https://github.com/thegeeklab/wp-gitea-release.git synced 2024-11-25 09:20:39 +00:00

remove reduntant check in buildRelease and simplify

This commit is contained in:
jackspirou 2016-01-11 22:40:06 -06:00
parent 7869f1ba85
commit 6bd30fd58b

View File

@ -1,7 +1,6 @@
package main package main
import ( import (
"errors"
"fmt" "fmt"
"net/url" "net/url"
"os" "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 // if not release was found by that tag, create a new one
release, err = newRelease(client, owner, repo, tag) release, err = newRelease(client, owner, repo, tag)
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("Failed to retrieve or create a release: %s", err)
}
if release != nil {
return release, nil
} }
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) { func getRelease(client *github.Client, owner string, repo string, tag string) (*github.RepositoryRelease, error) {