当前位置:网站首页>Go learning notes 1.3- data types of variables
Go learning notes 1.3- data types of variables
2022-06-26 06:23:00 【Who made the promise】
Data type of variable
One 、 Basic data type
1. Numerical type
1.1 Integer types
int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 byte
1.2 floating-point
folat32 folat64
1.3 Character ( There is no special character type , Usually use byte To save individual letters and characters )
1.4 Boolean type true fasle
1.5 String type (string)
2. The derived | Complex data types
2.1 The pointer (pointer)
2.2 Array
2.3 Structure (struct)
2.4 The Conduit (channel)
2.5 function
2.6 section (slice)
2.7 Interface (interface)
2.8 map
Two 、 Detailed explanation of data types
1.1 Integer types
int8: A signed 8 An integer (-128 To 127)
int16: A signed 16 An integer (-32768 To 32767)
int32: A signed 32 An integer (-2147483648 To 2147483647)
int64: A signed 64 An integer (-9223372036854775808 To 9223372036854775807)
uint8: Unsigned 8 An integer (0 To 255)
uint16: Unsigned 16 An integer (0 To 65535)
uint32: Unsigned 32 An integer (0 To 4294967295)
uint64: Unsigned 64 An integer (0 To 18446744073709551615)
byte: uint8 Type alias for Unsigned 8 An integer (0 To 255)
1.2 floating-point ( Their arithmetical specifications are made by IEEE754 Floating point international standard definition , This floating-point specification is used by all modern CPU Support )
float32: IEEE-754 32 Bit floating point number
float64: IEEE-754 64 Bit floating point number
1.3 String type
String is an immutable sequence of bytes , Element of string cannot be modified ( Element cannot be changed , String variables can be reassigned ), It's just a Read byte array . So the length of the string is fixed , But unlike arrays , The string length is not part of the string type .
1.4 Boolean type true fasle
2. Complex type
..... Subsequent complement
3、 ... and 、 Escape character
\b Backspace
\f Change the page
\n Line break
\r enter
\t tabs
\v Vertical tabs
\' Single quotation marks ( Only in '\'' Formal rune Symbol face value )
\" Double quotes ( Only in "..." In the string face value of form )
\\ The backslash
边栏推荐
- Volatile application scenarios
- Research Report on market supply and demand and strategy of China's microneedle device industry
- Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
- MYSQL索引不生效的原因
- 架构设计方法
- Pytorch uses multi GPU parallel training and its principle and precautions
- Mongodb——使用Mongodb对字段中字符串内容进行截取,并进行分组统计
- DPDK——TCP/UDP协议栈服务端实现(一)
- Requirement analysis of personal blog system
- Tortoise and rabbit race example
猜你喜欢

EFK昇級到ClickHouse的日志存儲實戰
The sysdig 2022 cloud native security and usage report found that more than 75% of the running containers have serious vulnerabilities

事务与消息语义

Jasminum plug-in of Zotero document management tool

MySQL 索引底层原理

Message queue - function, performance, operation and maintenance comparison

去哪儿网BI平台建设演进史

【golang】time相关

Mysql-10 (key)

DPDK——TCP/UDP协议栈服务端实现(二)
随机推荐
Logstash——Logstash向Email发送告警邮件
架构设计方法
01 golang and matlab code of knapsack problem
个人博客系统需求分析
Pytorch mixing accuracy principle and how to start this method
How can an enterprise successfully complete cloud migration?
温度报警器
Custom reference formats used by Zotero
Redis multithreading and ACL
Play with a variety of application scenarios and share secrets with Kwai MMU
Unsatisfied dependency expressed through field ‘baseMapper‘; nested exceptio
MySQL-05
Tortoise and rabbit race example
Typescript type
Playing RTSP streaming video on Web pages (webrtc)
Laravel 实现 groupBy 查询分组数量
Go语言学习笔记 1.1
Work accumulation - problems encountered in using ThreadLocal in web requests
A new paradigm for large model application: unified feature representation optimization (UFO)
事务与消息语义