Skip to content

fix: use plain errors for clickhouse model messages#1980

Merged
sunsingerus merged 1 commit intoAltinity:0.27.0from
immanuwell:fix/clickhouse-error-vet
May 8, 2026
Merged

fix: use plain errors for clickhouse model messages#1980
sunsingerus merged 1 commit intoAltinity:0.27.0from
immanuwell:fix/clickhouse-error-vet

Conversation

@immanuwell
Copy link
Copy Markdown
Contributor

@immanuwell immanuwell commented May 8, 2026

Tiny vet cleanup in the ClickHouse model package.

Go 1.26 flags fmt.Errorf(s) when s is already a built string. No formatting needed here, so errors.New(s) is the straight shot. same behavior, less noise.

Repro before:

go test ./pkg/model/clickhouse

It failed with:

non-constant format string in call to fmt.Errorf

After:

go test ./pkg/model/clickhouse

passes

Signed-off-by: immanuwell <pchpr.00@list.ru>
Copy link
Copy Markdown
Collaborator

@sunsingerus sunsingerus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tiny, correct vet cleanup — fmt.Errorf(s)errors.New(s) at 3 sites in pkg/model/clickhouse. Verified:

  • Functional equivalence: identical *errors.errorString output when s has no % verbs; no callers use errors.Is/errors.As on these errors.
  • Sweep is complete for the package: go vet ./pkg/model/clickhouse/ flags exactly these 3 sites.
  • Go version claim is accurate: go.mod declares go 1.26.2.
  • Format-injection rationale is real (SQL interpolates user-controlled cluster names), though theoretical in Go (memory-safe fmt).

Approved.

@sunsingerus sunsingerus merged commit aa057aa into Altinity:0.27.0 May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants