0
0
mirror of https://github.com/thegeeklab/wp-gitea-release.git synced 2024-11-09 17:30: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
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) {