"Let's Go" in 1:go language environment

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

Development about three years or so, but the use of Java, in addition to the company's projects, their own use of Java to do a task management system, Android did a few apps, think also should learn a new language, on-line browse the next, finally chose Go,let ' s go!

Download preparation

1: Download Go

Address: Http://www.golangtc.com/PS: Originally wanted to send the official website, but the celestial network you understand, simply not boring! Recommended download MSI package, ask me why: Save things.

2: Setting Environment variables

as follows:

GOARCH=AMD64//I am a Windows x64 system I'll just write 32.386
Gobin=c:\go\bin //go The bin inside the installation path
Goos=windows//I am windows I will fill out Windows Linux Mac self check
Gopath=c:\gopath//This does not need to create a new, and then in the new src, bin, pkg three directory
Goroot=c:\go//go Installation path

3: Download Sublime Text 3

Address: http://www.sublimetext.com/

3.1: Install the package Control

Ctrl+~ Open the Sublime console input as follows, you can install, if you want to network:

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

PS: If Ann is unsuccessful, then please own Baidu, because this is not the point.

4: Install git

Download Address: http://git-scm.com/download/

PS: You ask me how Ann? Do not develop the software is not a good architect, fuck off!

5: Install Gocode

the console runs the following two lines:

  
Get Github.com/disposaboy/margo

6: Install the sublime plugin

need to install Gosublime and sidebarenhancements, other help yourself.

Ps:sublime How to insert a piece please own Baidu

After installation, under the Preferences menu, locate the package Settings, find the Gosublime, and then find Settings-default. Re-open the file, add the following configuration, and save: "env": {"path": "C:/go/bin;"},

7: Write test code

Create a new file called Hello.go

The contents are as follows:

Package Main
Import (
"FMT"
)
Func Main () {
Fmt. Println ("Hello and Fuck the World")
}

PS: I wipe, OSC editor Why not format it yourself

8: Run the Code

Juvenile prepare your left hand, press Ctrl+b to open the console, and then enter: Go Run hello.go

You'll see in the console:Hello and fuck the world

9: It's over, I just want to record!








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.