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

x/tools/go/packages: can not load single file outside GOPATH and a module directory #49949

Closed
aarzilli opened this issue Dec 3, 2021 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@aarzilli
Copy link
Contributor

aarzilli commented Dec 3, 2021

Reproducer:

	tmp, _ := ioutil.TempDir("", "a")
	defer os.RemoveAll(tmp)
	filename := filepath.Join(tmp, "a.go")
	ioutil.WriteFile(filename, []byte(`package main; func main() { println("hello world") }`)
	pkgs, err := packages.Load(&packages.Config{Mode:packages.LoadSyntax, Dir: tmp}, "file="+filename)
@gopherbot gopherbot added this to the Unreleased milestone Dec 3, 2021
@gopherbot
Copy link

Change https://golang.org/cl/369014 mentions this issue: go/packages: fix loading single file when outside of GOPATH, module

@findleyr findleyr changed the title x/go/packages: can not load single file outside GOPATH and a module directory x/tools/go/packages: can not load single file outside GOPATH and a module directory Dec 3, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Dec 3, 2021
@mknyszek
Copy link
Contributor

mknyszek commented Dec 3, 2021

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 3, 2021
@golang golang locked and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants