-
Notifications
You must be signed in to change notification settings - Fork 0
chore: golang-cliの導入 #228
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
base: master
Are you sure you want to change the base?
chore: golang-cliの導入 #228
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
spec-core | 168180d | Commit Preview URL Branch Preview URL |
Nov 22 2025, 02:04 AM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
このPRは、golangci-lintの導入とそれに伴うコード品質の改善を目的としています。具体的には、Go 1.19から1.20へのバージョンアップ、errcheckやstaticcheckによる指摘事項の修正、非推奨APIの置き換えを実施しています。
- CI/CDパイプラインにgolangci-lintによる自動リントを追加
- エラーハンドリングの強化(JWT生成、リクエストバインド、トランザクション、データベース操作)
- 非推奨の
ioutil.ReadAllをio.ReadAllに置き換え
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/lint.yml |
golangci-lintの自動実行ワークフローを追加 |
go.mod |
Goバージョンを1.19から1.20にアップグレード |
pkg/mattermost/post_mattermost_create_user.go |
非推奨のioutil.ReadAllをio.ReadAllに変更 |
pkg/batch/mattermost_post.go |
データベース操作の戻り値チェックとエラーログ出力を追加 |
pkg/api/authenticator/authenticator.go |
JWTトークン生成時のjwt.Set()エラーチェックを追加、変数名の修正 |
pkg/api/server/put_*.go |
リクエストボディのバインドエラーチェックとトランザクションロールバックのエラーログ出力を追加(16ファイル) |
pkg/api/server/post_*.go |
リクエストボディのバインドエラーチェックとトランザクションロールバックのエラーログ出力を追加(10ファイル) |
pkg/api/server/delete_*.go |
トランザクションロールバックのエラーログ出力を追加(5ファイル) |
pkg/api/server/irregular/post_mattermost_cmd.go |
リクエストボディのバインドエラーチェックとトランザクションロールバックのエラーログ出力を追加 |
close #229
close #139
概要
golangci-lintの導入と、lintツールによる指摘事項の修正を行いました。
変更内容
1. CI/CDの追加
.github/workflows/lint.ymlを追加し、golangci-lintによる自動リントを実装2. Goバージョンアップ
go.mod: Go 1.19 → 1.20にアップグレード(Dockerで指定しているイメージのバージョンに統一しました)3. エラーハンドリングの改善
以下のlintツール(errcheck、staticcheck)の指摘事項を修正:
pkg/api/authenticator/authenticator.go)jwt.Set()の戻り値をチェックpkg/batch/mattermost_post.go:Exec()の戻り値をチェック4. 非推奨APIの置き換え
pkg/mattermost/post_mattermost_create_user.go:ioutil.ReadAll→io.ReadAllに変更ioutil.ReadAll→io.ReadAllは互換性があります