Skip to content

Support Go 1.27 - #90

Merged
sipsma merged 3 commits into
mainfrom
sipsma/go-1.27
Nov 2, 2026
Merged

sipsma merged 3 commits into
mainfrom
sipsma/go-1.27

Conversation

@sipsma

@sipsma sipsma commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Modules on Go 1.27 now build, test and lint. Two things failed on them before:

  • The source scan. The scanner was built with Go 1.26, whose parser rejects Go 1.27's generic methods ("method must have no type parameters"). Any module using one failed before anything built. The scanner, the tool builder and the default for modules with no go directive now use Go 1.27. Go 1.27 targets the same platforms as 1.26, so the platform list is unchanged.
  • golangci-lint. The default release, 2.11.4, was built with Go 1.26 and refuses any module on Go 1.27. The default is now 2.15.0, pinned by digest. 2.15.0 deprecates some options of the exhaustive linter; the old ones still work.

Each has a new check, generic-methods-check in the root suite and in golangci-lint's, which fails without its fix.

The suite now tests on Go 1.27.3. The checks that compare this module's builds with plain go build run under each supported Go:

  • test binaries and PGO builds under 1.26 and 1.27;
  • embeds under 1.25, 1.26 and 1.27.

With 1.27 swapped in before any fix, every existing check passed, including the byte-for-byte comparisons, so gobuild already handles Go 1.27's build plans.

Staticcheck's path for a module on a newer Go than the tool builder's stays, but no released Go is newer than 1.27 to check it with.

The source scanner parses every Go file in full, and Go 1.26's parser
rejects Go 1.27's generic methods ("method must have no type
parameters"). So a module on Go 1.27 that declared one failed in the
scan, before anything built. Built with Go 1.27, the scanner reads that
syntax and every earlier Go's.

The tool builder and the default for modules with no go directive share
the version, so they move to Go 1.27 too. Go 1.27 targets the same
platforms as Go 1.26, so the platform list is unchanged.

Staticcheck for a module on Go 1.27 is now built in the tool builder.
Its newer-than-the-builder path stays, but no released Go is newer to
check it with.

Signed-off-by: Erik Sipsma <[email protected]>
golangci-lint refuses a module on a newer Go than the one it was built
with. 2.11.4 was built with Go 1.26, so linting any module on Go 1.27
failed with "the Go language version (go1.26) used to build
golangci-lint is lower than the targeted Go version". 2.15.0 is built
with Go 1.27, and support for Go 1.27's syntax arrived in 2.13.0.

2.15.0 also changes the exhaustive linter's options; the replaced ones
still work, deprecated.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma force-pushed the sipsma/go-1.27 branch 2 times, most recently from e4c96fe to 4d2d913 Compare November 2, 2026 19:16
The suite's own fixtures and pinned versions move from Go 1.26.1 to
1.27.3. The checks that compare the module's builds with plain go
build, byte for byte or by behavior, now run under each supported Go:
test binaries and PGO builds under 1.26 and 1.27, embeds under 1.25,
1.26 and 1.27. The toolchain-switch check keeps its 1.25 base switching
to 1.26, and the version check still reads the scanner helper's own
go.mod.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma merged commit 4392e5b into main Nov 2, 2026
79 checks passed
sipsma added a commit to dagger/dagger that referenced this pull request Nov 4, 2026
Move the workspace's Go module from dagger/go#84's merge commit to the
v0.4.0 release. That brings in Go 1.27 (dagger/go#90), the faster
workspace scan (dagger/go#91) and the module discovery index and test
check cuts (dagger/go#89).

dagger.lock records the tag and the sub-modules the release resolves,
as written by dagger.

Signed-off-by: Erik Sipsma <[email protected]>
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