Since this example does not specify its expected output (// Output:), this failure will not be registered via go test. Edit: the source files have // Output:, so it's not clear to me what is happening.
I'm new to go/types, so it's not clear to me whether the example is broken, or packages are broken.
The text was updated successfully, but these errors were encountered:
@jmank88 go/types requires the "fmt" package to be installed. This code runs fine if you copy it and run it locally (with a std library installed), or if you run the godoc server locally (with a std library installed). go/types and the example are correct but the example set up may need tweaks, or perhaps an explanation. Leaving for @alandonovan who added this example.
As the comment in the example says, the importer loads files from $GOROOT/pkg/$GOOS_$GOOARCH/fmt.a; these files are not present in the Playground's sandbox.
Not all example programs are intended to be executable in the Go Playground, for example, anything that accesses the network will not work. This is a limitation of the Playground, not a mistake in the example.