Skip to content

Upgrade to Go 1.27 + golangci-lint 2.13.1 - #1356

Merged
brandur merged 1 commit into
masterfrom
brandur-go-1.27
Aug 21, 2026
Merged

Upgrade to Go 1.27 + golangci-lint 2.13.1#1356
brandur merged 1 commit into
masterfrom
brandur-go-1.27

Conversation

@brandur

@brandur brandur commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Just since everything's fully available in Homebrew etc. now, here
take the opportunity upgrade Go to 1.27 and golangci-lint to 2.13.1 so
we can get our lint CI fully passing again.

@bgentry bgentry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like there's an old linter to fix but otherwise LGTM

@brandur
brandur force-pushed the brandur-go-1.27 branch 3 times, most recently from 3673fe3 to 84a52fd Compare August 21, 2026 22:22
Just since everything's fully available in Homebrew etc. now, here
take the opportunity upgrade Go to 1.27 and golangci-lint  to 2.13.1 so
we can get our lint CI fully passing again.
@brandur
brandur merged commit 231f157 into master Aug 21, 2026
16 of 27 checks passed
@brandur
brandur deleted the brandur-go-1.27 branch August 21, 2026 23:17
@brandur brandur mentioned this pull request Aug 22, 2026
brandur added a commit that referenced this pull request Aug 22, 2026
Follows up #1356 to bring back in some modernizers that I'd disabled to
not make the diff for that original PR gigantic.

In particular:

* `errorsastype`: Requires the use of the new `errors.AsType` helper.
  This is a really nice one and turns this old code:

        var pgErr *pgconn.PgError
        if errors.As(err, &pgErr) {

    Into this much nicer generics variant:

        if pgErr, ok := errors.AsType[*pgconn.PgError](err); ok {

* `newexpr`: Converts pointer helpers like `ptrutil.Ptr(...)` to `new`.
  I remove all uses of `ptrutil.Ptr(...)`, but left its definition in
  `rivershared` for now because I think it'll allow a little more
  flexibility in what version of River a River Pro installation can use.
  For example, an older version of River Pro could potentially point to
  a newer version of River and still have compilation work (it has
  however been marked as deprecated). I doubt too many people are in
  this situation though so we can probably remove it soon.

* `stditerators`: Replaces some manual iteration patterns with newer
  standard library iterator APIs. For example this:

        for i := range typ.NumField() {
            field := typ.Field(i)

    Goes to this:

        for field := range typ.Fields() {�[27;5;106~
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