-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
go/ast: CommentMap example does not compile #20450
Comments
The example is not rendered as a runnable example (we have examples that cannot be run in the playground, for example the ones that need access to the filesystem, and we render them without the run button) so IMHO you shouldn't expect it to actually be runnable. The purpose of the example is to show how to use CommentMap and you can treat |
Thanks for the quick response! |
If we can make it runnable without losing clarity, I think we should do it. |
I would like to claim this issue. |
CL https://golang.org/cl/48969 mentions this issue. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ritesh/code/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/5x/m5n_f_wj6fngljvf9g7y3mp4qphpn9/T/go-build111820297=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
Tried to run the example in https://golang.org/pkg/go/ast/#example_CommentMap. A link to the full program, with imports, is here:
https://play.golang.org/p/5DA91qtnm4
What did you expect to see?
Expected the example to run, without any errors.
What did you see instead?
tmp/sandbox659516205/main.go:44: undefined: removeFirstVarDecl
The text was updated successfully, but these errors were encountered: