Go language Environment Build + Sublime Text 3 + Git + MarGo + Gocode combination configuration detailed

Source: Internet
Author: User
Tags sublime text gocode
This is a creation in Article, where the information may have evolved or changed.
1.window installation Gogoogle has a win installation package, for beginners or very simple! https://code.google.com/p/go/downloads/list; The environment variable is already configured we only need to configure a Gopath directory, we recommend to create a non-C disk    ; The directory format is: 2. Set gopath,3. After the preparation is complete, start building the sublime text development environment for the go language. A. After downloading the installation sublime text, install the package Control from the menu View-show console or CTRL + ~ shortcut keys to bring up the console. Paste the following Python code in and enter to perform the installation without exception. The installation code for ST3 and ST2 is provided below: Sublime Text 3:import Urllib.request,os; PF = ' package control.sublime-package '; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); Open (Os.path.join (IPP, PF), ' WB '). Write (Urllib.request.urlopen (' http://sublime.wbond.net/' + pf.replace (', '%20 ')) . Read ()) Sublime Text 2:import Urllib2,os; Pf= ' Package control.sublime-package '; IPP = Sublime.installed_packages_path (); Os.makedirs (IPP) if not os.path.exists (IPP) else None; Urllib2.install_opener (Urllib2.build_opener (urllib2. Proxyhandler ())); Open (Os.path.join (IPP, PF), ' WB '). Write (Urllib2.urlopen (' Http://sublime.wbond.net/' +pf.replace (', '%20 '). read ()); Print (' Restart Sublime Text to finish installation ') 4. Install Gocode and Margo. Before you do this, make sure you have Git installed. If not then please follow the steps below to install the Git feature (not all features, only to complete the construction of the environment, about the details of git, please refer to the GIT website).     If you are already a git user, skip the steps below and proceed directly to 6 steps. 5.msysgit is a git for Windows version, and its home page is: http://msysgit.github.io/click on the "Download" page to enter the download list. After downloading, double-click to start the installation: 1, except for the ADVANCEDXXX option, the remaining select all. 2. Select "Use Git Bash only". 3, select "Checkout as-is,commit as-is".    4, configure the GIT environment variable, appended to the path (copy the following code to change the installation path of git);D: \program Files\git\bin;d:\program Files\git\libexec\git-core; 6. Open the terminal and run the following command to install Gocode and Margo. Here you can enter in cmd: Go get github.com/nsf/gocode Go get Github.com/disposaboy/margo (the tool has been emptied by the author, most people are stuck in this step) if you are stuck in the second step,   Then you can replace it in my own way. Use go get Github.com/slene/margo this instead. But this tool needs to be changed a little bit by itself. After performing this step, you can restart the next Sublimetext test, the following will output the installation error message, you will be prompted to find a file called Gosublime.margo_***.exe. At this time, you can go to your gopath under the bin directory to find margo.exe files, you can rename this file to just can't find the file name.     Then copy it to the C:\users\**\appdata\roaming\sublime Text 3\packages\user\gosublime\windows-x64\bin below. 7. Installing SublimetexT plugins: Gosublime, sidebarenhancements and go buid. Modify the Gosublime configuration: Under the Preferences menu, locate the package Settings, find Gosublime, and then find Settings-default. Re-open the file, add the following configuration, and save: "env": {"path": ": E:/go/development\bin;"}, (own Gopath under Bin directory) 8. The environment has been fully built.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

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.