Can view any revision/branch/tag or even CL of GOROOT packages on gotools.org—is this helpful to other Go developers?

160 views
Skip to first unread message

Dmitri Shuralyov

unread,
Aug 16, 2017, 6:18:48 PM8/16/17
to golang-dev
Hello,

For those that haven't seen it, https://gotools.org is a small utility site, inspired by godoc.org, but for viewing the source code any Go package on a single page.

As I've started to send more CLs to the Go project recently, especially ones affecting documentation, I found myself wanting to prioritize issue 45, which was adding the ability to view packages in Go standard library (i.e., in GOROOT) at different revisions/branches/tags. I've completed that today. (Previously, it was only possible to see the current stable version of GOROOT.)

I wanted to share that, and find out if anyone here would find it useful, and ask how are people in general solving the problem of wanting to see/read/compare GOROOT code at different revisions.

I could use GitHub, but it's not pleasant because:
- it's hard to navigate between .go files of a single Go package (gotools shows them all one page)
- there's no F shortcut to jump to an identifier (just like there is on godoc.org... and gotools.org also has it)

I could use my local editor, but it's not pleasant because:
- often, I want to see/view/compare 2 different revisions against each other, or look something up while in the middle of work. stashing changes, checking out another branch is harder than opening a browser tab and visiting gotools.org/import/path?rev=somecommit

Those are the reasons I wanted to be able to use the gotools UI for this.

---

Note that it's possible to view CLs as well (they're just a refs/changes/* revision), so this brings up my next question. I am considering adding a "godoc" tab to gotools.org which would then allow you to view/preview godoc of any package in GOROOT at any revision/tag/branch/CL. Also be able to share that link with other people so they can see it too.

godoc.org today lets you view godoc of any Go package, but only its latest version. It's great in most cases, but insufficient when you want to preview how a PR or CL will make the godoc show up (e.g., in a CL like this). The local godoc -http=:6060 command works, but requires you to check out the branch you want to see, which is hard if you're in the middle of making changes. You also can't share it, so you end up having to take screenshots...

Before I work on that, I just wanted to ask if anyone else would find it useful? What do people use to solve these tasks, if anything, right now?

If there's any other feedback on this, I'd gladly want to hear it. I worked on this tool because I really wanted to fill an obvious gap in my Go development workflow, but it'd be even better if it's helpful for others too.

Thanks.
Reply all
Reply to author
Forward
0 new messages