wangchenxuya opened a new pull request, #106:
URL: https://github.com/apache/incubator-seata-go-samples/pull/106
**What this PR does**:
Fixes the `build` workflow, which has been red on `main` since #88 landed.
`tcc/rocketmq/cmd/main.go` imports
`seata.apache.org/seata-go/v2/pkg/{client,integration/rocketmq,tm,util/log}`,
but `go.mod` only requires the **v1** module path `seata.apache.org/seata-go`.
Nothing provides the `/v2` packages, so `go build ./...` fails:
```
tcc/rocketmq/cmd/main.go:29:2: no required module provides package
seata.apache.org/seata-go/v2/pkg/client; to add it:
go get seata.apache.org/seata-go/v2/pkg/client
```
The sample was developed against a local `replace seata.apache.org/seata-go
=> ../incubator-seata-go` checkout. The replace was commented out again before
merge, but the `/v2` imports stayed.
The same root cause also fails the `golang ci lint` job on open PRs, with:
```
can't run linter goanalysis_metalinter: inspect: failed to load package :
could not load export data for "seata.apache.org/seata-go/v2/pkg/client"
```
**Why not simply drop the `/v2` prefix**
`pkg/integration/rocketmq` exists on seata-go `master` only:
| seata-go version | `pkg/integration/` contents |
|---|---|
| `v1.2.1-0.20251220113411-b18bcb019b65` (currently pinned here) | dubbo,
gin, grpc |
| `v2.1.0` — latest release, 2026-02-12 | dubbo, gin, grpc |
| `master` @ `3bcd201` | dubbo, gin, grpc, **rocketmq** |
It was added in apache/incubator-seata-go#1054 (2026-06-05) and reworked in
apache/incubator-seata-go#1125 (2026-07-10) — both after `v2.1.0` was cut, so
no tagged release contains it yet.
**What this changes**
Pins `seata.apache.org/seata-go/v2` to the current `master` pseudo-version
alongside the existing v1 requirement — this repo already pins a v1
pseudo-version, so it is the same practice.
`go.mod` gains one direct require plus three indirect (`jackc/pg*`, pulled
in by the v2 module graph) and `go.sum` gains 8 lines. **No existing dependency
version changes**, so only `tcc/rocketmq` resolves against v2 and every other
sample builds exactly as before.
Once seata-go cuts a release containing the RocketMQ integration this should
be repointed at that tag, ideally as part of moving the whole repo to
`seata-go/v2` — a separate change.
**Which issue(s) this PR fixes**:
Fixes #
**The related PR of seata-go**
- apache/incubator-seata-go#1054 — feature: add RocketMQ TCC integration
- apache/incubator-seata-go#1125 — feat: support rocketmq mode in tcc
**Verification**, with Go 1.20 — the version `.github/workflows/build.yaml`
and `golangci-lint.yml` both use:
| check | result |
|---|---|
| `go vet ./...` (type-checks every package) | exit 0 |
| `go build -o /tmp/rmq ./tcc/rocketmq/cmd` | exit 0 |
| `go build ./...` (Go 1.22) | exit 0 |
| `go fmt ./...` | no changes |
| `go test -v ./...` | no test files in the repo |
| `golangci-lint run` v1.51.0 | exit 0, no findings |
**You should pay attention to items below to ensure your pr passes our ci
test**
- [x] All ut passed (run 'go test ./...' in project root)
- [x] After go-fmt ed , run 'go fmt project' using goland.
- [x] Golangci-lint passed — ran golangci-lint v1.51.0 under Go 1.20, same
as CI: exit 0, no findings. This PR changes no .go files; it repairs the
type-check failure that currently aborts the linter
- [x] Your new-created file needs to have apache license at the top — no new
files
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]