Sublime Configuring the Golang development environment in text 3

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

1: First download go source https://golang.org/dl/[according to different environment selection]

2: New File project folder holds D:/go_project

Create bin src pkg subfolder separately

3: Configure Environment variables

Goroot = "D:\Go" (Go installation path)

Gopath = "D:\Go_project" (custom)

Second, install sublime Text

1. Download Sublime Text http://www.sublimetext.com/

2. Installing Package-ctrl

Enter under View->show console
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 ())

Enter, restart sublime after success.

3. Install Gosublime, sidebarenhancements

Press CTRL +SHIFT+P to open the package Ctrl enter install press ENTER to enter the installation page.

Enter Gosublime to locate and then enter install. (some slow, wait until the input box pops up to search)

Third, installation Gocode

Open the console and enter the following:

Go get-u github.com/nsf/gocode

Go Install Github.com/nsf/gocode

(You need to install GIT tools to configure the GIT environment; C:\Program Files\git\bin; C:\Program Files\git\libexec\git-core;)

Windows git download http://msysgit.github.io/

Four, Ctrl+b automatically run go

Tools->build system->new Build System

Modify text

{

"Shell_cmd": "C:\\go\\bin\\go run $file",

"Encoding": "Utf-8"

}

Then save Gobuild.submlime-build

Then Tools->build System selects Gobuild

Five, write a hello.go file test open

Then press CTRL+B.

Package Main

Import (
"FMT"
)

Func Main () {
Fmt. Println ("Hello world!")
}

The address will appear: Hello world! Installation Successful

Reference Document: http://www.w3hacker.com/sublime-text-3%E6%90%AD%E5%BB%BAgo%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%EF%BC% 88window-7%ef%bc%89.html

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.