0 votes
in GoLang by
What are the Data Types in GoLang?

1 Answer

0 votes
by

Below are the Data Types in Golang.

Types(data types) represent the type of the value stored in a variable, type of the value a function returns, etc.

There are three basic types in Go Language

Numeric types – Represent numeric values which includes integer, floating point, and complex values. Various numeric types are:

int8 – 8 bit signed integers.

int16 – 16 bit signed integers.

int32 – 32 bit signed integers.

int64 – 64 bit signed integers.

uint8 – 8 bit unsigned integers.

uint16 – 16 bit unsigned integers.

uint32 – 32 bit unsigned integers.

uint64 – 64 bit unsigned integers.

float32 – 32 bit floating point numbers.

float64 – 64 bit floating point numbers.

complex64 – has float32 real and imaginary parts.

complex128 – has float32 real and imaginary parts.

String types – Represents a sequence of bytes(characters). You can do various operations on strings like string concatenation, extracting substring, etc

Boolean types – Represents 2 values, either true or false.

...