当前位置:网站首页>Go language identifier and package name specification
Go language identifier and package name specification
2022-06-30 20:23:00 【Zen and the art of computer programming】
The definition of identifier
identifier (identifier) A symbol used to identify an entity , It has different meanings in different application environments . In computer programming languages , Identifier is the name used by the user when programming , Used to give variables 、 Constant 、 function 、 Statement block and so on , To establish a relationship between the name and the use .
go Variables in language , function , And package name, etc. all belong to a kind of identifier .
Package naming rules
(1) As far as possible, the package name should be consistent with the directory name where it is located , Do not conflict with the standard library .
(2) with main The package of the function must put it package Defined as main, So that we can use go run To run the file ,go build To generate an executable file .
(3) Variable name 、 Function name 、 Constant names are named by hump method
(4) Variable name 、 Function name 、 Constant names are capitalized , Can be accessed by other packages . Lowercase letters can only be used in this package .
(5) Custom packages are referenced , It will be automatically replenished $GOPATH/src/ , The folder in the path is / Division .(GOPATH For environment variables , You have to configure it yourself ).
边栏推荐
- MySQL master-slave synchronization
- CV+Deep Learning——网络架构Pytorch复现系列——basenets(BackBones)(一)
- Black apple server system installation tutorial, black apple installation tutorial, teach you how to install black apple in detail [easy to understand]
- Build document editor based on slate
- Why must we move from Devops to bizdevops?
- 开会,OneMeeting,OK!
- 大神詳解開源 BUFF 增益攻略丨直播
- The prospectus of pelt medical was "invalid" for the second time in the Hong Kong stock exchange, and the listing plan was substantially delayed
- 25: Chapter 3: developing pass service: 8: [registration / login] interface: receiving and verifying "mobile number and verification code" parameters; (it is important to know the application scenario
- 项目经理面试常见问题及回答技巧
猜你喜欢

Jenkins can't pull the latest jar package

计网 | 【五 传输层、六 应用层】知识点及例题

To eliminate bugs, developers must know several bug exploration and testing artifacts.

mysql主从同步
Application of JDBC in performance test

1、生成对抗网络入门

Build your own website (20)

传输层 使用滑动窗口实现流量控制

4.3-inch touch screen 12 channel control port programmable network central control supports mutual backup of 5 central control hosts

Torchdrug -- drug attribute prediction
随机推荐
Transport layer uses sliding window to realize flow control
TorchDrug--药物属性预测
将秒数转换为**小时**分钟
杰理之关于长按开机检测抬起问题【篇】
项目经理是领导吗?可以批评指责成员吗?
Jerry's question about long press boot detection [chapter]
Ten percent of the time, the tar command can't parse the English bracket "()" when decompressing the file
Jerry's touch key recognition process [chapter]
C language: hashtable
Django上传excel表格并将数据写入数据库的详细步骤
如何做好测试用例设计
杰理之检测灵敏度级别确定【篇】
Basic syntax of VB
1045 error occurred in MySQL login. Modification method [easy to understand]
maya房子建模
Network planning | [five transport layers and six application layers] knowledge points and examples
WeakSet
【1175. 质数排列】
Torchdrug -- drug attribute prediction
数据智能——DTCC2022!中国数据库技术大会即将开幕