mirror of
https://github.com/thegeeklab/wp-gitea-release.git
synced 2024-11-22 10:10:40 +00:00
remove reduntant check in buildRelease and simplify
This commit is contained in:
parent
7869f1ba85
commit
6bd30fd58b
8
main.go
8
main.go
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user