2.2. Go locale installation

发布时间 :2023-10-12 23:00:09 UTC      

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!

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.