This is a creation in Article, where the information may have evolved or changed.
See the Go language this afternoon (I see "Go Language Programming"), which has a complete program, but the book is built in the Linux environment, but I am in the Windows environment, how much different.
The first thing to figure out is the path to go:
Goroot:go is automatically added to the system environment variable after installation
Gopath: This needs to be configured by itself, the class is in Java configuration classpath the same
After creating the environment variable, build the first project:
1. Program Directory structure:
A
b) where the parent directory of this bin is the directory of the Gopath configuration, bin, pkg, src start with some empty folders
c) SRC created below are some packages, such as: Algorithm,sorter
D) The code is all placed in SRC
2. After writing the code, start building the program.
A) A brief introduction to the program structure
I. Main function in the Sorter.go file, Sorter.go calls the functions in the Bubblesort.go and file Qsort.go files
II. BUBBLESORT_TEST.GO and qsort_test.go are test files
b) Enter the directory where Gopath is located in the command line
c) and then start building the code
I. Go build Algorithm/qsort
II. Go Build Algorithm/bubblesort
Iii. Go Test Algorithm/qsort
Iv. Go Test Algorithm/bubblesort
V. Go install Algorithm/qsort
VI. Go Install Algorithm/bubblesort
Vii. Go Build Sorter
Viii. Go Install Sorter
D) If no prompt error message appears, you can see a sorter.exe file in the current directory
e) then run up to see if the expected results
f) to be here is to build and execute the GO program successfully
3. Final result diagram:
December 10, 2015 17:25:37
By:champly