From 86a263747e938b87054c7ce721addd80c69132d3 Mon Sep 17 00:00:00 2001 From: Filippo Rossi Date: Fri, 1 Apr 2022 22:20:39 +0200 Subject: [PATCH] cmd/go: remove unnecessary Stat in go work use --- src/cmd/go/internal/workcmd/use.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cmd/go/internal/workcmd/use.go b/src/cmd/go/internal/workcmd/use.go index 4a60917b20f..6da64b3f09e 100644 --- a/src/cmd/go/internal/workcmd/use.go +++ b/src/cmd/go/internal/workcmd/use.go @@ -125,11 +125,7 @@ func runUse(ctx context.Context, cmd *base.Command, args []string) { } if !*useR { - if target, err := fsys.Stat(useDir); err == nil && !target.IsDir() { - base.Errorf(`go: argument "%s" is not a directory`, useDir) - } else { - lookDir(useDir) - } + lookDir(useDir) continue }