Skip to content

Commit

Permalink
fix: not a go module on go 1.15
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Mar 30, 2021
1 parent 008bd86 commit 90f2ba6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/pipe/gomod/gomod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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")
}

Expand Down

1 comment on commit 90f2ba6

@vercel
Copy link

@vercel vercel bot commented on 90f2ba6 Mar 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.