Let ' s go! First step: Build the development environment

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

Under Ubuntu development environment

Download Address

After entering the download directory, run the following command to unzip the downloaded Go development package /usr/local . The official recommended catalogue.

tar -C /usr/local -xzf go1.8.linux-amd64.tar.gz

Configuration variables

Open /etc/profile or $HOME/.profile file, add the following content

export PATH=$PATH:/usr/local/go/bin

When customizing the installation directory: Goroot is the Custom installation directory

export GOROOT=$HOME/go1.Xexport PATH=$PATH:$GOROOT/bin

Open terminal, run to go env see if there is no output environment information. There is a successful configuration

Installing Sublime

Go to website download
CTRL + ' Enter the following to install the package Control

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 Installation
Sublime Input Chinese

Installing the Gosublime Plugin

GoSublimeerrors may occur after installation:

MarGo: Missing required environment variables: GOPATH

This is because of a configuration problem. Open GoSublime the configuration file.
Enter the information configured above

{    "env":     {         "GOPATH": "$HOME/golang",        "GOROOT": "GOROOT=$HOME/go1.X"    }}

Test

package mainimport "fmt"import "runtime"func main() {    fmt.Printf("format %s", runtime.Version())}

Use Sublime Press ctrl+b to run the next program to see the output.

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.