当前位置:网站首页>Go --- identifiers and keywords in go language
Go --- identifiers and keywords in go language
2022-07-26 22:03:00 【redrose2100】
List of articles
One 、 identifier
1.1 Identifier introduction
The English of the identifier is identifier, Generally speaking , Is to give variables 、 Constant 、 function 、 Method 、 Structure 、 Array 、 section 、 Interface name .
1.2 The composition of the identifier
Identifier by number 、 Letters and underscores (_) form .123 abc _
Only letters and underscores (_) start .abc123 _sysVar 123abc
Identifiers are case sensitive . name Name NAME
1.3 Give an example to illustrate the naming of identifiers
Correct naming
package main
import "fmt"
func main() {
var name string
var age int
var _sys int
}
Bad identifier
package main
import "fmt"
func main() {
var 1name string
var &age int
var !email
}
Two 、go Language keywords
2.1 go Language provides 25 Key words , As shown below .
| break | default | func | interface | select |
| case | defer | go | map | struct |
| chan | else | goto | package | switch |
| const | fallthrough | if | range | type |
| continue | for | import | return | var |
2.2 Go Language and 36 Predefined identifiers
It contains the name of the basic type and some basic built-in functions , See the table below :
| append | bool | byte | cap | close | complex | complex64 | complex128 | uint16 |
| copy | false | float32 | float64 | imag | int | int8 | int16 | uint32 |
| int32 | int64 | iota | len | make | new | nil | panic | uint64 |
| println | real | recover | string | true | uint | uint8 | uintptr |
边栏推荐
- 寻找数字零售的发展新方向,才是保证数字零售可以进入到全新发展阶段的关键
- FreeRTOS个人笔记-事件
- 开发转测试:从零开始的6年自动化之路
- Six instructions of Memcache based caching mechanism
- matlab 基音周期估计后处理
- Flink 在讯飞 AI 营销业务的实时数据分析实践
- It is said that Samsung obtained EUV photoresist from Belgium
- flask 源码启动阶段
- Can I view the history in the "stealth" mode of the secure browser?
- From manual test to automatic test, it only took me a few months to double my salary
猜你喜欢

Selenium automated test interview questions family bucket

现货黄金操作指南与建议(上)

matlab 画短时平均幅度谱

From manual test to automatic test, it only took me a few months to double my salary

JDBC operation and entry case of MySQL

Xshell7 personal free download, use

开发转测试:从零开始的6年自动化之路

仅需一个依赖给Swagger换上新皮肤,既简单又炫酷

JMeter自定义日志与日志分析

In depth analysis of the source code, why is the string class immutable? (hit me before you understand)
随机推荐
45、实例分割的labelme数据集转coco数据集以及coco数据集转labelme数据集
Can you use redis? Then come and learn about redis protocol
实际权威来自信息优势
js验证复杂密码
Pytorch torch.add() torch.add_() 用法
Circular progress bar animation based on cashapelayer and Bezier curve
[audio and video] ijkplayer player parameter description document
月薪5万的朋友告诉我,你只是在打杂
Thoroughly understand the principle and implementation of service discovery
day07-
From manual test to automatic test, it only took me a few months to double my salary
也谈数据治理
会用redis吗?那还不快来了解下redis protocol
Supplement - nonlinear programming
Flash source code startup phase
寻找数字零售的发展新方向,才是保证数字零售可以进入到全新发展阶段的关键
Flask对token的解码&挂载&装饰器&七牛云上传
Highlight the secondary and tertiary columns under the primary column of pbootcms
Afnetworking understand
JDBC summary