Content of this article
- Overview
- Go SDK
- Liteide
- Resources
Google launched its second open source language Go in 2009. The evaluation of Go is mixed, China's enthusiasm is higher than that of foreign countries. Go is born for concurrency and the network , in addition to this, in static compilation, GC, cross-platform, easy to learn, rich standard library, etc., in fact, not as C + +, Java, C #, Python. So you can imagine, why go? And why are there so many questions and arguments about Go? -maybe go is more like a "genius autistic", and if you see this, then the praise of Go will be able to take a stride.
Download overview
Development Go generally requires two programs:
- Go SDK,;
- Go Ide--liteide,.
This article takes Windows 7 64-bit as an example for the environment, GO1.4.2.WINDOWS-AMD64 and LITEIDEX27.2.1.WINDOWS-QT5.
Go SDK
Figure 1 Go SDK
The default installation path is C:\go . Of course you can change the path, as long as the IDE is subsequently configured with the correct path.
When the installation is complete, the Go SDK will automatically add system environment variables for you.
Now, you can use any text editor to write Go code, such as Helloworld.go, stored under the C packing path:
Package Main
Import (
"FMT"
)
func Main () {
Fmt. Println ("Hello world!")
}
You can then execute the program by running go run helloworld.go .
C:\>Go run helloworld.go
Hello, world
C:\>
Liteide
If you do not want to use the command line, you can use the IDE environment--liteide, just configure the IDE appropriately.
Download Liteide compressed file, unzip to "Liteide", double-click "{Your path}\liteide\bin\liteide.exe" can see the following interface:
Figure 2 Liteide Main interface
To configure Liteide, click on the menu bar "view-and options" and you will see 3:
Figure 3 Configuring Liteide
Select "Liteide" on the left, choose your environment on the right, for example, my Windows 7 64-bit, select Win64-user.env, double-click, you will see the contents of the configuration file:,
# Native Compiler Windows AMD64
Goroot=c:\go
#GOBIN =
Goarch=amd64
Goos=windows
Cgo_enabled=1
Path=%goroot%\bin;%PATH%
Liteide_gdb=gdb64
Liteide_make=mingw32-make
liteide_term=%comspec%
liteide_termargs=
liteide_exec=%comspec%
Liteide_execopt=/c
In addition to win64-user.env, there are win64.env, the former is the user profile, the latter is the entire machine configuration file, because the Windows operating system is multi-user.
Make sure the goroot=c:\ line is the path to the actual Go SDK for your machine, for example, my path has its default path C:\Go.
The work path. You can configure the work path for liteide. Select the toolbar "Go icon" and you will see Figure 4:
Figure 4 Configuring the work Path
You can see two paths, the first one is my custom, the second one is the system default.
Resources
Go Language Environment Building