1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-09 13:36:56 +02:00

refactor: small improvement on if stmt

Inverted if statements are harder to read. No need for that.
This commit is contained in:
Carlos Alexandro Becker 2017-11-20 10:54:35 -02:00 committed by Carlos Alexandro Becker
parent 9a9b9373a2
commit 03aec11c60

View File

@ -50,10 +50,10 @@ func checkMain(ctx *context.Context, build config.Build) error {
if err != nil {
return errors.Wrapf(err, "failed to parse file: %s", build.Main)
}
if !hasMain(file) {
return fmt.Errorf("build for %s does not contain a main function", build.Binary)
if hasMain(file) {
return nil
}
return nil
return fmt.Errorf("build for %s does not contain a main function", build.Binary)
}
var dir = build.Main
if dir == "" {