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

fixing golangci-lint@1.60.3 errors of current build #912

Merged
merged 2 commits into from
Sep 1, 2024

Conversation

dvilaverde
Copy link
Contributor

Noticed that the current build had a failure during golangci-lint check. Simply addressing those.

// When this project supports golang 1.20 as a minimum, then this mrand.New(...)
// line can be eliminated and the random number can be generated by simply
// calling mrand.Intn()
random := mrand.New(mrand.NewSource(time.Now().UTC().UnixNano()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although this line is no longer needed with golang 1.20+ and simply the call to mrand.Intn() can be used, I've created a new random from a Source because this projects go.mod declares golang 1.18. But left a note in the code for future reference.

@@ -203,7 +203,7 @@ func (c *conn) CheckNamedValue(nv *sqldriver.NamedValue) error {
} else {
// we've found an error, if the error is driver.ErrSkip then
// keep looking otherwise return the unknown error
if !goErrors.Is(sqldriver.ErrSkip, err) {
if !goErrors.Is(err, sqldriver.ErrSkip) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the arguments were in the wrong order here.

@dvilaverde dvilaverde changed the title fixing golangci-lint@1.60.1 errors of currnet build fixing golangci-lint@1.60.3 errors of current build Sep 1, 2024
@lance6716 lance6716 merged commit 39e2e96 into go-mysql-org:master Sep 1, 2024
13 checks passed
@dvilaverde dvilaverde deleted the lint_fixes branch September 12, 2024 11:34
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