Repository navigation
Introduce golangci lint - #121
Merged
Merged
Conversation
Signed-off-by: yamatcha <soju-yamashita@cybozu.co.jp>
Signed-off-by: yamatcha <soju-yamashita@cybozu.co.jp>
Signed-off-by: yamatcha <soju-yamashita@cybozu.co.jp>
There was a problem hiding this comment.
Pull request overview
This PR transitions the repository’s Go linting workflow to golangci-lint (installed via aqua), aligning with the approach used by cybozu-go/moco and updating both local make targets and CI accordingly.
Changes:
- Add
golangci-linttoaquaand introduce a.golangci.ymlconfiguration. - Replace the old
make validatepipeline withmake lint(and update CI to use it). - Apply code updates required to satisfy the enabled linters (e.g., errcheck-related close/sync calls,
anymodernization).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
server/suite_test.go |
Removes prior custom-checker suppression comment now that linting is unified under golangci-lint. |
server/mysqld_health.go |
Updates error-checking style for rows.Close() (now triggers errcheck considerations). |
server/mysqld_health_test.go |
Modernizes interface{} to any in test code. |
server/initialize.go |
Adjusts db.Close() usage to satisfy errcheck. |
server/clone.go |
Adjusts Close() usage to satisfy errcheck. |
Makefile |
Replaces validate/tool-install targets with a lint target that runs golangci-lint. |
cmd/moco-init/main.go |
Adjusts file close handling to satisfy errcheck. |
cmd/moco-agent/cmd/root.go |
Updates logger interface signature, adds error handling for mysql.SetLogger, and adjusts close/sync defers. |
cmd/cp/main.go |
Adjusts file close handling to satisfy errcheck. |
aqua.yaml |
Adds golangci/golangci-lint@v2.12.2. |
aqua-checksums.json |
Adds checksums for golangci-lint artifacts. |
.golangci.yml |
Adds golangci-lint v2 configuration and formatter settings. |
.github/workflows/ci.yaml |
Updates validation job to run make lint and removes prior tool caching steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return | ||
| } | ||
| rows.Close() | ||
| _ = rows.Close() |
Member
There was a problem hiding this comment.
@yamatcha
We should use GetContext in this situation.
https://jmoiron.github.io/sqlx/#getAndSelect
Handling QueryContext correctly is too difficult for humanity 😅
Signed-off-by: yamatcha <soju-yamashita@cybozu.co.jp>
lrf141
approved these changes
Sep 15, 2026
This file contains hidden or 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
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.
#120