From 50117da6b5adcabffe30adae9985450ba078b49a Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 3 Apr 2021 16:47:57 -0300 Subject: [PATCH] fix: not using go mods on go 1.15 Signed-off-by: Carlos Alexandro Becker --- internal/pipe/gomod/gomod.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/pipe/gomod/gomod.go b/internal/pipe/gomod/gomod.go index 3b4cbb117..ac1a34178 100644 --- a/internal/pipe/gomod/gomod.go +++ b/internal/pipe/gomod/gomod.go @@ -42,14 +42,13 @@ func (Pipe) Default(ctx *context.Context) error { // Run the pipe. func (Pipe) Run(ctx *context.Context) error { out, err := exec.CommandContext(ctx, ctx.Config.GoMod.GoBinary, "list", "-m").CombinedOutput() - if err != nil { - return fmt.Errorf("failed to get module path: %w: %s", err, string(out)) - } - result := strings.TrimSpace(string(out)) if result == go115NotAGoModuleError || result == go116NotAGoModuleError { return pipe.Skip("not a go module") } + if err != nil { + return fmt.Errorf("failed to get module path: %w: %s", err, string(out)) + } ctx.ModulePath = result