1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-18 03:56:52 +02:00

improved code a little

This commit is contained in:
Carlos Alexandro Becker 2017-01-02 11:49:30 -02:00
parent 3388cbbf63
commit 27aaac4132
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -84,16 +84,13 @@ func (Pipe) Run(config config.ProjectConfig) error {
return err
}
func sha(client *github.Client, owner, repo, name string, out bytes.Buffer) (*string, error) {
var sha *string
file, _, _, err := client.Repositories.GetContents(
owner, repo, name, &github.RepositoryContentGetOptions{},
)
if err == nil {
sha = file.SHA
} else {
sha = github.String(fmt.Sprintf("%s", sha256.Sum256(out.Bytes())))
return file.SHA, err
}
return sha, err
return github.String(fmt.Sprintf("%s", sha256.Sum256(out.Bytes()))), err
}
func buildFormulae(config config.ProjectConfig, client *github.Client) (bytes.Buffer, error) {