Windows under Gosublime configuration Go Auto Install three-party package and can prompt

Source: Internet
Author: User
Tags gocode
This is a creation in Article, where the information may have evolved or changed.

preparatory work:

1. Set up a system environment variable similar to the following :


Set goarch=386    set Gobin=c:\go\bin    set gochar=8    set Goexe=.exe    set gohostarch=386    set Gohostos=windows    set goos=windows    set Gopath=e:\mygo    set gorace=    set Goroot=c:\go    set gotooldir=c:\go\pkg\tool\windows_386    set CC=GCC    set gogccflags=-g-o2-m32-mthreads    set cgo_enabled= 1


2. go to sublime text in the install package search gosublime

3. Download Gocode

the command line to go working directory (thatis, Gopath) executes:

Go get-u-ldflags-h=windowsgui Github.com/nsf/gocode
and then to go working directory (i.e. Gopath below \ bin to find Gocode.exe copy one to C:\go under

4. Open the Sublime Text menu Preferences, package Settings, Gosublime->settings-user and enter:

{"    env": {     "goroot": "C:\\go",//go installation path     "GOBIN": "C:\\go\\bin",     "Gopath": "E:\\mygo",//The work path of your go "     Goarch": "386",//system variable inside the Gohostarch, 386 for 32-bit platform, AMD64 for 64-bit platform     "GOOS": "Windows",//System inside the GOOS     "PATH": "% gobin%;%path% "    },    " comp_lint_enabled ": true,   //Open this only to the contents of the comp_lint_commands tag below        " Comp_ Lint_commands ": [{" cmd ": [" Go "," Install "]}],    " On_save ": [{" cmd ":" Gs_comp_lint "}   //When the command executed automatically with CMD on save]}

    5. Restart   after saving; Sublime text any of the files in your go project can be applied to the third-party package's self-help hint  

Related Article

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.