当前位置:网站首页>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 ).
边栏推荐
- 项目经理不应该犯的错误
- 以全栈全功能解决方案,应对多样工具复杂环境DevOps落地难题
- 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
- 凌云出海记 | 一零跃动&华为云:共助非洲普惠金融服务
- 如何做好测试用例设计
- PostgreSQL heap堆表 存储引擎实现原理
- maya房子建模
- SecureCRTPortable的安装和使用(图文详解)
- 最新海康摄像机、NVR、流媒体服务器、回放取流RTSP地址规则说明[通俗易懂]
- Notes on modification of Jerry's test box pairing software [chapter]
猜你喜欢
![Jerry's touch key recognition process [chapter]](/img/ec/25d2d6fd26571e4fb642129a4eee1b.png)
Jerry's touch key recognition process [chapter]

Torchdrug -- drug attribute prediction

DEX file parsing - Method_ IDS resolution

Why must a digital transformation strategy include continuous testing?

Lambda 表达式原理分析学习(2022.06.23)

【450. 删除二叉搜索树中的节点】

8 - 函数

杰理之触摸按键识别流程【篇】

计网 | 【五 传输层、六 应用层】知识点及例题
![Network planning | [five transport layers and six application layers] knowledge points and examples](/img/4f/31acce51b584bed5ef56b2093c4db3.png)
Network planning | [five transport layers and six application layers] knowledge points and examples
随机推荐
Jerry's touch key recognition process [chapter]
QT :QAxObject操作Excel
神经网络入门(上)
Enterprise middle office planning and it architecture microservice transformation
CADD课程学习(1)-- 药物设计基础知识
杰理之触摸按键识别流程【篇】
NLP 论文领读|文本生成模型退化怎么办?SimCTG 告诉你答案
如何做好测试用例设计
文件包含&条件竞争
Detailed explanation of specific methods and steps for TCP communication between s7-1500 PLCs (picture and text)
杰理之触摸按键识别流程【篇】
计网 | 【五 传输层、六 应用层】知识点及例题
广州股票开户选择手机办理安全吗?
originpro 2021 附安装教程
Go 语言标识符、包名规范
pytorch实现FLOPs和Params的计算
Smarter! Airiot accelerates the upgrading of energy conservation and emission reduction in the coal industry
Halcon知识:盘点一下计量对象【1】
Filebeat自定义index和fields
【论文阅读】Trajectory-guided Control Prediction for End-to-end Autonomous Driving: A Simple yet Strong Baseline