Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: panic: LoadImport called with empty package path when listing GOROOT/test/*.go #60230

Open
bcmills opened this issue May 16, 2023 · 1 comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bcmills
Copy link
Member

bcmills commented May 16, 2023

What did you do?

~$ gotip version
go version devel go1.21-5534f044 Tue May 16 16:01:08 2023 +0000 linux/amd64

~$ cd $(gotip env GOROOT)/test

~/sdk/gotip/test$ gotip list *.go
panic: LoadImport called with empty package path

goroutine 1 [running]:
cmd/go/internal/load.loadImport({0xb57718, 0xee60e0}, {0x0, 0x0, 0x0, 0x1, 0x0, 0x0}, 0x0, {0xc00051f5ee, ...}, ...)
        /usr/local/google/home/bcmills/sdk/gotip/src/cmd/go/internal/load/pkg.go:727 +0x124a
cmd/go/internal/load.LoadImport(...)
        /usr/local/google/home/bcmills/sdk/gotip/src/cmd/go/internal/load/pkg.go:710
cmd/go/internal/load.(*Package).load(0xc0001bcc00, {0xb57718, 0xee60e0}, {0x0, 0x0, 0x0, 0x1, 0x0, 0x0}, {0xa59638, ...}, ...)
        /usr/local/google/home/bcmills/sdk/gotip/src/cmd/go/internal/load/pkg.go:2004 +0x1a49
cmd/go/internal/load.GoFilesPackage({0xb57718, 0xee60e0}, {0x0, 0x0, 0x0, 0x1, 0x0, 0x0}, {0xc000134020, 0x145, ...})
        /usr/local/google/home/bcmills/sdk/gotip/src/cmd/go/internal/load/pkg.go:3181 +0x827
cmd/go/internal/load.PackagesAndErrors({0xb57718?, 0xee60e0?}, {0x0, 0x0, 0x0, 0x1, 0x0, 0x0}, {0xc000134020, 0x145, ...})
        /usr/local/google/home/bcmills/sdk/gotip/src/cmd/go/internal/load/pkg.go:2826 +0x253
cmd/go/internal/list.runList({0xb57718?, 0xee60e0}, 0xeaad60?, {0xc000134020?, 0x145, 0x14e})
        /usr/local/google/home/bcmills/sdk/gotip/src/cmd/go/internal/list/list.go:612 +0xcf0
main.invoke(0xeaad60, {0xc000134010, 0x146, 0x14f})
        /usr/local/google/home/bcmills/sdk/gotip/src/cmd/go/main.go:243 +0x4d6
main.main()
        /usr/local/google/home/bcmills/sdk/gotip/src/cmd/go/main.go:183 +0x7cf

What did you expect to see?

An error message explaining why I can't load all of the .go files in GOROOT/test as a single package.

What did you see instead?

Panic!

@bcmills bcmills added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels May 16, 2023
@bcmills bcmills added this to the Backlog milestone May 16, 2023
@bcmills
Copy link
Member Author

bcmills commented May 16, 2023

(CC @matloob)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

1 participant