Skip to content

Commit

Permalink
fix according to the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuki77 committed Aug 11, 2021
1 parent 9c9b32f commit 2683904
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/cmd/go/internal/load/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,10 @@ func loadImport(ctx context.Context, opts PackageOpts, pre *preload, path, srcDi
if p.Internal.Local && parent != nil && !parent.Internal.Local {
perr := *p
var err error
if path == "." {
if cfg.ModulesEnabled {
err = ImportErrorf(path, "local import %q not supported in module mode", path)
} else if path == "." {
err = ImportErrorf(path, "%s: cannot import current directory", path)
} else if build.IsLocalImport(path) {
err = ImportErrorf(path, "%s: relative import not supported", path)
} else {
err = ImportErrorf(path, "local import %q in non-local package", path)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! go build
stderr 'main.go:4:2: ./foo: relative import not supported'
stderr 'main.go:4:2: local import "./foo" not supported in module mode'

-- foo/foo.go --
package foo
Expand Down

0 comments on commit 2683904

Please sign in to comment.