Use Notepad ++ in Windows to configure the go Language Development Environment

Source: Internet
Author: User
Tags install go

In the previous articleArticle(Http://www.cnblogs.com/MikeZhang/archive/2012/02/09/windowsGo.html) introduced how to install go language in windows, today I want to introduce how to use Notepad ++ to configure the go language development environment.

I. preparations:
1. Install the go language;
2. Add the go/bin directory to the environment variable;
3. Install notepad ++;

2. Configure notepad ++ to support go syntax highlighting
1. Download The go language support package (http://notepad-plus.sourceforge.net/commun/userDefinedLang/go.zip) of notepad ++ );
2. copy the file userdefinelang_go.xml to userdefinelang. XML in the notepad ++ directory under application data;
XP: C: \ Documents ents and Settings \ [username] \ Application Data \ notepad ++
Vista/win7: C: \ Users \ [username] \ appdata \ roaming \ notepad ++
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 ++;

3. Set the shortcut keys for compiling and running the go Language
Here we use the followingCodeDemo:
File Name: test1.go

 
Package main

Import "FMT"

Func main (){
FMT. println ("test ")
}

Principle:
Compilation: 8g-o test1.8 test1.go
Link: 8l-O test1.exe test1.8
Run: test1.exe
Run the compilation link: 8g-o test1.8 test1.go & 8l-O test1.exe test1.8 & test1.exe

Implementation:
1. Use notepad ++ to open the test1.go file;
2. Press F5 and enter the following content in the pop-up dialog box:
CMD/K 8g.exe-O tmp.8 "$ (full_current_path)" & 8l.exe-O tmp.exe tmp.8 & del tmp.8 & tmp.exe & pause & del tmp.exe & Exit
Save as "Run Go" and set Ctrl + F6 as the shortcut key;
3. Press Ctrl + F6 to runProgram;

Okay, that's all. I hope it will help you.

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.