Getting help from godoc

I would like to list all available imports in Golang

Also I would like to read the syntax of switch statement in Golang.

In what Godoc page would I see the syntax for switch statement??

I know the syntax, just want to know where to look for it.

Available on your machine? Available in the Internet? Available as part of go?

In the language specs:

Available on my machine or as part of go itself, not on the internet.

Preferably via command line

There have to be a godoc page for it, I just don’t know it

You could use curl or wget to download the spec.

You can run godoc -http=:6060 then you can access package’s document by browse to localhost:6060/pkg and localhost:6060/ref/spec for the language spec.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.