Home  >  Article  >  Backend Development  >  What are the data types in golang?

What are the data types in golang?

silencement
silencementOriginal
2019-12-25 11:00:202871browse

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 tutorial

".

The 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn