Skip to content

cmd/compile: "go tool compile foo.go " doesn't work #56776

@erifan

Description

@erifan

What version of Go are you using (go version)?

$ go version
go version devel go1.20-fee0ab8b5e Thu Nov 17 03:47:35 2022 +0000 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
darwin/arm64

What 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions