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

[feature] Format the code and improve Mini Program authorization to o… #473

Merged
merged 4 commits into from Sep 8, 2021

Conversation

houseme
Copy link
Collaborator

@houseme houseme commented Sep 7, 2021

…btain openid(miniprogram/auth/auth.go Code2Session)

miniprogram/auth/auth.go Outdated Show resolved Hide resolved
miniprogram/auth/auth.go Outdated Show resolved Hide resolved
@silenceper
Copy link
Owner

另外代码格式化format是根据哪个规范来的,可以贴下规则吗?

@houseme
Copy link
Collaborator Author

houseme commented Sep 8, 2021

另外代码格式化format是根据哪个规范来的,可以贴下规则吗?

主要是格式化了代码注释部分的双斜杠后面的内容 ,没有添加空格的新加一个空格 ,这样统一格式。其他的没有变化。

注释要求

  1. 统一使用中文注释,对于中英文字符之间严格使用空格分隔, 这个不仅仅是中文和英文之间,英文和中文标点之间也都要使用空格分隔

  2. 全部使用单行注释,禁止使用多行注释

  3. 和代码的规范一样,单行注释不要过长,禁止超过 120 字符。

缩进和折行

  1. 缩进必须使用 gofmt 工具格式化

  2. 折行方面,一行最长不超过120个字符,超过的请使用换行展示,尽量保持格式优雅

括号和空格

  1. 括号和空格方面,也可以直接使用 gofmt 工具格式化(go 会强制左大括号不换行,换行会报语法错误),所有的运算符和操作数之间要留空格。

@silenceper
Copy link
Owner

是通过哪个工具格式化的吗?

@houseme
Copy link
Collaborator Author

houseme commented Sep 8, 2021

是通过哪个工具格式化的吗?

Goland 自带的格式化,以及配置了这些

image

@silenceper
Copy link
Owner

感谢您的提交

@silenceper silenceper merged commit 96c1f98 into silenceper:release-2.0 Sep 8, 2021
fiochen pushed a commit to fiochen/wechat that referenced this pull request Oct 8, 2021
silenceper#473)

* [feature] Format the code and improve Mini Program authorization to obtain openid(miniprogram/auth/auth.go Code2Session)

* [feature] CheckEncryptedData (https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html)

* upgrade json error

* upgrade json error

Co-authored-by: houseme <houseme@outlook.com>
fiochen added a commit to fiochen/wechat that referenced this pull request Oct 8, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants