Construction of Golang development environment under Linux

Source: Internet
Author: User
Tags git clone gocode gotags

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.