Would be nice to have all the snippets in the documentation have complete import statements of all the packages referenced in each snippet code.
When a new Gopher comes along, trying to learn, and comes across a snippet like below.. It makes it really tough when snippets like this can't just be copy/pasted into things like, https://play.golang.org/ w/o first investigating and figuring out which packages need to be included.
There's nothing in the code snippet to explicitly tell the Gopher where things like, http, mux, bytes, strings, jwt, fmt, etc are coming from.
I know to a lot of seasoned folks, these things may seem "obvious" to them... But to new Gophers trying to learn how to use Golang, it's a big stumbling block...
Would be nice to have all the snippets in the documentation have complete
import
statements of all the packages referenced in each snippet code.When a new Gopher comes along, trying to learn, and comes across a snippet like below.. It makes it really tough when snippets like this can't just be copy/pasted into things like, https://play.golang.org/ w/o first investigating and figuring out which packages need to be included.
There's nothing in the code snippet to explicitly tell the Gopher where things like,
http
,mux
,bytes
,strings
,jwt
,fmt
, etc are coming from.I know to a lot of seasoned folks, these things may seem "obvious" to them... But to new Gophers trying to learn how to use Golang, it's a big stumbling block...