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.