2.2. Go locale installation

发布时间 : 2025-10-25 13:32:57 UTC      

Page Views: 9 views

Go language supports the following systems:

  • Linux

  • FreeBSD

  • Mac OS X (also known as Darwin)

  • Windows

The download address of the installation package is https://golang.org/dl/ .

If you can’t open it, you can use this address: https://golang.google.cn/dl/ .

The package name corresponding to each system:

Operating system

Package name

Windows

Go1.4.windows-amd64.msi

Linux

Go1.4.linux-amd64.tar.gz

Mac

Go1.4.darwin-amd64-osx10.8.pkg

FreeBSD

Go1.4.freebsd-amd64.tar.gz

Image0

2.2.1. UNIX/Linux/Mac OS X, and FreeBSD installation #

The following describes the installation method of using source code on UNIX/Linux/Mac OS X and FreeBSD systems:

1.Download binary package: go1.4.linux-amd64.tar.gz.

2.Extract the downloaded binary package to the/usr/local directory.

tar -C /usr/local -xzf go1.4.linux-amd64.tar.gz 

3.Set /usr/local/go/bin directory added to PATH environment variables:

export PATH=$PATH:/usr/local/go/bin 

The above can only be added temporarily PATH if you close the terminal and log in again, it will be gone.

We can edit it. ~/.bash_profile or /etc/profile and add the following command to the end of the file, which is permanent:

export PATH=$PATH:/usr/local/go/bin 

After adding, you need to execute:

source ~/.bash_profile or source /etc/profile 

Note: you can use the MAC system. .pkg double-click directly at the end of the installation package to complete the installation, and the installation directory is in /usr/local/go/ .

2.2.2. Installation under Windows system #

Can be used under Windows .msi install the package with the suffix (the file can be found in the download list, such as go1.4.2.windows-amd64.msi).

By default .msi files will be installed in the c:Go directory. You can add the c:Gobin directory to the Path in the environment variable. After adding, you need to restart the command window to take effect.

2.2.3. Installation test #

Create a working directory C:\>Go_WorkSpace .

test.go file code: #

package main import "fmt" func main() { fmt.Println("Hello, World!") } 

Use go output of the above code executed by the command is as follows:

C:\Go_WorkSpace>go run test.go Hello, World! 
《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。