Conversation
- probe each candidate experiment with `go env` and keep only the accepted ones - drop the hardcoded GOEXPERIMENT from the generate target - record the experiments used in the generated header - fail loudly when a probe breaks for any reason other than a rejected experiment, so a broken environment cannot silently narrow the list make generate failed on Go 1.27 with "unknown GOEXPERIMENT synctest", and the hardcoded value has needed manual repair on every recent Go release. Signed-off-by: osamingo <1390409+osamingo@users.noreply.github.com>
- add crypto/hpke, crypto/mldsa, crypto/mlkem/mlkemtest, simd, simd/archsimd, testing/cryptotest and uuid - cover uuid in TestStandardPackageSpecificity uuid was sorted into the third-party group, which conflicts with goimports, gofumpt and golangci-lint fmt. Signed-off-by: osamingo <1390409+osamingo@users.noreply.github.com>
- regenerate the list with stable Go and diff it on every pull request - ignore the generated header line so patch releases do not fail the job - scope the job name to the root module, since v2 keeps its own list Signed-off-by: osamingo <1390409+osamingo@users.noreply.github.com>
osamingo
force-pushed
the
feat/standard-list-go1.27
branch
from
September 2, 2026 09:43
e899dc8 to
881366c
Compare
osamingo
marked this pull request as ready for review
September 2, 2026 10:01
|
+1 on the uuid sort. I have imports that are: import (
"database/sql"
"errors"
"net/http"
"github.com/jackc/pgx/v5/pgtype"
"github.com/rs/zerolog/log"
"uuid"
)But I would expect import (
"database/sql"
"errors"
"net/http"
"uuid"
"github.com/jackc/pgx/v5/pgtype"
"github.com/rs/zerolog/log"
) |
Author
|
@daixiang0 friendly ping on this one — the For what it is worth, the same workflows are green on my fork for an identical DCO passes and the branch is still mergeable. If the scope is more than you want, the three concerns are in separate commits — |
sirkostya009
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Regenerate the standard package list with Go 1.27, and stop the generator from
breaking on every Go release.
Why
Go 1.27 adds standard packages that
gcidoes not know about. The most visibleone is
uuid:gcicurrently sorts it into the third-party group, whilegoimports,gofumptandgolangci-lint fmtall keep it in the standardgroup. Projects running
gcinext to any of those end up with two formattersfighting over the same import block.
While updating the list I hit a second problem:
make generatedoes not work onGo 1.27 at all. The
GOEXPERIMENTvalue is hardcoded and includessynctest,which is no longer a known experiment:
This is not a one-off. The hardcoded value has needed manual repair on every
recent release:
synctestadded for 1.24 (#227),jsonv2added for 1.25(#233),
synctestremoved for 1.26 (#245),simdadded for 1.27. It is alsoduplicated between the
Makefileandinternal/generate.go, and the two hadalready drifted apart before #233 resynced them. Because CI only runs
make test, nothing catches any of this.What changed
1. Generation no longer hardcodes
GOEXPERIMENT(internal/generate.go,Makefile)The generator now probes which of the candidate experiments the toolchain in use
accepts, and passes only those. An experiment the toolchain explicitly rejects
is skipped, so
make generatekeeps working on future Go versions withoutedits. Any other probe failure aborts generation, so a broken environment cannot
quietly rewrite the list with a narrower one.
The generated header now records the experiments explicitly, since they are no
longer implied by the binary's own
runtime.Version():2. Regenerated
pkg/section/standard_list.gowith Go 1.27.Newly listed packages, nothing removed:
3. Added a CI job that regenerates the list and fails if it is stale
(
.github/workflows/build.yml)The check ignores the generated header line, so a patch release such as
go1.27.0 to go1.27.1 does not turn it red on its own — only an actual change in
the package set does.
Note this job runs on
stable, so it will go red once Go 1.28 ships and thelist needs refreshing. That is the intent, but it does mean unrelated PRs are
blocked until someone refreshes the list, and a contributor on an older
toolchain cannot fix it by running
make generatelocally. If you would prefer,it can be pinned to the generating version, made non-blocking, or moved to a
scheduled run. Happy to change it.
The job is named for the root module because it only covers
pkg/section/standard_list.go.v2/pkg/section/standard_list.gois a separate,hand-maintained map with no generator, and it is currently 27 entries behind the
root list — including
cmp,iter,math/rand/v2,unique,weak,crypto/sha3andencoding/json/v2— sogci/v2sorts those into thethird-party group. That is out of scope here; #245 is the change that would put
v2under the generator.Test
uuidcase toTestStandardPackageSpecificity.go test ./...passes."uuid"in the standard group is moved to thethird-party group by the current release, and is left alone after this change.
Relation to #245
#245 updates the list to Go 1.26 and additionally refactors the generator so it
also emits
v2/pkg/section/standard_list.go. This PR targets Go 1.27 and leavesv2alone, so the two overlap inpkg/section/standard_list.go.If you would rather land #245 first, I am happy to close this and re-send the
Go 1.27 delta on top of it.
The three concerns are in separate commits, so if you only want the refreshed
list you can take the middle one on its own and leave the generator and CI
changes out.