-
Notifications
You must be signed in to change notification settings - Fork 43
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
解決go lint上顯示的warning,包含縮寫及error命名、一致的receiver命名等 #54
Merged
PichuChen
merged 12 commits into
Ptt-official-app:development
from
titaneric:feature/#52-go-lint
Mar 6, 2021
Merged
解決go lint上顯示的warning,包含縮寫及error命名、一致的receiver命名等 #54
PichuChen
merged 12 commits into
Ptt-official-app:development
from
titaneric:feature/#52-go-lint
Mar 6, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
titaneric
force-pushed
the
feature/#52-go-lint
branch
from
March 4, 2021 10:05
42c8827
to
6ea547b
Compare
準備可以review了,但CI好像有go build的問題要幫忙看一下 |
@titaneric CI 裡的問題是 #37 及 #58 (comment) 提到的 module declare,注意到 development 分支在剛剛已經修正了。 |
可以再幫我 pull 一次 development 嗎? |
簡單在 merge current development 後的版本,透過 golangci-lint 跑 golint,發現幾個漏網之魚,提供參考: $ golangci-lint run
cache/systemvshm.go:50:2: var `shmId` should be `shmID` (golint)
shmId, err := Shmget(key, size, flag)
^
cache/systemvshm.go:95:2: var `shmId` should be `shmID` (golint)
shmId, err := Shmget(key, 0, 0)
^
cache/systemvshm.go:112:1: receiver name m should be consistent with previous receiver name s for SHM (golint)
func (m *SHM) Close() error {
^
pttbbs/board.go:69:23: method BoardId should be BoardID (golint)
func (b *BoardHeader) BoardId() string { return b.BoardID() }
^
pttbbs/cache.go:14:2: struct field `posOfUserId` should be `posOfUserID` (golint)
posOfUserId int
^
pttbbs/cache.go:297:17: method UserId should be UserID (golint)
func (c *Cache) UserId(uid int) string {
^ |
感謝 @minchao 與 @PichuChen ,目前CI過囉,再麻煩幫忙review |
@titaneric 剩下最後一個 receiver 修改就過 lint 囉 % golangci-lint run
cache/systemvshm.go:112:1: receiver name m should be consistent with previous receiver name s for SHM (golint)
func (m *SHM) Close() error {
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👏 解決掉的 issue / Resolved Issues
⛏ 變更內容 / Details of Changes