I'd like to announce a tool I've been working on; it's available in the
form of a website.
It's just like godoc.org, but given an import path of any Go package, it
displays its *_source code_*.
http://gotools.org/
(2 minute screencast here: https://www.youtube.com/watch?v=twjxYEubmzs)
You can already see source code of a Go package on github, etc., so why
this? Three main reasons:
- It works on any valid Go package import path.
- It doesn't matter if's hosted on GitHub or code.google.com, if it's a
part of standard Go library, or if it uses a vanity import path. If you can go
get it, you can see its source in the same place, e.g.:
http://gotools.org/net/http
http://gotools.org/rsc.io/pdf
http://gotools.org/gopkg.in/pipe.v2
http://gotools.org/github.com/shurcooL/gtdo
- It supports "goto symbol" functionality, making navigation with
keyboard only much faster/easier.
- When you know what identifier you want to see, press Cmd+R (or just R
in browsers that don't allow intercepting Cmd+R) to bring up a symbols
view. This is inspired by Sublime Text and I wanted the same experience in
this tool.
Go symbol names are always unique, so this is an incredible way to
navigate code. No need to search for NewRequest in net/http when you can
*_lookup_*:
http://gotools.org/net/http#NewRequest
- It displays all .go files on one page.
- Makes it easy to access entire Go package source at once and use Cmd+F
to find something without having to know which .go file it's in.
Combined with a predictable URL scheme of gotools.org/import-path, the
entire site is very usable with keyboard only, which is great when you're
in the middle of development and just want to quickly get to somewhere.
It also supports viewing any branch or revision of a Go package. The query
parameter `rev` specifies it; there's a branch selector dropdown box at the
top. It's handy when you're in the middle of work and don't want to stash
your changes, check out another branch just to look something up.
---
I use godoc.org multiple times a day when I'm writing Go code. I find
myself in situations where I want to use gotools.org to look up some source
code of some Go package on some branch a few times a week. Not as often,
but it is useful when the need arises. Being able to jump to any symbol
with Cmd+R is really my most favorite feature, as well as ability to paste
import path in the URL and go there.
I want gotools.org to be the best tool for viewing Go package source code.
I'm continuing work to fill in remaining missing features. I want this to
become a helpful tool for the Go community, and if it can eventually be
accepted as part of Go project that'd be something I'm happy to do. If you
like the general idea behind it, improvement suggestions are welcome. It's
open source so you can play a role in making it better. If it's something
that adds complexity, open an issue first and discuss your proposal, as I
have limited resources to spend on maintenance. (As an implementation
detail, all frontend code is written in Go; there is no hand-written
JavaScript, and I want to keep it that way. I also want to keep the code as
short and simple as possible.)
It uses sourcegraph's awesome go-vcs and vcsstore libraries for accessing
underlying git/mercurial repos, and GopherJS for compiling frontend code.
Let me know what you think and how I can make it more useful!
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.