HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
nsf
gocode
Go2011–2016
nsf / gocode

gocode

An autocompletion daemon for the Go programming language

13Distinct people
14Mentions
0Explicit recommenders
5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

An autocompletion daemon for the Go programming language

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year14 dated mentions

Observed mentions: 2011-05-10 03:49:19 UTC to 2016-10-22 17:13:05 UTC.

0123452011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20112012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2016

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC110
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC404
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC514
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC303

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
An autocompletion daemon for the Go programming language IMPORTANT: This project is not maintained anymore, consider using https://pkg.go.dev/golang.org/x/tools/gopls, a tool which provides similar functionality and more, created and maintained by Go team. Gocode is a helper tool which is intended to be integrated with your source code editor, like vim, neovim and emacs. It provides several advanced capabilities, which currently includes: Context-sensitive autocompletion It is called daemon, because it uses client/server architecture for caching purposes. In particular, it makes autocompletions very fast. Typical autocompletion time with warm cache is 30ms, which is barely noticeable. Also watch the demo screencast. Setup You should have a correctly installed Go compiler environment and your personal workspace ($GOPATH). If you have no idea what $GOPATH is, take a look here. Please make sure that your $GOPATH/bin is available in your $PATH. This is important, because most editors assume that gocode binary is available in one of the directories, specified by your $PATH environment variable. Otherwise manually copy the gocode binary from $GOPATH/bin to a location which is part of your $PATH after getting it in step 2. Do these steps only if you understand why you need to do them: export GOPATH=$HOME/goprojects export PATH=$PATH:$GOPATH/bin Then you need to get the appropriate version of the gocode, for 6g/8g/5g compiler you can do this: go get -u github.com/nsf/gocode (-u flag for "update") Windows users should consider doing this instead: go get -u -ldflags -H=windowsgui github.com/nsf/gocode That way on the Windows OS gocode will be built as a GUI application and doing so solves hanging window issues with some of the editors. Next steps are editor specific. See below. Vim setup Vim manual installation Note: As of go 1.5 there is no $GOROOT/misc/vim script. Suggested installation is via vim-go plugin. In order to install vim scripts, you need to fulfill the following steps: Install official Go vim scripts from $GOROOT/misc/vim. If you did that already, proceed to the step 2. Install gocode vim scripts. Usually it's enough to do the following: 2.1. vim/update.sh update.sh script does the following: #!/bin/sh mkdir -p "$HOME/.vim/autoload" mkdir -p "$HOME/.vim/ftplugin/go" cp "${0%/*}/autoload/gocomplete.vim" "$HOME/.vim/autoload" cp "${0%/*}/ftplugin/go/gocomplete.vim" "$HOME/.vim/ftplugin/go" 2.2. Alternatively, you can create symlinks using symlink.sh script in order to avoid running update.sh after every gocode update. symlink.sh script does the following: #!/bin/sh cd "${0%/*}" ROOTDIR=`pwd` mkdir -p "$HOME/.vim/autoload" mkdir -p "$HOME/.vim/ftplugin/go" ln -s "$ROOTDIR/autoload/gocomplete.vim" "$HOME/.vim/autoload/" ln -s "$ROOTDIR/ftplugin/go/gocomplete.vim" "$HOME/.vim/ftplugin/go/" Make sure vim has filetype plugin enabled. Simply add that to your .vimrc: filetype plugin on Autocompletion should work now. Use <C-x><C-o> for autocompletion (omnifunc autocompletion). Using Vundle in Vim Add the following line to your .vimrc: Plugin 'nsf/gocode', {'rtp': 'vim/'} And then update your packages by running :PluginInstall. Using vim-plug in Vim Add the following line to your .vimrc: Plug 'nsf/gocode', { 'rtp': 'vim', 'do': '~/.vim/plugged/gocode/vim/symlink.sh' } And then update your packages by running :PlugInstall. Other Alternatively take a look at the vundle/pathogen friendly repo: https://github.com/Blackrush/vim-gocode. Neovim setup Neovim manual installation Neovim users should also follow Vim manual installation, except that you should goto gocode/nvim in step 2, and remember that, the Neovim configuration file is ~/.config/nvim/init.vim. Using Vundle in Neovim Add the following line to your init.vim: Plugin 'nsf/gocode', {'rtp': 'nvim/'} And then update your packages by running :PluginInstall. Using vim-plug in Neovim Add the following line to your init.vim: Plug 'nsf/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' } And then update your packages by running :PlugInstall. Emacs setup In order to install emacs script, you need to fulfill the following steps: Install auto-complete-mode Copy emacs/go-autocomplete.el file from the gocode source distribution to a directory which is in your 'load-path' in emacs. Add these lines to your .emacs: (require 'go-autocomplete) (require 'auto-complete-config) (ac-config-default) Also, there is an alternative plugin for emacs using company-mode. See emacs-company/README for installation instructions. If you're a MacOSX user, you may find that script useful: https://github.com/purcell/exec-path-from-shell. It helps you with setting up the right environment variables as Go and gocode require it. By default it pulls the PATH, but don't forget to add the GOPATH as well, e.g.: (when (memq window-system '(mac ns)) (exec-path-from-shell-initialize) (exec-path-from-shell-copy-env "GOPATH")) Options You can change all available options using gocode set command. The config file uses json format and is usually stored somewhere in ~/.config/gocode directory. On windows it's stored in the appropriate AppData folder. It's suggested to avoid modifying config file manually, do that using the gocode set command. gocode set lists all options and their values. gocode set <option> shows the value of that option. gocode set <option> <value> sets the new value for that option. propose-builtins A boolean option. If true, gocode will add built-in types, functions and constants to autocompletion proposals. Default: false. lib-path A string option. Allows you to add search paths for packages. By default, gocode only searches $GOPATH/pkg/$GOOS_$GOARCH and $GOROOT/pkg/$GOOS_$GOARCH in terms of previously existed environment variables. Also you can specify multiple paths using ':' (colon) as a separator (on Windows use semicolon ';'). The paths specified by lib-path are prepended to the default ones.
Read the full README on GitHub

What Hacker News says

14 sources
> Go has a lot of very polished tooling (eg. gocode) that is supported in multiple editors Have you tried racer? It seems quite similar, and apparently it does more (see [1]). I mean, I agree in the abstract that yes, having tooling and a bigger library ecosystem matters a lot. But the things you've cited so far (code completion and an AWS library) are things that Rust does have. I'd be more interested in hearing specific problems with those. [1]: https://github.com/nsf/gocode/issues/307#issuecomment-155080...
In 2017 Rust Roadmap
The Rust people are hard at work on making the compiler incremental. I don't know if IDE integration is part of the plan, but it would certainly be great if Rust could expose the kind of incremental, stateful API that TypeScript does. There's a good talk by Ander Hejlsberg about how it was designed from the ground up to support things like syntax highlighting and autocompletion, on the fly; as I understand, even syntax highlighting can be done by asking the compiler for the AST, as opposed to regexing, and it's all computed and cached as an incrementally built pipeline. I remember using Eclipse for Java development years and years ago, which has an entire incremental Java compiler built in. As a result, it offered lightning-fast error display and autocompletion, because it never needed to compile more than exactly what you were editing. I
Read the rest
t was amazing, and ever since I have been disappointed that this approach did not catch on elsewhere -- either people didn't know about it, or they chose to ignore it. Even Go -- whose toolchain is very much designed to be run programmatically by apps such as IDEs -- seems to have dropped the ball there. There is an autocompletion daemon (https://github.com/nsf/gocode), but it's not part of Go.
In Rust: Systems Programming for Everyone
(throwaaway here) Before you waste the next few months of your life learning a corrupt programming language: - Typesafe co-founder quits: https://www.youtube.com/watch?v=uiJycy6dFSQ - https://vimeo.com/64716826: Paul Dix - Why Node and Scala will dry up: Go will drink their milkshake - I can personally tell you, scala is awful at handling large codebases and is so filled with idioms, you have a difficult time reading it. I remember opening scala code, seeing english, but it felt impossible to decipher. - You feel clever when you write it. No doubt about that. Other programmers and your customers don't care. - Compilation time: It's atrocious, we're talking 1 to 10 minutes to compile web apps. - Package dependencies: You end up incorporating java at the end of the day. Version mismatches. - As for the "functional language" thing, just pick
Read the rest
real Haskell or Ocaml. Don't fall prey to scala being a functional language. - You need to rely on a huge, laggy IDE with missing / out of date plugin packages to get autocompletion. On the other hand, Golang: - compiles these massive applications in line 2 seconds. - It's highly lintable. - The syntax is just... dumb. - Yet you don't feel limited at all. - It runs fast-fast-fast without having to rely on JVM. - Familiar syntax... like a hybrid between Python and C - You can import packages from github / git repos, automatically grab dependencies with one command. - The build system and tooling is simple and genius - Autocompletion (https://github.com/nsf/gocode) OP: I hope you don't waste your time on a scala venture. Scala has it's die hard fanboys, especially those who spent 15 years in java and have too much of an ego-investment to think anything else, but even the co-founder of typesafe, the most prolific committer says the language is a mess.
In Ask HN: Should I learn Scala or Go?
I hope no emacs users use control, there is a caps lock for that. It's ok to disagree with godit, it's not meant for everybody. Frankly, just for me. And if someone else likes it, I don't mind sharing it. Go-completion facility in Emacs is available. `github.com/nsf/gocode` has two plugins for emacs (auto-complete-mode and company-mode).
In Godit - A very religious text editor written in Go
> Everyone who has used vi(m) has copied and pasted text in while in command mode and done who knows what. If you are using vim, you should play per vim rules. When you are entering text, you enter insert mode. When you are done, back to command mode. Once you have that mental model, you don't try to c-v(or c-shift-v or whatever) in command mode. Also, if you are willing to try vim, grab a vim build with clipboard support and copy-paste from within vim(=+p paste clipboard, =p paste x selection, =+y{motion} copy to clipboard ... in command mode; or ctrl-r+ paste from clipboard, ctrl-r paste from x selection in insert mode) > I find the concepts of modes jarring, even antiquated. The thing I like about vim is translating intent to vim commands - delete 10 lines and then move to the top of the file 10ddG, delete everything inside these pare
Read the rest
ns and put me in insert mode cib etc. Without modes, these won't be as short and sweet. You will be left with long key combinations - the way emacs does it. > Emacs is better in this regard but I find Emacs's need to consecutive key presses (or a key press followed by a command) to be longwinded. Isn't that obvious? If you always want to be in insert mode, how else will the special instructions be entered? > The advantage of either is they're easy to use over ssh+screen (or tmux) for resuming sessions. And they are very good at editing text, and majority of programming languages, though might require some configuration. > For statically typed languages (eg Java/C#), IDEs (quite rightly) rule supreme. Static code analysis, auto-completion, etc are just so much better than text-based editors. I generally am able to find something for Vim which makes language specific stuff easy. Clojure - http://www.vim.org/scripts/script.php?script_id=2501 Java - http://eclim.org/ Go - https://github.com/nsf/gocode C - http://www.vim.org/scripts/script.php?script_id=3302 Python - http://rope.sourceforge.net/ropevim.html And a lot more... > I tend to think the speed differences over not using the mouse are largely illusory. Doesn't that depend on the task? What will be faster - ctrl-f on this page or clicking edit(or some menu)->find? Also, for me, it is more about having my fingers on home row is the sweet spot and moving my fingers from my sweet spot is irritating.
In Vim, you complete me
I'm extremely happy with nsf's gocode [1] adding auto-complete support to Sublime Text and Vim. It's quite nice. Go, itself (from `hg`), has syntax support for vim and (I think) an emacs plugin. There's also a Goclipse modified Eclipse install which I don't know much of anything about. There are others, [2] I mean, there certainly isn't a complete equivalence of Eclipse for Go (yet?). [1]: https://github.com/nsf/gocode [2]: http://go-lang.cat-v.org/dev-utils http://go-lang.cat-v.org/text-editors/ etc, etc
In Go is amazing, period.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.