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

fix: not a go module on go 1.15

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2021-03-30 09:28:44 -03:00
parent 008bd866a9
commit 90f2ba6925

View File

@ -16,6 +16,11 @@ func (Pipe) String() string {
return "loading go mod information"
}
const (
go115NotAGoModuleError = "go list -m: not using modules"
go116NotAGoModuleError = "command-line-arguments"
)
// Run the pipe.
func (Pipe) Run(ctx *context.Context) error {
out, err := exec.CommandContext(ctx, "go", "list", "-m").CombinedOutput()
@ -24,7 +29,7 @@ func (Pipe) Run(ctx *context.Context) error {
}
result := strings.TrimSpace(string(out))
if result == "command-line-arguments" {
if result == go115NotAGoModuleError || result == go116NotAGoModuleError {
return pipe.Skip("not a go module")
}