WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Go language data type


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

The data type appears to divide the data into data of different memory sizes. When you need to use large data when programming, you can use the memory.

Go languages have the following data types by category:

Sr.No. Types and Description
1

Boolean values

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

2

Numeric types

Integer int and float float32, float64, Go language supports integer and floating-point numbers, and supports complex numbers, where bit operations are complements.

3

String types

A string is a sequence of characters that are connected by a series of fixed-length characters. Go's string is concatenated by a single byte. The bytes of the Go language string use UTF-8 encoding to identify Unicode text.

4

Derived sorts

Includes:

  • (a) Pointer type
  • (b) Array type
  • (c) Structured type (struct)
  • (d) Channel type
  • (e) Function type
  • (f) Slice type
  • (g) Interface type (interface)
  • (h) Map type
Array sorts and shape types are together referred to as mixture sorts.

Integer Types

There are following architecture-independent integer sorts :
Sr.No. Types and Description
1

uint8

Unsigned eight-bit integers (0 to 255)

2

uint16

Unsigned 16-bit integers (zero to 65535)

3

uint32

Unsigned 32-bit integers (0 to 4294967295)

4

uint64

Unsigned 64-bit integers (zero to 18446744073709551615)

5

int8

Signed 8-bit integers (-128 to 127)

6

int16

Signed sixteen-bit integers (-32768 to 32767)

7

int32

Signed 32-bit integers (-2147483648 to 2147483647)

8

int64

Signed 64-bit integers (-9223372036854775808 to 9223372036854775807)

Floating Types

There are following independent -unbiased float sorts are
Sr.No. Types and Description
1

float32

IEEE-754 32-bit floating-point numbers

2

float64

IEEE-754 sixty 4-bit floating-point numbers

3

complex64

Complex numbers with float32 real and imaginary parts

4

complex128

Complex numbers with float64 real and imaginary parts

Other Numeric Types

There are following a set of numeric types with implementation-specific sizes
Sr.No. Types and Description
1

byte

same as uint8

2

rune

same as int32

3

uint

32 or 64 bits

4

int

same length as uint

5

uintptr

an unsigned integer to store the uninterpreted bits of a pointer value.