gdoc is a small utility to search on GoDoc.org. It's also suitable to read package documents via command-line.
Warning: This tool is only tested on Linux and OSX.
With a properly configured Go environment:
go get -u github.com/buraksezer/gdoc
gdoc search <keyword>
gdoc lists the first 10 package as default. If you want to increase or decrease that number, use
gdoc search -c 3 <keyword>
gdoc has an interactive mode. If you use the
-i/--interactive parameter when you search something, gdoc lists packages with numbers and await for your action to fetch its document from GoDoc.org.
gdoc search -i memberlist ==> (1) github.com/hashicorp/memberlist ==> imports: 192 stars: 804 memberlist is a library that manages cluster membership and member failure detection using a gossip based protocol. ==> (2) github.com/Nitro/memberlist ==> imports: 3 stars: 0 memberlist is a library that manages cluster membership and member failure detection using a gossip based protocol. ==> (3) github.com/journeymidnight/nentropy/memberlist ==> imports: 3 stars: 1 .... Give a number to read the document:
Read package documentation:
gdoc read <package path>
gdoc read github.com/hashicorp/memberlist
Fetches the package document from GoDoc.org in text format and pipes to an available pager. gdoc looks for
PAGER environment variables to get the pager command as respectively. If you want to disable paging, use
gdoc read --disable-pager <package path>
gdoc supports aliases to access easily the frequently used documents. If you set an alias for a package previously, just use
-a/--alias to get the document for that package.
gdoc read -a <alias>
In order to add an alias for a package:
gdoc alias set <short name> <package path>
gdoc alias set memberlist github.com/hashicorp/memberlist
If you want to delete previously setted alias, just use
gdoc alias del <short name>
You can use
list subcommand to list already setted aliases.
gdoc is a free software, you feel free to send PRs to improve gdoc.
gdoc is licensed under the GNU General Public License v3.0 - see LICENSE for more details.
There is no documentation for this package.