Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c03/c03_04 #29

Open
utterances-bot opened this issue Mar 1, 2022 · 1 comment
Open

c03/c03_04 #29

utterances-bot opened this issue Mar 1, 2022 · 1 comment

Comments

@utterances-bot
Copy link

3.4 代码规范:Go语言中编码规范 — Go编程时光 1.0.0 documentation

https://golang.iswbm.com/c03/c03_04.html

Copy link

  1. 常量命名
    目前在网络上可以看到主要有两种风格的写法

第一种是驼峰命名法,比如 appVersion

第二种使用全大写且用下划线分词,比如 APP_VERSION

这两种风格,没有孰好孰弱,可自由选取,我个人更倾向于使用第二种,主要是能一眼与变量区分开来。

如果要定义多个变量,请使用 括号 来组织。

如果要定义多个变量,请使用 括号 来组织。改成多个常量

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants