Go language installation, notepad++ configuration Go development environment

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

Install Go

Take WINDOW7 environment as an example:

    • Download Go language installation package https://golang.org/dl/
      Select the Go1.4.2.windows-386.msi version and click Install directly.
    • To configure environment variables:
      Add C:\Go\bin to the PATH environment variable (the default seems to be there, you do not need to add)
    • Open cmd, enter go: shown below is OK.

Configure the Go development environment under notepad++

Why choose np++, because people around the response to go IDE lite what is not good to say ~ ~
First, there must be notepad++ ...

1. Install the Go Development plugin

1. Running the notepad++ software
2. Open the menu plugin –>plugin manager–>show plugin Manager

Find GONPP. Click Install.
3. Testing
Write one of the easiest go codes

package mainimport"fmt"func main() {    fmt.Println("Hello")}

Save as Hello.go with notepad++ edits
Click the plugin –>gonpp–>go run

The output will be in the right column or just below.

2. Configure syntax highlighting

1. Download notepad++ 's Go language support package

2. Copy the file Userdefinelang_go.xml content to the userdefinelang.xml of notepad++ directory under Application data (if this file does not exist, it will be userdefinelang_ directly Go.xml saved as Userdefinelang.xml);
win7:c:\users[username]\appdata\roaming\notepad++
Here the XML needs to be modified under:

<notepadplus>    <userlang name="Go" ext="Go">        <Settings>            <Global caseignored="No" />            <treatassymbol Comment="No" commentline="No" />             <Prefix words1= "no " words2= "no " words3=" No" words4="No" />        </Settings>        <keywordlists>            <Keywords name="delimiters">&quot; ' 0&quot; '</Keywords>            <Keywords name="folder+"></Keywords>            <Keywords name="folder-"></Keywords>            <Keywords name="Operators">( ) [ ] { } ... . , _ &amp; ^% &gt; &lt;! = + - *  | :</Keywords>            <Keywords name="Comment">1/* 2*/0//</Keywords>            <Keywords name="Words1">append bool Break byte cap case Chan close complex complex128 complex64 const continue copy default defer else Fallthrough False float32 float64 for func go goto if iota imag import int int16 int32 int64 int8 interface len make map new nil pack Age Panic print println range real recover return select string struct switch True type uint UInt16 uint32 UInt64 uint8 UI ntptr var</Keywords>            <Keywords name="Words2"></Keywords>            <Keywords name="Words3"></Keywords>            <Keywords name="Words4"></Keywords>        </keywordlists>        <Styles>            <wordsstyle  name  =  "DEFAULT"  styleid  = "one"   Fgcolor  = "000000"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "Folderopen"  styleid  = "all"   Fgcolor  = "FFFF00"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "Folderclose"  styleid  = "all"   Fgcolor  = "0b243b"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "KEYWORD1"  styleid  = "5"   Fgcolor  = "AA0000"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "1" />             <wordsstyle  name  =  "KEYWORD2"  styleid  = "6"   Fgcolor  = "AA0000"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "1" />             <wordsstyle  name  =  "KEYWORD3"  styleid  = "7"   Fgcolor  = "AA0000"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "KEYWORD4"  styleid  = "8"   Fgcolor  = "A00000"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "COMMENT"  styleid  = "1"   Fgcolor  = "aaaaaa"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "COMMENT Line"  styleid  = "2"   Fgcolor  = "aaaaaa"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "number"  styleid  = "4"   Fgcolor  = "A52A2A"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "OPERATOR"  styleid  = "ten"   Fgcolor  = "8000FF"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "1" />             <wordsstyle  name  =  "DELIMINER1"  styleid  = "+"   Fgcolor  = "0000FF"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle  name  =  "DELIMINER2"  styleid  = "all"   Fgcolor  = "0000FF"  bgcolor  = "FFFFFF"  fontname  = Span class= "Hljs-attribute" >fontstyle  = "0" />             <wordsstyle name="DELIMINER3" styleID=" fgcolor" = "0000FF" BgColor="FFFFFF" fontname= "" " fontstyle=" 0 " />         </Styles>    </Userlang></notepadplus>

The notes are removed.
3. Copy the Go.xml file to the Plugins\apis directory under the notepad++ installation directory (for example: D:\Program Files\notepad++\plugins\apis);
4, restart notepad++;
Reopen Hello.go, select menu: Language –>go. It's OK.

Finally, strongly recommend a notepad++ theme

Open notepad++, select menu –> set –> language formatting

Obsidian Obsidian Theme +consolas font
Save and exit ... Nice.
However, this theme and go do not match the color.
To DIY, you have to change the color set in the Userdefinelang.xml file ~ ~

Reference

http://golang.org/
Http://www.cnblogs.com/MikeZhang/archive/2012/02/10/nppRunGo.html
Http://jingyan.baidu.com/article/0f5fb099f473556d8334eabe.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.