Home >Backend Development >Golang >What are the data types in golang?
In the Go programming language, data types are used to declare functions and variables.
The emergence of data types is to divide data into data with different memory sizes. When programming, you need to apply for large memory only when you need to use big data, so that you can make full use of the memory.
Go language has the following data types according to categories:
Boolean type
The value of Boolean type can only be the constant true or false. A simple example: var b bool = true.
Number type
Integer type int and floating point type float32, float64, Go language supports integer and floating point numbers, and supports complex numbers, in which the bitwise operations use complement.
String type:
A string is a sequence of characters connected by a fixed length of characters. Go's strings are concatenated from individual bytes. The bytes of Go language strings use UTF-8 encoding to identify Unicode text.
It is recommended to study "
golang tutorialThe above is the detailed content of What are the data types in golang?. For more information, please follow other related articles on the PHP Chinese website!