-
Notifications
You must be signed in to change notification settings - Fork 18k
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/compile: "go tool compile foo.go " doesn't work #56776
Comments
maybe just need to compile the fmt package to goroot or gopath. |
You can also set In general |
For go1.19, go1.18 and previous versions of go, this usage is feasible, the latest code before CL 432535 also supports this usage, and I didn't see any discussion of changing this behavior in #47257. In my opinion, this is a common user behavior change, does not it require a proposal process? @rsc
Temporarily reopen this issue, I'll close it if this is still not considered an issue. |
I often get tripped up on this when compiling a test for other architectures, where the test imports a package like |
You can |
Thanks @randall77 @ianlancetaylor In fact, I think whether |
If you run Closing because this is a workflow that we've decided, for what we think are good reasons, to not support by default. |
Okay, can you elaborate ? Or point me to the issue link. Is it #47257 ? |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
$ cat foo.go
package main
import (
"fmt"
)
func main() {
fmt.Println("he")
}
$ go tool compile foo.go
What did you expect to see?
The program compiles.
What did you see instead?
foo.go:4:2: could not import fmt (file not found)
Git bisect points to https://go-review.googlesource.com/c/go/+/432535 cc @michaelmatloob
The text was updated successfully, but these errors were encountered: