2.6. Go language data type

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

Page Views: 9 views

In Go programming languages, data types are used to declare functions and variables.

The emergence of data types is to divide the data into data with different memory sizes. When programming, you need to use big data to apply for large memory, so you can make full use of memory.

Go languages have the following data types by category:

Serial number

Type and description

1

Boolean values can only be constant true or false. A simple example: var b bool = true.

2

Numeric type integer int and floating point float32, float64,Go language supports integer and floating point numbers, and supports plural numbers, where the operation of bits uses complement.

3

String type: a string is a sequence of characters joined together by a string of fixed-length characters. Go strings are concatenated by a single byte. Bytes of a string in the Go language use UTF-8 encoding to identify Unicode text.

4

Derived type: including: ● (a) pointer type (Pointer) ● (b) array type ● (c)structured type (struct) ● (d) Channel type ● (e) function type ● (f) slicetype ● (g) interface type (interface) ● (h) Map type

2.6.1. Numeric type #

Go also has schema-based types, such as: int uint and uintptr .

Serial number

Type and description

1

Uint8 unsigned 8-bit integers (0 to 255)

2

Uint16 unsigned 16-bit integer (0 to 65535)

3

Uint32 unsigned 32-bit integer (0 to 4294967295)

4

Uint64 unsigned 64-bit integer (0 to 18446744073709551615)

5

Int8 signed 8-bit integers (- 128to127)

6

Int16 signed 16-bit integers (- 32768 to 32767)

7

Int32 signed 32-bit integers (- 2147483648 to 2147483647)

8

Int64 signed 64-bit integers (- 9223372036854775808 to 9223372036854775807)

2.6.2. Floating point type #

Serial number

Type and description

1

Float32 IEEE-754 32-bit floating point number

2

Float64 IEEE-754 64-bit floating point number

3

Complex64 32-bit real and imaginary numbers

4

Complex128 64-bit real and imaginary numbers

2.6.3. Other numeric types #

Other more numeric types are listed below:

Serial number

Type and description

1

Byte is similar to uint8

2

Rune is similar to int32

3

Uint 32 or 64 bit

4

Int is the same size as uint

5

Uintptr unsigned integer, used to store a pointer

《地理信息系统原理、技术与方法》  97

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