diff --git a/Makefile b/Makefile index e28909698..d476ecb57 100644 --- a/Makefile +++ b/Makefile @@ -16,4 +16,4 @@ test: clean @cd v2 && go test -v -count=1 -cover ./... generate: - @GOEXPERIMENT=arenas,boringcrypto,synctest,jsonv2 go generate ./... + @GOEXPERIMENT=arenas,boringcrypto,jsonv2 go generate ./... diff --git a/internal/generate.go b/internal/generate.go index 74c0d7dac..a36479e42 100644 --- a/internal/generate.go +++ b/internal/generate.go @@ -18,7 +18,10 @@ import ( //go:generate go run . -const outputFile = "../pkg/section/standard_list.go" +var outputFiles = []string{ + "../pkg/section/standard_list.go", + "../v2/pkg/section/standard_list.go", +} const stdTemplate = ` package section @@ -101,7 +104,7 @@ func generate() error { pkgs, err := packages.Load(&packages.Config{ Mode: packages.NeedName, - Env: append(os.Environ(), "GOOS="+goos, "GOARCH="+goarch, "GOEXPERIMENT=arenas,boringcrypto,synctest,jsonv2"), + Env: append(os.Environ(), "GOOS="+goos, "GOARCH="+goarch, "GOEXPERIMENT=arenas,boringcrypto,jsonv2"), }, "std") if err != nil { return err @@ -136,6 +139,17 @@ func generate() error { slices.Sort(pkgs) + for _, outputFile := range outputFiles { + err := generateFile(outputFile, pkgs) + if err != nil { + return err + } + } + + return nil +} + +func generateFile(outputFile string, pkgs []string) error { file, err := os.Create(outputFile) if err != nil { return err diff --git a/pkg/section/standard_list.go b/pkg/section/standard_list.go index 34cf38cec..6b5d9dc83 100644 --- a/pkg/section/standard_list.go +++ b/pkg/section/standard_list.go @@ -1,6 +1,6 @@ package section -// Code generated based on go1.25rc1 X:boringcrypto,arenas,synctest,jsonv2. DO NOT EDIT. +// Code generated based on go1.26.1-X:boringcrypto,arenas,jsonv2. DO NOT EDIT. var standardPackages = map[string]struct{}{ "archive/tar": {}, @@ -31,8 +31,10 @@ var standardPackages = map[string]struct{}{ "crypto/fips140": {}, "crypto/hkdf": {}, "crypto/hmac": {}, + "crypto/hpke": {}, "crypto/md5": {}, "crypto/mlkem": {}, + "crypto/mlkem/mlkemtest": {}, "crypto/pbkdf2": {}, "crypto/rand": {}, "crypto/rc4": {}, @@ -165,6 +167,7 @@ var standardPackages = map[string]struct{}{ "syscall": {}, "syscall/js": {}, "testing": {}, + "testing/cryptotest": {}, "testing/fstest": {}, "testing/iotest": {}, "testing/quick": {}, diff --git a/pkg/section/standard_test.go b/pkg/section/standard_test.go index 6f9a71821..7be091ccb 100644 --- a/pkg/section/standard_test.go +++ b/pkg/section/standard_test.go @@ -8,6 +8,7 @@ import ( func TestStandardPackageSpecificity(t *testing.T) { testCases := []specificityTestData{ + {"cmp", Standard{}, specificity.StandardMatch{}}, {"context", Standard{}, specificity.StandardMatch{}}, {"contexts", Standard{}, specificity.MisMatch{}}, {"crypto", Standard{}, specificity.StandardMatch{}}, @@ -15,6 +16,7 @@ func TestStandardPackageSpecificity(t *testing.T) { {"crypto/ae", Standard{}, specificity.MisMatch{}}, {"crypto/aes", Standard{}, specificity.StandardMatch{}}, {"crypto/aes2", Standard{}, specificity.MisMatch{}}, + {"crypto/hpke", Standard{}, specificity.StandardMatch{}}, {"syscall/js", Standard{}, specificity.StandardMatch{}}, } testSpecificity(t, testCases) diff --git a/v2/pkg/section/standard_list.go b/v2/pkg/section/standard_list.go index 7868a63de..6b5d9dc83 100644 --- a/v2/pkg/section/standard_list.go +++ b/v2/pkg/section/standard_list.go @@ -1,163 +1,188 @@ package section -var standardPackages = map[string]bool{ - "archive/tar": true, - "archive/zip": true, - "bufio": true, - "bytes": true, - "compress/bzip2": true, - "compress/flate": true, - "compress/gzip": true, - "compress/lzw": true, - "compress/zlib": true, - "container/heap": true, - "container/list": true, - "container/ring": true, - "context": true, - "crypto": true, - "crypto/aes": true, - "crypto/cipher": true, - "crypto/des": true, - "crypto/dsa": true, - "crypto/ecdh": true, - "crypto/ecdsa": true, - "crypto/ed25519": true, - "crypto/elliptic": true, - "crypto/hmac": true, - "crypto/md5": true, - "crypto/rand": true, - "crypto/rc4": true, - "crypto/rsa": true, - "crypto/sha1": true, - "crypto/sha256": true, - "crypto/sha512": true, - "crypto/subtle": true, - "crypto/tls": true, - "crypto/x509": true, - "crypto/x509/pkix": true, - "database/sql": true, - "database/sql/driver": true, - "debug/buildinfo": true, - "debug/dwarf": true, - "debug/elf": true, - "debug/gosym": true, - "debug/macho": true, - "debug/pe": true, - "debug/plan9obj": true, - "embed": true, - "encoding": true, - "encoding/ascii85": true, - "encoding/asn1": true, - "encoding/base32": true, - "encoding/base64": true, - "encoding/binary": true, - "encoding/csv": true, - "encoding/gob": true, - "encoding/hex": true, - "encoding/json": true, - "encoding/pem": true, - "encoding/xml": true, - "errors": true, - "expvar": true, - "flag": true, - "fmt": true, - "go/ast": true, - "go/build": true, - "go/build/constraint": true, - "go/constant": true, - "go/doc": true, - "go/doc/comment": true, - "go/format": true, - "go/importer": true, - "go/parser": true, - "go/printer": true, - "go/scanner": true, - "go/token": true, - "go/types": true, - "hash": true, - "hash/adler32": true, - "hash/crc32": true, - "hash/crc64": true, - "hash/fnv": true, - "hash/maphash": true, - "html": true, - "html/template": true, - "image": true, - "image/color": true, - "image/color/palette": true, - "image/draw": true, - "image/gif": true, - "image/jpeg": true, - "image/png": true, - "index/suffixarray": true, - "io": true, - "io/fs": true, - "io/ioutil": true, - "log": true, - "log/slog": true, - "log/syslog": true, - "maps": true, - "math": true, - "math/big": true, - "math/bits": true, - "math/cmplx": true, - "math/rand": true, - "mime": true, - "mime/multipart": true, - "mime/quotedprintable": true, - "net": true, - "net/http": true, - "net/http/cgi": true, - "net/http/cookiejar": true, - "net/http/fcgi": true, - "net/http/httptest": true, - "net/http/httptrace": true, - "net/http/httputil": true, - "net/http/pprof": true, - "net/mail": true, - "net/netip": true, - "net/rpc": true, - "net/rpc/jsonrpc": true, - "net/smtp": true, - "net/textproto": true, - "net/url": true, - "os": true, - "os/exec": true, - "os/signal": true, - "os/user": true, - "path": true, - "path/filepath": true, - "plugin": true, - "reflect": true, - "regexp": true, - "regexp/syntax": true, - "runtime": true, - "runtime/cgo": true, - "runtime/debug": true, - "runtime/metrics": true, - "runtime/pprof": true, - "runtime/race": true, - "runtime/trace": true, - "slices": true, - "sort": true, - "strconv": true, - "strings": true, - "sync": true, - "sync/atomic": true, - "syscall": true, - "syscall/js": true, - "testing": true, - "testing/fstest": true, - "testing/iotest": true, - "testing/quick": true, - "text/scanner": true, - "text/tabwriter": true, - "text/template": true, - "text/template/parse": true, - "time": true, - "time/tzdata": true, - "unicode": true, - "unicode/utf16": true, - "unicode/utf8": true, - "unsafe": true, +// Code generated based on go1.26.1-X:boringcrypto,arenas,jsonv2. DO NOT EDIT. + +var standardPackages = map[string]struct{}{ + "archive/tar": {}, + "archive/zip": {}, + "arena": {}, + "bufio": {}, + "bytes": {}, + "cmp": {}, + "compress/bzip2": {}, + "compress/flate": {}, + "compress/gzip": {}, + "compress/lzw": {}, + "compress/zlib": {}, + "container/heap": {}, + "container/list": {}, + "container/ring": {}, + "context": {}, + "crypto": {}, + "crypto/aes": {}, + "crypto/boring": {}, + "crypto/cipher": {}, + "crypto/des": {}, + "crypto/dsa": {}, + "crypto/ecdh": {}, + "crypto/ecdsa": {}, + "crypto/ed25519": {}, + "crypto/elliptic": {}, + "crypto/fips140": {}, + "crypto/hkdf": {}, + "crypto/hmac": {}, + "crypto/hpke": {}, + "crypto/md5": {}, + "crypto/mlkem": {}, + "crypto/mlkem/mlkemtest": {}, + "crypto/pbkdf2": {}, + "crypto/rand": {}, + "crypto/rc4": {}, + "crypto/rsa": {}, + "crypto/sha1": {}, + "crypto/sha256": {}, + "crypto/sha3": {}, + "crypto/sha512": {}, + "crypto/subtle": {}, + "crypto/tls": {}, + "crypto/tls/fipsonly": {}, + "crypto/x509": {}, + "crypto/x509/pkix": {}, + "database/sql": {}, + "database/sql/driver": {}, + "debug/buildinfo": {}, + "debug/dwarf": {}, + "debug/elf": {}, + "debug/gosym": {}, + "debug/macho": {}, + "debug/pe": {}, + "debug/plan9obj": {}, + "embed": {}, + "encoding": {}, + "encoding/ascii85": {}, + "encoding/asn1": {}, + "encoding/base32": {}, + "encoding/base64": {}, + "encoding/binary": {}, + "encoding/csv": {}, + "encoding/gob": {}, + "encoding/hex": {}, + "encoding/json": {}, + "encoding/json/jsontext": {}, + "encoding/json/v2": {}, + "encoding/pem": {}, + "encoding/xml": {}, + "errors": {}, + "expvar": {}, + "flag": {}, + "fmt": {}, + "go/ast": {}, + "go/build": {}, + "go/build/constraint": {}, + "go/constant": {}, + "go/doc": {}, + "go/doc/comment": {}, + "go/format": {}, + "go/importer": {}, + "go/parser": {}, + "go/printer": {}, + "go/scanner": {}, + "go/token": {}, + "go/types": {}, + "go/version": {}, + "hash": {}, + "hash/adler32": {}, + "hash/crc32": {}, + "hash/crc64": {}, + "hash/fnv": {}, + "hash/maphash": {}, + "html": {}, + "html/template": {}, + "image": {}, + "image/color": {}, + "image/color/palette": {}, + "image/draw": {}, + "image/gif": {}, + "image/jpeg": {}, + "image/png": {}, + "index/suffixarray": {}, + "io": {}, + "io/fs": {}, + "io/ioutil": {}, + "iter": {}, + "log": {}, + "log/slog": {}, + "log/syslog": {}, + "maps": {}, + "math": {}, + "math/big": {}, + "math/bits": {}, + "math/cmplx": {}, + "math/rand": {}, + "math/rand/v2": {}, + "mime": {}, + "mime/multipart": {}, + "mime/quotedprintable": {}, + "net": {}, + "net/http": {}, + "net/http/cgi": {}, + "net/http/cookiejar": {}, + "net/http/fcgi": {}, + "net/http/httptest": {}, + "net/http/httptrace": {}, + "net/http/httputil": {}, + "net/http/pprof": {}, + "net/mail": {}, + "net/netip": {}, + "net/rpc": {}, + "net/rpc/jsonrpc": {}, + "net/smtp": {}, + "net/textproto": {}, + "net/url": {}, + "os": {}, + "os/exec": {}, + "os/signal": {}, + "os/user": {}, + "path": {}, + "path/filepath": {}, + "plugin": {}, + "reflect": {}, + "regexp": {}, + "regexp/syntax": {}, + "runtime": {}, + "runtime/cgo": {}, + "runtime/coverage": {}, + "runtime/debug": {}, + "runtime/metrics": {}, + "runtime/pprof": {}, + "runtime/race": {}, + "runtime/trace": {}, + "slices": {}, + "sort": {}, + "strconv": {}, + "strings": {}, + "structs": {}, + "sync": {}, + "sync/atomic": {}, + "syscall": {}, + "syscall/js": {}, + "testing": {}, + "testing/cryptotest": {}, + "testing/fstest": {}, + "testing/iotest": {}, + "testing/quick": {}, + "testing/slogtest": {}, + "testing/synctest": {}, + "text/scanner": {}, + "text/tabwriter": {}, + "text/template": {}, + "text/template/parse": {}, + "time": {}, + "time/tzdata": {}, + "unicode": {}, + "unicode/utf16": {}, + "unicode/utf8": {}, + "unique": {}, + "unsafe": {}, + "weak": {}, } diff --git a/v2/pkg/section/standard_test.go b/v2/pkg/section/standard_test.go index 1c002c109..d3aac68bb 100644 --- a/v2/pkg/section/standard_test.go +++ b/v2/pkg/section/standard_test.go @@ -8,6 +8,7 @@ import ( func TestStandardPackageSpecificity(t *testing.T) { testCases := []specificityTestData{ + {"cmp", Standard{}, specificity.StandardMatch{}}, {"context", Standard{}, specificity.StandardMatch{}}, {"contexts", Standard{}, specificity.MisMatch{}}, {"crypto", Standard{}, specificity.StandardMatch{}}, @@ -15,6 +16,7 @@ func TestStandardPackageSpecificity(t *testing.T) { {"crypto/ae", Standard{}, specificity.MisMatch{}}, {"crypto/aes", Standard{}, specificity.StandardMatch{}}, {"crypto/aes2", Standard{}, specificity.MisMatch{}}, + {"crypto/hpke", Standard{}, specificity.StandardMatch{}}, {"syscall/js", Standard{}, specificity.StandardMatch{}}, } testSpecificity(t, testCases)