Sublime Text 3 Build Golang development environment

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

Installing Golang

Go Language Home page:

https://golang.org/

Go language installation Download:

Https://golang.org/dl

environment variable settings:

Goroot:

Goroot variable set the root directory of Go installation, under Windows, usually C:\go

Gopath:

Gopath variable set the root directory where go source code is stored

Installing Sublime TEXT3

First, install Sublime Text 3:

Http://www.sublimetext.com/3

Next, install the Sublime Text 3 package Control:

Https://packagecontrol.io/installation#st3

Run Sublime Text 3, press the shortcut key Ctrl+' bring up the console, execute the Python code in the above page to install the package control, and then restart Sublime Text 3.

Finally, install the plugin gosublime:

1) in Sublime, press and hold the shortcut key SHIFT + CTRL + P, enter the install package in the pop-up box , and press ENTER

2) Next, enter Gosublime, and press ENTER (may need to wait a little bit, can see sublime the bottom of the state)

3) After thegosublime installation is complete, click menu item Preferences , package settings , gosublime - Settings-uesrs, configuring gopath,goroot

    Enter the following in the open window and save

{"    env": {        "Gopath": "C:/go",        "Goroot": "D:/goworkspace"    }}

4) Configure (optional), click the menu item Tools->build system->new Build System, enter the following in the open window and save

{"cmd": ["Go", "Run", "$file _name"],    "File_regex": "^[]*file \" (... *) \ ", line ([0-9]*)",    "Working_dir": "$file _path",    "selector": "Source.go"}

Other references:

Sublime TEXT3 + Golang Building development 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.