You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "222twotwotwo (via GitHub)" <gi...@apache.org> on 2026/07/16 13:37:34 UTC
[PR] fix modernize fmt flag [dubbo-getty]
222twotwotwo opened a new pull request, #135:
URL: https://github.com/apache/dubbo-getty/pull/135
<!-- Thanks for sending a pull request!
-->
**What this PR does**:
Updates the `fmt` target in `Makefile` to use the current `modernize` CLI flag `-any` instead of the removed `-category=efaceany` flag.
This fixes the GitHub Actions `Check Code Format` step failure caused by `modernize@latest` no longer supporting `-category`.
**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #134
**Special notes for your reviewer**:
The change is intentionally minimal and only updates the failing `modernize` flag.
Local validation:
```bash
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -any -fix -test ./...
go fmt ./...
imports-formatter
go test ./... -coverprofile=coverage.txt -covermode=atomic
go vet ./...
golangci-lint run ./... --timeout=10m
```
**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
NONE
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix modernize fmt flag [dubbo-getty]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #135:
URL: https://github.com/apache/dubbo-getty/pull/135#discussion_r3600300541
##########
.github/workflows/github-actions.yml:
##########
@@ -28,7 +28,7 @@ jobs:
# If you want to matrix build , you can append the following list.
matrix:
go_version:
- - '1.23'
+ - '1.24'
Review Comment:
[P1] 保留 Go 1.23 兼容性测试,不要用工具要求替换代码测试矩阵
`go.mod` 仍声明 `go 1.23`,而这里是唯一的单测/Lint 矩阵。直接改成 1.24 后,后续代码即使引用 Go 1.24 新增的标准库 API 也会在 CI 通过,但 Go 1.23 用户会编译失败。`x/tools v0.38.0` 的 Go 1.24 要求只属于格式工具:请保留 Go 1.23 的代码测试任务,并把 format 拆到单独的 Go 1.24 job/step,或仅为该命令显式选择 1.24 工具链;如果项目确实要把最低版本提升到 1.24,则应同时更新 `go.mod` 和升级说明。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix modernize fmt flag [dubbo-getty]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #135:
URL: https://github.com/apache/dubbo-getty/pull/135#discussion_r3600506989
##########
.github/workflows/github-actions.yml:
##########
@@ -28,7 +28,7 @@ jobs:
# If you want to matrix build , you can append the following list.
matrix:
go_version:
- - '1.23'
+ - '1.24'
Review Comment:
明确一下,正确的最小改法就是当前 Head `c50b47ea`:
- `.github/workflows/github-actions.yml` 继续使用 Go 1.23,不提升唯一的代码测试矩阵;
- `Makefile` 中的 `modernize` 使用公开入口并固定 `v0.38.0`,只在该命令前设置 `GOTOOLCHAIN=go1.24.0`。
我已在 WSL 验证 `GOTOOLCHAIN=go1.23.12 go vet ./...`,以及 `GOTOOLCHAIN=go1.24.0 go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@v0.38.0 -any -diff -test ./...`,两条命令均通过,工作区没有产生改动。这个 P1 在代码层面已经修复,不需要再调整实现;当前新 Head 尚无 checks,接下来只需批准或触发 Actions,并确认检查通过。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix modernize fmt flag [dubbo-getty]
Posted by "222twotwotwo (via GitHub)" <gi...@apache.org>.
222twotwotwo commented on code in PR #135:
URL: https://github.com/apache/dubbo-getty/pull/135#discussion_r3600560561
##########
.github/workflows/github-actions.yml:
##########
@@ -28,7 +28,7 @@ jobs:
# If you want to matrix build , you can append the following list.
matrix:
go_version:
- - '1.23'
+ - '1.24'
Review Comment:
已按照建议做出修改
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix modernize fmt flag [dubbo-getty]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks merged PR #135:
URL: https://github.com/apache/dubbo-getty/pull/135
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix modernize fmt flag [dubbo-getty]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #135:
URL: https://github.com/apache/dubbo-getty/pull/135#discussion_r3599964267
##########
Makefile:
##########
@@ -36,7 +36,7 @@ test: clean
fmt: install-imports-formatter
# replace interface{} with any
- go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -category=efaceany -fix -test ./...
+ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -any -fix -test ./...
Review Comment:
`modernize@latest` keeps the fmt target coupled to upstream CLI changes (this is what caused the recent CI break). To make CI more stable, consider pinning `modernize` to a known-good `golang.org/x/tools` version (and optionally centralize it in a Makefile variable).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix modernize fmt flag [dubbo-getty]
Posted by "222twotwotwo (via GitHub)" <gi...@apache.org>.
222twotwotwo commented on code in PR #135:
URL: https://github.com/apache/dubbo-getty/pull/135#discussion_r3600218397
##########
Makefile:
##########
@@ -36,7 +36,7 @@ test: clean
fmt: install-imports-formatter
# replace interface{} with any
- go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -category=efaceany -fix -test ./...
+ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -any -fix -test ./...
Review Comment:
done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix modernize fmt flag [dubbo-getty]
Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks commented on code in PR #135:
URL: https://github.com/apache/dubbo-getty/pull/135#discussion_r3600015010
##########
Makefile:
##########
@@ -36,7 +36,7 @@ test: clean
fmt: install-imports-formatter
# replace interface{} with any
- go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -category=efaceany -fix -test ./...
+ go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -any -fix -test ./...
Review Comment:
[P2] 补充当前可复现证据:本次 CI 实际解析到 `gopls v0.23.0`,它要求 Go 1.26,因此虽然 workflow 声明 Go 1.23,格式步骤仍自动下载并切换到了 Go 1.26.5;在 `GOTOOLCHAIN=go1.23.12` 下该命令会直接失败。另外,`gopls v0.21.0+` 已把这个 `gopls/internal/.../cmd/modernize` 入口标记为 deprecated,要求迁移到公开的 `golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize`。因此只替换 flag 仍保留了同一类上游漂移风险。建议改用公开入口、固定工具版本,并让该版本的最低 Go 要求与 CI 明确对齐。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] fix modernize fmt flag [dubbo-getty]
Posted by "222twotwotwo (via GitHub)" <gi...@apache.org>.
222twotwotwo commented on code in PR #135:
URL: https://github.com/apache/dubbo-getty/pull/135#discussion_r3600494862
##########
.github/workflows/github-actions.yml:
##########
@@ -28,7 +28,7 @@ jobs:
# If you want to matrix build , you can append the following list.
matrix:
go_version:
- - '1.23'
+ - '1.24'
Review Comment:
OK,done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org