3 ms·
If you want to read the code, each godoc name can be clicked to directly redirect you to the source code of what you're looking for, eg. to a github page code v
by q3k 6y ago
If you want to read the code, each godoc name can be clicked to directly redirect you to the source code of what you're looking for, eg. to a github page code viewer.
Depending on whether you use gomodules, GOPATH, or any other build system you also can find the files locally to grep through them or use your text editor to read them locally. You can also override import resolution to point to a fork (eg. of any module if using gomodules), if you want to test drive some local patches.
I do a _ton_ of code reading in my work, and I find using Godoc for that probably the best experience of any language (second only to maybe Haskell/Hoogle, but there you get much more difficult-to-grok-at-a-glance code).
- doublerabbit 6y ago> You can also override import resolution to point to a fork (eg. of any module if using gomodules), if you want to test drive some local patches. So much overhead where time is limited. I shouldn't need to fork packages, I don't want to fork.
- q3k 6y agoIt's one `cp -r` and a 1 line change in go.mod [1]. You can also just `go mod vendor` to have all modules land in a `vendor/` directory when you can edit things as you wish [2]. [1] - https://golang.org/ref/mod#go-mod-file-replace https://golang.org/ref/mod#go-mod-file-replace [2] - https://golang.org/ref/mod#vendoring https://golang.org/ref/mod#vendoring