mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-13 13:48:40 +02:00
refactor: small improvement on if stmt
Inverted if statements are harder to read. No need for that.
This commit is contained in:
parent
9a9b9373a2
commit
03aec11c60
@ -50,11 +50,11 @@ func checkMain(ctx *context.Context, build config.Build) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "failed to parse file: %s", build.Main)
|
return errors.Wrapf(err, "failed to parse file: %s", build.Main)
|
||||||
}
|
}
|
||||||
if !hasMain(file) {
|
if hasMain(file) {
|
||||||
return fmt.Errorf("build for %s does not contain a main function", build.Binary)
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
return fmt.Errorf("build for %s does not contain a main function", build.Binary)
|
||||||
|
}
|
||||||
var dir = build.Main
|
var dir = build.Main
|
||||||
if dir == "" {
|
if dir == "" {
|
||||||
dir = "."
|
dir = "."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user