Skip to content

fix: golangci-lint errors#393

Merged
jakezhu9 merged 1 commit intogo-sonic:masterfrom
golangboy:master
Feb 24, 2024
Merged

fix: golangci-lint errors#393
jakezhu9 merged 1 commit intogo-sonic:masterfrom
golangboy:master

Conversation

@golangboy
Copy link
Copy Markdown
Contributor

@golangboy golangboy commented Feb 23, 2024

@golangboy
Copy link
Copy Markdown
Contributor Author

@jakezhu9

Comment thread template/extension/link.go Outdated
rand.Shuffle(len(links), func(i, j int) {
s := rand.NewSource(time.Now().UnixNano())
r := rand.New(s)
r.Shuffle(len(links), func(i, j int) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golang 现在会自动初始化随机数生成器,直接将rand.Seed(time.Now().UnixNano())删掉就可以了

使用rand.NewSource应该是没有必要的

Comment thread template/extension/tool.go Outdated
r := rand.New(s)
random := func(min, max int) int {
return min + rand.Intn(max-min)
return min + r.Intn(max-min)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@golangboy
Copy link
Copy Markdown
Contributor Author

@jakezhu9

Copy link
Copy Markdown
Member

@jakezhu9 jakezhu9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jakezhu9 jakezhu9 merged commit 53db556 into go-sonic:master Feb 24, 2024
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.

2 participants