Go language Environment Build +sublime Text3 (under the Windows environment)

Source: Internet
Author: User
Tags install go sublime text

1. Install Sublime Text3

2. Install the Go language package

3. Test if the Go language is installed successfully

Type the cmd command, open the DOS window, type the GO command (if it is not found under the default path, you can find it in the installation directory, Eg:go/bin)

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/81/FA/wKiom1dGk7igNbFSAAHsC3sIjOk348.jpg "title=" F4722a59e3704c7aa16887562ffd8908.jpg "alt=" Wkiom1dgk7ignbfsaahsc3sijok348.jpg "/>

Indicates successful installation

4. Configure Environment variables

My Computer = "attribute =" System settings = "Environment variable setting, add Gopath variable, the path of this variable is the place where the source code is placed

There are also two variables, which are usually the default settings, GO, Goroot

5. Check if environment variable setting is successful DOS type go env view

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/81/F8/wKioL1dGlMbBDsm0AAEu5uzYr0U013.jpg "title=" 0683d1c08ec246c292b59f57919fa78b.jpg "alt=" Wkiol1dglmbbdsm0aaeu5uzyr0u013.jpg "/>

The interface that the command executes successfully prompts should

6. Configure Sublime Text3 (Install sublime plugin)

1). First install the Package Control pack, shortcut CTRL + ' ( menu item View > Show Console to bring up the Command interface ), enter X

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 ()); restart Sublime Text3

2). Preferences=>package control (or shortcut key Ctrl+shift+p) Enter package install Enter to start installing sublime plugin

3). Install the Gosublime plugin and enter Gosublime in the previous pop-up box

4). Install Go build plugin, ditto

7. Test the Go Language environment configuration

A Go language code is executed, the file is placed in the SRC folder of Gopath, ctrl+b pop-up Command box (if it does not appear manually set,

Tools=>build system=>gosumlime, this kind of can. );

Go run the current program and enter information

Go build compiles the current program, outputs an. exe program


Note: Two ways to see execution compile execution: 1. In sublime text 3 ctr+b Enter go run *.go file execution or go build *.go file, generate *.exe file; 2. or open a DOS window and run the *.go file



Text 2 Package Control installation

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‘Please restart Sublime Text to finish installation‘)


TEXT3 Package Control Installation

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())

Go language Environment Build +sublime Text3 (under the Windows environment)

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.