You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
changed the title
go/types ExampleMethodSet failing
go/types ExampleMethodSet errors, but doesn't fail
Apr 12, 2016
@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.
What version of Go are you using (
go version
)?Whatever golang.org is using behind the scenes to run examples, as of 2016-4-12 ~5pm CT.
What operating system and processor architecture are you using (
go env
)?Same as 1.
What did you do?
Ran the example code here: https://golang.org/pkg/go/types/#example_MethodSet
What did you expect to see?
I expected the program to "Print the method sets of Celsius and *Celsius." as documented.
What did you see instead?
An error:
The error is returned from this call:
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: