Update to Go 1.27 - #63902
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the compiler and tooling to Go 1.27 and adopts its standard-library and modernization features.
Changes:
- Raises Go requirements and refreshes dependencies/tooling.
- Migrates to
encoding/json/v2. - Applies Go 1.27 struct-literal and reverse-iteration simplifications.
Reviewed changes
Copilot reviewed 63 out of 65 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tsc/internal/tsoptions/tsconfigparsing.go |
Uses reverse-slice iteration. |
tsc/internal/tsoptions/tsconfigparsing_test.go |
Simplifies embedded-field literals. |
tsc/internal/tsoptions/contentmappers_test.go |
Simplifies mapper literals. |
tsc/internal/transformers/estransforms/taggedtemplate.go |
Uses slices.Clip. |
tsc/internal/testutil/contentmappertest/transforming.go |
Flattens result literals. |
tsc/internal/testutil/contentmappertest/synthesizing.go |
Flattens result literals. |
tsc/internal/testutil/contentmappertest/supplemental.go |
Flattens output literals. |
tsc/internal/testutil/contentmappertest/supplemental_module.go |
Flattens supplemental outputs. |
tsc/internal/testutil/contentmappertest/supplemental_globals.go |
Flattens supplemental outputs. |
tsc/internal/testutil/contentmappertest/supplemental_diagnostics.go |
Flattens supplemental outputs. |
tsc/internal/testutil/contentmappertest/mapper_test.go |
Simplifies mapper construction. |
tsc/internal/testutil/contentmappertest/lisp.go |
Flattens result literals. |
tsc/internal/testutil/contentmappertest/editing.go |
Flattens mapped outputs. |
tsc/internal/testutil/contentmappertest/duplicate.go |
Flattens result literals. |
tsc/internal/testutil/contentmappertest/component.go |
Flattens result literal. |
tsc/internal/testutil/autoimporttestutil/fixtures.go |
Simplifies embedded file handle. |
tsc/internal/pseudochecker/lookup.go |
Uses reverse-slice iteration. |
tsc/internal/project/snapshotfs.go |
Simplifies disk-file literal. |
tsc/internal/project/session.go |
Flattens resource requests. |
tsc/internal/project/refcountcache_test.go |
Simplifies embedded-field literals. |
tsc/internal/project/overlayfs.go |
Simplifies embedded file bases. |
tsc/internal/project/logging/logcollector.go |
Flattens logger literal. |
tsc/internal/project/dirty/syncmap.go |
Flattens map-entry literals. |
tsc/internal/project/dirty/map.go |
Flattens map-entry literals. |
tsc/internal/project/contentmapper_test.go |
Simplifies mapper fixtures. |
tsc/internal/project/api.go |
Flattens resource request. |
tsc/internal/printer/utilities.go |
Uses reverse-slice iteration. |
tsc/internal/printer/changetrackerwriter.go |
Flattens writer literal. |
tsc/internal/modulespecifiers/specifiers_test.go |
Flattens JSON-value literal. |
tsc/internal/lsp/server.go |
Simplifies mapper construction. |
tsc/internal/ls/symbols.go |
Uses reverse-slice iteration. |
tsc/internal/ls/lsutil/formatcodeoptions.go |
Flattens default editor settings. |
tsc/internal/ls/lsutil/children.go |
Uses reverse-slice iteration. |
tsc/internal/ls/lsconv/converters.go |
Flattens mapped-span literal. |
tsc/internal/ls/findallreferences.go |
Flattens position literal. |
tsc/internal/ls/documenthighlights.go |
Uses reverse-slice iteration. |
tsc/internal/ls/autoimport/registry_test.go |
Simplifies embedded fixture templates. |
tsc/internal/ls/autoimport/extract.go |
Flattens export identifier. |
tsc/internal/json/json.go |
Adopts standard encoding/json/v2. |
tsc/internal/fswatch/watcher.go |
Modernizes rollback iteration. |
tsc/internal/fourslash/test_parser.go |
Flattens location literal. |
tsc/internal/fourslash/fourslash.go |
Modernizes reverse edit iteration. |
tsc/internal/format/span.go |
Modernizes reverse rule iteration. |
tsc/internal/format/format_test.go |
Flattens formatting settings. |
tsc/internal/format/comment_test.go |
Flattens formatting fixtures. |
tsc/internal/format/api_test.go |
Flattens formatting fixtures. |
tsc/internal/execute/tsc/diagnostics.go |
Flattens path-formatting options. |
tsc/internal/execute/incremental/buildinfo_contentmapper_test.go |
Simplifies mapper fixtures. |
tsc/internal/core/core.go |
Modernizes reverse search helpers. |
tsc/internal/contentmapper/transform_test.go |
Simplifies mapper fixtures. |
tsc/internal/contentmapper/host_test.go |
Simplifies mapper and output fixtures. |
tsc/internal/compiler/contentmapper_test.go |
Simplifies mapper fixture. |
tsc/internal/checker/checker.go |
Modernizes reverse context lookup. |
tsc/internal/astnav/tokens.go |
Modernizes reverse token lookup. |
tsc/go.sum |
Refreshes compiler dependency checksums. |
tsc/go.mod |
Requires Go 1.27 and updates dependencies. |
tools/go.sum |
Refreshes tooling dependency checksums. |
tools/go.mod |
Requires Go 1.27 and updates tooling. |
tools/customlint/testdata/go.mod |
Updates custom-linter test module. |
NOTICE.txt |
Updates dependency notices. |
go.work |
Requires Go 1.27 workspace-wide. |
CONTRIBUTING.md |
Documents Go 1.27 prerequisite. |
.golangci.yml |
Enables new modernization and guards JSON v2. |
.github/actions/setup-go/action.yml |
Installs Go 1.27 in CI. |
.custom-gcl.yml |
Updates custom golangci-lint version. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
afd3876 to
910acab
Compare
| }, | ||
| "gofumpt": { | ||
| "langVersion": "go1.26", | ||
| "langVersion": "go1.27", |
There was a problem hiding this comment.
There's a new version that'll parse generic methods, but we need to wait a week for the npm quarantine.
It's probably best to wait anyway because linters are still getting bugfixes.
There was a problem hiding this comment.
Acknowledged. I am leaving @jakebailey/dprint-plugin-gofumpt at 0.0.13 for now and will avoid adopting generic methods in this PR.
| module github.com/microsoft/TypeScript/tsc | ||
|
|
||
| go 1.26 | ||
| go 1.27 |
There was a problem hiding this comment.
There is not yet a published dev-1.27-bookworm image, so I added GOTOOLCHAIN=go1.27.0 to the devcontainer environment while retaining the Go 1.26 base image. This makes the temporary local toolchain choice explicit and reproducible.
| "containerEnv": { | ||
| "GOTOOLCHAIN": "go1.27.0" | ||
| }, |
There was a problem hiding this comment.
Sadly, the devcontainer is not out
Lotsa goodies