For Golang development, Windows can be used Vscode or liteide are good, but the development of Linux is only vim, so how to use the fun of vim Golang development?
Refer to one of the official recommended plugins: Vim-go
Installation steps:
Vim-go installation requires the use of VIM plug-in management tools, I use the Vundlevim, the specific installation operation according to the tool's readme.
When the Vim-go installation is complete, according to Vim-go's readme inside the introduction, need to use the command: goinstallbinaries to install the necessary tools, but here to say, the domestic cause of the wall will cause installation failure, My workaround here is to find the tools and their paths that need to be installed when executing the goinstallbinaries command, with the following lines in ~/.vim/bundle/vim-go/plugin/go.vim :
1\'asmfmt': ['github.com/klauspost/asmfmt/cmd/asmfmt'],2\'Errcheck': ['Github.com/kisielk/errcheck'],3\'fillstruct': ['github.com/davidrjenni/reftools/cmd/fillstruct'],4\'Gocode': ['Github.com/nsf/gocode', {'Windows':'-ldflags-h=windowsgui'}],5\'Godef': ['Github.com/rogpeppe/godef'],6\'Gogetdoc': ['Github.com/zmb3/gogetdoc'],7\'Goimports': ['Golang.org/x/tools/cmd/goimports'],8\'Golint': ['Github.com/golang/lint/golint'],9\'Gometalinter': ['Github.com/alecthomas/gometalinter'],Ten\'Gomodifytags': ['Github.com/fatih/gomodifytags'], One\'Gorename': ['Golang.org/x/tools/cmd/gorename'], A\'Gotags': ['Github.com/jstemmer/gotags'], -\'guru': ['Golang.org/x/tools/cmd/guru'], -\'Impl': ['Github.com/josharian/impl'], the\'keyify': ['github.com/dominikh/go-tools/cmd/keyify'], -\'Motion': ['github.com/fatih/motion'],
Here we need to manually install, for github.com to execute: Go get path, for the golang.org execution: Go install path.
Before installing golang.org we need to manually clone the Golang.org Tools library (this is a mirror on GitHub) to local.
1. Create a new golang.org/x directory under the GOPATH/SRC directory and CD in
2. Then git clone https://github.com/golang/tools.git
Once this is done, the tool can be installed.
Construction of Golang development environment under Linux