Conversation
There was a problem hiding this comment.
Pull request overview
Upgrades the repository’s GolangCI-Lint tooling to v2.11 (needed for Go 1.25 compatibility) and applies the associated repo-wide lint-driven refactors/expectation updates without intended behavioral changes.
Changes:
- Update GolangCI-Lint CI workflow to use
golangci/golangci-lint-action@v9withv2.11, and migrate.golangci.ymlto the v2 config format. - Apply widespread Go lint cleanups (receiver renames away from
this, minor simplifications, and error-string casing/format changes). - Update local test
expect_failuregolden outputs to match updated error/log formatting.
Show a summary per file
| File | Description |
|---|---|
| localtests/trigger-ghost-name-conflict/expect_failure | Update expected failure output formatting/casing. |
| localtests/modify-change-case-pk/expect_failure | Update expected failure output formatting/casing. |
| localtests/fail-rename-table/expect_failure | Update expected failure output formatting/casing. |
| localtests/fail-no-unique-key/expect_failure | Update expected failure output formatting/casing. |
| localtests/fail-no-shared-uk/expect_failure | Update expected failure output formatting/casing. |
| localtests/fail-float-unique-key/expect_failure | Update expected failure output formatting/casing. |
| localtests/fail-existing-datetime-with-zero/expect_failure | Update expected failure output (now includes full fatal MySQL error text). |
| localtests/fail-drop-pk/expect_failure | Update expected failure output formatting/casing. |
| localtests/datetime-to-timestamp-pk-fail/expect_failure | Update expected failure output formatting/casing. |
| go/sql/types.go | Receiver renames; column/column-list helpers; introduces/keeps a broken ColumnList.Equals implementation. |
| go/sql/parser.go | Receiver renames for AlterTableParser methods. |
| go/sql/builder_test.go | Use strings.ReplaceAll in query normalization helper. |
| go/sql/builder.go | Error string casing changes; minor simplification. |
| go/mysql/utils.go | Receiver rename; error string casing changes. |
| go/mysql/instance_key_map.go | Receiver renames for InstanceKeyMap methods. |
| go/mysql/instance_key.go | IPv6 host:port regex tweak; receiver renames; error string casing changes. |
| go/mysql/connection.go | Receiver renames for ConnectionConfig; minor formatting/casing changes. |
| go/mysql/binlog_gtid.go | Receiver renames for GTID coordinate methods. |
| go/mysql/binlog_file.go | Receiver renames; error string casing changes. |
| go/logic/throttler.go | Receiver renames; small readability refactor while preserving behavior. |
| go/logic/streamer_test.go | Cleanup import aliasing for sql.NullString; remove nolint comment. |
| go/logic/streamer.go | Receiver renames; error string casing changes. |
| go/logic/server.go | Receiver renames; user-facing message tweaks (one loses trailing newline). |
| go/logic/migrator_test.go | Remove nolint comments; adjust test code formatting. |
| go/logic/inspect.go | Receiver renames; error string casing changes (one message now has a typo: “Isp scenario…”). |
| go/logic/hooks.go | Receiver renames for HooksExecutor. |
| go/logic/applier_test.go | Update expected error string; remove nolint comments. |
| go/binlog/gomysql_reader.go | Receiver renames; slight loop restructuring in StreamEvents. |
| go/binlog/binlog_entry.go | Receiver rename for String(). |
| go/binlog/binlog_dml_event.go | Receiver rename for String(). |
| go/base/utils.go | Error string casing changes. |
| go/base/load_map.go | Receiver renames for LoadMap. |
| go/base/context.go | Receiver renames across MigrationContext methods; minor string helper changes. |
| .golangci.yml | Migrate to golangci-lint v2 config; adjust enabled/disabled linters/formatters; remove prior run timeout. |
| .github/workflows/golangci-lint.yml | Use golangci-lint-action@v9 with golangci-lint v2.11. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
go/sql/builder.go:212
BuildRangeComparisonreturns errors that mentionGetEqualsComparison, which is misleading (and doesn't match theBuild*naming used here). Updating these messages will make it much easier to understand failures in range comparison construction.
func BuildRangeComparison(columns []string, values []string, args []interface{}, comparisonSign ValueComparisonSign) (result string, explodedArgs []interface{}, err error) {
if len(columns) == 0 {
return "", explodedArgs, fmt.Errorf("got 0 columns in GetRangeComparison")
}
if len(columns) != len(values) {
return "", explodedArgs, fmt.Errorf("got %d columns but %d values in GetEqualsComparison", len(columns), len(values))
}
if len(columns) != len(args) {
return "", explodedArgs, fmt.Errorf("got %d columns but %d args in GetEqualsComparison", len(columns), len(args))
}
.golangci.yml:6
- The previous
run.timeout: 5msetting was removed. Since the workflow does not pass an explicit--timeoutand larger repos can exceed golangci-lint's default, consider restoring an explicit timeout (either in.golangci.ymlunderrun:or via the GitHub Action config) to avoid flaky CI timeouts.
version: "2"
linters:
enable:
- bodyclose
- containedctx
- contextcheck
- Files reviewed: 36/37 changed files
- Comments generated: 5
| func (this *ColumnList) Equals(other *ColumnList) bool { | ||
| return reflect.DeepEqual(this.Columns, other.Columns) | ||
| func (cl *ColumnList) Equals(other *ColumnList) bool { | ||
| return reflect.DeepEqual(cl.Columns, other.Columns) |
There was a problem hiding this comment.
ColumnList.Equals is comparing the Columns method values (cl.Columns / other.Columns) instead of the underlying slices, so it will always return false (functions are only DeepEqual when both are nil). It should compare cl.columns/other.columns (or cl.Columns()/other.Columns()), and ideally handle other == nil to avoid panics if added later.
| return reflect.DeepEqual(cl.Columns, other.Columns) | |
| if cl == other { | |
| return true | |
| } | |
| if cl == nil || other == nil { | |
| return false | |
| } | |
| return reflect.DeepEqual(cl.columns, other.columns) |
There was a problem hiding this comment.
out of scope, I don't want to change any logic
Upgrade golangci-lint to v2.11 since the current version won't work with go1.25 (#1668). This requires a lot of trivial changes to satisfy the linters. No logic is changed in this PR.
script/cibuildreturns with no formatting errors, build errors or unit test errors.