From a1671452b896a3febfff03862f30063085bc917a Mon Sep 17 00:00:00 2001 From: "renovate-sh-app[bot]" <219655108+renovate-sh-app[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 23:14:56 +0000 Subject: [PATCH] fix(deps): update gomod patch updates | datasource | package | from | to | | ---------- | ------------------------------------------------------------- | -------------------------------------- | ---------------------------------- | | go | cel.dev/expr | v0.25.1 | v0.25.3 | | go | cloud.google.com/go/auth | v0.23.0 | v0.23.2 | | go | codeberg.org/chavacava/garif | v0.2.0 | v0.2.1 | | go | github.com/4meepo/tagalign | v1.4.3 | v1.4.4 | | go | github.com/andybalholm/brotli | v1.2.2 | v1.2.4 | | go | github.com/antchfx/xpath | v1.3.6 | v1.3.8 | | go | github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding | v1.13.15 | v1.13.19 | | go | github.com/bitfield/gotestdox | v0.2.2 | v0.2.3 | | go | github.com/bytedance/gopkg | v0.1.3 | v0.1.4 | | go | github.com/bytedance/sonic | v1.15.1 | v1.15.4 | | go | github.com/bytedance/sonic/loader | v0.5.1 | v0.5.2 | | go | github.com/charmbracelet/ultraviolet | v0.0.0-20260811164956-006e29f97886 | v0.0.0-20260910203606-6c9e17dc7a16 | | go | github.com/cloudwego/base64x | v0.1.6 | v0.1.7 | | go | github.com/elastic/lunes | v0.2.0 | v0.2.2 | | go | github.com/foxboron/go-tpm-keyfiles | v0.0.0-20251226215517-609e4778396f | v0.0.0-20260902202739-8c9c2d1005f4 | | go | github.com/fxamacker/cbor/v2 | v2.9.0 | v2.9.3 | | go | github.com/go-jose/go-jose/v4 | v4.1.4 | v4.1.5 | | go | github.com/go-logr/logr | v1.4.3 | v1.4.4 | | go | github.com/go-openapi/analysis | v0.26.1 | v0.26.2 | | go | github.com/go-openapi/jsonpointer | v1.0.0 | v1.0.1 | | go | github.com/go-openapi/jsonreference | v1.0.0 | v1.0.2 | | go | github.com/go-openapi/loads | v0.25.1 | v0.25.3 | | go | github.com/go-openapi/spec | v0.22.10 | v0.22.11 | | go | github.com/go-openapi/strfmt | v0.27.0 | v0.27.2 | | go | github.com/go-openapi/swag | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/cmdutils | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/conv | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/fileutils | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/jsonutils | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/loading | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/mangling | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/netutils | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/pools | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/stringutils | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/typeutils | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/swag/yamlutils | v0.29.1 | v0.29.2 | | go | github.com/go-openapi/validate | v0.26.0 | v0.26.5 | | go | github.com/godoc-lint/godoc-lint | v0.11.2 | v0.11.4 | | go | github.com/gofrs/flock | v0.13.0 | v0.13.1 | | go | github.com/golangci/rowserrcheck | v0.0.0-20260419091836-c5f79b8a11ba | v0.0.0-20260901154044-241134db7241 | | go | github.com/google/jsonschema-go | v0.4.2 | v0.4.3 | | go | github.com/googleapis/enterprise-certificate-proxy | v0.3.17 | v0.3.22 | | go | github.com/grafana/pyroscope-go/godeltaprof | v0.1.9 | v0.1.12 | | go | github.com/hashicorp/consul/api | v1.34.4 | v1.34.5 | | go | github.com/knadh/koanf/maps | v0.1.2 | v0.1.3 | | go | github.com/knadh/koanf/providers/confmap | v1.0.0 | v1.0.1 | | go | github.com/knadh/koanf/v2 | v2.3.4 | v2.3.6 | | go | github.com/lufia/plan9stats | v0.0.0-20251013123823-9fd1530e3ec3 | v0.0.0-20260802145828-341c2f0c90b5 | | go | github.com/mattn/go-isatty | v0.0.20 | v0.0.24 | | go | github.com/mattn/go-isatty | v0.0.22 | v0.0.24 | | go | github.com/mattn/go-runewidth | v0.0.24 | v0.0.30 | | go | github.com/mattn/go-runewidth | v0.0.23 | v0.0.30 | | go | github.com/matttproud/golang_protobuf_extensions | v1.0.1 | v1.0.4 | | go | github.com/miekg/dns | v1.1.72 | v1.1.73 | | go | github.com/olekukonko/ll | v0.1.6 | v0.1.8 | | go | github.com/opentracing-contrib/go-grpc | v0.1.2 | v0.1.4 | | go | github.com/pb33f/jsonpath | v0.8.2 | v0.8.3 | | go | github.com/pierrec/lz4/v4 | v4.1.26 | v4.1.29 | | go | github.com/power-devops/perfstat | v0.0.0-20240221224432-82ca36839d55 | v0.0.0-20260805114148-88456608a4f6 | | go | github.com/prometheus/client_model | v0.6.2 | v0.6.3 | | go | github.com/raeperd/recvcheck | v0.3.0 | v0.3.1 | | go | github.com/santhosh-tekuri/jsonschema/v6 | v6.0.2 | v6.0.3 | | go | github.com/shirou/gopsutil/v4 | v4.26.4 | v4.26.8 | | go | github.com/sirupsen/logrus | v1.10.1 | v1.10.2 | | go | github.com/stretchr/objx | v0.5.2 | v0.5.3 | | go | github.com/timakin/bodyclose | v0.0.0-20260129054331-73d1f95b84b4 | v0.0.0-20260723120731-857993a2939c | | go | github.com/tinylib/msgp | v1.6.1 | v1.6.4 | | go | github.com/twmb/franz-go | v1.21.2 | v1.21.6 | | go | github.com/ua-parser/uap-go | v0.0.0-20251207011819-db9adb27a0b8 | v0.0.0-20260529044130-17c35e68e58c | | go | github.com/yuin/gopher-lua | v1.1.1 | v1.1.2 | | go | go.augendre.info/fatcontext | v0.10.0 | v0.10.1 | | go | go.yaml.in/yaml/v2 | v2.4.2 | v2.4.4 | | go | golang.org/x/exp | v0.0.0-20260312153236-7ab1446f8b90 | v0.0.0-20260908205506-85c1c2202aba | | go | golang.org/x/exp/typeparams | v0.0.0-20260811152304-ee035b5b010f | v0.0.0-20260908205506-85c1c2202aba | | go | golang.org/x/telemetry | v0.0.0-20260811182544-a038080d80e5 | v0.0.0-20260910141331-15ceca2b0a1f | | go | google.golang.org/genproto | v0.0.0-20260519071638-aa98bba5eb94 | v0.0.0-20260911204522-f61a6ca850bd | | go | google.golang.org/genproto/googleapis/api | v0.0.0-20260630182238-925bb5da69e7 | v0.0.0-20260911204522-f61a6ca850bd | | go | google.golang.org/genproto/googleapis/rpc | v0.0.0-20260630182238-925bb5da69e7 | v0.0.0-20260911204522-f61a6ca850bd | | go | google.golang.org/protobuf | v1.36.11 | v1.36.12 | | go | google.golang.org/protobuf | v1.36.12-0.20260120151049-f2248ac996af | v1.36.12 | | go | gopkg.in/ini.v1 | v1.67.0 | v1.67.3 | | go | gopkg.in/ini.v1 | v1.67.2 | v1.67.3 | | go | sigs.k8s.io/json | v0.0.0-20250730193827-2d320260d730 | v0.0.0-20260909141634-11ed52e25bc5 | | go | sigs.k8s.io/structured-merge-diff/v6 | v6.4.1 | v6.4.2 | Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> --- go.mod | 160 +- go.sum | 332 +- tools/go.mod | 46 +- tools/go.sum | 103 +- vendor/cel.dev/expr/README.md | 2 +- vendor/cloud.google.com/go/auth/CHANGES.md | 14 + .../go/auth/credentials/idtoken/cache.go | 139 + .../go/auth/credentials/idtoken/compute.go | 89 + .../go/auth/credentials/idtoken/file.go | 225 + .../go/auth/credentials/idtoken/idtoken.go | 272 + .../go/auth/credentials/idtoken/validate.go | 314 + .../go/auth/credentials/impersonate/doc.go | 45 + .../auth/credentials/impersonate/idtoken.go | 141 + .../credentials/impersonate/impersonate.go | 284 + .../go/auth/credentials/impersonate/user.go | 203 + .../go/auth/internal/version.go | 2 +- .../detectors/gcp/detector.go | 3 + .../detectors/gcp/faas.go | 32 +- .../github.com/andybalholm/brotli/.gitignore | 1 + .../andybalholm/brotli/flate/LICENSE | 27 - .../andybalholm/brotli/flate/README.md | 2 - .../andybalholm/brotli/flate/gzip.go | 65 - .../brotli/flate/huffman_bit_writer.go | 517 - .../andybalholm/brotli/flate/huffman_code.go | 346 - .../andybalholm/brotli/flate/token.go | 80 - .../andybalholm/brotli/flate/writer.go | 66 - vendor/github.com/andybalholm/brotli/http.go | 11 +- .../andybalholm/brotli/matchfinder/zdfast.go | 6 +- .../andybalholm/brotli/matchfinder/zfast.go | 6 +- vendor/github.com/antchfx/xpath/build.go | 13 + vendor/github.com/antchfx/xpath/func.go | 68 +- vendor/github.com/antchfx/xpath/func_go110.go | 9 +- .../antchfx/xpath/func_pre_go110.go | 15 +- vendor/github.com/antchfx/xpath/operator.go | 43 +- vendor/github.com/antchfx/xpath/parse.go | 6 +- vendor/github.com/antchfx/xpath/query.go | 14 +- .../internal/accept-encoding/CHANGELOG.md | 16 + .../accept-encoding/go_module_metadata.go | 2 +- vendor/github.com/aws/smithy-go/CHANGELOG.md | 59 + .../aws/smithy-go/go_module_metadata.go | 2 +- vendor/github.com/aws/smithy-go/schema.go | 36 +- vendor/github.com/aws/smithy-go/schema_ext.go | 11 +- .../smithy-go/transport/http/eventstream.go | 12 +- .../http/middleware_close_response_body.go | 29 + .../http/middleware_content_length.go | 3 + .../aws/smithy-go/transport/http/request.go | 9 + .../bytedance/gopkg/lang/dirtmake/bytes.go | 7 + .../gopkg/lang/dirtmake/bytes_tinygo.go | 24 + vendor/github.com/bytedance/sonic/AGENTS.md | 33 + vendor/github.com/bytedance/sonic/README.md | 2 +- .../bytedance/sonic/README_ZH_CN.md | 2 +- vendor/github.com/bytedance/sonic/ast/api.go | 4 +- .../bytedance/sonic/ast/api_compat.go | 4 +- .../github.com/bytedance/sonic/ast/search.go | 2 +- vendor/github.com/bytedance/sonic/compat.go | 4 +- .../bytedance/sonic/decoder/decoder_compat.go | 4 +- .../bytedance/sonic/decoder/decoder_native.go | 4 +- .../bytedance/sonic/encoder/encoder_compat.go | 7 +- .../bytedance/sonic/encoder/encoder_native.go | 4 +- vendor/github.com/bytedance/sonic/go.work | 1 + .../bytedance/sonic/internal/compat/warn.go | 9 +- .../internal/decoder/api/decoder_amd64.go | 4 +- .../internal/decoder/api/decoder_arm64.go | 4 +- .../decoder/jitdec/asm_stubs_amd64_go121.go | 4 +- .../decoder/jitdec/assembler_regabi_amd64.go | 10 +- .../decoder/jitdec/generic_regabi_amd64.go | 4 +- .../sonic/internal/encoder/alg/spec.go | 4 +- .../sonic/internal/encoder/alg/spec_compat.go | 4 +- .../encoder/x86/asm_stubs_amd64_go121.go | 4 +- .../encoder/x86/assembler_export_amd64.go | 4 +- .../encoder/x86/assembler_regabi_amd64.go | 4 +- .../sonic/internal/encoder/x86/debug_go117.go | 4 +- .../sonic/internal/rt/base64_amd64.go | 4 +- .../sonic/internal/rt/base64_compat.go | 4 +- .../bytedance/sonic/internal/rt/gcwb.go | 4 +- .../internal/rt/{map_go124.go => map.go} | 8 +- .../bytedance/sonic/internal/rt/map_go126.go | 15 - .../bytedance/sonic/internal/rt/map_legacy.go | 26 - .../internal/rt/maptype_indirectelem_go126.go | 24 - .../rt/maptype_indirectelem_legacy.go | 8 - .../bytedance/sonic/internal/rt/stubs.go | 6 +- .../bytedance/sonic/loader/funcdata_compat.go | 4 +- .../bytedance/sonic/loader/funcdata_go127.go | 130 + .../bytedance/sonic/loader/moduledata.go | 4 +- vendor/github.com/bytedance/sonic/sonic.go | 4 +- .../bytedance/sonic/unquote/unquote.go | 4 +- .../sonic/unquote/unquote_fallback.go | 4 +- .../github.com/bytedance/sonic/utf8/utf8.go | 4 +- .../bytedance/sonic/utf8/utf8_fallback.go | 4 +- .../github.com/cloudwego/base64x/_typos.toml | 12 + .../github.com/cloudwego/base64x/base64x.go | 102 +- .../cloudwego/base64x/base64x_fallback.go | 83 + .../cloudwego/base64x/base64x_native.go | 38 + .../cloudwego/base64x/base64x_subr_amd64.go | 24 +- .../base64x/base64x_subr_native_amd64.go | 27 + .../github.com/cloudwego/base64x/faststr.go | 25 +- .../base64x/internal/native/avx2/b64decode.go | 10 +- .../internal/native/avx2/b64decode_subr.go | 50 +- .../native/avx2/b64decode_text_amd64.go | 17 +- .../base64x/internal/native/avx2/b64encode.go | 9 +- .../internal/native/avx2/b64encode_subr.go | 42 +- .../native/avx2/b64encode_text_amd64.go | 17 +- .../internal/native/avx2/native_export.go | 10 +- .../base64x/internal/native/b64decode.tmpl | 4 +- .../base64x/internal/native/b64encode.tmpl | 3 + .../base64x/internal/native/dispatch.go | 29 +- .../internal/native/native_export.tmpl | 4 +- .../base64x/internal/native/sse/b64decode.go | 10 +- .../internal/native/sse/b64decode_subr.go | 50 +- .../native/sse/b64decode_text_amd64.go | 15 +- .../base64x/internal/native/sse/b64encode.go | 9 +- .../internal/native/sse/b64encode_subr.go | 38 +- .../native/sse/b64encode_text_amd64.go | 15 +- .../internal/native/sse/native_export.go | 10 +- .../cloudwego/base64x/internal/rt/asm_amd64.s | 14 + .../cloudwego/base64x/internal/rt/asm_arm64.s | 14 + .../cloudwego/base64x/internal/rt/fastmem.go | 8 +- vendor/github.com/ebitengine/purego/func.go | 9 +- .../internal/fakecgo/zsymbols_freebsd.go | 20 +- .../ebitengine/purego/syscall_sysv.go | 5 +- vendor/github.com/elastic/lunes/CHANGELOG.md | 5 + vendor/github.com/elastic/lunes/NOTICE.txt | 2 +- vendor/github.com/elastic/lunes/README.md | 2 +- .../elastic/lunes/catalog-info.yaml | 43 - vendor/github.com/elastic/lunes/lunes.go | 98 +- .../v3/upstream_http_11_connect.pb.go | 162 + .../upstream_http_11_connect.pb.validate.go | 198 + .../v3/upstream_http_11_connect_vtproto.pb.go | 127 + .../foxboron/go-tpm-keyfiles/der.go | 3 +- .../foxboron/go-tpm-keyfiles/importablekey.go | 167 +- .../foxboron/go-tpm-keyfiles/keyfile.go | 11 +- .../foxboron/go-tpm-keyfiles/signer.go | 16 +- .../go-tpm-keyfiles/template/template.go | 123 +- .../foxboron/go-tpm-keyfiles/tpm.go | 194 +- .../fxamacker/cbor/v2/.golangci.yml | 176 +- vendor/github.com/fxamacker/cbor/v2/README.md | 29 +- vendor/github.com/fxamacker/cbor/v2/cache.go | 257 +- vendor/github.com/fxamacker/cbor/v2/decode.go | 444 +- .../fxamacker/cbor/v2/decode_map_utils.go | 98 + .../github.com/fxamacker/cbor/v2/diagnose.go | 25 +- vendor/github.com/fxamacker/cbor/v2/doc.go | 20 +- vendor/github.com/fxamacker/cbor/v2/encode.go | 55 +- .../fxamacker/cbor/v2/simplevalue.go | 2 +- vendor/github.com/fxamacker/cbor/v2/stream.go | 177 +- .../fxamacker/cbor/v2/structfields.go | 65 +- vendor/github.com/fxamacker/cbor/v2/tag.go | 5 + vendor/github.com/fxamacker/cbor/v2/valid.go | 20 +- .../go-jose/go-jose/v4/asymmetric.go | 26 +- .../go-jose/go-jose/v4/cipher/cbc_hmac.go | 6 +- .../github.com/go-jose/go-jose/v4/crypter.go | 86 +- .../go-jose/go-jose/v4/json/scanner.go | 19 +- vendor/github.com/go-jose/go-jose/v4/jwe.go | 8 + vendor/github.com/go-jose/go-jose/v4/jwk.go | 213 +- vendor/github.com/go-jose/go-jose/v4/jws.go | 15 +- .../github.com/go-jose/go-jose/v4/opaque.go | 5 + .../github.com/go-jose/go-jose/v4/shared.go | 6 + .../github.com/go-jose/go-jose/v4/signing.go | 111 +- .../go-jose/go-jose/v4/symmetric.go | 10 +- .../github.com/go-logr/logr/context_noslog.go | 1 - .../github.com/go-logr/logr/context_slog.go | 1 - vendor/github.com/go-logr/logr/funcr/funcr.go | 47 +- .../github.com/go-logr/logr/funcr/slogsink.go | 22 +- vendor/github.com/go-logr/logr/sloghandler.go | 1 - vendor/github.com/go-logr/logr/slogr.go | 1 - vendor/github.com/go-logr/logr/slogsink.go | 1 - .../go-openapi/analysis/CONTRIBUTORS.md | 33 +- vendor/github.com/go-openapi/analysis/go.work | 2 +- .../go-openapi/jsonpointer/CONTRIBUTORS.md | 4 +- .../go-openapi/jsonpointer/README.md | 4 +- .../go-openapi/jsonpointer/pointer.go | 2 +- .../go-openapi/jsonreference/.golangci.yml | 4 + .../go-openapi/jsonreference/CONTRIBUTORS.md | 4 +- .../go-openapi/jsonreference/README.md | 4 +- .../jsonreference/internal/normalize_url.go | 77 +- .../github.com/go-openapi/loads/.golangci.yml | 2 + .../go-openapi/loads/CONTRIBUTORS.md | 4 +- vendor/github.com/go-openapi/loads/README.md | 4 +- vendor/github.com/go-openapi/loads/spec.go | 21 +- .../go-openapi/spec/CONTRIBUTORS.md | 5 +- vendor/github.com/go-openapi/spec/expander.go | 2 +- vendor/github.com/go-openapi/spec/gob.go | 230 + .../github.com/go-openapi/spec/normalizer.go | 44 +- .../go-openapi/strfmt/.golangci.yml | 1 + .../go-openapi/strfmt/CONTRIBUTORS.md | 4 +- vendor/github.com/go-openapi/strfmt/README.md | 4 +- .../github.com/go-openapi/strfmt/default.go | 3 +- vendor/github.com/go-openapi/strfmt/format.go | 6 +- vendor/github.com/go-openapi/strfmt/go.work | 2 +- .../github.com/go-openapi/swag/.golangci.yml | 1 + .../go-openapi/swag/CONTRIBUTORS.md | 4 +- vendor/github.com/go-openapi/swag/README.md | 4 +- vendor/github.com/go-openapi/swag/go.work | 2 +- .../go-openapi/swag/yamlutils/yaml.go | 2 +- .../github.com/go-openapi/validate/.gitignore | 1 + .../go-openapi/validate/.golangci.yml | 3 + .../go-openapi/validate/BENCHMARK.md | 34 - .../go-openapi/validate/CONTRIBUTORS.md | 5 +- .../github.com/go-openapi/validate/README.md | 4 +- .../go-openapi/validate/collection_format.go | 131 + .../go-openapi/validate/default_validator.go | 146 +- .../go-openapi/validate/discriminator.go | 156 + vendor/github.com/go-openapi/validate/doc.go | 17 +- .../go-openapi/validate/example_validator.go | 131 +- .../github.com/go-openapi/validate/formats.go | 22 +- .../github.com/go-openapi/validate/helpers.go | 147 +- .../go-openapi/validate/object_validator.go | 100 +- .../go-openapi/validate/param_locations.go | 122 + vendor/github.com/go-openapi/validate/path.go | 269 + .../github.com/go-openapi/validate/pools.go | 420 +- .../go-openapi/validate/pools_debug.go | 1015 - .../go-openapi/validate/ref_locations.go | 49 + .../go-openapi/validate/ref_redirects.go | 71 + .../go-openapi/validate/required_walk.go | 179 + .../go-openapi/validate/resolvable.go | 70 + .../github.com/go-openapi/validate/result.go | 254 +- .../github.com/go-openapi/validate/schema.go | 98 +- .../go-openapi/validate/schema_option.go | 46 + .../go-openapi/validate/schema_props.go | 60 +- .../validate/security_requirements.go | 99 + .../go-openapi/validate/slice_validator.go | 43 +- .../github.com/go-openapi/validate/sorted.go | 39 + vendor/github.com/go-openapi/validate/spec.go | 397 +- .../go-openapi/validate/spec_messages.go | 60 + .../go-openapi/validate/spec_ref_warnings.go | 6 +- vendor/github.com/go-openapi/validate/type.go | 22 +- .../go-openapi/validate/update-fixtures.sh | 17 - .../go-openapi/validate/validator.go | 201 +- .../google/go-tpm/tpm2/structures.go | 4 +- vendor/github.com/google/go-tpm/tpm2/tpm2.go | 4 +- .../google/jsonschema-go/jsonschema/infer.go | 5 +- .../jsonschema-go/jsonschema/validate.go | 11 +- .../grafana/pyroscope-go/godeltaprof/block.go | 24 +- .../grafana/pyroscope-go/godeltaprof/heap.go | 23 +- .../godeltaprof/http/pprof/pprof_go21.go | 7 - .../godeltaprof/http/pprof/pprof_go22.go | 2 - .../godeltaprof/internal/pprof/delta_heap.go | 24 +- .../godeltaprof/internal/pprof/delta_mutex.go | 10 +- .../godeltaprof/internal/pprof/elf.go | 2 +- .../internal/pprof/mutex_scale_go19.go | 27 - .../internal/pprof/mutex_scale_go20.go | 3 - .../godeltaprof/internal/pprof/proto.go | 5 +- .../internal/pprof/runtime_profile_go123.go | 77 + .../internal/pprof/runtime_profile_go127.go | 72 + .../godeltaprof/internal/pprof/stub_go20.go | 25 - .../godeltaprof/internal/pprof/stub_go22.go | 27 - .../godeltaprof/internal/pprof/stub_go23.go | 3 - .../grafana/pyroscope-go/godeltaprof/proto.go | 5 +- .../github.com/hashicorp/consul/api/agent.go | 80 + .../hashicorp/consul/api/config_entry.go | 6 + .../consul/api/config_entry_gateways.go | 26 +- .../consul/api/config_entry_routes.go | 7 +- .../consul/api/operator_feature_gate.go | 104 + vendor/github.com/knadh/koanf/maps/maps.go | 127 +- .../knadh/koanf/providers/confmap/confmap.go | 14 +- vendor/github.com/knadh/koanf/v2/getters.go | 2 +- vendor/github.com/knadh/koanf/v2/go.work | 3 - vendor/github.com/knadh/koanf/v2/go.work.sum | 90 +- vendor/github.com/knadh/koanf/v2/koanf.go | 39 +- .../mattn/go-isatty/isatty_others.go | 4 +- ...{isatty_tcgets.go => isatty_tiocgwinsz.go} | 6 +- .../github.com/mattn/go-runewidth/SECURITY.md | 25 + .../mattn/go-runewidth/runewidth.go | 670 +- .../mattn/go-runewidth/runewidth_posix.go | 62 +- .../mattn/go-runewidth/runewidth_table.go | 255 +- vendor/github.com/miekg/dns/README.md | 11 +- vendor/github.com/miekg/dns/dnssec.go | 50 +- vendor/github.com/miekg/dns/tools.go | 10 - vendor/github.com/miekg/dns/version.go | 2 +- vendor/github.com/miekg/dns/zmsg.go | 2 +- vendor/github.com/olekukonko/ll/comb.hcl | 11 +- .../github.com/olekukonko/ll/conditional.go | 70 +- vendor/github.com/olekukonko/ll/field.go | 210 +- vendor/github.com/olekukonko/ll/global.go | 20 +- .../github.com/olekukonko/ll/lh/buffered.go | 242 +- .../github.com/olekukonko/ll/lh/colorized.go | 396 +- .../olekukonko/ll/lh/colorized_unix.go | 10 + .../olekukonko/ll/lh/colorized_windows.go | 47 + vendor/github.com/olekukonko/ll/lh/dedup.go | 197 +- vendor/github.com/olekukonko/ll/lh/json.go | 122 +- vendor/github.com/olekukonko/ll/lh/lh.go | 90 +- vendor/github.com/olekukonko/ll/lh/pipe.go | 2 +- vendor/github.com/olekukonko/ll/lh/rotate.go | 99 +- vendor/github.com/olekukonko/ll/lh/text.go | 3 +- vendor/github.com/olekukonko/ll/ll.go | 377 +- .../github.com/olekukonko/ll/lx/interface.go | 5 + vendor/github.com/olekukonko/ll/lx/lx.go | 9 + .../github.com/olekukonko/ll/lx/namespace.go | 37 +- vendor/github.com/olekukonko/ll/lx/types.go | 35 +- vendor/github.com/olekukonko/ll/middleware.go | 6 +- vendor/github.com/olekukonko/ll/options.go | 6 +- vendor/github.com/olekukonko/ll/writer.go | 53 + .../opentracing-contrib/go-grpc/client.go | 21 +- .../jsonpath/pkg/jsonpath/config/config.go | 36 + .../jsonpath/pkg/jsonpath/context_usage.go | 21 +- .../pb33f/jsonpath/pkg/jsonpath/filter.go | 662 +- .../pb33f/jsonpath/pkg/jsonpath/jsonpath.go | 91 +- .../pb33f/jsonpath/pkg/jsonpath/parser.go | 1417 +- .../pb33f/jsonpath/pkg/jsonpath/segment.go | 218 +- .../pb33f/jsonpath/pkg/jsonpath/selector.go | 4 +- .../jsonpath/pkg/jsonpath/spectral_eval.go | 529 + .../jsonpath/pkg/jsonpath/spectral_expr.go | 659 + .../jsonpath/pkg/jsonpath/token/token.go | 1529 +- .../pb33f/jsonpath/pkg/jsonpath/yaml_query.go | 1046 +- .../lz4/v4/internal/lz4block/decode_arm64.s | 352 +- .../lz4/v4/internal/xxh32/xxh32zero.go | 5 +- .../lz4/v4/internal/xxh32/xxh32zero_arm64.go | 12 + .../lz4/v4/internal/xxh32/xxh32zero_arm64.s | 160 + .../lz4/v4/internal/xxh32/xxh32zero_other.go | 3 +- vendor/github.com/pierrec/lz4/v4/writer.go | 1 + .../power-devops/perfstat/c_helpers.c | 13 + .../power-devops/perfstat/c_helpers.h | 1 + .../power-devops/perfstat/cpustat.go | 4 +- .../power-devops/perfstat/diskstat.go | 16 +- .../power-devops/perfstat/fsstat.go | 1 + .../power-devops/perfstat/lvmstat.go | 8 +- .../power-devops/perfstat/memstat.go | 4 +- .../power-devops/perfstat/netstat.go | 12 +- .../power-devops/perfstat/procstat.go | 8 +- .../jsonschema/v6/.golangci.yml | 1 - .../santhosh-tekuri/jsonschema/v6/.swp | Bin 20480 -> 0 bytes .../santhosh-tekuri/jsonschema/v6/format.go | 2 +- .../santhosh-tekuri/jsonschema/v6/go.work.sum | 2 +- .../jsonschema/v6/kind/kind.go | 2 +- .../jsonschema/v6/objcompiler.go | 6 +- .../santhosh-tekuri/jsonschema/v6/schema.go | 31 +- .../santhosh-tekuri/jsonschema/v6/util.go | 3 + .../jsonschema/v6/validator.go | 6 +- .../santhosh-tekuri/jsonschema/v6/vocab.go | 4 + .../shirou/gopsutil/v4/cpu/cpu_darwin.go | 4 +- .../shirou/gopsutil/v4/cpu/cpu_freebsd.go | 3 + .../shirou/gopsutil/v4/cpu/cpu_netbsd.go | 6 + .../shirou/gopsutil/v4/cpu/cpu_openbsd.go | 6 + .../shirou/gopsutil/v4/cpu/cpu_windows.go | 145 +- .../v4/internal/common/common_darwin.go | 133 +- .../v4/internal/common/common_windows.go | 2 +- .../shirou/gopsutil/v4/mem/mem_darwin.go | 2 +- .../shirou/gopsutil/v4/mem/mem_linux.go | 4 +- .../shirou/gopsutil/v4/mem/mem_openbsd_386.go | 7 +- .../gopsutil/v4/mem/mem_openbsd_amd64.go | 4 +- .../shirou/gopsutil/v4/mem/mem_openbsd_arm.go | 7 +- .../gopsutil/v4/mem/mem_openbsd_arm64.go | 7 +- .../gopsutil/v4/mem/mem_openbsd_riscv64.go | 7 +- .../github.com/shirou/gopsutil/v4/net/net.go | 17 +- .../shirou/gopsutil/v4/net/net_darwin.go | 68 +- .../shirou/gopsutil/v4/net/net_linux.go | 6 +- .../shirou/gopsutil/v4/net/net_windows.go | 16 +- .../shirou/gopsutil/v4/process/process.go | 10 +- .../gopsutil/v4/process/process_darwin.go | 173 +- .../gopsutil/v4/process/process_linux.go | 18 + .../gopsutil/v4/process/process_openbsd.go | 16 +- .../gopsutil/v4/process/process_windows.go | 140 +- .../v2/bundle/spiffebundle/bundle.go | 119 +- .../go-spiffe/v2/bundle/spiffebundle/set.go | 15 + .../v2/exp/bundle/witbundle/bundle.go | 208 + .../go-spiffe/v2/exp/bundle/witbundle/set.go | 106 + .../v2/exp/bundle/witbundle/source.go | 10 + vendor/github.com/stretchr/objx/README.md | 49 +- vendor/github.com/tinylib/msgp/msgp/json.go | 28 +- .../tinylib/msgp/msgp/json_bytes.go | 21 + vendor/github.com/tinylib/msgp/msgp/read.go | 60 + .../franz-go/pkg/kgo/atomic_maybe_work.go | 12 + .../twmb/franz-go/pkg/kgo/broker.go | 431 +- .../twmb/franz-go/pkg/kgo/client.go | 403 +- .../twmb/franz-go/pkg/kgo/compression.go | 72 +- .../twmb/franz-go/pkg/kgo/config.go | 109 +- .../twmb/franz-go/pkg/kgo/consumer.go | 188 +- .../twmb/franz-go/pkg/kgo/consumer_group.go | 531 +- .../franz-go/pkg/kgo/consumer_group_848.go | 196 +- .../twmb/franz-go/pkg/kgo/consumer_share.go | 310 +- .../twmb/franz-go/pkg/kgo/errors.go | 45 +- .../twmb/franz-go/pkg/kgo/group_balancer.go | 90 +- .../github.com/twmb/franz-go/pkg/kgo/hooks.go | 16 +- .../franz-go/pkg/kgo/internal/sticky/graph.go | 7 +- .../pkg/kgo/internal/sticky/sticky.go | 38 +- .../twmb/franz-go/pkg/kgo/logger.go | 16 +- .../twmb/franz-go/pkg/kgo/metadata.go | 142 +- .../twmb/franz-go/pkg/kgo/metrics_714.go | 135 +- .../twmb/franz-go/pkg/kgo/partitioner.go | 51 +- .../github.com/twmb/franz-go/pkg/kgo/pools.go | 21 +- .../twmb/franz-go/pkg/kgo/producer.go | 320 +- .../twmb/franz-go/pkg/kgo/record_and_fetch.go | 13 +- .../twmb/franz-go/pkg/kgo/record_formatter.go | 72 +- .../github.com/twmb/franz-go/pkg/kgo/ring.go | 34 +- .../github.com/twmb/franz-go/pkg/kgo/sink.go | 245 +- .../twmb/franz-go/pkg/kgo/source.go | 410 +- .../franz-go/pkg/kgo/topics_and_partitions.go | 95 +- .../github.com/twmb/franz-go/pkg/kgo/txn.go | 372 +- .../twmb/franz-go/pkg/sasl/scram/scram.go | 7 +- .../ua-parser/uap-go/uaparser/parser.go | 9 +- vendor/github.com/yuin/gopher-lua/README.md | 833 + vendor/github.com/yuin/gopher-lua/README.rst | 890 - vendor/github.com/yuin/gopher-lua/compile.go | 13 +- vendor/github.com/yuin/gopher-lua/iolib.go | 13 +- vendor/github.com/yuin/gopher-lua/oslib.go | 3 +- vendor/github.com/yuin/gopher-lua/pm/pm.go | 19 +- .../contrib/detectors/gcp/cloud-function.go | 2 +- .../contrib/detectors/gcp/cloud-run.go | 2 +- .../contrib/detectors/gcp/detector.go | 2 +- .../contrib/detectors/gcp/gce.go | 2 +- .../contrib/detectors/gcp/gke.go | 2 +- .../contrib/detectors/gcp/version.go | 2 +- vendor/golang.org/x/mod/LICENSE | 27 - vendor/golang.org/x/mod/PATENTS | 22 - vendor/golang.org/x/mod/semver/semver.go | 407 - vendor/golang.org/x/net/html/escape.go | 5 +- vendor/golang.org/x/net/http2/ascii.go | 14 +- vendor/golang.org/x/net/http2/databuffer.go | 5 +- vendor/golang.org/x/net/http2/h2c/h2c.go | 5 + .../golang.org/x/net/http2/server_common.go | 47 + vendor/golang.org/x/net/http2/transport.go | 2 + .../x/net/http2/transport_common.go | 79 +- .../golang.org/x/net/http2/transport_wrap.go | 2 + .../x/net/internal/httpcommon/README.md | 7 + .../x/net/internal/httpcommon/request.go | 34 +- vendor/golang.org/x/net/trace/histogram.go | 5 +- .../golang.org/x/sync/semaphore/semaphore.go | 9 +- vendor/golang.org/x/sys/cpu/cpu.go | 21 +- vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go | 11 + .../golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 4 + .../golang.org/x/sys/cpu/cpu_linux_riscv64.go | 11 + .../golang.org/x/sys/cpu/cpu_netbsd_amd64.go | 47 + vendor/golang.org/x/sys/cpu/cpu_other_x86.go | 2 +- vendor/golang.org/x/sys/cpu/cpu_riscv64.s | 17 + vendor/golang.org/x/sys/cpu/cpu_sparc64.go | 12 + vendor/golang.org/x/sys/unix/ifreq_linux.go | 8 +- vendor/golang.org/x/sys/unix/ioctl_linux.go | 7 + vendor/golang.org/x/sys/unix/mkerrors.sh | 9 +- vendor/golang.org/x/sys/unix/syscall.go | 2 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 2 +- vendor/golang.org/x/sys/unix/syscall_linux.go | 2 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 2 + .../x/sys/unix/zerrors_linux_386.go | 1 - .../x/sys/unix/zerrors_linux_amd64.go | 1 - .../x/sys/unix/zerrors_linux_arm.go | 1 - .../x/sys/unix/zerrors_linux_arm64.go | 1 - .../x/sys/unix/zerrors_linux_loong64.go | 1 - .../x/sys/unix/zerrors_linux_mips.go | 1 - .../x/sys/unix/zerrors_linux_mips64.go | 1 - .../x/sys/unix/zerrors_linux_mips64le.go | 1 - .../x/sys/unix/zerrors_linux_mipsle.go | 1 - .../x/sys/unix/zerrors_linux_ppc.go | 1 - .../x/sys/unix/zerrors_linux_ppc64.go | 1 - .../x/sys/unix/zerrors_linux_ppc64le.go | 1 - .../x/sys/unix/zerrors_linux_riscv64.go | 1 - .../x/sys/unix/zerrors_linux_s390x.go | 1 - .../x/sys/unix/zerrors_linux_sparc64.go | 35 +- vendor/golang.org/x/sys/unix/ztypes_linux.go | 86 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 32 +- .../x/sys/unix/ztypes_linux_amd64.go | 32 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 32 +- .../x/sys/unix/ztypes_linux_arm64.go | 32 +- .../x/sys/unix/ztypes_linux_loong64.go | 32 +- .../x/sys/unix/ztypes_linux_mips.go | 32 +- .../x/sys/unix/ztypes_linux_mips64.go | 32 +- .../x/sys/unix/ztypes_linux_mips64le.go | 32 +- .../x/sys/unix/ztypes_linux_mipsle.go | 32 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 32 +- .../x/sys/unix/ztypes_linux_ppc64.go | 32 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 32 +- .../x/sys/unix/ztypes_linux_riscv64.go | 32 +- .../x/sys/unix/ztypes_linux_s390x.go | 32 +- .../x/sys/unix/ztypes_linux_sparc64.go | 32 +- .../golang.org/x/sys/windows/types_windows.go | 1 + vendor/golang.org/x/term/terminal.go | 24 +- .../x/text/encoding/japanese/iso2022jp.go | 10 + vendor/golang.org/x/text/unicode/bidi/core.go | 5 +- .../x/text/unicode/norm/composition.go | 42 +- .../x/text/unicode/norm/forminfo.go | 24 +- .../x/text/unicode/norm/normalize.go | 5 +- .../x/text/unicode/norm/tables15.0.0.go | 1884 +- .../x/text/unicode/norm/tables17.0.0.go | 1924 +- .../x/text/unicode/norm/transform.go | 5 +- vendor/golang.org/x/tools/LICENSE | 27 - vendor/golang.org/x/tools/PATENTS | 22 - vendor/golang.org/x/tools/go/ast/edge/edge.go | 299 - .../x/tools/go/ast/inspector/cursor.go | 592 - .../x/tools/go/ast/inspector/inspector.go | 311 - .../x/tools/go/ast/inspector/iter.go | 113 - .../x/tools/go/ast/inspector/typeof.go | 227 - .../x/tools/go/ast/inspector/walk.go | 341 - .../x/tools/go/gcexportdata/gcexportdata.go | 236 - .../x/tools/go/gcexportdata/importer.go | 75 - vendor/golang.org/x/tools/go/packages/doc.go | 253 - .../x/tools/go/packages/external.go | 153 - .../golang.org/x/tools/go/packages/golist.go | 1126 - .../x/tools/go/packages/golist_overlay.go | 83 - .../x/tools/go/packages/loadmode_string.go | 56 - .../x/tools/go/packages/packages.go | 1605 -- .../golang.org/x/tools/go/packages/visit.go | 108 - .../x/tools/go/types/objectpath/objectpath.go | 952 - .../x/tools/internal/aliases/aliases.go | 18 - .../x/tools/internal/event/core/event.go | 95 - .../x/tools/internal/event/core/export.go | 67 - .../x/tools/internal/event/core/fast.go | 77 - .../golang.org/x/tools/internal/event/doc.go | 7 - .../x/tools/internal/event/event.go | 127 - .../x/tools/internal/event/keys/keys.go | 237 - .../x/tools/internal/event/keys/standard.go | 22 - .../x/tools/internal/event/keys/util.go | 21 - .../x/tools/internal/event/label/label.go | 203 - .../x/tools/internal/gcimporter/bimport.go | 89 - .../x/tools/internal/gcimporter/exportdata.go | 421 - .../x/tools/internal/gcimporter/gcimporter.go | 108 - .../x/tools/internal/gcimporter/iexport.go | 1605 -- .../x/tools/internal/gcimporter/iimport.go | 1122 - .../tools/internal/gcimporter/predeclared.go | 91 - .../x/tools/internal/gcimporter/support.go | 30 - .../x/tools/internal/gcimporter/ureader.go | 813 - .../x/tools/internal/gocommand/invoke.go | 567 - .../internal/gocommand/invoke_notunix.go | 13 - .../x/tools/internal/gocommand/invoke_unix.go | 13 - .../x/tools/internal/gocommand/vendor.go | 163 - .../x/tools/internal/gocommand/version.go | 75 - .../x/tools/internal/moremaps/maps.go | 116 - .../internal/packagesinternal/packages.go | 23 - .../x/tools/internal/pkgbits/codes.go | 77 - .../x/tools/internal/pkgbits/decoder.go | 519 - .../x/tools/internal/pkgbits/doc.go | 32 - .../x/tools/internal/pkgbits/encoder.go | 392 - .../x/tools/internal/pkgbits/flags.go | 9 - .../x/tools/internal/pkgbits/reloc.go | 42 - .../x/tools/internal/pkgbits/support.go | 17 - .../x/tools/internal/pkgbits/sync.go | 136 - .../internal/pkgbits/syncmarker_string.go | 92 - .../x/tools/internal/pkgbits/version.go | 102 - .../x/tools/internal/stdlib/deps.go | 550 - .../x/tools/internal/stdlib/import.go | 97 - .../x/tools/internal/stdlib/manifest.go | 18615 ---------------- .../x/tools/internal/stdlib/stdlib.go | 105 - .../internal/typesinternal/assignedaddress.go | 128 - .../internal/typesinternal/classify_call.go | 198 - .../x/tools/internal/typesinternal/element.go | 134 - .../tools/internal/typesinternal/errorcode.go | 1560 -- .../typesinternal/errorcode_string.go | 179 - .../x/tools/internal/typesinternal/fx.go | 88 - .../x/tools/internal/typesinternal/isnamed.go | 71 - .../tools/internal/typesinternal/qualifier.go | 54 - .../x/tools/internal/typesinternal/recv.go | 44 - .../x/tools/internal/typesinternal/toonew.go | 107 - .../x/tools/internal/typesinternal/types.go | 280 - .../x/tools/internal/typesinternal/varkind.go | 23 - .../internal/typesinternal/varkind_go124.go | 39 - .../tools/internal/typesinternal/zerovalue.go | 381 - .../x/tools/internal/versions/features.go | 49 - .../x/tools/internal/versions/gover.go | 172 - .../x/tools/internal/versions/types.go | 33 - .../x/tools/internal/versions/versions.go | 57 - vendor/google.golang.org/grpc/clientconn.go | 23 +- .../clientconn_disconnect_reason_noplan9.go | 48 + .../clientconn_disconnect_reason_plan9.go | 39 + .../credentials/alts/internal/conn/record.go | 3 + ...cp_service_account_identity_credentials.go | 278 + .../credentials/google/internal/internal.go | 35 + .../credentials/xds/handshake_info.go | 3 + .../grpc/internal/envconfig/envconfig.go | 12 +- .../grpc/internal/envconfig/xds.go | 7 +- .../internal/grpcsync/callback_serializer.go | 26 + .../grpc/internal/mem/buffer_pool.go | 14 + .../grpc/internal/resolver/config_selector.go | 78 +- .../grpc/internal/transport/client_stream.go | 5 +- .../grpc/internal/transport/handler_server.go | 2 +- .../grpc/internal/transport/http2_client.go | 6 +- .../grpc/internal/transport/http2_server.go | 2 +- .../grpc/internal/transport/transport.go | 112 +- .../xds/balancer/cdsbalancer/configbuilder.go | 19 + .../xds/balancer/clustermanager/picker.go | 11 +- .../internal/xds/httpfilter/fault/fault.go | 11 +- .../internal/xds/httpfilter/httpfilter.go | 30 +- .../grpc/internal/xds/httpfilter/rbac/rbac.go | 122 +- .../internal/xds/httpfilter/router/router.go | 4 +- .../internal/xds/resolver/serviceconfig.go | 13 +- .../internal/xds/resolver/xds_resolver.go | 19 +- .../internal/xds/server/listener_wrapper.go | 17 +- .../xds/xdsclient/xdsresource/matcher.go | 6 - .../xds/xdsclient/xdsresource/metadata.go | 46 +- .../xds/xdsclient/xdsresource/type_cds.go | 4 + .../xds/xdsclient/xdsresource/type_rds.go | 6 +- .../xdsclient/xdsresource/unmarshal_cds.go | 46 +- .../xdsclient/xdsresource/unmarshal_rds.go | 27 +- .../xdsclient/xdsresource/version/version.go | 19 +- .../xds/xdsdepmgr/xds_dependency_manager.go | 16 +- .../google.golang.org/grpc/mem/buffer_pool.go | 4 - vendor/google.golang.org/grpc/mem/buffers.go | 6 +- vendor/google.golang.org/grpc/stream.go | 35 +- vendor/google.golang.org/grpc/version.go | 2 +- .../grpc/xds/googledirectpath/googlec2p.go | 55 +- .../editiondefaults/editions_defaults.binpb | Bin 154 -> 191 bytes .../internal/encoding/defval/default.go | 8 +- .../protobuf/internal/genid/descriptor_gen.go | 5 + .../protobuf/internal/version/version.go | 4 +- .../reflect/protoreflect/source_gen.go | 2 + .../types/descriptorpb/descriptor.pb.go | 101 +- .../protobuf/types/known/anypb/any.pb.go | 160 +- .../types/known/fieldmaskpb/field_mask.pb.go | 34 +- .../types/known/structpb/struct.pb.go | 55 +- .../types/known/timestamppb/timestamp.pb.go | 6 +- vendor/gopkg.in/ini.v1/key.go | 49 +- vendor/modules.txt | 255 +- 598 files changed, 24964 insertions(+), 50895 deletions(-) create mode 100644 vendor/cloud.google.com/go/auth/credentials/idtoken/cache.go create mode 100644 vendor/cloud.google.com/go/auth/credentials/idtoken/compute.go create mode 100644 vendor/cloud.google.com/go/auth/credentials/idtoken/file.go create mode 100644 vendor/cloud.google.com/go/auth/credentials/idtoken/idtoken.go create mode 100644 vendor/cloud.google.com/go/auth/credentials/idtoken/validate.go create mode 100644 vendor/cloud.google.com/go/auth/credentials/impersonate/doc.go create mode 100644 vendor/cloud.google.com/go/auth/credentials/impersonate/idtoken.go create mode 100644 vendor/cloud.google.com/go/auth/credentials/impersonate/impersonate.go create mode 100644 vendor/cloud.google.com/go/auth/credentials/impersonate/user.go delete mode 100644 vendor/github.com/andybalholm/brotli/flate/LICENSE delete mode 100644 vendor/github.com/andybalholm/brotli/flate/README.md delete mode 100644 vendor/github.com/andybalholm/brotli/flate/gzip.go delete mode 100644 vendor/github.com/andybalholm/brotli/flate/huffman_bit_writer.go delete mode 100644 vendor/github.com/andybalholm/brotli/flate/huffman_code.go delete mode 100644 vendor/github.com/andybalholm/brotli/flate/token.go delete mode 100644 vendor/github.com/andybalholm/brotli/flate/writer.go create mode 100644 vendor/github.com/bytedance/gopkg/lang/dirtmake/bytes_tinygo.go create mode 100644 vendor/github.com/bytedance/sonic/AGENTS.md rename vendor/github.com/bytedance/sonic/internal/rt/{map_go124.go => map.go} (60%) delete mode 100644 vendor/github.com/bytedance/sonic/internal/rt/map_go126.go delete mode 100644 vendor/github.com/bytedance/sonic/internal/rt/map_legacy.go delete mode 100644 vendor/github.com/bytedance/sonic/internal/rt/maptype_indirectelem_go126.go delete mode 100644 vendor/github.com/bytedance/sonic/internal/rt/maptype_indirectelem_legacy.go create mode 100644 vendor/github.com/bytedance/sonic/loader/funcdata_go127.go create mode 100644 vendor/github.com/cloudwego/base64x/base64x_fallback.go create mode 100644 vendor/github.com/cloudwego/base64x/base64x_native.go create mode 100644 vendor/github.com/cloudwego/base64x/base64x_subr_native_amd64.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.pb.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.pb.validate.go create mode 100644 vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect_vtproto.pb.go create mode 100644 vendor/github.com/fxamacker/cbor/v2/decode_map_utils.go create mode 100644 vendor/github.com/go-openapi/spec/gob.go delete mode 100644 vendor/github.com/go-openapi/validate/BENCHMARK.md create mode 100644 vendor/github.com/go-openapi/validate/collection_format.go create mode 100644 vendor/github.com/go-openapi/validate/discriminator.go create mode 100644 vendor/github.com/go-openapi/validate/param_locations.go create mode 100644 vendor/github.com/go-openapi/validate/path.go delete mode 100644 vendor/github.com/go-openapi/validate/pools_debug.go create mode 100644 vendor/github.com/go-openapi/validate/ref_locations.go create mode 100644 vendor/github.com/go-openapi/validate/ref_redirects.go create mode 100644 vendor/github.com/go-openapi/validate/required_walk.go create mode 100644 vendor/github.com/go-openapi/validate/resolvable.go create mode 100644 vendor/github.com/go-openapi/validate/security_requirements.go create mode 100644 vendor/github.com/go-openapi/validate/sorted.go delete mode 100644 vendor/github.com/go-openapi/validate/update-fixtures.sh delete mode 100644 vendor/github.com/grafana/pyroscope-go/godeltaprof/http/pprof/pprof_go21.go delete mode 100644 vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/mutex_scale_go19.go create mode 100644 vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/runtime_profile_go123.go create mode 100644 vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/runtime_profile_go127.go delete mode 100644 vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go20.go delete mode 100644 vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go22.go create mode 100644 vendor/github.com/hashicorp/consul/api/operator_feature_gate.go rename vendor/github.com/mattn/go-isatty/{isatty_tcgets.go => isatty_tiocgwinsz.go} (62%) create mode 100644 vendor/github.com/mattn/go-runewidth/SECURITY.md delete mode 100644 vendor/github.com/miekg/dns/tools.go create mode 100644 vendor/github.com/olekukonko/ll/lh/colorized_unix.go create mode 100644 vendor/github.com/olekukonko/ll/lh/colorized_windows.go create mode 100644 vendor/github.com/olekukonko/ll/writer.go create mode 100644 vendor/github.com/pb33f/jsonpath/pkg/jsonpath/spectral_eval.go create mode 100644 vendor/github.com/pb33f/jsonpath/pkg/jsonpath/spectral_expr.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm64.go create mode 100644 vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm64.s delete mode 100644 vendor/github.com/santhosh-tekuri/jsonschema/v6/.swp create mode 100644 vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/bundle.go create mode 100644 vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/set.go create mode 100644 vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/source.go create mode 100644 vendor/github.com/yuin/gopher-lua/README.md delete mode 100644 vendor/github.com/yuin/gopher-lua/README.rst delete mode 100644 vendor/golang.org/x/mod/LICENSE delete mode 100644 vendor/golang.org/x/mod/PATENTS delete mode 100644 vendor/golang.org/x/mod/semver/semver.go create mode 100644 vendor/golang.org/x/net/internal/httpcommon/README.md create mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_riscv64.s create mode 100644 vendor/golang.org/x/sys/cpu/cpu_sparc64.go delete mode 100644 vendor/golang.org/x/tools/LICENSE delete mode 100644 vendor/golang.org/x/tools/PATENTS delete mode 100644 vendor/golang.org/x/tools/go/ast/edge/edge.go delete mode 100644 vendor/golang.org/x/tools/go/ast/inspector/cursor.go delete mode 100644 vendor/golang.org/x/tools/go/ast/inspector/inspector.go delete mode 100644 vendor/golang.org/x/tools/go/ast/inspector/iter.go delete mode 100644 vendor/golang.org/x/tools/go/ast/inspector/typeof.go delete mode 100644 vendor/golang.org/x/tools/go/ast/inspector/walk.go delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/importer.go delete mode 100644 vendor/golang.org/x/tools/go/packages/doc.go delete mode 100644 vendor/golang.org/x/tools/go/packages/external.go delete mode 100644 vendor/golang.org/x/tools/go/packages/golist.go delete mode 100644 vendor/golang.org/x/tools/go/packages/golist_overlay.go delete mode 100644 vendor/golang.org/x/tools/go/packages/loadmode_string.go delete mode 100644 vendor/golang.org/x/tools/go/packages/packages.go delete mode 100644 vendor/golang.org/x/tools/go/packages/visit.go delete mode 100644 vendor/golang.org/x/tools/go/types/objectpath/objectpath.go delete mode 100644 vendor/golang.org/x/tools/internal/aliases/aliases.go delete mode 100644 vendor/golang.org/x/tools/internal/event/core/event.go delete mode 100644 vendor/golang.org/x/tools/internal/event/core/export.go delete mode 100644 vendor/golang.org/x/tools/internal/event/core/fast.go delete mode 100644 vendor/golang.org/x/tools/internal/event/doc.go delete mode 100644 vendor/golang.org/x/tools/internal/event/event.go delete mode 100644 vendor/golang.org/x/tools/internal/event/keys/keys.go delete mode 100644 vendor/golang.org/x/tools/internal/event/keys/standard.go delete mode 100644 vendor/golang.org/x/tools/internal/event/keys/util.go delete mode 100644 vendor/golang.org/x/tools/internal/event/label/label.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/bimport.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/exportdata.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/iexport.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/iimport.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/predeclared.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/support.go delete mode 100644 vendor/golang.org/x/tools/internal/gcimporter/ureader.go delete mode 100644 vendor/golang.org/x/tools/internal/gocommand/invoke.go delete mode 100644 vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.go delete mode 100644 vendor/golang.org/x/tools/internal/gocommand/invoke_unix.go delete mode 100644 vendor/golang.org/x/tools/internal/gocommand/vendor.go delete mode 100644 vendor/golang.org/x/tools/internal/gocommand/version.go delete mode 100644 vendor/golang.org/x/tools/internal/moremaps/maps.go delete mode 100644 vendor/golang.org/x/tools/internal/packagesinternal/packages.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/codes.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/decoder.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/doc.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/encoder.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/flags.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/reloc.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/support.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/sync.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go delete mode 100644 vendor/golang.org/x/tools/internal/pkgbits/version.go delete mode 100644 vendor/golang.org/x/tools/internal/stdlib/deps.go delete mode 100644 vendor/golang.org/x/tools/internal/stdlib/import.go delete mode 100644 vendor/golang.org/x/tools/internal/stdlib/manifest.go delete mode 100644 vendor/golang.org/x/tools/internal/stdlib/stdlib.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/assignedaddress.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/classify_call.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/element.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/fx.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/isnamed.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/qualifier.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/recv.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/toonew.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/types.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/varkind.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/varkind_go124.go delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/zerovalue.go delete mode 100644 vendor/golang.org/x/tools/internal/versions/features.go delete mode 100644 vendor/golang.org/x/tools/internal/versions/gover.go delete mode 100644 vendor/golang.org/x/tools/internal/versions/types.go delete mode 100644 vendor/golang.org/x/tools/internal/versions/versions.go create mode 100644 vendor/google.golang.org/grpc/clientconn_disconnect_reason_noplan9.go create mode 100644 vendor/google.golang.org/grpc/clientconn_disconnect_reason_plan9.go create mode 100644 vendor/google.golang.org/grpc/credentials/google/gcp_service_account_identity_credentials.go create mode 100644 vendor/google.golang.org/grpc/credentials/google/internal/internal.go diff --git a/go.mod b/go.mod index 78829692b83..20a09cb38fb 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/grafana/tempo -go 1.26.5 +go 1.26.7 require ( cloud.google.com/go/storage v1.62.2 @@ -29,12 +29,12 @@ require ( github.com/minio/minio-go/v7 v7.2.0 github.com/olekukonko/tablewriter v1.1.4 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.153.0 - github.com/opentracing-contrib/go-grpc v0.1.2 // indirect + github.com/opentracing-contrib/go-grpc v0.1.4 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pierrec/lz4/v4 v4.1.26 // indirect + github.com/pierrec/lz4/v4 v4.1.29 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.24.1 - github.com/prometheus/client_model v0.6.2 + github.com/prometheus/client_model v0.6.3 github.com/prometheus/common v0.70.1 github.com/prometheus/prometheus v0.312.0 github.com/segmentio/fasthash v1.0.3 @@ -56,11 +56,11 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.28.0 go.yaml.in/yaml/v3 v3.0.5 - golang.org/x/sync v0.22.0 + golang.org/x/sync v0.23.0 golang.org/x/time v0.15.0 google.golang.org/api v0.287.1 - google.golang.org/grpc v1.82.1 - google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af + google.golang.org/grpc v1.83.1 + google.golang.org/protobuf v1.36.12 ) require ( @@ -70,7 +70,7 @@ require ( github.com/KimMachineGun/automemlimit v0.7.5 github.com/axiomhq/hyperloglog v0.2.6 github.com/bits-and-blooms/bloom/v3 v3.7.1 - github.com/bytedance/sonic v1.15.1 + github.com/bytedance/sonic v1.15.4 github.com/evanphx/json-patch/v5 v5.9.11 github.com/googleapis/gax-go/v2 v2.23.0 github.com/grafana/gomemcache v0.0.0-20260728143316-9448343bd654 @@ -88,7 +88,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.153.0 github.com/parquet-go/parquet-go v0.30.1 github.com/redis/go-redis/v9 v9.20.0 - github.com/twmb/franz-go v1.21.2 + github.com/twmb/franz-go v1.21.6 github.com/twmb/franz-go/pkg/kadm v1.18.0 github.com/twmb/franz-go/pkg/kfake v0.0.0-20260421215025-4e7a1e1569ac github.com/twmb/franz-go/pkg/kmsg v1.13.1 @@ -118,37 +118,37 @@ require ( go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 go.opentelemetry.io/proto/otlp v1.10.0 go.yaml.in/yaml/v2 v2.4.4 - golang.org/x/net v0.58.0 - google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 + golang.org/x/net v0.59.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20260911204522-f61a6ca850bd ) require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.36 // indirect - github.com/google/jsonschema-go v0.4.2 // indirect + github.com/google/jsonschema-go v0.4.3 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect go.opentelemetry.io/contrib/exporters/autoexport v0.69.0 // indirect - gopkg.in/ini.v1 v1.67.2 // indirect + gopkg.in/ini.v1 v1.67.3 // indirect ) require ( - cel.dev/expr v0.25.1 // indirect + cel.dev/expr v0.25.3 // indirect cloud.google.com/go v0.123.0 // indirect - cloud.google.com/go/auth v0.23.0 // indirect + cloud.google.com/go/auth v0.23.2 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect cloud.google.com/go/compute/metadata v0.9.0 // indirect cloud.google.com/go/iam v1.13.0 // indirect cloud.google.com/go/monitoring v1.30.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.8.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.60.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.60.0 // indirect github.com/alecthomas/participle/v2 v2.1.4 // indirect github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b // indirect - github.com/andybalholm/brotli v1.2.2 // indirect + github.com/andybalholm/brotli v1.2.4 // indirect github.com/antchfx/xmlquery v1.5.1 // indirect - github.com/antchfx/xpath v1.3.6 // indirect + github.com/antchfx/xpath v1.3.8 // indirect github.com/apache/thrift v0.24.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-msk-iam-sasl-signer-go v1.0.4 // indirect @@ -158,66 +158,66 @@ require ( github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.23 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.35 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.35 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.15 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.35 // indirect github.com/aws/aws-sdk-go-v2/service/signin v1.5.4 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.33.4 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.4 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.45.4 // indirect - github.com/aws/smithy-go v1.27.6 // indirect + github.com/aws/smithy-go v1.28.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.25.0 // indirect github.com/buger/jsonparser v1.6.1 // indirect - github.com/bytedance/gopkg v0.1.3 // indirect - github.com/bytedance/sonic/loader v0.5.1 // indirect + github.com/bytedance/gopkg v0.1.4 // indirect + github.com/bytedance/sonic/loader v0.5.2 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/clipperhouse/displaywidth v0.11.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect - github.com/cloudwego/base64x v0.1.6 // indirect + github.com/cloudwego/base64x v0.1.7 // indirect github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.7.0 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/dgryski/go-metro v0.0.0-20250106013310-edb8663e5e33 // indirect - github.com/ebitengine/purego v0.10.0 // indirect + github.com/ebitengine/purego v0.10.2 // indirect github.com/edsrzf/mmap-go v1.2.1-0.20241212181136-fad1cd13edbd // indirect github.com/elastic/go-grok v0.3.1 // indirect - github.com/elastic/lunes v0.2.0 // indirect + github.com/elastic/lunes v0.2.2 // indirect github.com/envoyproxy/go-control-plane/envoy v1.39.0 // indirect github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect github.com/expr-lang/expr v1.17.8 // indirect github.com/fatih/color v1.19.0 // indirect github.com/felixge/httpsnoop v1.1.0 // indirect - github.com/foxboron/go-tpm-keyfiles v0.0.0-20251226215517-609e4778396f // indirect + github.com/foxboron/go-tpm-keyfiles v0.0.0-20260902202739-8c9c2d1005f4 // indirect github.com/fsnotify/fsnotify v1.10.1 // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/go-jose/go-jose/v4 v4.1.4 // indirect - github.com/go-logr/logr v1.4.3 // indirect + github.com/fxamacker/cbor/v2 v2.9.3 // indirect + github.com/go-jose/go-jose/v4 v4.1.5 // indirect + github.com/go-logr/logr v1.4.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-openapi/analysis v0.26.1 // indirect + github.com/go-openapi/analysis v1.0.0 // indirect github.com/go-openapi/errors v0.22.8 // indirect - github.com/go-openapi/jsonpointer v1.0.0 // indirect - github.com/go-openapi/jsonreference v1.0.0 // indirect - github.com/go-openapi/loads v0.25.1 // indirect - github.com/go-openapi/spec v0.22.10 // indirect - github.com/go-openapi/strfmt v0.27.0 // indirect - github.com/go-openapi/swag v0.29.1 // indirect - github.com/go-openapi/swag/cmdutils v0.29.1 // indirect - github.com/go-openapi/swag/conv v0.29.1 // indirect - github.com/go-openapi/swag/fileutils v0.29.1 // indirect - github.com/go-openapi/swag/jsonutils v0.29.1 // indirect - github.com/go-openapi/swag/loading v0.29.1 // indirect - github.com/go-openapi/swag/mangling v0.29.1 // indirect - github.com/go-openapi/swag/netutils v0.29.1 // indirect - github.com/go-openapi/swag/pools v0.29.1 // indirect - github.com/go-openapi/swag/stringutils v0.29.1 // indirect - github.com/go-openapi/swag/typeutils v0.29.1 // indirect - github.com/go-openapi/swag/yamlutils v0.29.1 // indirect - github.com/go-openapi/validate v0.26.0 // indirect + github.com/go-openapi/jsonpointer v1.0.1 // indirect + github.com/go-openapi/jsonreference v1.0.2 // indirect + github.com/go-openapi/loads v0.25.3 // indirect + github.com/go-openapi/spec v1.0.1 // indirect + github.com/go-openapi/strfmt v0.27.2 // indirect + github.com/go-openapi/swag v0.29.2 // indirect + github.com/go-openapi/swag/cmdutils v0.29.2 // indirect + github.com/go-openapi/swag/conv v0.29.2 // indirect + github.com/go-openapi/swag/fileutils v0.29.2 // indirect + github.com/go-openapi/swag/jsonutils v0.29.2 // indirect + github.com/go-openapi/swag/loading v0.29.2 // indirect + github.com/go-openapi/swag/mangling v0.29.2 // indirect + github.com/go-openapi/swag/netutils v0.29.2 // indirect + github.com/go-openapi/swag/pools v0.29.2 // indirect + github.com/go-openapi/swag/stringutils v0.29.2 // indirect + github.com/go-openapi/swag/typeutils v0.29.2 // indirect + github.com/go-openapi/swag/yamlutils v0.29.2 // indirect + github.com/go-openapi/validate v0.26.5 // indirect github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/goccy/go-json v0.10.6 // indirect @@ -226,14 +226,14 @@ require ( github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/golang/snappy v1.0.0 // indirect github.com/google/btree v1.1.3 // indirect - github.com/google/go-tpm v0.9.8 // indirect + github.com/google/go-tpm v0.9.9-0.20260124013517-8f8f42cba0de // indirect github.com/google/s2a-go v0.1.9 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.17 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.22 // indirect github.com/grafana/otel-profiling-go v0.6.0 // indirect - github.com/grafana/pyroscope-go/godeltaprof v0.1.9 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.12 // indirect github.com/grafana/regexp v0.0.0-20250905093917-f7b3be9d1853 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect - github.com/hashicorp/consul/api v1.34.4 // indirect + github.com/hashicorp/consul/api v1.34.5 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect @@ -260,18 +260,18 @@ require ( github.com/kamstrup/intmap v0.5.2 // indirect github.com/klauspost/cpuid/v2 v2.4.0 // indirect github.com/klauspost/crc32 v1.3.0 // indirect - github.com/knadh/koanf/maps v0.1.2 // indirect - github.com/knadh/koanf/providers/confmap v1.0.0 // indirect - github.com/knadh/koanf/v2 v2.3.4 // indirect + github.com/knadh/koanf/maps v0.1.3 // indirect + github.com/knadh/koanf/providers/confmap v1.0.1 // indirect + github.com/knadh/koanf/v2 v2.3.6 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 // indirect + github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 // indirect github.com/magefile/mage v1.17.2 // indirect github.com/mattn/go-colorable v0.1.15 // indirect - github.com/mattn/go-isatty v0.0.22 // indirect - github.com/mattn/go-runewidth v0.0.23 // indirect + github.com/mattn/go-isatty v0.0.24 // indirect + github.com/mattn/go-runewidth v0.0.30 // indirect github.com/mdlayher/socket v0.6.0 // indirect github.com/mdlayher/vsock v1.3.0 // indirect - github.com/miekg/dns v1.1.72 // indirect + github.com/miekg/dns v1.1.73 // indirect github.com/minio/crc64nvme v1.1.1 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -284,7 +284,7 @@ require ( github.com/oklog/ulid/v2 v2.1.2 // indirect github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect github.com/olekukonko/errors v1.3.0 // indirect - github.com/olekukonko/ll v0.1.6 // indirect + github.com/olekukonko/ll v0.1.8 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.153.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.153.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.153.0 // indirect @@ -299,7 +299,7 @@ require ( github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/parquet-go/bitpack v1.0.1 // indirect github.com/parquet-go/jsonlite v1.5.5 // indirect - github.com/pb33f/jsonpath v0.8.2 // indirect + github.com/pb33f/jsonpath v0.8.3 // indirect github.com/pb33f/libopenapi v0.38.7 // indirect github.com/pb33f/ordered-map/v2 v2.3.1 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect @@ -309,7 +309,7 @@ require ( github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect + github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 // indirect github.com/prometheus/alertmanager v0.32.1 // indirect github.com/prometheus/client_golang/exp v0.0.0-20260518105423-c9d5bc4c50a9 // indirect github.com/prometheus/exporter-toolkit v0.16.0 // indirect @@ -321,19 +321,19 @@ require ( github.com/rs/cors v1.11.1 // indirect github.com/rs/xid v1.6.0 // indirect github.com/sagikazarmark/locafero v0.11.0 // indirect - github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect github.com/sercand/kuberesolver/v6 v6.0.1 // indirect - github.com/shirou/gopsutil/v4 v4.26.4 // indirect + github.com/shirou/gopsutil/v4 v4.26.8 // indirect github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/cobra v1.10.2 // indirect github.com/spf13/pflag v1.0.10 // indirect - github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect - github.com/stretchr/objx v0.5.2 // indirect + github.com/spiffe/go-spiffe/v2 v2.7.0 // indirect + github.com/stretchr/objx v0.5.3 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/tinylib/msgp v1.6.1 // indirect + github.com/tinylib/msgp v1.6.4 // indirect github.com/tklauser/go-sysconf v0.3.16 // indirect github.com/tklauser/numcpus v0.11.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect @@ -341,11 +341,11 @@ require ( github.com/twmb/franz-go/plugin/kzap v1.1.2 // indirect github.com/twmb/murmur3 v1.1.8 // indirect github.com/twpayne/go-geom v1.6.1 // indirect - github.com/ua-parser/uap-go v0.0.0-20251207011819-db9adb27a0b8 // indirect + github.com/ua-parser/uap-go v0.0.0-20260529044130-17c35e68e58c // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect - github.com/yuin/gopher-lua v1.1.1 // indirect + github.com/yuin/gopher-lua v1.1.2 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zeebo/xxh3 v1.1.0 // indirect go.etcd.io/etcd/api/v3 v3.6.9 // indirect @@ -394,7 +394,7 @@ require ( go.opentelemetry.io/collector/service/hostcapabilities v0.153.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.18.0 // indirect go.opentelemetry.io/contrib/bridges/prometheus v0.69.0 // indirect - go.opentelemetry.io/contrib/detectors/gcp v1.43.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.44.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 // indirect go.opentelemetry.io/contrib/otelconf v0.23.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.43.0 // indirect @@ -415,17 +415,15 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect go.yaml.in/yaml/v4 v4.0.0-rc.6 // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect - golang.org/x/crypto v0.55.0 // indirect - golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect - golang.org/x/mod v0.40.0 // indirect + golang.org/x/crypto v0.57.0 // indirect + golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sys v0.47.0 // indirect - golang.org/x/term v0.45.0 // indirect - golang.org/x/text v0.41.0 // indirect - golang.org/x/tools v0.49.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/term v0.46.0 // indirect + golang.org/x/text v0.42.0 // indirect gonum.org/v1/gonum v0.17.0 // indirect - google.golang.org/genproto v0.0.0-20260519071638-aa98bba5eb94 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 // indirect + google.golang.org/genproto v0.0.0-20260911204522-f61a6ca850bd // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260911204522-f61a6ca850bd // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apimachinery v0.36.3 // indirect @@ -433,9 +431,9 @@ require ( k8s.io/klog/v2 v2.140.0 // indirect k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad // indirect k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 // indirect - sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5 // indirect sigs.k8s.io/randfill v1.0.0 // indirect - sigs.k8s.io/structured-merge-diff/v6 v6.4.1 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.4.2 // indirect sigs.k8s.io/yaml v1.6.0 // indirect ) diff --git a/go.sum b/go.sum index 263a1950fe4..97d2e7bde34 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,17 @@ -cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4= -cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= -cloud.google.com/go/auth v0.23.0 h1:6Gg1CMgpgubRG7DGz5Vf1pcoNo8RfiRiRAPS4crTp54= -cloud.google.com/go/auth v0.23.0/go.mod h1:4DhBRcqvtljQN3dJ57qtqbib5ZGCYE5f2crfiiC2EM0= +cloud.google.com/go/auth v0.23.2 h1:pxSCpfiji41hpzpPdMCftEUCezpgpqmmDdYiAjCKXxo= +cloud.google.com/go/auth v0.23.2/go.mod h1:4DhBRcqvtljQN3dJ57qtqbib5ZGCYE5f2crfiiC2EM0= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/iam v1.13.0 h1:ufT3FPT5rFFXu6UtLkNoxaOaV5EuA1dsSkmemCSTo6U= cloud.google.com/go/iam v1.13.0/go.mod h1:gHXdDEiPDvqd1q1KwBDGQlgZY/BwY760zU2LhOZS5w0= -cloud.google.com/go/logging v1.18.0 h1:KhzZq+1cSkPH9YUaKLLhLtQxIHitVayBmk0sGfoM9+k= -cloud.google.com/go/logging v1.18.0/go.mod h1:ZGKnpBaURITh+g/uom2VhbiFoFWvejcrHPDhxFtU/gI= +cloud.google.com/go/logging v1.19.1 h1:7SsLhyTDBDrJw+Ll6Ns3I2mByqHXvJUc3rGjSlwiWgU= +cloud.google.com/go/logging v1.19.1/go.mod h1:2IkQ/d8jVJqV2qW8ZUGUiMjdZG1gkLD2JReGbZ8isqg= cloud.google.com/go/longrunning v1.2.0 h1:WjYH3YHBGCxGJP9M4dWGHBfXr/cFIjMkNgWcJj7/iMM= cloud.google.com/go/longrunning v1.2.0/go.mod h1:5KMQALFGOCtFoi2xSOA1u3H7WKlhmckgiyFw7+LGQp0= cloud.google.com/go/monitoring v1.30.0 h1:r/d+JUbyKmJ8b07iznuKfzVzrIXTWxHQ3lBRm3x2LlY= @@ -45,8 +45,8 @@ github.com/Code-Hex/go-generics-cache v1.5.1/go.mod h1:qxcC9kRVrct9rHeiYpFWSoW1v github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 h1:rIkQfkCOVKc1OiRCNcSDD8ml5RJlZbH/Xsq7lbpynwc= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0/go.mod h1:RD2SsorTmYhF6HkTmDw7KmPYQk8OBYwTkuasChwv7R4= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 h1:l7+6kwRMJNwdCvYdDl7Eax+wzEYHSnNY7zrrfbhDdTA= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0/go.mod h1:pJTkW8hEUIIi3Pf65lPZOnn4Y81yCllX6IWk2jNXdkM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.60.0 h1:HldzheTs05E3ybqSitI/wHaof6+XERRudgZLjYbs3eE= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.60.0/go.mod h1:evkqaSczW9g2BQm1veCtgNhJ4wCCsRrOsSgNIn9LHQk= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.60.0 h1:Fx8NtDCmKH4ML2hUkPz4Dq250903vRDojMjVCDKwQuc= @@ -75,12 +75,13 @@ github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b h1:mimo19zliBX/vS github.com/alecthomas/units v0.0.0-20240927000941-0f3dac36c52b/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= github.com/alicebob/miniredis/v2 v2.37.0 h1:RheObYW32G1aiJIj81XVt78ZHJpHonHLHW7OLIshq68= github.com/alicebob/miniredis/v2 v2.37.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= -github.com/andybalholm/brotli v1.2.2 h1:HzTuoo2ErYQqf5qvcJInB8uvqSVxRttzkFexPWtnceM= -github.com/andybalholm/brotli v1.2.2/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= +github.com/andybalholm/brotli v1.2.4 h1:649LN6qF+/7JJYNN3Wdu4Dt5PS6eC/yP/Go3Bb0/AHI= +github.com/andybalholm/brotli v1.2.4/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= github.com/antchfx/xmlquery v1.5.1 h1:T9I4Ns1EXiWHy0IqKupGhnfTQtJwlGrpXtauYOoNv78= github.com/antchfx/xmlquery v1.5.1/go.mod h1:bVqnl7TaDXSReKINrhZz+2E/PbCu2tUahb+wZ7WZNT8= -github.com/antchfx/xpath v1.3.6 h1:s0y+ElRRtTQdfHP609qFu0+c6bglDv20pqOViQjjdPI= github.com/antchfx/xpath v1.3.6/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= +github.com/antchfx/xpath v1.3.8 h1:RQlkLaJDKk1Ew1H6CUPUTKM+IQxm+6HTyOgcrfqOU9c= +github.com/antchfx/xpath v1.3.8/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= github.com/apache/thrift v0.24.0 h1:zy31L1a49QTNB2bG1BBfMXol3yJrTH975G3pPubQVLQ= github.com/apache/thrift v0.24.0/go.mod h1:zPt6WxgvTOM6hF92y8C+MkEM5LMxZuk4JcQOiU4Esvs= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= @@ -109,8 +110,8 @@ github.com/aws/aws-sdk-go-v2/service/ecs v1.81.0 h1:2Sp9EwK7giQpJnQ54k0zdUh6aykm github.com/aws/aws-sdk-go-v2/service/ecs v1.81.0/go.mod h1:TIKZ9zIFS6W2k9FeW+r5sGVnlxp+aUt9oQ/St3Suj1o= github.com/aws/aws-sdk-go-v2/service/elasticache v1.52.2 h1:5wbCUfyxXcjIqesyVfJBBJs0bDMyejthtHyy48mfZCI= github.com/aws/aws-sdk-go-v2/service/elasticache v1.52.2/go.mod h1:o4vQxDt6oteknUjkXIEskp0ccy+93NRTPKXw3HlVMFE= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.15 h1:JJLBQxwY+AFwuPAi5ivGc1ChnTdUt4cXMv7e76m2c/Y= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.15/go.mod h1:lQknBIe78MVL0cQOQDlag8KGflMbMEVFx9mB6O8ENvk= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 h1:bAdDl/HkGCcGPoe25ToSHEw23VIxt6CT5fLcg111BKg= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19/go.mod h1:KaUzbLxv4CeSxh6ZCl9B4m7CuFenS8kUEaDs+f/DQr4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.35 h1:BBEElKh4a+rKshvjrfpajTe9CbpZvrbb4Jkg2PB7RzA= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.35/go.mod h1:zaZk983w//8beSruBVec/mr4CmDwgZitW/qzGhAAX0g= github.com/aws/aws-sdk-go-v2/service/kafka v1.52.0 h1:jalIJqKvZMvJRvs6ABLX+FhHz8E9pjU03Pyml4D9r3k= @@ -127,8 +128,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.4 h1:AsbZcJAQPRmHDJG8K1N0pof/ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.4/go.mod h1:6imqztH0//t0mKbl6yWl7swSEl7F/w32oAmqB3vP1ag= github.com/aws/aws-sdk-go-v2/service/sts v1.45.4 h1:w/AryDYMjSUANSQ2uoZxJovUsMTwWJNTv3IMex30Y+4= github.com/aws/aws-sdk-go-v2/service/sts v1.45.4/go.mod h1:WeBiAa67azG7Su9Vf+ChGDBLiAozJCXzdjXiPBUwtbc= -github.com/aws/smithy-go v1.27.6 h1:0zjT8jgK3jbrTT7JJ3EE6JsMhX8JTrZ+f1sEndYDXrA= -github.com/aws/smithy-go v1.27.6/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aws/smithy-go v1.28.1 h1:R/nXH00c8qcfCzQVELtRw+eLQWtzv+VAIEFJ1/xxXlQ= +github.com/aws/smithy-go v1.28.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/axiomhq/hyperloglog v0.2.6 h1:sRhvvF3RIXWQgAXaTphLp4yJiX4S0IN3MWTaAgZoRJw= github.com/axiomhq/hyperloglog v0.2.6/go.mod h1:YjX/dQqCR/7QYX0g8mu8UZAjpIenz1FKM71UEsjFoTo= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= @@ -152,12 +153,12 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/buger/jsonparser v1.6.1 h1:I0phFv0PlbLHnM7TZAVjZ2MJ2/eWRTDyuO7GLR98IEs= github.com/buger/jsonparser v1.6.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M= -github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM= -github.com/bytedance/sonic v1.15.1 h1:nJD5PmM0vY7J8CT6MxoqbVAAMhkSmV2HgRAUrrpLoOw= -github.com/bytedance/sonic v1.15.1/go.mod h1:mT2NbXunuaEbnZ+mRIX/vYqKISmgEuHFDI4UzmKx2SA= -github.com/bytedance/sonic/loader v0.5.1 h1:Ygpfa9zwRCCKSlrp5bBP/b/Xzc3VxsAW+5NIYXrOOpI= -github.com/bytedance/sonic/loader v0.5.1/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= +github.com/bytedance/gopkg v0.1.4 h1:oZnQwnX82KAIWb7033bEwtxvTqXcYMxDBaQxo5JJHWM= +github.com/bytedance/gopkg v0.1.4/go.mod h1:v1zWfPm21Fb+OsyXN2VAHdL6TBb2L88anLQgdyje6R4= +github.com/bytedance/sonic v1.15.4 h1:FgtV/4aBHpla9AxuMpuuzVUpa/Cf3izufkxNmnEzdI8= +github.com/bytedance/sonic v1.15.4/go.mod h1:8e51yTPdY8M6t+vvGL1c2Y1xL9i+frEeIAQAEl75NUc= +github.com/bytedance/sonic/loader v0.5.2 h1:0QtP1gevc1OZ6/H8Lb9BRZiCXd1Ftjd3OKuj1T1lBIo= +github.com/bytedance/sonic/loader v0.5.2/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= @@ -171,8 +172,8 @@ github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSE github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= -github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M= -github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU= +github.com/cloudwego/base64x v0.1.7 h1:NppS+Fgzg5ovhn4NkUXaDT3x9jldgH5ToMCqzBSi2zI= +github.com/cloudwego/base64x v0.1.7/go.mod h1:Cu1PV9zfrSf7ET2tIbWbbEy7jO7HHJ13q4X2SQ8aWYg= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os8IaYg++6uMOdKK83QtkkvJik= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= @@ -208,16 +209,16 @@ github.com/drone/envsubst v1.0.3 h1:PCIBwNDYjs50AsLZPYdfhSATKaRg/FJmDc2D6+C2x8g= github.com/drone/envsubst v1.0.3/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/ebitengine/purego v0.10.0 h1:QIw4xfpWT6GWTzaW5XEKy3HXoqrJGx1ijYHzTF0/ISU= -github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/ebitengine/purego v0.10.2 h1:W809HbnvzAxgdm+aOvlSekrM16wGCdT/e76+9tS7gzE= +github.com/ebitengine/purego v0.10.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/edsrzf/mmap-go v1.2.1-0.20241212181136-fad1cd13edbd h1:I4PrRZuNMeDP3VbFrak4QsqwO5tWkQf0tqrrr1L2DsU= github.com/edsrzf/mmap-go v1.2.1-0.20241212181136-fad1cd13edbd/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/efficientgo/tools/core v0.0.0-20220225185207-fe763185946b h1:ZHiD4/yE4idlbqvAO6iYCOYRzOMRpxkW+FKasRA3tsQ= github.com/efficientgo/tools/core v0.0.0-20220225185207-fe763185946b/go.mod h1:OmVcnJopJL8d3X3sSXTiypGoUSgFq1aDGmlrdi9dn/M= github.com/elastic/go-grok v0.3.1 h1:WEhUxe2KrwycMnlvMimJXvzRa7DoByJB4PVUIE1ZD/U= github.com/elastic/go-grok v0.3.1/go.mod h1:n38ls8ZgOboZRgKcjMY8eFeZFMmcL9n2lP0iHhIDk64= -github.com/elastic/lunes v0.2.0 h1:WI3bsdOTuaYXVe2DS1KbqA7u7FOHN4o8qJw80ZyZoQs= -github.com/elastic/lunes v0.2.0/go.mod h1:u3W/BdONWTrh0JjNZ21C907dDc+cUZttZrGa625nf2k= +github.com/elastic/lunes v0.2.2 h1:dZFEaebNg9l+mzvOQN6Nd/c9y6y8rUe3tBWsTgvM08U= +github.com/elastic/lunes v0.2.2/go.mod h1:u3W/BdONWTrh0JjNZ21C907dDc+cUZttZrGa625nf2k= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= @@ -239,16 +240,16 @@ github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc= github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= -github.com/foxboron/go-tpm-keyfiles v0.0.0-20251226215517-609e4778396f h1:RJ+BDPLSHQO7cSjKBqjPJSbi1qfk9WcsjQDtZiw3dZw= -github.com/foxboron/go-tpm-keyfiles v0.0.0-20251226215517-609e4778396f/go.mod h1:VHbbch/X4roIY22jL1s3qRbZhCiRIgUAF/PdSUcx2io= +github.com/foxboron/go-tpm-keyfiles v0.0.0-20260902202739-8c9c2d1005f4 h1:zqtQvVnFZ71RsyDMNVAaWf4g2OVEDH5LDs26MZFHy7s= +github.com/foxboron/go-tpm-keyfiles v0.0.0-20260902202739-8c9c2d1005f4/go.mod h1:wxFx38LbEL4RF0JH6PR3lf7ZJ6ZO0yQWQstLCTQQNjA= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho= github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo= -github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= -github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= -github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= -github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= +github.com/fxamacker/cbor/v2 v2.9.3 h1:oQBnFATpNdY8gJHTndDDv5Xl4QqNaz51G5LLEPhng3Q= +github.com/fxamacker/cbor/v2 v2.9.3/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-jose/go-jose/v4 v4.1.5 h1:RjgjO2LOtWOJKUC5wpwY9LR3B3vwVAz6JS2YHfYU6eA= +github.com/go-jose/go-jose/v4 v4.1.5/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= @@ -258,59 +259,59 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.6.1 h1:4hvbpePJKnIzH1B+8OR/JPbTx37NktoI9LE2QZBBkvE= github.com/go-logfmt/logfmt v0.6.1/go.mod h1:EV2pOAQoZaT1ZXZbqDl5hrymndi4SY9ED9/z6CO0XAk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= -github.com/go-openapi/analysis v0.26.1 h1:BqYuDaQiFflcgPWGDQc7niUFE2pHTVq1H3iwDsRYMqM= -github.com/go-openapi/analysis v0.26.1/go.mod h1:E2siwFrz00/Z1sifwhy63h+hMkg0USofwD4gYPYeQME= +github.com/go-openapi/analysis v1.0.0 h1:sNvbAGCJqUTqIAodr9IVqJMmuZas3YS9ms1dGK9yiJ4= +github.com/go-openapi/analysis v1.0.0/go.mod h1:NhYjJ57fnE+bcE7UwrJyMkhWA3Dfz7TdiBfTVAnos4Y= github.com/go-openapi/errors v0.22.8 h1:oP7sW7TWc3wFFjrzzj0nI83H2qMBkNjNfSd+XRejk/I= github.com/go-openapi/errors v0.22.8/go.mod h1:BuUoHcYrU6E7V9gfj1I5wLQqgtIHnup/alXZ8KdgQ0w= -github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= -github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= -github.com/go-openapi/jsonreference v1.0.0 h1:jlmTr6torcd1YgDQvSfNmRtKzYDO4FGBkrAdlAVWnpY= -github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1WZST4rT32LWB+sv0= -github.com/go-openapi/loads v0.25.1 h1:toKQdIDLxlqfKLLGUUmUsiTd5/X0Chzvde9EGYQP/Ac= -github.com/go-openapi/loads v0.25.1/go.mod h1:33Hen4tsKXHL45TyYojvfD5fZUFN4O1y4r/XhsRW2zc= -github.com/go-openapi/spec v0.22.10 h1:5cp1dq++t4U/4WCg6f1wqReZowUrJ5kl8Eri4SMl51s= -github.com/go-openapi/spec v0.22.10/go.mod h1:aWRr+Ntv5tHoMQo0C1slTNLFo1FOYdZXFlUqViCN7yM= -github.com/go-openapi/strfmt v0.27.0 h1:kbcTeaD9TXuXD0hhMXzuYa1sdTo6+dWGvwjW93E80IM= -github.com/go-openapi/strfmt v0.27.0/go.mod h1:s/qhDqfY72irigXUGJmtgid2Rm+3tnz3k8hZaRmvWYc= -github.com/go-openapi/swag v0.29.1 h1:C6EeWzUwQtcWEhE9eqBdUubGXxhWY4PlzHMLD7kLaiQ= -github.com/go-openapi/swag v0.29.1/go.mod h1:BzxEXKiPlSXRsRTv1KSBF/BpGKHxA/YciCnr4tv9bvA= -github.com/go-openapi/swag/cmdutils v0.29.1 h1:3DorPGfUdE80BogKY22EzoHBcHMrkVomZMoV7kS4ANY= -github.com/go-openapi/swag/cmdutils v0.29.1/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= -github.com/go-openapi/swag/conv v0.29.1 h1:AC4Eh/5c/eUDOUCzzsRC9ghmFgOSBHeRMGIngY0ZUGA= -github.com/go-openapi/swag/conv v0.29.1/go.mod h1:S1X7/ZrBEZOC0Wc8AGxjbcGS92l3WEjA7aPtpl+RaqM= -github.com/go-openapi/swag/fileutils v0.29.1 h1:ZcPzMceVhU1WPbK6N1G6sNQKdd1CWJlf3cA08UHuoM0= -github.com/go-openapi/swag/fileutils v0.29.1/go.mod h1:/wofKYckbtRl2p3+EwQsosie5CT1B38+dQ+PS579BzI= -github.com/go-openapi/swag/jsonutils v0.29.1 h1:AFCxs0eQZ24/QyfhVHM2t49rMz7Vv3XCsZQI6yrNy+c= -github.com/go-openapi/swag/jsonutils v0.29.1/go.mod h1:u3+sCfJpttDpcmS5kpm0yxL6GK0eWgODsx8Yw8fcqNM= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1 h1:BiiXE31Bx9SfpsMmOQj5KYpUhTZBpLVriVhJDuLuY2o= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1/go.mod h1:julgTUKZ9/D0j6O7GKajmRs+812FWxQg/mMpGunWSjg= -github.com/go-openapi/swag/loading v0.29.1 h1:FCv5fG8UhTdDJa2R7w+5O9Ekpcbw7tt0nFWvmDKGBjc= -github.com/go-openapi/swag/loading v0.29.1/go.mod h1:N0ESuem4p2oedKal8EJhciqnJ9Q9Wmt83L1CRB3Fouw= -github.com/go-openapi/swag/mangling v0.29.1 h1:lHALtvYCdxVnRl4GrHmFPwfBTZYIObqdGNSKyu/8D6I= -github.com/go-openapi/swag/mangling v0.29.1/go.mod h1:SAop9pB7PUjQ/CGCNf/JmCKTRK+GDO+RqE9UHqC/N6s= -github.com/go-openapi/swag/netutils v0.29.1 h1:IjIvdEP5duKcghFqJEPSUraRnkKYHoM65kTluTu+Jb4= -github.com/go-openapi/swag/netutils v0.29.1/go.mod h1:DUde7x4Bx00k5jYl2AdRpNAO0m7atUvD2x6X+bWkbno= -github.com/go-openapi/swag/pools v0.29.1 h1:NRogYxdEW9SjRM4mkAOji9iefO4MRXq3p/ZJcoQbUKg= -github.com/go-openapi/swag/pools v0.29.1/go.mod h1:leDcaghjkRAhCuCRv9NfJU5f0mjoU3cT/XZObhMk3pc= -github.com/go-openapi/swag/stringutils v0.29.1 h1:1ykunK7iJQk1uOO7+oUH1ukbsK85fFCOiCFMOVSY+F0= -github.com/go-openapi/swag/stringutils v0.29.1/go.mod h1:7fSqZ+z8Qc0tOfAAK0jVa5qFGrnIlRi6n7NeGGrr1vc= -github.com/go-openapi/swag/typeutils v0.29.1 h1:Nzv9nhnlLCRBPQqfOX+7lB6Guju370or8StT+lIOf6M= -github.com/go-openapi/swag/typeutils v0.29.1/go.mod h1:hxpgDZJVBkBsi/d3MIUosafoFdE5exaQRmVp0zwu3YE= -github.com/go-openapi/swag/yamlutils v0.29.1 h1:69w3tsBajm7MR/fejLy7HD/3J68Ys1SeeZMEzZ3w2sk= -github.com/go-openapi/swag/yamlutils v0.29.1/go.mod h1:rgsp3vT/QdWzKwn43CigDwjOGIenPyTZMKnxEM8jZOA= -github.com/go-openapi/testify/enable/yaml/v2 v2.6.1 h1:Jm+/ze2rMtbD98yen92AhATGLGREDYXG56Xr4gMjEtE= -github.com/go-openapi/testify/enable/yaml/v2 v2.6.1/go.mod h1:YDPnwCRDu38/oJBVMBVXOUDiJ9cIeBHWvfImHaXqnv4= +github.com/go-openapi/jsonpointer v1.0.1 h1:2KxywRmNwJkT/FMBa3iRNHEaAxSJvjqoufQZy3au1Mg= +github.com/go-openapi/jsonpointer v1.0.1/go.mod h1:wI7ZYsFmbIi9nBXOZqgDaS/bqOchRGZjqxFli7FBYxY= +github.com/go-openapi/jsonreference v1.0.2 h1:oS4et8FOf3p3UQxEo4Xt0esijmBUM+F259Xl72OSZsc= +github.com/go-openapi/jsonreference v1.0.2/go.mod h1:TbUNSOo+fcorZjFaNoiSDSoaNnnZtqJtLGR1PuvE/Cs= +github.com/go-openapi/loads v0.25.3 h1:V+jKy/thXWdLJUuYC8sZX2dICyAa8M3DokF70jj34P0= +github.com/go-openapi/loads v0.25.3/go.mod h1:LgLyCSOLBL2Qnj0Ps1oo2YH8jZoEKsMeVZCc+ALIxFo= +github.com/go-openapi/spec v1.0.1 h1:lj2vdGpNDcVgwRc6qXdw6qt/KQpCtSa9tnUH6vpDPDk= +github.com/go-openapi/spec v1.0.1/go.mod h1:M//GWQGtDUAjnP37gE6fInLgaczB+FatoipV3H1fYw8= +github.com/go-openapi/strfmt v0.27.2 h1:SG32SlbwNy92s0KJiVxt2joJeFdqIYHvwrA0OU6HqzQ= +github.com/go-openapi/strfmt v0.27.2/go.mod h1:M4CKsMO0Fb8qR10+1Ra75wCKNNquy+Vj+4LWZrhTo2E= +github.com/go-openapi/swag v0.29.2 h1:9n8frkcsuQRA0INU31VbxNxt1zBaHxrHYGEf5BUjFi4= +github.com/go-openapi/swag v0.29.2/go.mod h1:RkCiX1gCVXWgLOavDXE3ALJrQ/VO2ziiIzOUs3z10xo= +github.com/go-openapi/swag/cmdutils v0.29.2 h1:cXEzX/nWCODon251f+1HgL75/R4XXML5IZxgLCWMoro= +github.com/go-openapi/swag/cmdutils v0.29.2/go.mod h1:XziaSVzYqkDvpWXzASfWajw2YvJrLscq610O2XiyqJw= +github.com/go-openapi/swag/conv v0.29.2 h1:8c9shoB8l0QRSR6ymq1llHdBWDqpIgJfjTGHx3Vuhm0= +github.com/go-openapi/swag/conv v0.29.2/go.mod h1:AZS0YigTNf8qNtD6WqJz/N4RUNmpr76SyjFGkq4+p6Q= +github.com/go-openapi/swag/fileutils v0.29.2 h1:mdUL+Vw5ah1fO1AvFCoHeIyv7YZsCz2MN3KNqd/lLVI= +github.com/go-openapi/swag/fileutils v0.29.2/go.mod h1:7QKmmodjAebaq61lGVJa8ldLdGeMF4DSgYv8tXOGGo0= +github.com/go-openapi/swag/jsonutils v0.29.2 h1:uZNSD2/rJDYAfvsLYkykTzXuyxM3QpDKV9jhRHrMu6k= +github.com/go-openapi/swag/jsonutils v0.29.2/go.mod h1:ONTdNvj3Y+IXRzfa17E+Rgt2ns/qiSOYjIo2K7v2yDs= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.2 h1:w+Fd6EBOMGlC74GYGHqCLGyb3Bpams8TtNrgM/SG4jo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.2/go.mod h1:HC2egPORFzbj/gf05Zrfgz8Mgplx3oW7hgGi7pjZVhM= +github.com/go-openapi/swag/loading v0.29.2 h1:QU1ry24e6r6Shoxe380Nx0X5iKkpRO+hJffsyJ2dVlY= +github.com/go-openapi/swag/loading v0.29.2/go.mod h1:DqilDjuiJKETecsS4TRopWG1acUDsfqN39ZmQhPu6uI= +github.com/go-openapi/swag/mangling v0.29.2 h1:ltdo3K0tTP4P6zWhVVWDU9D37/YYBuMJRdZxiS2Dtog= +github.com/go-openapi/swag/mangling v0.29.2/go.mod h1:RjDi4TnItAenS3cgCXSpIl1kKbjG7il6pnmQVl/8bp8= +github.com/go-openapi/swag/netutils v0.29.2 h1:dBli6jyUa93sDS/XYWShJzf4+nnVfFKfvY9SLUaUzB8= +github.com/go-openapi/swag/netutils v0.29.2/go.mod h1:1pM6Xg/Um8E1eps3umWl8Hme3ByWXOtHsvFC0CULHUE= +github.com/go-openapi/swag/pools v0.29.2 h1:PlGoDRF8WtSyXkedZZkpW3f9wDhFf3u8KtaBcmgmh8c= +github.com/go-openapi/swag/pools v0.29.2/go.mod h1:V3lhxVT4qDYRqc2MRSSbLsTYIYV/2HlHafhyEkmzLIc= +github.com/go-openapi/swag/stringutils v0.29.2 h1:lcnBxwAaysT3bMUVBfn9V/PkfVqkurpqufKU6rTUMGk= +github.com/go-openapi/swag/stringutils v0.29.2/go.mod h1:i9cdh7sGaa0nm3CqIvH5IM5h2QClk1wns2ktKeILvRI= +github.com/go-openapi/swag/typeutils v0.29.2 h1:O7aVvkTs3pXwikgtrPLenigEMdQFgONKRooQA9pgf2I= +github.com/go-openapi/swag/typeutils v0.29.2/go.mod h1:7+GDG+uz9Ke+eVt4rClZg7wklSDp8hT/mKNh/pC26TE= +github.com/go-openapi/swag/yamlutils v0.29.2 h1:IFKFFeDnuIwzfsuWRQU+rI8iL3g4XyAYjV/RlnlxPLM= +github.com/go-openapi/swag/yamlutils v0.29.2/go.mod h1:7MGqtcrK73sxQ4ceiyIf8qiXS/s09JLMdR5esK5euYQ= +github.com/go-openapi/testify/enable/yaml/v2 v2.7.0 h1:wPW6YRgx3+SID1yUy/Xwa17L8kFEaEKod2VRbJDZNUs= +github.com/go-openapi/testify/enable/yaml/v2 v2.7.0/go.mod h1:mI1M88etYbc3PhgHsWQK2kwvNwW5aGFqMPbmib+SGIs= github.com/go-openapi/testify/v2 v2.7.0 h1:bycOreEj6wfBvijg3YFogZ/sFjTCDmQnwSodSzHa3X8= github.com/go-openapi/testify/v2 v2.7.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= -github.com/go-openapi/validate v0.26.0 h1:dxWzQ3F+vb1SajqUxHjwb5T4mTpSHmdrtv5Bi7+ZNhw= -github.com/go-openapi/validate v0.26.0/go.mod h1:b4o00uq7fJeJA+wWhVFCJpKTctzeFwzZImGGmHsl2JA= +github.com/go-openapi/validate v0.26.5 h1:Vm02dSmhevDx/4v4m8KAtMwffHGfq9wRLqICeebE/D4= +github.com/go-openapi/validate v0.26.5/go.mod h1:2VVi2kpxSvInv/OOI6echOcYddydjXOxJvkHQ5VsoZw= github.com/go-resty/resty/v2 v2.17.2 h1:FQW5oHYcIlkCNrMD2lloGScxcHJ0gkjshV3qcQAyHQk= github.com/go-resty/resty/v2 v2.17.2/go.mod h1:kCKZ3wWmwJaNc7S29BRtUhJwy7iqmn+2mLtQrOyQlVA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -354,21 +355,21 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= -github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo= -github.com/google/go-tpm v0.9.8/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= +github.com/google/go-tpm v0.9.9-0.20260124013517-8f8f42cba0de h1:U6GxkpXnFhR76KyzdJCa3/YopeqiMgKWEGPp5u2mCSQ= +github.com/google/go-tpm v0.9.9-0.20260124013517-8f8f42cba0de/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= github.com/google/go-tpm-tools v0.4.7 h1:J3ycC8umYxM9A4eF73EofRZu4BxY0jjQnUnkhIBbvws= github.com/google/go-tpm-tools v0.4.7/go.mod h1:gSyXTZHe3fgbzb6WEGd90QucmsnT1SRdlye82gH8QjQ= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/jsonschema-go v0.4.2 h1:tmrUohrwoLZZS/P3x7ex0WAVknEkBZM46iALbcqoRA8= -github.com/google/jsonschema-go v0.4.2/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= +github.com/google/jsonschema-go v0.4.3 h1:/DBOLZTfDow7pe2GmaJNhltueGTtDKICi8V8p+DQPd0= +github.com/google/jsonschema-go v0.4.3/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.17 h1:73NfMHdiqo9JFU9+7a5ExpVa10/R29pXfZIaW559nrg= -github.com/googleapis/enterprise-certificate-proxy v0.3.17/go.mod h1:rSEsBUemEBZEexP2y6jPp16LUmUbjmSbcPMQizR0o4k= +github.com/googleapis/enterprise-certificate-proxy v0.3.22 h1:NU4XpII6jD+Dxcot94fqjE+AfJoE/lQP9q3faYGzC/c= +github.com/googleapis/enterprise-certificate-proxy v0.3.22/go.mod h1:L3D/IQExI6LqEjBdXcZQ1WluSgigQmSwBboFstVPM4w= github.com/googleapis/gax-go/v2 v2.23.0 h1:Tchl7qkvE7Ip3y+ztvNufYFvkfqTe7NfLTYGIdJRLuE= github.com/googleapis/gax-go/v2 v2.23.0/go.mod h1:rBQKOVJCdb8IFEzg+FCwlt1LP/xMDGuqUXhUG+XMXEg= github.com/gophercloud/gophercloud/v2 v2.12.0 h1:Gxmc/Bog1UDKkxTcQW7MSPTDviJXpLeEgVeN5KrxoCo= @@ -389,18 +390,18 @@ github.com/grafana/memberlist v0.3.1-0.20260515134459-1798cf41aca7 h1:F5hMoc+tCK github.com/grafana/memberlist v0.3.1-0.20260515134459-1798cf41aca7/go.mod h1:OSu8+LHxPUHB67c9v5Gfw5NQZxFWOL3EKmn9TgHvyCo= github.com/grafana/otel-profiling-go v0.6.0 h1:W7lOZaJj4IJISXMcM1UBk3fJF3tzF2OD6MJBJaQp1H8= github.com/grafana/otel-profiling-go v0.6.0/go.mod h1:cqLIDgNXlnzknJ0WLiEe+JPjZk2MZ4ftMdqRJRWj1ZM= -github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og= -github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= +github.com/grafana/pyroscope-go/godeltaprof v0.1.12 h1:X6OemT2WcLtxdmNukEQuIp0c+efWVI/tBTd0oeWeDHI= +github.com/grafana/pyroscope-go/godeltaprof v0.1.12/go.mod h1:aNSXN1bn1VHAd06EiepmwhAabHsMc67gx8itecdF2c8= github.com/grafana/regexp v0.0.0-20250905093917-f7b3be9d1853 h1:cLN4IBkmkYZNnk7EAJ0BHIethd+J6LqxFNw5mSiI2bM= github.com/grafana/regexp v0.0.0-20250905093917-f7b3be9d1853/go.mod h1:+JKpmjMGhpgPL+rXZ5nsZieVzvarn86asRlBg4uNGnk= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI= github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= -github.com/hashicorp/consul/api v1.34.4 h1:0U4YZ1Yp7K9WK9ex0gTJraFim26l02wCvsmf2ukalVE= -github.com/hashicorp/consul/api v1.34.4/go.mod h1:vz5gBNeycefpAAVNVbLBFObUu3isju6EK8UVZjXSTWc= -github.com/hashicorp/consul/sdk v0.18.1 h1:RDTeBvAeOveI2xI86sV+8WkaN7OkP4zz+cG3fOobDCM= -github.com/hashicorp/consul/sdk v0.18.1/go.mod h1:XdP2tEJmAvlK4jgoKTTtohGkRJlS4mU44mv9/sjU21s= +github.com/hashicorp/consul/api v1.34.5 h1:QpMhHZyfYsOsIu5n5QA7TQTLabM4OQJEbKi3pXXnw7U= +github.com/hashicorp/consul/api v1.34.5/go.mod h1:OrXEufkaxFy1pMIRHFrn3JkuircxMhA4BHHpbR8k+5U= +github.com/hashicorp/consul/sdk v0.18.2 h1:wMFx4OkUPg8un6kimUmzADVBsuRqUdNRtJ0KREGs7vM= +github.com/hashicorp/consul/sdk v0.18.2/go.mod h1:2V4Z2YguOFZelOtkQs3UnIrkCXDQ6iL3P4B6EtSqoQY= github.com/hashicorp/cronexpr v1.1.3 h1:rl5IkxXN2m681EfivTlccqIryzYJSXRGRNa0xeG7NA4= github.com/hashicorp/cronexpr v1.1.3/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -496,12 +497,12 @@ github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV91 github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU= github.com/klauspost/crc32 v1.3.0 h1:sSmTt3gUt81RP655XGZPElI0PelVTZ6YwCRnPSupoFM= github.com/klauspost/crc32 v1.3.0/go.mod h1:D7kQaZhnkX/Y0tstFGf8VUzv2UofNGqCjnC3zdHB0Hw= -github.com/knadh/koanf/maps v0.1.2 h1:RBfmAW5CnZT+PJ1CVc1QSJKf4Xu9kxfQgYVQSu8hpbo= -github.com/knadh/koanf/maps v0.1.2/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v1.0.0 h1:mHKLJTE7iXEys6deO5p6olAiZdG5zwp8Aebir+/EaRE= -github.com/knadh/koanf/providers/confmap v1.0.0/go.mod h1:txHYHiI2hAtF0/0sCmcuol4IDcuQbKTybiB1nOcUo1A= -github.com/knadh/koanf/v2 v2.3.4 h1:fnynNSDlujWE+v83hAp8wKr/cdoxHLO0629SN+U8Urc= -github.com/knadh/koanf/v2 v2.3.4/go.mod h1:gRb40VRAbd4iJMYYD5IxZ6hfuopFcXBpc9bbQpZwo28= +github.com/knadh/koanf/maps v0.1.3 h1:P1z7EvTqdFBrPYbzSvorvrpib+sjkUMxf0FVvA5NKK4= +github.com/knadh/koanf/maps v0.1.3/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v1.0.1 h1:L15hbvMqlvhwUuCtL9BkL+rqiMAjk6cZc8O9XoDtE3A= +github.com/knadh/koanf/providers/confmap v1.0.1/go.mod h1:txHYHiI2hAtF0/0sCmcuol4IDcuQbKTybiB1nOcUo1A= +github.com/knadh/koanf/v2 v2.3.6 h1:JoQPSJmvS4aP0xNc8xMDr5tcrkSEInL23/Il7pITAKo= +github.com/knadh/koanf/v2 v2.3.6/go.mod h1:gRb40VRAbd4iJMYYD5IxZ6hfuopFcXBpc9bbQpZwo28= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b h1:udzkj9S/zlT5X367kqJis0QP7YMxobob6zhzq6Yre00= github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -517,8 +518,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/linode/linodego v1.69.1 h1:f45N2MHR/oece2/ktTTCYmrlfse4//k3NgwcF5zbGZ0= github.com/linode/linodego v1.69.1/go.mod h1:Fha0NYsQSx5VZK1HQNJY/z/dIxxkFp+vb5veawbmAUw= -github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 h1:PwQumkgq4/acIiZhtifTV5OUqqiP82UAl0h87xj/l9k= -github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= +github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 h1:eveIIGn4BGM3qknO74omf6HYr30/exH+eVUTuAgwjZ0= +github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg= github.com/magefile/mage v1.17.2 h1:fyXVu1eadI8Ap1HCCNgEhJ5McIWiYhLR8uol64ZZc40= github.com/magefile/mage v1.17.2/go.mod h1:Yj51kqllmsgFpvvSzgrZPK9WtluG3kUhFaBUVLo4feA= github.com/mark3labs/mcp-go v0.54.1 h1:Ap/ptEB9FtWzFKM8NDsTA7QDxerQOC06eZigrTldVj0= @@ -529,10 +530,10 @@ github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= -github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= -github.com/mattn/go-runewidth v0.0.23 h1:7ykA0T0jkPpzSvMS5i9uoNn2Xy3R383f9HDx3RybWcw= -github.com/mattn/go-runewidth v0.0.23/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= +github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= +github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= +github.com/mattn/go-runewidth v0.0.30 h1:+KUuiDA4fF0R1p5FeueHefjDm+GIM+kWfFnDjybOPgk= +github.com/mattn/go-runewidth v0.0.30/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maypok86/otter/v2 v2.3.0 h1:8H8AVVFUSzJwIegKwv1uF5aGitTY+AIrtktg7OcLs8w= github.com/maypok86/otter/v2 v2.3.0/go.mod h1:XgIdlpmL6jYz882/CAx1E4C1ukfgDKSaw4mWq59+7l8= @@ -540,8 +541,8 @@ github.com/mdlayher/socket v0.6.0 h1:ScZPaAGyO1icQnbFrhPM8mnXyMu9qukC1K4ZoM2IQKU github.com/mdlayher/socket v0.6.0/go.mod h1:q7vozUAnxSqnjHc12Fik5yUKIzfZ8ITCfMkhOtE9z18= github.com/mdlayher/vsock v1.3.0 h1:bqQfZ1OznI03y6YiXp2sze05RVdzLn/zsfjnjd4+ivI= github.com/mdlayher/vsock v1.3.0/go.mod h1:WsuksavOvwCnV5UqGHUkvAvCy+Dqy81y4goKQTzxxNY= -github.com/miekg/dns v1.1.72 h1:vhmr+TF2A3tuoGNkLDFK9zi36F2LS+hKTRW0Uf8kbzI= -github.com/miekg/dns v1.1.72/go.mod h1:+EuEPhdHOsfk6Wk5TT2CzssZdqkmFhf8r+aVyDEToIs= +github.com/miekg/dns v1.1.73 h1:uhT8nJxmTrPJYClxVxTCX+CVn6qnzSiybRk72Z6DgrE= +github.com/miekg/dns v1.1.73/go.mod h1:RW2Obtfd5NZHvOFe3zYG0W8koWOQtAzyHaLo8vASBuQ= github.com/minio/crc64nvme v1.1.1 h1:8dwx/Pz49suywbO+auHCBpCtlW1OfpcLN7wYgVR6wAI= github.com/minio/crc64nvme v1.1.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= @@ -579,8 +580,8 @@ github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 h1:zrbMGy9YXpIeTnGj github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6/go.mod h1:rEKTHC9roVVicUIfZK7DYrdIoM0EOr8mK1Hj5s3JjH0= github.com/olekukonko/errors v1.3.0 h1:teJvgLGUEqMzBUms+Dj3/3szNqCG/Jdw9iDbum8fR6U= github.com/olekukonko/errors v1.3.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y= -github.com/olekukonko/ll v0.1.6 h1:lGVTHO+Qc4Qm+fce/2h2m5y9LvqaW+DCN7xW9hsU3uA= -github.com/olekukonko/ll v0.1.6/go.mod h1:NVUmjBb/aCtUpjKk75BhWrOlARz3dqsM+OtszpY4o88= +github.com/olekukonko/ll v0.1.8 h1:ysHCJRGHYKzmBSdz9w5AySztx7lG8SQY+naTGYUbsz8= +github.com/olekukonko/ll v0.1.8/go.mod h1:RPRC6UcscfFZgjo1nulkfMH5IM0QAYim0LfnMvUuozw= github.com/olekukonko/tablewriter v1.1.4 h1:ORUMI3dXbMnRlRggJX3+q7OzQFDdvgbN9nVWj1drm6I= github.com/olekukonko/tablewriter v1.1.4/go.mod h1:+kedxuyTtgoZLwif3P1Em4hARJs+mVnzKxmsCL/C5RY= github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.153.0 h1:ORagPr62RoPzXApgVn8sVIAIZe6pqk0/IDBkeC2iU10= @@ -629,8 +630,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= -github.com/opentracing-contrib/go-grpc v0.1.2 h1:MP16Ozc59kqqwn1v18aQxpeGZhsBanJ2iurZYaQSZ+g= -github.com/opentracing-contrib/go-grpc v0.1.2/go.mod h1:glU6rl1Fhfp9aXUHkE36K2mR4ht8vih0ekOVlWKEUHM= +github.com/opentracing-contrib/go-grpc v0.1.4 h1:m9VukGYQ+tfcgtwdsifjjFtAoWRqmcbnGhgRQcZ+ZQA= +github.com/opentracing-contrib/go-grpc v0.1.4/go.mod h1:xP8rkWX/qdQJVTkf01D6Fc002zN0WUMKsvuKg7Tf93E= github.com/opentracing-contrib/go-stdlib v1.1.1 h1:nl22krMt3PpAWPCKpDjFiAH4Qdr2855F5wOkQ52C0+w= github.com/opentracing-contrib/go-stdlib v1.1.1/go.mod h1:S0p+X9p6dcBkoMTL+Qq2VOvxKs9ys5PpYWXWqlCS0bQ= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= @@ -649,8 +650,8 @@ github.com/parquet-go/parquet-go v0.30.1 h1:Oy6ganNrAdFiVwy7wNmWagfPTWA2X9Z3tVHB github.com/parquet-go/parquet-go v0.30.1/go.mod h1:navtkAYr2LGoJVp141oXPlO/sxLvaOe3la2JEoD8+rg= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pb33f/jsonpath v0.8.2 h1:Ou4C7zjYClBm97dfZjDCjdZGusJoynv/vrtiEKNfj2Y= -github.com/pb33f/jsonpath v0.8.2/go.mod h1:zBV5LJW4OQOPatmQE2QdKpGQJvhDTlE5IEj6ASaRNTo= +github.com/pb33f/jsonpath v0.8.3 h1:gdOUYn31vic8iRSSR4I2SEv7UQf2WxLeDcUnDPpGZNE= +github.com/pb33f/jsonpath v0.8.3/go.mod h1:zBV5LJW4OQOPatmQE2QdKpGQJvhDTlE5IEj6ASaRNTo= github.com/pb33f/libopenapi v0.38.7 h1:Q2jfgRPdnU38WW8wQvrX2HEPGiqsxj01PX1BHmAEihc= github.com/pb33f/libopenapi v0.38.7/go.mod h1:naZ03Auhn7i+RJtMv8ck8l7Ag8E2/x2w66j9vsDFL38= github.com/pb33f/libopenapi-validator v0.13.8 h1:3t/5hUq8EYIWe6Uwj5RA7xFSWkleDbqsueA78/tIAo8= @@ -667,8 +668,8 @@ github.com/pelletier/go-toml/v2 v2.4.3/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8 github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM= github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.26 h1:GrpZw1gZttORinvzBdXPUXATeqlJjqUG/D87TKMnhjY= -github.com/pierrec/lz4/v4 v4.1.26/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4= +github.com/pierrec/lz4/v4 v4.1.29 h1:CDQY6qZOLI4DW0Nx6R1vRrifrCeQHnNXkMb0hZWXFjg= +github.com/pierrec/lz4/v4 v4.1.29/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4= github.com/pires/go-proxyproto v0.15.0 h1:dTshmNbFm/D+0+sbrxUuddPOZ5Y0B7c5NhtsBkm6LqI= github.com/pires/go-proxyproto v0.15.0/go.mod h1:OXsCrKwrK2tXS9YrI5tkHx5xaQlO8FH3lFW76orFh24= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -682,8 +683,8 @@ github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= -github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 h1:jL3a8soXdzuTCcRnKhOmtcsVOObdDTFf4O2B403HPRU= +github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/alertmanager v0.32.1 h1:BQ3jHXNq2A7VSD9Kh0Qx+kXbifNbHSDuKVbMmdRHHJ0= github.com/prometheus/alertmanager v0.32.1/go.mod h1:0Dy9faTtMgpVYxJVxV0o65elTxHnSRCF/7gy5BKGZiE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -696,8 +697,8 @@ github.com/prometheus/client_golang/exp v0.0.0-20260518105423-c9d5bc4c50a9/go.mo github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= -github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo= +github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.70.1 h1:1HvjP4D5oL3t8RsPlwxA9onvvStjtIHYE5XuuwOi/PY= @@ -730,8 +731,8 @@ github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 h1:1EYB5IzjZawrrnELUi78f9fPu57HuXjmddZPjrls/28= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.3/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36 h1:ObX9hZmK+VmijreZO/8x9pQ8/P/ToHD/bdSb4Eg4tUo= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36/go.mod h1:LEsDu4BubxK7/cWhtlQWfuxwL4rf/2UEpxXz1o1EMtM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= @@ -740,8 +741,8 @@ github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtr github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/sercand/kuberesolver/v6 v6.0.1 h1:XZUTA0gy/lgDYp/UhEwv7Js24F1j8NJ833QrWv0Xux4= github.com/sercand/kuberesolver/v6 v6.0.1/go.mod h1:C0tsTuRMONSY+Xf7pv7RMW1/JlewY1+wS8SZE+1lf1s= -github.com/shirou/gopsutil/v4 v4.26.4 h1:B4SXVbcwTyrocPHEmWBC4uCYr4Xcu3MK1TXqbprAOWY= -github.com/shirou/gopsutil/v4 v4.26.4/go.mod h1:LZ6ewCSkBqUpvSOf+LsTGnRinC6iaNUNMGBtDkJBaLQ= +github.com/shirou/gopsutil/v4 v4.26.8 h1:YQMTF/1J50B5+Y0vlo1eDRf5DoR7Gk69hY+8wjYkQeo= +github.com/shirou/gopsutil/v4 v4.26.8/go.mod h1:5O9FjBiXoTDFatIWjZZosqj4pV0DRtLx598xGbBehzM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sony/gobreaker v1.0.0 h1:feX5fGGXSl3dYd4aHZItw+FpHLvvoaqkawKjVNiFMNQ= @@ -759,16 +760,17 @@ github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= -github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= -github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= +github.com/spiffe/go-spiffe/v2 v2.7.0 h1:uXe1MflJoHw58wAUvxVlcM7WpKtijWG7I1UidcGh6g4= +github.com/spiffe/go-spiffe/v2 v2.7.0/go.mod h1:47Q0Q9/AqGha8QLHp+kxpH4Wca7X7EnOtlIJy3mxZ3U= github.com/stackitcloud/stackit-sdk-go/core v0.26.0 h1:jQEb9gkehfp6VCP6TcYk7BI10cz4l0KM2L6hqYBH2QA= github.com/stackitcloud/stackit-sdk-go/core v0.26.0/go.mod h1:WU1hhxnjXw2EV7CYa1nlEvNpMiRY6CvmIOaHuL3pOaA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= +github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -785,8 +787,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/thanos-io/objstore v0.0.0-20220809103346-8ef1f215e2bf h1:onQsPyHlq2yIWU+Nfl6yStuqnZuVQQN8FZ8sBb2wqtw= github.com/thanos-io/objstore v0.0.0-20220809103346-8ef1f215e2bf/go.mod h1:v0NhuxxxUFUPatQcVNSCUkBEVezXzl7LSdaBOZygq98= -github.com/tinylib/msgp v1.6.1 h1:ESRv8eL3u+DNHUoSAAQRE50Hm162zqAnBoGv9PzScPY= -github.com/tinylib/msgp v1.6.1/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA= +github.com/tinylib/msgp v1.6.4 h1:mOwYbyYDLPj35mkA2BjjYejgJk9BuHxDdvRnb6v2ZcQ= +github.com/tinylib/msgp v1.6.4/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA= github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA= github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI= github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw= @@ -795,8 +797,8 @@ github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqri github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/twmb/franz-go v1.7.0/go.mod h1:PMze0jNfNghhih2XHbkmTFykbMF5sJqmNJB31DOOzro= -github.com/twmb/franz-go v1.21.2 h1:WrvV/spF48JzcRylqDQy02Vm6V6W4lhtD9Y4BOYNMu4= -github.com/twmb/franz-go v1.21.2/go.mod h1:rfoMTnVk7107fhTGxfEKIHP/e7tPe6oyij/ywzO0czk= +github.com/twmb/franz-go v1.21.6 h1:+v0dQJVIIuw9uPmPWmPrkoUHs1pPeV8MSwA4eU/Y2kY= +github.com/twmb/franz-go v1.21.6/go.mod h1:wMepkgCatAdV9vCsuwM+wr+C1fl7KV/41+uHGAjt/wc= github.com/twmb/franz-go/pkg/kadm v1.18.0 h1:WRf/LZmDdcDXwX7WMbtDU++v+b3NzYh2bCGoPMmzirw= github.com/twmb/franz-go/pkg/kadm v1.18.0/go.mod h1:XeLhGoLXLFzK8/ryv5FfpxPxGwj4oFEGpPJMB/x6KDE= github.com/twmb/franz-go/pkg/kfake v0.0.0-20260421215025-4e7a1e1569ac h1:6Dn8at7J4+5A8H7NgVLcPj4dfVm4pRtUZMHxXmBKxJ4= @@ -816,8 +818,8 @@ github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/twpayne/go-geom v1.6.1 h1:iLE+Opv0Ihm/ABIcvQFGIiFBXd76oBIar9drAwHFhR4= github.com/twpayne/go-geom v1.6.1/go.mod h1:Kr+Nly6BswFsKM5sd31YaoWS5PeDDH2NftJTK7Gd028= -github.com/ua-parser/uap-go v0.0.0-20251207011819-db9adb27a0b8 h1:yS0rzVnj7Z/ZeHzvv5erQbO2b8gyTL4CeMNodl9SJMQ= -github.com/ua-parser/uap-go v0.0.0-20251207011819-db9adb27a0b8/go.mod h1:gwANdYmo9R8LLwGnyDFWK2PMsaXXX2HhAvCnb/UhZsM= +github.com/ua-parser/uap-go v0.0.0-20260529044130-17c35e68e58c h1:XbG4n3OWA1PcRTpbBA22E2ChPLvJCuwYRXO12tIyVL0= +github.com/ua-parser/uap-go v0.0.0-20260529044130-17c35e68e58c/go.mod h1:gwANdYmo9R8LLwGnyDFWK2PMsaXXX2HhAvCnb/UhZsM= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= @@ -833,8 +835,8 @@ github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT0 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= -github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +github.com/yuin/gopher-lua v1.1.2 h1:yF/FjE3hD65tBbt0VXLE13HWS9h34fdzJmrWRXwobGA= +github.com/yuin/gopher-lua v1.1.2/go.mod h1:7aRmXIWl37SqRf0koeyylBEzJ+aPt8A+mmkQ4f1ntR8= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= @@ -991,8 +993,8 @@ go.opentelemetry.io/contrib/bridges/otelzap v0.18.0 h1:EkWTww6Nqs2P29r01NeuNsG7q go.opentelemetry.io/contrib/bridges/otelzap v0.18.0/go.mod h1:lj3bgA/c7nJy0NhxqyvWJFC30aTgB+G0RKDdLbvJ4QM= go.opentelemetry.io/contrib/bridges/prometheus v0.69.0 h1:saQoWg5845Q8TojpqeVStS7zGwVZ6bc5W2PJavTPiBM= go.opentelemetry.io/contrib/bridges/prometheus v0.69.0/go.mod h1:AAaS6xs5AyqMdR3Ir0nSWK+QudL2XM8Vbw5INzUxNc8= -go.opentelemetry.io/contrib/detectors/gcp v1.43.0 h1:62yY3dT7/ShwOxzA0RsKRgshBmfElKI4d/Myu2OxDFU= -go.opentelemetry.io/contrib/detectors/gcp v1.43.0/go.mod h1:RyaZMFY7yi1kAs45S6mbFGz8O8rqB0dTY14uzvG4LCs= +go.opentelemetry.io/contrib/detectors/gcp v1.44.0 h1:NmLfL734pJhM0JKaYd2Y28+nY9dPRWYAAbxhRCrKXPw= +go.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s= go.opentelemetry.io/contrib/exporters/autoexport v0.69.0 h1:R3jsCoTIzv0BiYNhW0axyswn/6SMJ8xL1OuGxvni1Kw= go.opentelemetry.io/contrib/exporters/autoexport v0.69.0/go.mod h1:m07gqyr2QhQxKOKb5vqKCCBtLH3uqlNYR7PU/FISXVU= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0 h1:2yEATaop1/a1I4psnSLgWVPLWwCzkqWakgJy7xTDVy0= @@ -1092,10 +1094,10 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= -golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= -golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 h1:jiDhWWeC7jfWqR9c/uplMOqJ0sbNlNWv0UkzE0vX1MA= -golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90/go.mod h1:xE1HEv6b+1SCZ5/uscMRjUBKtIxworgEcEi+/n9NQDQ= +golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= +golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= +golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba h1:Ck8QetSgk912qxWLMCKxd0in+aiyBQyDSMae6e/xmpU= +golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba/go.mod h1:50RgIsmK7OwqzTTeqcSXQW8SswW0o8fRcDxmqGluJ8E= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -1103,8 +1105,6 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs= -golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1124,8 +1124,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= -golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= +golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues= +golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1139,8 +1139,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1168,8 +1168,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1179,8 +1179,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= -golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= -golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= +golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE= +golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1191,8 +1191,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= -golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1203,8 +1203,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI= -golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= +golang.org/x/tools v0.50.0 h1:c2ifzfcuY7L90lZ2aKd8S4K2NpASF08SZx9ZuJkHmSU= +golang.org/x/tools v0.50.0/go.mod h1:7ulVMw3831Mwi5EZD6RomGyffr4VFjuNYXf2BbCEAV0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1214,17 +1214,17 @@ gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E google.golang.org/api v0.287.1 h1:LiyJx32VU3cwQfLchn/513qKhc25hq0pEANYJoWNnnI= google.golang.org/api v0.287.1/go.mod h1:lM2kYRzYUCBY91P9h6VF1PYmvhxii3O5hji37qRvIcY= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20260519071638-aa98bba5eb94 h1:YJjbgu+dkp5kUJLfpMyCLfBIWZb/FcJyuLeo1gVBOuo= -google.golang.org/genproto v0.0.0-20260519071638-aa98bba5eb94/go.mod h1:RRHjglSYABVCWpQ7USCpdfhcd9t4PkajvVwyynZizTc= -google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 h1:jQ9p21COKWjP3VwuFrNRiiOTMh3mPpN45R7SLrH/HUU= -google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7/go.mod h1:KqHwBx2upmfa1XSi1WuRvC+2VGCLtooKkfmyvRbUmqA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 h1:eM/YSd5bBFagF51o1E745Ta7RwzpW0h+z+QDNZOgmQ8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto v0.0.0-20260911204522-f61a6ca850bd h1:s/EXdxMDrmT++u0VepJKO4U6dzOPJVRdHKmrazC1Qxg= +google.golang.org/genproto v0.0.0-20260911204522-f61a6ca850bd/go.mod h1:JfZ1Hyx5mAJgX/ip0vEicmPvzE6rIrbacB7rHMfjD7Q= +google.golang.org/genproto/googleapis/api v0.0.0-20260911204522-f61a6ca850bd h1:jgCQeWccunvocKNK2RjhQHNiSjSeMMuBpQ/5pbP+2lA= +google.golang.org/genproto/googleapis/api v0.0.0-20260911204522-f61a6ca850bd/go.mod h1:r4KD2hOq82JBWpTWkJ9NZLf6EwmRvAPIFmk7hPNtd+0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260911204522-f61a6ca850bd h1:29LZPNIJg+GEmJwZXruJJRwqy/wnWAYZXDtROToV/aQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260911204522-f61a6ca850bd/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE= -google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= -google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= -google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/grpc v1.83.1 h1:HIO0+BEtBP6soyqvqC8sNUjZ7bTs+0hFQuFF+RAy++Y= +google.golang.org/grpc v1.83.1/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1234,8 +1234,8 @@ gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnf gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.67.2 h1:JtOSMb9OuaCZKr7h5D/h6iii14sK0hLbplTc6frx4Ss= -gopkg.in/ini.v1 v1.67.2/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= +gopkg.in/ini.v1 v1.67.3 h1:iM9Lhz5MRSGhHVGGwCuzG9KO8PoirCXj/m/qTmOJJQw= +gopkg.in/ini.v1 v1.67.3/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1257,11 +1257,11 @@ k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3d k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad/go.mod h1:0/mqHCVhlumdJ3BhCfnjSZQE037nAhNodh1/hK0T8/I= k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 h1:jVkFFVfXdXP74B/zbO3hM3hpSFD0xvhQ5U686DPurkE= k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3/go.mod h1:M2s5JB1lIYP3jzZdorPLHXIPJzt9vv2muW5a6L9DtNM= -sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= -sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5 h1:k9jo7ED/fsfOcz3L1P20P5tjTNtsdQNwMOG2aKzHrl8= +sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= -sigs.k8s.io/structured-merge-diff/v6 v6.4.1 h1:AkER7js0XVWi/F/V2Iwl5N7O/B9VP2JyrOMmHPdco+g= -sigs.k8s.io/structured-merge-diff/v6 v6.4.1/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/structured-merge-diff/v6 v6.4.2 h1:qdOxHwrl2Kaag1aQEarlYcOA9vSyGCp3CIki3aW8c4Q= +sigs.k8s.io/structured-merge-diff/v6 v6.4.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/tools/go.mod b/tools/go.mod index 114179259ff..e9c1b93bd17 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -23,12 +23,12 @@ require ( 4d63.com/gocheckcompilerdirectives v1.4.0 // indirect 4d63.com/gochecknoglobals v0.2.2 // indirect charm.land/lipgloss/v2 v2.0.6 // indirect - codeberg.org/chavacava/garif v0.2.0 // indirect + codeberg.org/chavacava/garif v0.2.1 // indirect codeberg.org/polyfloyd/go-errorlint v1.9.0 // indirect dev.gaijin.team/go/exhaustruct/v4 v4.0.0 // indirect dev.gaijin.team/go/exhaustruct/v5 v5.0.3 // indirect dev.gaijin.team/go/golib v0.8.1 // indirect - github.com/4meepo/tagalign v1.4.3 // indirect + github.com/4meepo/tagalign v1.4.4 // indirect github.com/Abirdcfly/dupword v0.1.8 // indirect github.com/AdminBenni/iota-mixing v1.0.0 // indirect github.com/AlwxSin/noinlineerr v1.0.6 // indirect @@ -51,7 +51,7 @@ require ( github.com/ashanbrown/forbidigo/v2 v2.3.1 // indirect github.com/ashanbrown/makezero/v2 v2.2.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bitfield/gotestdox v0.2.2 // indirect + github.com/bitfield/gotestdox v0.2.3 // indirect github.com/bkielbasa/cyclop v1.2.3 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect github.com/bombsimon/wsl/v4 v4.7.0 // indirect @@ -65,7 +65,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.11 // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect - github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886 // indirect + github.com/charmbracelet/ultraviolet v0.0.0-20260910203606-6c9e17dc7a16 // indirect github.com/charmbracelet/x/ansi v0.11.8 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect github.com/charmbracelet/x/termios v0.1.1 // indirect @@ -97,8 +97,8 @@ require ( github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/godoc-lint/godoc-lint v0.11.2 // indirect - github.com/gofrs/flock v0.13.0 // indirect + github.com/godoc-lint/godoc-lint v0.11.4 // indirect + github.com/gofrs/flock v0.13.1 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golangci/asciicheck v0.5.0 // indirect github.com/golangci/canonicalheader v0.0.0-20260827115959-a25c71c521f6 // indirect @@ -110,7 +110,7 @@ require ( github.com/golangci/misspell v0.8.0 // indirect github.com/golangci/plugin-module-register v0.1.2 // indirect github.com/golangci/revgrep v0.8.0 // indirect - github.com/golangci/rowserrcheck v0.0.0-20260419091836-c5f79b8a11ba // indirect + github.com/golangci/rowserrcheck v0.0.0-20260901154044-241134db7241 // indirect github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e // indirect github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e // indirect github.com/google/go-cmp v0.7.0 // indirect @@ -151,9 +151,9 @@ require ( github.com/maratori/testpackage v1.1.2 // indirect github.com/matoous/godox v1.1.0 // indirect github.com/mattn/go-colorable v0.1.15 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.24 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mattn/go-isatty v0.0.24 // indirect + github.com/mattn/go-runewidth v0.0.30 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mgechev/revive v1.15.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -176,7 +176,7 @@ require ( github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/raeperd/recvcheck v0.3.0 // indirect + github.com/raeperd/recvcheck v0.3.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.16.0 // indirect github.com/ryancurrah/gomodguard v1.4.1 // indirect @@ -187,7 +187,7 @@ require ( github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.29.0 // indirect github.com/securego/gosec/v2 v2.28.0 // indirect - github.com/sirupsen/logrus v1.10.1 // indirect + github.com/sirupsen/logrus v1.10.2 // indirect github.com/sivchari/containedctx v1.0.3 // indirect github.com/sonatard/noctx v0.5.1 // indirect github.com/sourcegraph/go-diff v0.8.0 // indirect @@ -201,7 +201,7 @@ require ( github.com/stretchr/objx v0.5.3 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/tetafro/godot v1.5.6 // indirect - github.com/timakin/bodyclose v0.0.0-20260129054331-73d1f95b84b4 // indirect + github.com/timakin/bodyclose v0.0.0-20260723120731-857993a2939c // indirect github.com/timonwong/loggercheck v0.11.0 // indirect github.com/tomarrell/wrapcheck/v2 v2.12.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect @@ -210,7 +210,7 @@ require ( github.com/uudashr/gocognit v1.2.1 // indirect github.com/uudashr/iface v1.5.1 // indirect github.com/xen0n/gosmopolitan v1.3.0 // indirect - github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect + github.com/xo/terminfo v1.0.0 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.3.0 // indirect github.com/ykadowak/zerologlint v0.1.5 // indirect @@ -218,22 +218,22 @@ require ( go-simpler.org/musttag v0.14.0 // indirect go-simpler.org/sloglint v0.12.0 // indirect go.augendre.info/arangolint v0.4.0 // indirect - go.augendre.info/fatcontext v0.10.0 // indirect + go.augendre.info/fatcontext v0.10.1 // indirect go.uber.org/multierr v1.10.0 // indirect go.uber.org/zap v1.27.0 // indirect - go.yaml.in/yaml/v2 v2.4.2 // indirect + go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/crypto v0.54.0 // indirect - golang.org/x/exp/typeparams v0.0.0-20260811152304-ee035b5b010f // indirect - golang.org/x/mod v0.40.0 // indirect - golang.org/x/sync v0.22.0 // indirect - golang.org/x/sys v0.47.0 // indirect - golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5 // indirect + golang.org/x/exp/typeparams v0.0.0-20260908205506-85c1c2202aba // indirect + golang.org/x/mod v0.41.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/telemetry v0.0.0-20260910141331-15ceca2b0a1f // indirect golang.org/x/term v0.45.0 // indirect golang.org/x/text v0.40.0 // indirect golang.org/x/tools v0.49.0 // indirect - google.golang.org/protobuf v1.36.11 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect + google.golang.org/protobuf v1.36.12 // indirect + gopkg.in/ini.v1 v1.67.3 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gotest.tools/gotestsum v1.13.0 // indirect honnef.co/go/tools v0.8.1 // indirect diff --git a/tools/go.sum b/tools/go.sum index 8409d6e59d3..acb0ec639e5 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -codeberg.org/chavacava/garif v0.2.0 h1:F0tVjhYbuOCnvNcU3YSpO6b3Waw6Bimy4K0mM8y6MfY= -codeberg.org/chavacava/garif v0.2.0/go.mod h1:P2BPbVbT4QcvLZrORc2T29szK3xEOlnl0GiPTJmEqBQ= +codeberg.org/chavacava/garif v0.2.1 h1:K9oYxSlvlXrHXyW26Z4q61bTpJDo1wbvXcYKar/F/LM= +codeberg.org/chavacava/garif v0.2.1/go.mod h1:oHnDSmc0f9K1MeE+MQD/yjkiIB5Xsn5y3S9Dg96Xk84= codeberg.org/polyfloyd/go-errorlint v1.9.0 h1:VkdEEmA1VBpH6ecQoMR4LdphVI3fA4RrCh2an7YmodI= codeberg.org/polyfloyd/go-errorlint v1.9.0/go.mod h1:GPRRu2LzVijNn4YkrZYJfatQIdS+TrcK8rL5Xs24qw8= dev.gaijin.team/go/exhaustruct/v4 v4.0.0 h1:873r7aNneqoBB3IaFIzhvt2RFYTuHgmMjoKfwODoI1Y= @@ -47,8 +47,8 @@ dev.gaijin.team/go/exhaustruct/v5 v5.0.3/go.mod h1:KwtBsX8nHHH1YxhxkpiBq6bfsmw5W dev.gaijin.team/go/golib v0.8.1 h1:JYju4x9BSo+QD/AYeHULVDcvEhiFg8wOi6pT0IaZF5E= dev.gaijin.team/go/golib v0.8.1/go.mod h1:c5fu7t1RSGMxSQgcUYO1sODbzsYnOCXJLmHeNG1Eb+0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/4meepo/tagalign v1.4.3 h1:Bnu7jGWwbfpAie2vyl63Zup5KuRv21olsPIha53BJr8= -github.com/4meepo/tagalign v1.4.3/go.mod h1:00WwRjiuSbrRJnSVeGWPLp2epS5Q/l4UEy0apLLS37c= +github.com/4meepo/tagalign v1.4.4 h1:052JDGj2pBORc6NkD30dDXpsUpoYszDeUwr9/5YZuVA= +github.com/4meepo/tagalign v1.4.4/go.mod h1:00WwRjiuSbrRJnSVeGWPLp2epS5Q/l4UEy0apLLS37c= github.com/Abirdcfly/dupword v0.1.8 h1:SrhcUuGsROBuChFxHALRYzyyPODWn9zwghmzPvD9Cd8= github.com/Abirdcfly/dupword v0.1.8/go.mod h1:XZrhVnI7YGpsTiWZANSQaBJ4QpL/Tq5vIEdKJJAs9WI= github.com/AdminBenni/iota-mixing v1.0.0 h1:Os6lpjG2dp/AE5fYBPAA1zfa2qMdCAWwPMCgpwKq7wo= @@ -106,8 +106,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE= -github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= +github.com/bitfield/gotestdox v0.2.3 h1:H8Wy07kYacr3YSF5aJON/m9ASE+PGKOSufXkTjqQGb8= +github.com/bitfield/gotestdox v0.2.3/go.mod h1:bq/HemlNNqEvjOzy7brevVhzZD8WTGFDGq59DOIsHqI= github.com/bkielbasa/cyclop v1.2.3 h1:faIVMIGDIANuGPWH031CZJTi2ymOQBULs9H21HSMa5w= github.com/bkielbasa/cyclop v1.2.3/go.mod h1:kHTwA9Q0uZqOADdupvcFJQtp/ksSnytRMe8ztxG8Fuo= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= @@ -137,8 +137,8 @@ github.com/charithe/durationcheck v0.0.11 h1:g1/EX1eIiKS57NTWsYtHDZ/APfeXKhye1Di github.com/charithe/durationcheck v0.0.11/go.mod h1:x5iZaixRNl8ctbM+3B2RrPG5t856TxRyVQEnbIEM2X4= github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q= github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= -github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886 h1:rdnVWKgJpTVXKuKuJyxDJ+NFJdUaUqGvyGy61OcvlbA= -github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886/go.mod h1:nAw0d9PhFp1qdzi2xhQU5YOu5sVpDIHWlaW2Uz/bCro= +github.com/charmbracelet/ultraviolet v0.0.0-20260910203606-6c9e17dc7a16 h1:/hSCZO1puetbGd2JikHKN0nAcb2mFevzxJElFoduhaw= +github.com/charmbracelet/ultraviolet v0.0.0-20260910203606-6c9e17dc7a16/go.mod h1:JFvmQPZh3uAu7PpSZU91bcR0BrIy24HhW+0EsW1uGxE= github.com/charmbracelet/x/ansi v0.11.8 h1:JMFwp0CgDC2+jcOB162HH5k7I3FVbgFSMMYg7dSPBQQ= github.com/charmbracelet/x/ansi v0.11.8/go.mod h1:ZNN+3mXny/516oTQPLMPIBeSINvNJJQ8uQXDgbeJxY0= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= @@ -242,10 +242,10 @@ github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUW github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/godoc-lint/godoc-lint v0.11.2 h1:Bp0FkJWoSdNsBikdNgIcgtaoo+xz6I/Y9s5WSBQUeeM= -github.com/godoc-lint/godoc-lint v0.11.2/go.mod h1:iVpGdL1JCikNH2gGeAn3Hh+AgN5Gx/I/cxV+91L41jo= -github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= -github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= +github.com/godoc-lint/godoc-lint v0.11.4 h1:N9zUYVJ/OkznBbrBsU/zODvua64EUplMBLQWStO3+1M= +github.com/godoc-lint/godoc-lint v0.11.4/go.mod h1:7usTXoxS0QYIi5usTSCPwR0w/6xLjcz450shXjLn3t4= +github.com/gofrs/flock v0.13.1 h1:jjREztyBeSKBZYAC+mgc1laB+xsgy4kYMf3FbKF2UBo= +github.com/gofrs/flock v0.13.1/go.mod h1:sf4BFiHwnvgxa25DlQoDqXQnwRMEOwqxRq37P6MzzmE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -296,8 +296,8 @@ github.com/golangci/plugin-module-register v0.1.2 h1:e5WM6PO6NIAEcij3B053CohVp3H github.com/golangci/plugin-module-register v0.1.2/go.mod h1:1+QGTsKBvAIvPvoY/os+G5eoqxWn70HYDm2uvUyGuVw= github.com/golangci/revgrep v0.8.0 h1:EZBctwbVd0aMeRnNUsFogoyayvKHyxlV3CdUA46FX2s= github.com/golangci/revgrep v0.8.0/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= -github.com/golangci/rowserrcheck v0.0.0-20260419091836-c5f79b8a11ba h1:lqtcnSMDuuJdu/LrKWi5RJzpSNLOJXYe/nzQutTI5kg= -github.com/golangci/rowserrcheck v0.0.0-20260419091836-c5f79b8a11ba/go.mod h1:sCBNcpRmhJCtbFGz49+IM3ETTFf7QdJ30AeYCd43NKk= +github.com/golangci/rowserrcheck v0.0.0-20260901154044-241134db7241 h1:0kPqfqytQizeQ9WBk487NcsGcRdS8YhHeUhXxkfEAhA= +github.com/golangci/rowserrcheck v0.0.0-20260901154044-241134db7241/go.mod h1:lczq5oJ8PxpMESQG6dO3iFYTQPhpqoMOYw//n2FEnHA= github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e h1:ai0EfmVYE2bRA5htgAG9r7s3tHsfjIhN98WshBTJ9jM= github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e/go.mod h1:Vrn4B5oR9qRwM+f54koyeH3yzphlecwERs0el27Fr/s= github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e h1:gD6P7NEo7Eqtt0ssnqSJNNndxe69DOQ24A5h7+i3KpM= @@ -438,13 +438,14 @@ github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY= github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= +github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU= -github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/mattn/go-runewidth v0.0.30 h1:+KUuiDA4fF0R1p5FeueHefjDm+GIM+kWfFnDjybOPgk= +github.com/mattn/go-runewidth v0.0.30/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mgechev/revive v1.15.0 h1:vJ0HzSBzfNyPbHKolgiFjHxLek9KUijhqh42yGoqZ8Q= github.com/mgechev/revive v1.15.0/go.mod h1:LlAKO3QQe9OJ0pVZzI2GPa8CbXGZ/9lNpCGvK4T/a8A= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -525,8 +526,8 @@ github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= -github.com/raeperd/recvcheck v0.3.0 h1:PM+XYvyxIj3bo+kobJfFTdTuU3Lmfu96mKDbyHDbRt8= -github.com/raeperd/recvcheck v0.3.0/go.mod h1:PZNwG+HztFYMH2ZPq0Hu3QgkV2yiA6VrtNz9c1fXWJo= +github.com/raeperd/recvcheck v0.3.1 h1:p7nZMxiCWkdUtY2i3o+pv1h4fJCR5gpvqAXr9326hEY= +github.com/raeperd/recvcheck v0.3.1/go.mod h1:CbE7iRocQ4uc71JwpW/CPSh4BShnkre4A9Gb508RypU= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -554,8 +555,8 @@ github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NF github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.10.1 h1:xi4336Zh11WpU14fXR6I67V3yaTPQYwRx2WEtHbRg4Q= -github.com/sirupsen/logrus v1.10.1/go.mod h1:vsQHnG7xzNsxk3NrwboUiWPnIC3dmbjcGPykD7+tiHk= +github.com/sirupsen/logrus v1.10.2 h1:G2SED73/qrAu6YwbdxOD6peLkCBI3z7L+ykJFTXJBBo= +github.com/sirupsen/logrus v1.10.2/go.mod h1:SLEg8TqYulVKKfIGHldVp2K2aYz2DKSVBq4g/H5bR7Q= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/sonatard/noctx v0.5.1 h1:wklWg9c9ZYugOAk7qG4yP4PBrlQsmSLPTvW1K4PRQMs= @@ -582,11 +583,18 @@ github.com/stbenjam/no-sprintf-host-port v0.3.1 h1:AyX7+dxI4IdLBPtDbsGAyqiTSLpCP github.com/stbenjam/no-sprintf-host-port v0.3.1/go.mod h1:ODbZesTCHMVKthBHskvUUexdcNHAQRXk9NpSsL8p/HQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= @@ -597,8 +605,8 @@ github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpR github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v1.5.6 h1:IEkrFCwXaYHlOn4mGzGS3F3dkP6m9t0jpwqBFPIkKiA= github.com/tetafro/godot v1.5.6/go.mod h1:eOkMrVQurDui411nBY2FA05EYH01r14LuWY/NrVDVcU= -github.com/timakin/bodyclose v0.0.0-20260129054331-73d1f95b84b4 h1:SiHe5XLTn9sFWJ5pBwJ5FN/4j34q9ZlOAD//kMoMYp0= -github.com/timakin/bodyclose v0.0.0-20260129054331-73d1f95b84b4/go.mod h1:sDHLK7rb/59v/ZxZ7KtymgcoxuUMxjXq8gtu9VMOK8M= +github.com/timakin/bodyclose v0.0.0-20260723120731-857993a2939c h1:d/FUP8GD4QiY/rdFzZmBu3KqL9eBNVzMu7W/5pGkaMM= +github.com/timakin/bodyclose v0.0.0-20260723120731-857993a2939c/go.mod h1:sDHLK7rb/59v/ZxZ7KtymgcoxuUMxjXq8gtu9VMOK8M= github.com/timonwong/loggercheck v0.11.0 h1:jdaMpYBl+Uq9mWPXv1r8jc5fC3gyXx4/WGwTnnNKn4M= github.com/timonwong/loggercheck v0.11.0/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= github.com/tomarrell/wrapcheck/v2 v2.12.0 h1:H/qQ1aNWz/eeIhxKAFvkfIA+N7YDvq6TWVFL27Of9is= @@ -615,8 +623,8 @@ github.com/uudashr/iface v1.5.1 h1:BS3yrgaT55s3dAtJoxuTnsZNbsejq/mVuzp49YDyfBA= github.com/uudashr/iface v1.5.1/go.mod h1:5UWoT6SvTdTww/KToRj6clO+n4Kg3/NrAQvgOB+5Ggw= github.com/xen0n/gosmopolitan v1.3.0 h1:zAZI1zefvo7gcpbCOrPSHJZJYA9ZgLfJqtKzZ5pHqQM= github.com/xen0n/gosmopolitan v1.3.0/go.mod h1:rckfr5T6o4lBtM1ga7mLGKZmLxswUoH1zxHgNXOsEt4= -github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= -github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= +github.com/xo/terminfo v1.0.0 h1:2ZpYzqWzyyytjk3TP6aJVDhkMAkc99/1xKQdA3TDTBY= +github.com/xo/terminfo v1.0.0/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= @@ -639,8 +647,8 @@ go-simpler.org/sloglint v0.12.0 h1:UzWDlLWNE5FLqsvyq3tWYHuQMbqrervOhT8qPl4Mmw4= go-simpler.org/sloglint v0.12.0/go.mod h1:jBjjC2bm8rYrs88oTRlFX497kWjJsyZWYoNaXkGRI6I= go.augendre.info/arangolint v0.4.0 h1:xSCZjRoS93nXazBSg5d0OGCi9APPLNMmmLrC995tR50= go.augendre.info/arangolint v0.4.0/go.mod h1:l+f/b4plABuFISuKnTGD4RioXiCCgghv2xqst/xOvAA= -go.augendre.info/fatcontext v0.10.0 h1:HhFopmivh8U1+AU7f0kuwUeg2eiIns7YsGQOMHwSJ90= -go.augendre.info/fatcontext v0.10.0/go.mod h1:pqpGvA9GlrXy+aXkp8L2dKz12Zp4g2FhzcAtwToU+2w= +go.augendre.info/fatcontext v0.10.1 h1:HCS/+eob32cM0mEtmZM6NiXdqvS5KiZmsR+fCubTpbc= +go.augendre.info/fatcontext v0.10.1/go.mod h1:pqpGvA9GlrXy+aXkp8L2dKz12Zp4g2FhzcAtwToU+2w= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -652,8 +660,8 @@ go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= -go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= +go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= @@ -680,8 +688,8 @@ golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/y golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20260811152304-ee035b5b010f h1:+lI8cDJ4uceLipg2f1ODay7fEuLkk0BIHXd6PB8icxo= -golang.org/x/exp/typeparams v0.0.0-20260811152304-ee035b5b010f/go.mod h1:PqrXSW65cXDZH0k4IeUbhmg/bcAZDbzNz3byBpKCsXo= +golang.org/x/exp/typeparams v0.0.0-20260908205506-85c1c2202aba h1:ZoZmFkcuQ289xJilBm9Ck3W+/okrhXc4LUpbtKFQE4k= +golang.org/x/exp/typeparams v0.0.0-20260908205506-85c1c2202aba/go.mod h1:qkMnvgP8C7+xkci04txL2SJFc/0PGqnkf6gs5JUC43E= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -706,8 +714,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs= -golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE= +golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= +golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -763,8 +771,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -808,11 +816,10 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5 h1:ZUSxONxc981v7AW7QUg+I9WwZzSTTJ019ENBYr5pV/Q= -golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5/go.mod h1:LVehoXe41cL5SCVQilsV7Gg6BNG+Js6P9PhSbYTIUkQ= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/telemetry v0.0.0-20260910141331-15ceca2b0a1f h1:5LLXkapW8RSq5f6l0ztG82Xt1OYp5uRIyMHuZVmkm4k= +golang.org/x/telemetry v0.0.0-20260910141331-15ceca2b0a1f/go.mod h1:i+ivNqjDnTF3WTElsdk5g9V5DTSBYgdNo7xTU9SDwYA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -963,17 +970,16 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.3 h1:iM9Lhz5MRSGhHVGGwCuzG9KO8PoirCXj/m/qTmOJJQw= +gopkg.in/ini.v1 v1.67.3/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -981,6 +987,7 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/gotestsum v1.13.0 h1:+Lh454O9mu9AMG1APV4o0y7oDYKyik/3kBOiCqiEpRo= diff --git a/vendor/cel.dev/expr/README.md b/vendor/cel.dev/expr/README.md index 42d67f87c26..f3bcbe4bf5e 100644 --- a/vendor/cel.dev/expr/README.md +++ b/vendor/cel.dev/expr/README.md @@ -47,7 +47,7 @@ highly recommended to serialize the type-checked expression as a protocol buffer. The CEL team will maintains canonical protocol buffers for ASTs and will keep these versions identical and wire-compatible in perpetuity: -* [CEL canonical](https://github.com/google/cel-spec/tree/master/proto/cel/expr) +* [CEL canonical](https://github.com/cel-expr/cel-spec/tree/master/proto/cel/expr) * [CEL v1alpha1](https://github.com/googleapis/googleapis/tree/master/google/api/expr/v1alpha1) diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md index c50933e2a61..51c2683efd2 100644 --- a/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,5 +1,19 @@ # Changes +## [0.23.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.23.1...auth/v0.23.2) (2026-08-20) + + +### Bug Fixes + +* **auth:** Eliminate timing race conditions in grpctransport otel tests ([#20175](https://github.com/googleapis/google-cloud-go/issues/20175)) ([#20382](https://github.com/googleapis/google-cloud-go/issues/20382)) ([637505e](https://github.com/googleapis/google-cloud-go/commit/637505e5d5f090eec020604c3702b6ace11dcd38)) + +## [0.23.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.23.0...auth/v0.23.1) (2026-08-13) + + +### Bug Fixes + +* **auth:** Fix OpenTelemetry test flake in grpctransport ([#20191](https://github.com/googleapis/google-cloud-go/issues/20191)) ([e43ce28](https://github.com/googleapis/google-cloud-go/commit/e43ce28d01ea80970e6373e1c4540cb470cdc4a6)) + ## [0.23.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.22.0...auth/v0.23.0) (2026-08-07) diff --git a/vendor/cloud.google.com/go/auth/credentials/idtoken/cache.go b/vendor/cloud.google.com/go/auth/credentials/idtoken/cache.go new file mode 100644 index 00000000000..2fbbdb8072d --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/idtoken/cache.go @@ -0,0 +1,139 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package idtoken + +import ( + "context" + "encoding/json" + "fmt" + "log/slog" + "net/http" + "strconv" + "strings" + "sync" + "time" + + "cloud.google.com/go/auth/internal" + "github.com/googleapis/gax-go/v2/internallog" +) + +type cachingClient struct { + client *http.Client + + // clock optionally specifies a func to return the current time. + // If nil, time.Now is used. + clock func() time.Time + + mu sync.Mutex + certs map[string]*cachedResponse + logger *slog.Logger +} + +func newCachingClient(client *http.Client, logger *slog.Logger) *cachingClient { + return &cachingClient{ + client: client, + certs: make(map[string]*cachedResponse, 2), + logger: logger, + } +} + +type cachedResponse struct { + resp *certResponse + exp time.Time +} + +func (c *cachingClient) getCert(ctx context.Context, url string) (*certResponse, error) { + if response, ok := c.get(url); ok { + return response, nil + } + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + if err != nil { + return nil, err + } + c.logger.DebugContext(ctx, "cert request", "request", internallog.HTTPRequest(req, nil)) + resp, body, err := internal.DoRequest(c.client, req) + if err != nil { + return nil, err + } + c.logger.DebugContext(ctx, "cert response", "response", internallog.HTTPResponse(resp, body)) + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("idtoken: unable to retrieve cert, got status code %d", resp.StatusCode) + } + + certResp := &certResponse{} + if err := json.Unmarshal(body, &certResp); err != nil { + return nil, err + + } + c.set(url, certResp, resp.Header) + return certResp, nil +} + +func (c *cachingClient) now() time.Time { + if c.clock != nil { + return c.clock() + } + return time.Now() +} + +func (c *cachingClient) get(url string) (*certResponse, bool) { + c.mu.Lock() + defer c.mu.Unlock() + cachedResp, ok := c.certs[url] + if !ok { + return nil, false + } + if c.now().After(cachedResp.exp) { + return nil, false + } + return cachedResp.resp, true +} + +func (c *cachingClient) set(url string, resp *certResponse, headers http.Header) { + exp := c.calculateExpireTime(headers) + c.mu.Lock() + c.certs[url] = &cachedResponse{resp: resp, exp: exp} + c.mu.Unlock() +} + +// calculateExpireTime will determine the expire time for the cache based on +// HTTP headers. If there is any difficulty reading the headers the fallback is +// to set the cache to expire now. +func (c *cachingClient) calculateExpireTime(headers http.Header) time.Time { + var maxAge int + cc := strings.Split(headers.Get("cache-control"), ",") + for _, v := range cc { + if strings.Contains(v, "max-age") { + ss := strings.Split(v, "=") + if len(ss) < 2 { + return c.now() + } + ma, err := strconv.Atoi(ss[1]) + if err != nil { + return c.now() + } + maxAge = ma + } + } + a := headers.Get("age") + if a == "" { + return c.now().Add(time.Duration(maxAge) * time.Second) + } + age, err := strconv.Atoi(a) + if err != nil { + return c.now() + } + return c.now().Add(time.Duration(maxAge-age) * time.Second) +} diff --git a/vendor/cloud.google.com/go/auth/credentials/idtoken/compute.go b/vendor/cloud.google.com/go/auth/credentials/idtoken/compute.go new file mode 100644 index 00000000000..86f6cd77acf --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/idtoken/compute.go @@ -0,0 +1,89 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package idtoken + +import ( + "context" + "fmt" + "net/url" + "time" + + "cloud.google.com/go/auth" + "cloud.google.com/go/auth/internal" + "cloud.google.com/go/compute/metadata" + "github.com/googleapis/gax-go/v2/internallog" +) + +const identitySuffix = "instance/service-accounts/default/identity" + +// computeCredentials checks if this code is being run on GCE. If it is, it +// will use the metadata service to build a Credentials that fetches ID +// tokens. +func computeCredentials(opts *Options) (*auth.Credentials, error) { + if opts.CustomClaims != nil { + return nil, fmt.Errorf("idtoken: Options.CustomClaims can't be used with the metadata service, please provide a service account if you would like to use this feature") + } + metadataClient := metadata.NewWithOptions(&metadata.Options{ + Logger: internallog.New(opts.Logger), + }) + tp := &computeIDTokenProvider{ + audience: opts.Audience, + format: opts.ComputeTokenFormat, + client: metadataClient, + } + return auth.NewCredentials(&auth.CredentialsOptions{ + TokenProvider: auth.NewCachedTokenProvider(tp, &auth.CachedTokenProviderOptions{ + ExpireEarly: 5 * time.Minute, + }), + ProjectIDProvider: auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) { + return metadataClient.ProjectIDWithContext(ctx) + }), + UniverseDomainProvider: &internal.ComputeUniverseDomainProvider{ + MetadataClient: metadataClient, + }, + }), nil +} + +type computeIDTokenProvider struct { + audience string + format ComputeTokenFormat + client *metadata.Client +} + +func (c *computeIDTokenProvider) Token(ctx context.Context) (*auth.Token, error) { + v := url.Values{} + v.Set("audience", c.audience) + if c.format != ComputeTokenFormatStandard { + v.Set("format", "full") + } + if c.format == ComputeTokenFormatFullWithLicense { + v.Set("licenses", "TRUE") + } + urlSuffix := identitySuffix + "?" + v.Encode() + res, err := c.client.GetWithContext(ctx, urlSuffix) + if err != nil { + return nil, err + } + if res == "" { + return nil, fmt.Errorf("idtoken: invalid empty response from metadata service") + } + return &auth.Token{ + Value: res, + Type: internal.TokenTypeBearer, + // Compute tokens are valid for one hour: + // https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#create-id + Expiry: time.Now().Add(1 * time.Hour), + }, nil +} diff --git a/vendor/cloud.google.com/go/auth/credentials/idtoken/file.go b/vendor/cloud.google.com/go/auth/credentials/idtoken/file.go new file mode 100644 index 00000000000..4ff7e5e4db2 --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/idtoken/file.go @@ -0,0 +1,225 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package idtoken + +import ( + "encoding/json" + "fmt" + "path/filepath" + "strings" + + "cloud.google.com/go/auth" + "cloud.google.com/go/auth/credentials" + "cloud.google.com/go/auth/credentials/impersonate" + intexternalaccount "cloud.google.com/go/auth/credentials/internal/externalaccount" + intimpersonate "cloud.google.com/go/auth/credentials/internal/impersonate" + "cloud.google.com/go/auth/internal" + "cloud.google.com/go/auth/internal/credsfile" + "github.com/googleapis/gax-go/v2/internallog" +) + +const ( + jwtTokenURL = "https://oauth2.googleapis.com/token" + iamCredAud = "https://iamcredentials.googleapis.com/" +) + +// credsFromDefault takes the credentials detected from the environment or JSON +// and constructs appropriate ID token credentials. +// +// Note: For ExternalAccount and ImpersonatedServiceAccount types, this function +// will create a new, non-impersonated base credential to avoid double +// impersonation when generating the ID token. It does not use the provided +// 'creds' as-is for these types. +func credsFromDefault(creds *auth.Credentials, opts *Options) (*auth.Credentials, error) { + b := creds.JSON() + t, err := credsfile.ParseFileType(b) + if err != nil { + return nil, err + } + switch credentials.CredType(t) { + case credentials.ServiceAccount: + f, err := credsfile.ParseServiceAccount(b) + if err != nil { + return nil, err + } + var tp auth.TokenProvider + if resolveUniverseDomain(f) == internal.DefaultUniverseDomain { + tp, err = new2LOTokenProvider(f, opts) + if err != nil { + return nil, err + } + } else { + // In case of non-GDU universe domain, use IAM. + tp = intimpersonate.IDTokenIAMOptions{ + Client: opts.client(), + Logger: internallog.New(opts.Logger), + // Pass the credentials universe domain to configure the endpoint. + UniverseDomain: auth.CredentialsPropertyFunc(creds.UniverseDomain), + ServiceAccountEmail: f.ClientEmail, + GenerateIDTokenRequest: intimpersonate.GenerateIDTokenRequest{ + Audience: opts.Audience, + }, + } + } + tp = auth.NewCachedTokenProvider(tp, nil) + return auth.NewCredentials(&auth.CredentialsOptions{ + TokenProvider: tp, + JSON: b, + ProjectIDProvider: auth.CredentialsPropertyFunc(creds.ProjectID), + UniverseDomainProvider: auth.CredentialsPropertyFunc(creds.UniverseDomain), + }), nil + case credentials.ImpersonatedServiceAccount, credentials.ExternalAccount: + type url struct { + ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"` + } + var accountURL url + if err := json.Unmarshal(b, &accountURL); err != nil { + return nil, err + } + account := filepath.Base(accountURL.ServiceAccountImpersonationURL) + account = strings.Split(account, ":")[0] + + baseCreds, err := baseCredsForImpersonation(t, b, opts, creds) + if err != nil { + return nil, err + } + + config := impersonate.IDTokenOptions{ + Audience: opts.Audience, + TargetPrincipal: account, + IncludeEmail: true, + Client: opts.client(), + Credentials: baseCreds, // Use the non-impersonated base credentials! + Logger: internallog.New(opts.Logger), + } + idTokenCreds, err := impersonate.NewIDTokenCredentials(&config) + if err != nil { + return nil, err + } + return auth.NewCredentials(&auth.CredentialsOptions{ + TokenProvider: idTokenCreds, + JSON: b, + ProjectIDProvider: auth.CredentialsPropertyFunc(creds.ProjectID), + UniverseDomainProvider: auth.CredentialsPropertyFunc(creds.UniverseDomain), + QuotaProjectIDProvider: auth.CredentialsPropertyFunc(creds.QuotaProjectID), + }), nil + default: + return nil, fmt.Errorf("idtoken: unsupported credentials type: %v", t) + } +} + +func new2LOTokenProvider(f *credsfile.ServiceAccountFile, opts *Options) (auth.TokenProvider, error) { + opts2LO := &auth.Options2LO{ + Email: f.ClientEmail, + PrivateKey: []byte(f.PrivateKey), + PrivateKeyID: f.PrivateKeyID, + TokenURL: f.TokenURL, + UseIDToken: true, + Logger: internallog.New(opts.Logger), + } + if opts2LO.TokenURL == "" { + opts2LO.TokenURL = jwtTokenURL + } + + var customClaims map[string]interface{} + if opts != nil { + customClaims = opts.CustomClaims + } + if customClaims == nil { + customClaims = make(map[string]interface{}) + } + customClaims["target_audience"] = opts.Audience + + opts2LO.PrivateClaims = customClaims + return auth.New2LOTokenProvider(opts2LO) +} + +// resolveUniverseDomain returns the default service domain for a given +// Cloud universe. This is the universe domain configured for the credentials, +// which will be used in endpoint. +func resolveUniverseDomain(f *credsfile.ServiceAccountFile) string { + if f.UniverseDomain != "" { + return f.UniverseDomain + } + return internal.DefaultUniverseDomain +} + +// baseCredsForImpersonation constructs a non-impersonated base credential +// provider to avoid double impersonation. The 'creds' object returned by +// DetectDefault is already impersonated because it faithfully fulfills the +// instructions in the configuration file. However, for the specific context of +// generating an ID token, we must bypass that first layer of impersonation and +// use the source principal directly to call the generateIdToken API. This +// maintains separation of concerns by letting DetectDefault act as a general +// loader while handling the specific needs of idtoken generation here, avoiding +// a leaky abstraction in core packages. +func baseCredsForImpersonation(t string, b []byte, opts *Options, creds *auth.Credentials) (*auth.Credentials, error) { + var baseCreds *auth.Credentials + if credentials.CredType(t) == credentials.ExternalAccount { + f, err := credsfile.ParseExternalAccount(b) + if err != nil { + return nil, err + } + externalOpts := &intexternalaccount.Options{ + Audience: f.Audience, + SubjectTokenType: f.SubjectTokenType, + TokenURL: f.TokenURL, + TokenInfoURL: f.TokenInfoURL, + ClientSecret: f.ClientSecret, + ClientID: f.ClientID, + CredentialSource: f.CredentialSource, + QuotaProjectID: f.QuotaProjectID, + Scopes: []string{"https://www.googleapis.com/auth/cloud-platform"}, + WorkforcePoolUserProject: f.WorkforcePoolUserProject, + Client: opts.client(), + Logger: opts.Logger, + IsDefaultClient: opts.Client == nil, + } + // Do NOT set ServiceAccountImpersonationURL here to avoid the first layer of impersonation! + baseTP, err := intexternalaccount.NewTokenProvider(externalOpts) + if err != nil { + return nil, err + } + baseCreds = auth.NewCredentials(&auth.CredentialsOptions{ + TokenProvider: baseTP, + JSON: b, + UniverseDomainProvider: auth.CredentialsPropertyFunc(creds.UniverseDomain), + }) + } else { + // For ImpersonatedServiceAccount + f, err := credsfile.ParseImpersonatedServiceAccount(b) + if err != nil { + return nil, err + } + // Extract source credentials + sourceOpts := &credentials.DetectOptions{ + Scopes: []string{"https://www.googleapis.com/auth/cloud-platform"}, + CredentialsJSON: f.CredSource, + Client: opts.client(), + UseSelfSignedJWT: true, + } + // Detect credentials for the source + sourceCreds, err := credentials.DetectDefault(sourceOpts) + if err != nil { + return nil, err + } + baseCreds = auth.NewCredentials(&auth.CredentialsOptions{ + TokenProvider: sourceCreds, + JSON: b, + UniverseDomainProvider: auth.CredentialsPropertyFunc(creds.UniverseDomain), + }) + } + return baseCreds, nil +} diff --git a/vendor/cloud.google.com/go/auth/credentials/idtoken/idtoken.go b/vendor/cloud.google.com/go/auth/credentials/idtoken/idtoken.go new file mode 100644 index 00000000000..db3d0498875 --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/idtoken/idtoken.go @@ -0,0 +1,272 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package idtoken provides functionality for generating and validating ID +// tokens, with configurable options for audience, custom claims, and token +// formats. +// +// For more information on ID tokens, see +// https://cloud.google.com/docs/authentication/token-types#id. +package idtoken + +import ( + "errors" + "log/slog" + "net/http" + "os" + + "cloud.google.com/go/auth" + "cloud.google.com/go/auth/credentials" + "cloud.google.com/go/auth/internal" + "cloud.google.com/go/auth/internal/credsfile" + "cloud.google.com/go/compute/metadata" +) + +// ComputeTokenFormat dictates the the token format when requesting an ID token +// from the compute metadata service. +type ComputeTokenFormat int + +const ( + // ComputeTokenFormatDefault means the same as [ComputeTokenFormatFull]. + ComputeTokenFormatDefault ComputeTokenFormat = iota + // ComputeTokenFormatStandard mean only standard JWT fields will be included + // in the token. + ComputeTokenFormatStandard + // ComputeTokenFormatFull means the token will include claims about the + // virtual machine instance and its project. + ComputeTokenFormatFull + // ComputeTokenFormatFullWithLicense means the same as + // [ComputeTokenFormatFull] with the addition of claims about licenses + // associated with the instance. + ComputeTokenFormatFullWithLicense +) + +var ( + defaultScopes = []string{ + "https://iamcredentials.googleapis.com/", + "https://www.googleapis.com/auth/cloud-platform", + } + + errMissingOpts = errors.New("idtoken: opts must be provided") + errMissingAudience = errors.New("idtoken: Audience must be provided") + errBothFileAndJSON = errors.New("idtoken: CredentialsFile and CredentialsJSON must not both be provided") +) + +// Options for the configuration of creation of an ID token with +// [NewCredentials]. +type Options struct { + // Audience is the `aud` field for the token, such as an API endpoint the + // token will grant access to. Required. + Audience string + // ComputeTokenFormat dictates the the token format when requesting an ID + // token from the compute metadata service. Optional. + ComputeTokenFormat ComputeTokenFormat + // CustomClaims specifies private non-standard claims for an ID token. + // Optional. + CustomClaims map[string]interface{} + + // CredentialsFile sources a JSON credential file from the provided + // filepath. If provided, do not provide CredentialsJSON. Optional. + // + // Deprecated: This field is deprecated because of a potential security risk. + // It does not validate the credential configuration. The security risk occurs + // when a credential configuration is accepted from a source that is not + // under your control and used without validation on your side. + // + // If you know that you will be loading credential configurations of a + // specific type, it is recommended to use a credential-type-specific + // NewCredentialsFromFile method. This will ensure that an unexpected + // credential type with potential for malicious intent is not loaded + // unintentionally. You might still have to do validation for certain + // credential types. Please follow the recommendation for that method. For + // example, if you want to load only service accounts, you can use + // + // creds, err := idtoken.NewCredentialsFromFile(ctx, credentials.ServiceAccount, filename, opts) + // + // If you are loading your credential configuration from an untrusted source + // and have not mitigated the risks (e.g. by validating the configuration + // yourself), make these changes as soon as possible to prevent security + // risks to your environment. + // + // Regardless of the method used, it is always your responsibility to + // validate configurations received from external sources. + // + // For more details see: + // https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + CredentialsFile string + // CredentialsJSON sources a JSON credential file from the provided bytes. + // If provided, do not provide CredentialsJSON. Optional. + // + // Deprecated: This field is deprecated because of a potential security risk. + // It does not validate the credential configuration. The security risk occurs + // when a credential configuration is accepted from a source that is not + // under your control and used without validation on your side. + // + // If you know that you will be loading credential configurations of a + // specific type, it is recommended to use a credential-type-specific + // NewCredentialsFromJSON method. This will ensure that an unexpected + // credential type with potential for malicious intent is not loaded + // unintentionally. You might still have to do validation for certain + // credential types. Please follow the recommendation for that method. For + // example, if you want to load only service accounts, you can use + // + // creds, err := idtoken.NewCredentialsFromJSON(ctx, credentials.ServiceAccount, json, opts) + // + // If you are loading your credential configuration from an untrusted source + // and have not mitigated the risks (e.g. by validating the configuration + // yourself), make these changes as soon as possible to prevent security + // risks to your environment. + // + // Regardless of the method used, it is always your responsibility to + // validate configurations received from external sources. + // + // For more details see: + // https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + CredentialsJSON []byte + // Client configures the underlying client used to make network requests + // when fetching tokens. If provided this should be a fully-authenticated + // client. Optional. + Client *http.Client + // UniverseDomain is the default service domain for a given Cloud universe. + // The default value is "googleapis.com". This is the universe domain + // configured for the client, which will be compared to the universe domain + // that is separately configured for the credentials. Optional. + UniverseDomain string + // Logger is used for debug logging. If provided, logging will be enabled + // at the loggers configured level. By default logging is disabled unless + // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default + // logger will be used. Optional. + Logger *slog.Logger +} + +func (o *Options) client() *http.Client { + if o == nil || o.Client == nil { + return internal.DefaultClient() + } + return o.Client +} + +func (o *Options) validate() error { + if o == nil { + return errMissingOpts + } + if o.Audience == "" { + return errMissingAudience + } + if o.CredentialsFile != "" && len(o.CredentialsJSON) > 0 { + return errBothFileAndJSON + } + return nil +} + +// NewCredentials creates a [cloud.google.com/go/auth.Credentials] that returns +// ID tokens configured by the opts provided. The parameter opts.Audience must +// not be empty. If both opts.CredentialsFile and opts.CredentialsJSON are +// empty, an attempt will be made to detect credentials from the environment +// (see [cloud.google.com/go/auth/credentials.DetectDefault]). Only service +// account, impersonated service account, external account and Compute +// credentials are supported. Note: If the provided external account +// configuration (e.g., Workload Identity Federation) is configured to +// impersonate a service account, the returned credentials will yield ID tokens +// representing that target service account, rather than the external workload +// principal that initiated the request. +func NewCredentials(opts *Options) (*auth.Credentials, error) { + if err := opts.validate(); err != nil { + return nil, err + } + b := opts.jsonBytes() + if b == nil && metadata.OnGCE() { + return computeCredentials(opts) + } + creds, err := credentials.DetectDefault(&credentials.DetectOptions{ + Scopes: defaultScopes, + CredentialsJSON: b, + Client: opts.client(), + UseSelfSignedJWT: true, + }) + if err != nil { + return nil, err + } + return credsFromDefault(creds, opts) +} + +func (o *Options) jsonBytes() []byte { + if len(o.CredentialsJSON) > 0 { + return o.CredentialsJSON + } + var fnOverride string + if o != nil { + fnOverride = o.CredentialsFile + } + filename := credsfile.GetFileNameFromEnv(fnOverride) + if filename != "" { + b, _ := os.ReadFile(filename) + return b + } + return nil +} + +// NewCredentialsFromJSON creates a [cloud.google.com/go/auth.Credentials] that +// returns ID tokens from the provided JSON bytes. The credType argument +// specifies the expected credential type. If the JSON does not match the +// expected type, an error is returned. +// +// This method is safe to use with untrusted credential configurations if the +// expected credType is NOT [credentials.ExternalAccount] or +// [credentials.ImpersonatedServiceAccount]. +// +// **IMPORTANT**: If you use [credentials.ExternalAccount] or +// [credentials.ImpersonatedServiceAccount], you must validate the credential +// configuration before providing it to this method. Providing an unvalidated +// credential configuration to Google APIs can compromise the security of your +// systems and data. For more information, refer to [Validate credential +// configurations from external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). +func NewCredentialsFromJSON(credType credentials.CredType, b []byte, opts *Options) (*auth.Credentials, error) { + if err := opts.validate(); err != nil { + return nil, err + } + // Use credentials.NewCredentialsFromJSON to validate type and create base credentials. + creds, err := credentials.NewCredentialsFromJSON(credType, b, &credentials.DetectOptions{ + Client: opts.Client, + Logger: opts.Logger, + UniverseDomain: opts.UniverseDomain, + }) + if err != nil { + return nil, err + } + return credsFromDefault(creds, opts) +} + +// NewCredentialsFromFile creates a [cloud.google.com/go/auth.Credentials] that +// returns ID tokens from the provided file. The credType argument specifies the +// expected credential type. If the file content does not match the expected +// type, an error is returned. +// +// This method is safe to use with untrusted credential configurations if the +// expected credType is NOT [credentials.ExternalAccount] or +// [credentials.ImpersonatedServiceAccount]. +// +// **IMPORTANT**: If you use [credentials.ExternalAccount] or +// [credentials.ImpersonatedServiceAccount], you must validate the credential +// configuration before providing it to this method. Providing an unvalidated +// credential configuration to Google APIs can compromise the security of your +// systems and data. For more information, refer to [Validate credential +// configurations from external sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). +func NewCredentialsFromFile(credType credentials.CredType, filename string, opts *Options) (*auth.Credentials, error) { + b, err := os.ReadFile(filename) + if err != nil { + return nil, err + } + return NewCredentialsFromJSON(credType, b, opts) +} diff --git a/vendor/cloud.google.com/go/auth/credentials/idtoken/validate.go b/vendor/cloud.google.com/go/auth/credentials/idtoken/validate.go new file mode 100644 index 00000000000..4dd0dd53602 --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/idtoken/validate.go @@ -0,0 +1,314 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package idtoken + +import ( + "context" + "crypto" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rsa" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "fmt" + "log/slog" + "math/big" + "net/http" + "strings" + "time" + + "cloud.google.com/go/auth/internal" + "cloud.google.com/go/auth/internal/jwt" + "github.com/googleapis/gax-go/v2/internallog" +) + +const ( + es256KeySize int = 32 + // googleIAPCertsURL is used for ES256 Certs. + googleIAPCertsURL string = "https://www.gstatic.com/iap/verify/public_key-jwk" + // googleSACertsURL is used for RS256 Certs. + googleSACertsURL string = "https://www.googleapis.com/oauth2/v3/certs" +) + +var ( + defaultValidator = &Validator{client: newCachingClient(internal.DefaultClient(), internallog.New(nil))} + // now aliases time.Now for testing. + now = time.Now +) + +// certResponse represents a list jwks. It is the format returned from known +// Google cert endpoints. +type certResponse struct { + Keys []jwk `json:"keys"` +} + +// jwk is a simplified representation of a standard jwk. It only includes the +// fields used by Google's cert endpoints. +type jwk struct { + Alg string `json:"alg"` + Crv string `json:"crv"` + Kid string `json:"kid"` + Kty string `json:"kty"` + Use string `json:"use"` + E string `json:"e"` + N string `json:"n"` + X string `json:"x"` + Y string `json:"y"` +} + +// Validator provides a way to validate Google ID Tokens +type Validator struct { + client *cachingClient + rs256URL string + es256URL string +} + +// Payload represents a decoded payload of an ID token. +type Payload struct { + Issuer string `json:"iss"` + Audience string `json:"aud"` + Expires int64 `json:"exp"` + IssuedAt int64 `json:"iat"` + Subject string `json:"sub,omitempty"` + Claims map[string]interface{} `json:"-"` +} + +// ValidatorOptions provides a way to configure a [Validator]. +type ValidatorOptions struct { + // Client used to make requests to the certs URL. Optional. + Client *http.Client + // Custom certs URL for RS256 JWK to be used. If not provided, the default + // Google oauth2 endpoint will be used. Optional. + RS256CertsURL string + // Custom certs URL for ES256 JWK to be used. If not provided, the default + // Google IAP endpoint will be used. Optional. + ES256CertsURL string + // Logger is used for debug logging. If provided, logging will be enabled + // at the loggers configured level. By default logging is disabled unless + // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default + // Logger will be used. Optional. + Logger *slog.Logger +} + +// NewValidator creates a Validator that uses the options provided to configure +// a the internal http.Client that will be used to make requests to fetch JWKs. +func NewValidator(opts *ValidatorOptions) (*Validator, error) { + if opts == nil { + opts = &ValidatorOptions{} + } + client := opts.Client + if client == nil { + client = internal.DefaultClient() + } + rs256URL := opts.RS256CertsURL + es256URL := opts.ES256CertsURL + logger := internallog.New(opts.Logger) + return &Validator{client: newCachingClient(client, logger), rs256URL: rs256URL, es256URL: es256URL}, nil +} + +// Validate is used to validate the provided idToken with a known Google cert +// URL. If audience is not empty the audience claim of the Token is validated. +// Upon successful validation a parsed token Payload is returned allowing the +// caller to validate any additional claims. +func (v *Validator) Validate(ctx context.Context, idToken string, audience string) (*Payload, error) { + return v.validate(ctx, idToken, audience) +} + +// Validate is used to validate the provided idToken with a known Google cert +// URL. If audience is not empty the audience claim of the Token is validated. +// Upon successful validation a parsed token Payload is returned allowing the +// caller to validate any additional claims. +func Validate(ctx context.Context, idToken string, audience string) (*Payload, error) { + return defaultValidator.validate(ctx, idToken, audience) +} + +// ParsePayload parses the given token and returns its payload. +// +// Warning: This function does not validate the token prior to parsing it. +// +// ParsePayload is primarily meant to be used to inspect a token's payload. This is +// useful when validation fails and the payload needs to be inspected. +// +// Note: A successful Validate() invocation with the same token will return an +// identical payload. +func ParsePayload(idToken string) (*Payload, error) { + _, payload, _, err := parseToken(idToken) + if err != nil { + return nil, err + } + return payload, nil +} + +func (v *Validator) validate(ctx context.Context, idToken string, audience string) (*Payload, error) { + header, payload, sig, err := parseToken(idToken) + if err != nil { + return nil, err + } + + if audience != "" && payload.Audience != audience { + return nil, fmt.Errorf("idtoken: audience provided does not match aud claim in the JWT") + } + + if now().Unix() > payload.Expires { + return nil, fmt.Errorf("idtoken: token expired: now=%v, expires=%v", now().Unix(), payload.Expires) + } + hashedContent := hashHeaderPayload(idToken) + switch header.Algorithm { + case jwt.HeaderAlgRSA256: + if err := v.validateRS256(ctx, header.KeyID, hashedContent, sig); err != nil { + return nil, err + } + case jwt.HeaderAlgES256: + if err := v.validateES256(ctx, header.KeyID, hashedContent, sig); err != nil { + return nil, err + } + default: + return nil, fmt.Errorf("idtoken: expected JWT signed with RS256 or ES256 but found %q", header.Algorithm) + } + + return payload, nil +} + +func (v *Validator) validateRS256(ctx context.Context, keyID string, hashedContent []byte, sig []byte) error { + certResp, err := v.client.getCert(ctx, v.rs256CertsURL()) + if err != nil { + return err + } + j, err := findMatchingKey(certResp, keyID) + if err != nil { + return err + } + dn, err := decode(j.N) + if err != nil { + return err + } + de, err := decode(j.E) + if err != nil { + return err + } + + pk := &rsa.PublicKey{ + N: new(big.Int).SetBytes(dn), + E: int(new(big.Int).SetBytes(de).Int64()), + } + return rsa.VerifyPKCS1v15(pk, crypto.SHA256, hashedContent, sig) +} + +func (v *Validator) rs256CertsURL() string { + if v.rs256URL == "" { + return googleSACertsURL + } + return v.rs256URL +} + +func (v *Validator) validateES256(ctx context.Context, keyID string, hashedContent []byte, sig []byte) error { + certResp, err := v.client.getCert(ctx, v.es256CertsURL()) + if err != nil { + return err + } + j, err := findMatchingKey(certResp, keyID) + if err != nil { + return err + } + dx, err := decode(j.X) + if err != nil { + return err + } + dy, err := decode(j.Y) + if err != nil { + return err + } + + pk := &ecdsa.PublicKey{ + Curve: elliptic.P256(), + X: new(big.Int).SetBytes(dx), + Y: new(big.Int).SetBytes(dy), + } + r := big.NewInt(0).SetBytes(sig[:es256KeySize]) + s := big.NewInt(0).SetBytes(sig[es256KeySize:]) + if valid := ecdsa.Verify(pk, hashedContent, r, s); !valid { + return fmt.Errorf("idtoken: ES256 signature not valid") + } + return nil +} + +func (v *Validator) es256CertsURL() string { + if v.es256URL == "" { + return googleIAPCertsURL + } + return v.es256URL +} + +func findMatchingKey(response *certResponse, keyID string) (*jwk, error) { + if response == nil { + return nil, fmt.Errorf("idtoken: cert response is nil") + } + for _, v := range response.Keys { + if v.Kid == keyID { + return &v, nil + } + } + return nil, fmt.Errorf("idtoken: could not find matching cert keyId for the token provided") +} + +func parseToken(idToken string) (*jwt.Header, *Payload, []byte, error) { + segments := strings.Split(idToken, ".") + if len(segments) != 3 { + return nil, nil, nil, fmt.Errorf("idtoken: invalid token, token must have three segments; found %d", len(segments)) + } + // Header + dh, err := decode(segments[0]) + if err != nil { + return nil, nil, nil, fmt.Errorf("idtoken: unable to decode JWT header: %v", err) + } + var header *jwt.Header + err = json.Unmarshal(dh, &header) + if err != nil { + return nil, nil, nil, fmt.Errorf("idtoken: unable to unmarshal JWT header: %v", err) + } + + // Payload + dp, err := decode(segments[1]) + if err != nil { + return nil, nil, nil, fmt.Errorf("idtoken: unable to decode JWT claims: %v", err) + } + var payload *Payload + if err := json.Unmarshal(dp, &payload); err != nil { + return nil, nil, nil, fmt.Errorf("idtoken: unable to unmarshal JWT payload: %v", err) + } + if err := json.Unmarshal(dp, &payload.Claims); err != nil { + return nil, nil, nil, fmt.Errorf("idtoken: unable to unmarshal JWT payload claims: %v", err) + } + + // Signature + signature, err := decode(segments[2]) + if err != nil { + return nil, nil, nil, fmt.Errorf("idtoken: unable to decode JWT signature: %v", err) + } + return header, payload, signature, nil +} + +// hashHeaderPayload gets the SHA256 checksum for verification of the JWT. +func hashHeaderPayload(idtoken string) []byte { + // remove the sig from the token + content := idtoken[:strings.LastIndex(idtoken, ".")] + hashed := sha256.Sum256([]byte(content)) + return hashed[:] +} + +func decode(s string) ([]byte, error) { + return base64.RawURLEncoding.DecodeString(s) +} diff --git a/vendor/cloud.google.com/go/auth/credentials/impersonate/doc.go b/vendor/cloud.google.com/go/auth/credentials/impersonate/doc.go new file mode 100644 index 00000000000..0dc45f13fb7 --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/impersonate/doc.go @@ -0,0 +1,45 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package impersonate is used to impersonate Google Credentials. If you need +// to impersonate some credentials to use with a client library see +// [NewCredentials]. If instead you would like to create an Open +// Connect ID token using impersonation see [NewIDTokenCredentials]. +// +// # Required IAM roles +// +// In order to impersonate a service account the base service account must have +// the Service Account Token Creator role, roles/iam.serviceAccountTokenCreator, +// on the service account being impersonated. See +// https://cloud.google.com/iam/docs/understanding-service-accounts. +// +// Optionally, delegates can be used during impersonation if the base service +// account lacks the token creator role on the target. When using delegates, +// each service account must be granted roles/iam.serviceAccountTokenCreator +// on the next service account in the delgation chain. +// +// For example, if a base service account of SA1 is trying to impersonate target +// service account SA2 while using delegate service accounts DSA1 and DSA2, +// the following must be true: +// +// 1. Base service account SA1 has roles/iam.serviceAccountTokenCreator on +// DSA1. +// 2. DSA1 has roles/iam.serviceAccountTokenCreator on DSA2. +// 3. DSA2 has roles/iam.serviceAccountTokenCreator on target SA2. +// +// If the base credential is an authorized user and not a service account, or if +// the option WithQuotaProject is set, the target service account must have a +// role that grants the serviceusage.services.use permission such as +// roles/serviceusage.serviceUsageConsumer. +package impersonate diff --git a/vendor/cloud.google.com/go/auth/credentials/impersonate/idtoken.go b/vendor/cloud.google.com/go/auth/credentials/impersonate/idtoken.go new file mode 100644 index 00000000000..6c470822bd5 --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/impersonate/idtoken.go @@ -0,0 +1,141 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package impersonate + +import ( + "errors" + "log/slog" + "net/http" + + "cloud.google.com/go/auth" + "cloud.google.com/go/auth/credentials" + "cloud.google.com/go/auth/credentials/internal/impersonate" + "cloud.google.com/go/auth/httptransport" + "cloud.google.com/go/auth/internal" + "github.com/googleapis/gax-go/v2/internallog" +) + +// IDTokenOptions for generating an impersonated ID token. +type IDTokenOptions struct { + // Audience is the `aud` field for the token, such as an API endpoint the + // token will grant access to. Required. + Audience string + // TargetPrincipal is the email address of the service account to + // impersonate. Required. + TargetPrincipal string + // IncludeEmail includes the target service account's email in the token. + // The resulting token will include both an `email` and `email_verified` + // claim. Optional. + IncludeEmail bool + // Delegates are the ordered service account email addresses in a delegation + // chain. Each service account must be granted + // roles/iam.serviceAccountTokenCreator on the next service account in the + // chain. Optional. + Delegates []string + + // Credentials used in generating the impersonated ID token. If empty, an + // attempt will be made to detect credentials from the environment (see + // [cloud.google.com/go/auth/credentials.DetectDefault]). Optional. + Credentials *auth.Credentials + // Client configures the underlying client used to make network requests + // when fetching tokens. If provided this should be a fully-authenticated + // client. Optional. + Client *http.Client + // UniverseDomain is the default service domain for a given Cloud universe. + // The default value is "googleapis.com". This is the universe domain + // configured for the client, which will be compared to the universe domain + // that is separately configured for the credentials. Optional. + UniverseDomain string + // Logger is used for debug logging. If provided, logging will be enabled + // at the loggers configured level. By default logging is disabled unless + // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default + // logger will be used. Optional. + Logger *slog.Logger +} + +func (o *IDTokenOptions) validate() error { + if o == nil { + return errors.New("impersonate: options must be provided") + } + if o.Audience == "" { + return errors.New("impersonate: audience must be provided") + } + if o.TargetPrincipal == "" { + return errors.New("impersonate: target service account must be provided") + } + return nil +} + +var ( + defaultScope = "https://www.googleapis.com/auth/cloud-platform" +) + +// NewIDTokenCredentials creates an impersonated +// [cloud.google.com/go/auth/Credentials] that returns ID tokens configured +// with the provided config and using credentials loaded from Application +// Default Credentials as the base credentials if not provided with the opts. +// The tokens produced are valid for one hour and are automatically refreshed. +func NewIDTokenCredentials(opts *IDTokenOptions) (*auth.Credentials, error) { + if err := opts.validate(); err != nil { + return nil, err + } + client := opts.Client + creds := opts.Credentials + logger := internallog.New(opts.Logger) + if client == nil { + var err error + if creds == nil { + creds, err = credentials.DetectDefault(&credentials.DetectOptions{ + Scopes: []string{defaultScope}, + UseSelfSignedJWT: true, + Logger: logger, + }) + if err != nil { + return nil, err + } + } + client, err = httptransport.NewClient(&httptransport.Options{ + Credentials: creds, + UniverseDomain: opts.UniverseDomain, + Logger: logger, + }) + if err != nil { + return nil, err + } + } + + universeDomainProvider := resolveUniverseDomainProvider(creds) + var delegates []string + for _, v := range opts.Delegates { + delegates = append(delegates, internal.FormatIAMServiceAccountResource(v)) + } + + iamOpts := impersonate.IDTokenIAMOptions{ + Client: client, + Logger: logger, + // Pass the credentials universe domain provider to configure the endpoint. + UniverseDomain: universeDomainProvider, + ServiceAccountEmail: opts.TargetPrincipal, + GenerateIDTokenRequest: impersonate.GenerateIDTokenRequest{ + Audience: opts.Audience, + IncludeEmail: opts.IncludeEmail, + Delegates: delegates, + }, + } + return auth.NewCredentials(&auth.CredentialsOptions{ + TokenProvider: auth.NewCachedTokenProvider(iamOpts, nil), + UniverseDomainProvider: universeDomainProvider, + }), nil +} diff --git a/vendor/cloud.google.com/go/auth/credentials/impersonate/impersonate.go b/vendor/cloud.google.com/go/auth/credentials/impersonate/impersonate.go new file mode 100644 index 00000000000..7d8efd54efb --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/impersonate/impersonate.go @@ -0,0 +1,284 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package impersonate + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "log/slog" + "net/http" + "strings" + "time" + + "cloud.google.com/go/auth" + "cloud.google.com/go/auth/credentials" + "cloud.google.com/go/auth/httptransport" + "cloud.google.com/go/auth/internal" + "github.com/googleapis/gax-go/v2/internallog" +) + +var ( + universeDomainPlaceholder = "UNIVERSE_DOMAIN" + iamCredentialsUniverseDomainEndpoint = "https://iamcredentials.UNIVERSE_DOMAIN" + oauth2Endpoint = "https://oauth2.googleapis.com" + errMissingTargetPrincipal = errors.New("impersonate: target service account must be provided") + errMissingScopes = errors.New("impersonate: scopes must be provided") + errLifetimeOverMax = errors.New("impersonate: max lifetime is 12 hours") + errUniverseNotSupportedDomainWideDelegation = errors.New("impersonate: service account user is configured for the credential. " + + "Domain-wide delegation is not supported in universes other than googleapis.com") +) + +// TODO(codyoss): plumb through base for this and idtoken + +// NewCredentials returns an impersonated +// [cloud.google.com/go/auth/NewCredentials] configured with the provided options +// and using credentials loaded from Application Default Credentials as the base +// credentials if not provided with the opts. +func NewCredentials(opts *CredentialsOptions) (*auth.Credentials, error) { + if err := opts.validate(); err != nil { + return nil, err + } + + var isStaticToken bool + // Default to the longest acceptable value of one hour as the token will + // be refreshed automatically if not set. + lifetime := 1 * time.Hour + if opts.Lifetime != 0 { + lifetime = opts.Lifetime + // Don't auto-refresh token if a lifetime is configured. + isStaticToken = true + } + + client := opts.Client + creds := opts.Credentials + logger := internallog.New(opts.Logger) + if client == nil { + var err error + if creds == nil { + creds, err = credentials.DetectDefault(&credentials.DetectOptions{ + Scopes: []string{defaultScope}, + UseSelfSignedJWT: true, + Logger: logger, + }) + if err != nil { + return nil, err + } + } + + client, err = httptransport.NewClient(transportOpts(opts, creds, logger)) + if err != nil { + return nil, err + } + } + + universeDomainProvider := resolveUniverseDomainProvider(creds) + // If a subject is specified a domain-wide delegation auth-flow is initiated + // to impersonate as the provided subject (user). + if opts.Subject != "" { + tp, err := user(opts, client, lifetime, isStaticToken, universeDomainProvider) + if err != nil { + return nil, err + } + return auth.NewCredentials(&auth.CredentialsOptions{ + TokenProvider: tp, + UniverseDomainProvider: universeDomainProvider, + }), nil + } + + its := impersonatedTokenProvider{ + client: client, + targetPrincipal: opts.TargetPrincipal, + lifetime: fmt.Sprintf("%.fs", lifetime.Seconds()), + universeDomainProvider: universeDomainProvider, + logger: logger, + } + for _, v := range opts.Delegates { + its.delegates = append(its.delegates, internal.FormatIAMServiceAccountResource(v)) + } + its.scopes = make([]string, len(opts.Scopes)) + copy(its.scopes, opts.Scopes) + + var tpo *auth.CachedTokenProviderOptions + if isStaticToken { + tpo = &auth.CachedTokenProviderOptions{ + DisableAutoRefresh: true, + } + } + + return auth.NewCredentials(&auth.CredentialsOptions{ + TokenProvider: auth.NewCachedTokenProvider(its, tpo), + UniverseDomainProvider: universeDomainProvider, + }), nil +} + +// transportOpts returns options for httptransport.NewClient. If opts.UniverseDomain +// is provided, it will be used in the transport for a validation ensuring that it +// matches the universe domain in the base credentials. If opts.UniverseDomain +// is not provided, this validation will be skipped. +func transportOpts(opts *CredentialsOptions, creds *auth.Credentials, logger *slog.Logger) *httptransport.Options { + tOpts := &httptransport.Options{ + Credentials: creds, + Logger: logger, + } + if opts.UniverseDomain == "" { + tOpts.InternalOptions = &httptransport.InternalOptions{ + SkipUniverseDomainValidation: true, + } + } else { + tOpts.UniverseDomain = opts.UniverseDomain + } + return tOpts +} + +// resolveUniverseDomainProvider returns the default service domain for a given +// Cloud universe. This is the universe domain configured for the credentials, +// which will be used in endpoint(s), and compared to the universe domain that +// is separately configured for the client. +func resolveUniverseDomainProvider(creds *auth.Credentials) auth.CredentialsPropertyProvider { + if creds != nil { + return auth.CredentialsPropertyFunc(creds.UniverseDomain) + } + return internal.StaticCredentialsProperty(internal.DefaultUniverseDomain) +} + +// CredentialsOptions for generating an impersonated credential token. +type CredentialsOptions struct { + // TargetPrincipal is the email address of the service account to + // impersonate. Required. + TargetPrincipal string + // Scopes that the impersonated credential should have. Required. + Scopes []string + // Delegates are the service account email addresses in a delegation chain. + // Each service account must be granted roles/iam.serviceAccountTokenCreator + // on the next service account in the chain. Optional. + Delegates []string + // Lifetime is the amount of time until the impersonated token expires. If + // unset the token's lifetime will be one hour and be automatically + // refreshed. If set the token may have a max lifetime of one hour and will + // not be refreshed. Service accounts that have been added to an org policy + // with constraints/iam.allowServiceAccountCredentialLifetimeExtension may + // request a token lifetime of up to 12 hours. Optional. + Lifetime time.Duration + // Subject is the sub field of a JWT. This field should only be set if you + // wish to impersonate as a user. This feature is useful when using domain + // wide delegation. Optional. + Subject string + + // Credentials used in generating the impersonated token. If empty, an + // attempt will be made to detect credentials from the environment (see + // [cloud.google.com/go/auth/credentials.DetectDefault]). Optional. + Credentials *auth.Credentials + // Client configures the underlying client used to make network requests + // when fetching tokens. If provided this should be a fully-authenticated + // client. Optional. + Client *http.Client + // UniverseDomain is the default service domain for a given Cloud universe. + // This field has no default value, and only if provided will it be used to + // verify the universe domain from the credentials. Optional. + UniverseDomain string + // Logger is used for debug logging. If provided, logging will be enabled + // at the loggers configured level. By default logging is disabled unless + // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default + // logger will be used. Optional. + Logger *slog.Logger +} + +func (o *CredentialsOptions) validate() error { + if o == nil { + return errors.New("impersonate: options must be provided") + } + if o.TargetPrincipal == "" { + return errMissingTargetPrincipal + } + if len(o.Scopes) == 0 { + return errMissingScopes + } + if o.Lifetime.Hours() > 12 { + return errLifetimeOverMax + } + return nil +} + +type generateAccessTokenRequest struct { + Delegates []string `json:"delegates,omitempty"` + Lifetime string `json:"lifetime,omitempty"` + Scope []string `json:"scope,omitempty"` +} + +type generateAccessTokenResponse struct { + AccessToken string `json:"accessToken"` + ExpireTime string `json:"expireTime"` +} + +type impersonatedTokenProvider struct { + client *http.Client + // universeDomain is used for endpoint construction. + universeDomainProvider auth.CredentialsPropertyProvider + logger *slog.Logger + + targetPrincipal string + lifetime string + scopes []string + delegates []string +} + +// Token returns an impersonated Token. +func (i impersonatedTokenProvider) Token(ctx context.Context) (*auth.Token, error) { + reqBody := generateAccessTokenRequest{ + Delegates: i.delegates, + Lifetime: i.lifetime, + Scope: i.scopes, + } + b, err := json.Marshal(reqBody) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to marshal request: %w", err) + } + universeDomain, err := i.universeDomainProvider.GetProperty(ctx) + if err != nil { + return nil, err + } + endpoint := strings.Replace(iamCredentialsUniverseDomainEndpoint, universeDomainPlaceholder, universeDomain, 1) + url := fmt.Sprintf("%s/v1/%s:generateAccessToken", endpoint, internal.FormatIAMServiceAccountResource(i.targetPrincipal)) + req, err := http.NewRequestWithContext(ctx, "POST", url, bytes.NewReader(b)) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to create request: %w", err) + } + req.Header.Set("Content-Type", "application/json") + i.logger.DebugContext(ctx, "impersonated token request", "request", internallog.HTTPRequest(req, b)) + resp, body, err := internal.DoRequest(i.client, req) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to generate access token: %w", err) + } + i.logger.DebugContext(ctx, "impersonated token response", "response", internallog.HTTPResponse(resp, body)) + if c := resp.StatusCode; c < 200 || c > 299 { + return nil, fmt.Errorf("impersonate: status code %d: %s", c, body) + } + + var accessTokenResp generateAccessTokenResponse + if err := json.Unmarshal(body, &accessTokenResp); err != nil { + return nil, fmt.Errorf("impersonate: unable to parse response: %w", err) + } + expiry, err := time.Parse(time.RFC3339, accessTokenResp.ExpireTime) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to parse expiry: %w", err) + } + return &auth.Token{ + Value: accessTokenResp.AccessToken, + Expiry: expiry, + }, nil +} diff --git a/vendor/cloud.google.com/go/auth/credentials/impersonate/user.go b/vendor/cloud.google.com/go/auth/credentials/impersonate/user.go new file mode 100644 index 00000000000..432427fa88a --- /dev/null +++ b/vendor/cloud.google.com/go/auth/credentials/impersonate/user.go @@ -0,0 +1,203 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package impersonate + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "log/slog" + "net/http" + "net/url" + "strings" + "time" + + "cloud.google.com/go/auth" + "cloud.google.com/go/auth/internal" + "github.com/googleapis/gax-go/v2/internallog" +) + +var ( + iamCredentialsEndpoint = "https://iamcredentials.googleapis.com" +) + +// user provides an auth flow for domain-wide delegation, setting +// CredentialsConfig.Subject to be the impersonated user. +func user(opts *CredentialsOptions, client *http.Client, lifetime time.Duration, isStaticToken bool, universeDomainProvider auth.CredentialsPropertyProvider) (auth.TokenProvider, error) { + if opts.Subject == "" { + return nil, errors.New("CredentialsConfig.Subject must not be empty") + } + u := userTokenProvider{ + client: client, + targetPrincipal: opts.TargetPrincipal, + subject: opts.Subject, + lifetime: lifetime, + universeDomainProvider: universeDomainProvider, + logger: internallog.New(opts.Logger), + } + u.delegates = make([]string, len(opts.Delegates)) + for i, v := range opts.Delegates { + u.delegates[i] = internal.FormatIAMServiceAccountResource(v) + } + u.scopes = make([]string, len(opts.Scopes)) + copy(u.scopes, opts.Scopes) + var tpo *auth.CachedTokenProviderOptions + if isStaticToken { + tpo = &auth.CachedTokenProviderOptions{ + DisableAutoRefresh: true, + } + } + return auth.NewCachedTokenProvider(u, tpo), nil +} + +type claimSet struct { + Iss string `json:"iss"` + Scope string `json:"scope,omitempty"` + Sub string `json:"sub,omitempty"` + Aud string `json:"aud"` + Iat int64 `json:"iat"` + Exp int64 `json:"exp"` +} + +type signJWTRequest struct { + Payload string `json:"payload"` + Delegates []string `json:"delegates,omitempty"` +} + +type signJWTResponse struct { + // KeyID is the key used to sign the JWT. + KeyID string `json:"keyId"` + // SignedJwt contains the automatically generated header; the + // client-supplied payload; and the signature, which is generated using + // the key referenced by the `kid` field in the header. + SignedJWT string `json:"signedJwt"` +} + +type exchangeTokenResponse struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + ExpiresIn int64 `json:"expires_in"` +} + +type userTokenProvider struct { + client *http.Client + logger *slog.Logger + + targetPrincipal string + subject string + scopes []string + lifetime time.Duration + delegates []string + universeDomainProvider auth.CredentialsPropertyProvider +} + +func (u userTokenProvider) Token(ctx context.Context) (*auth.Token, error) { + // Because a subject is specified a domain-wide delegation auth-flow is initiated + // to impersonate as the provided subject (user). + // Return error if users try to use domain-wide delegation in a non-GDU universe. + ud, err := u.universeDomainProvider.GetProperty(ctx) + if err != nil { + return nil, err + } + if ud != internal.DefaultUniverseDomain { + return nil, errUniverseNotSupportedDomainWideDelegation + } + signedJWT, err := u.signJWT(ctx) + if err != nil { + return nil, err + } + return u.exchangeToken(ctx, signedJWT) +} + +func (u userTokenProvider) signJWT(ctx context.Context) (string, error) { + now := time.Now() + exp := now.Add(u.lifetime) + claims := claimSet{ + Iss: u.targetPrincipal, + Scope: strings.Join(u.scopes, " "), + Sub: u.subject, + Aud: fmt.Sprintf("%s/token", oauth2Endpoint), + Iat: now.Unix(), + Exp: exp.Unix(), + } + payloadBytes, err := json.Marshal(claims) + if err != nil { + return "", fmt.Errorf("impersonate: unable to marshal claims: %w", err) + } + signJWTReq := signJWTRequest{ + Payload: string(payloadBytes), + Delegates: u.delegates, + } + + bodyBytes, err := json.Marshal(signJWTReq) + if err != nil { + return "", fmt.Errorf("impersonate: unable to marshal request: %w", err) + } + reqURL := fmt.Sprintf("%s/v1/%s:signJwt", iamCredentialsEndpoint, internal.FormatIAMServiceAccountResource(u.targetPrincipal)) + req, err := http.NewRequestWithContext(ctx, "POST", reqURL, bytes.NewReader(bodyBytes)) + if err != nil { + return "", fmt.Errorf("impersonate: unable to create request: %w", err) + } + req.Header.Set("Content-Type", "application/json") + u.logger.DebugContext(ctx, "impersonated user sign JWT request", "request", internallog.HTTPRequest(req, bodyBytes)) + resp, body, err := internal.DoRequest(u.client, req) + if err != nil { + return "", fmt.Errorf("impersonate: unable to sign JWT: %w", err) + } + u.logger.DebugContext(ctx, "impersonated user sign JWT response", "response", internallog.HTTPResponse(resp, body)) + if c := resp.StatusCode; c < 200 || c > 299 { + return "", fmt.Errorf("impersonate: status code %d: %s", c, body) + } + + var signJWTResp signJWTResponse + if err := json.Unmarshal(body, &signJWTResp); err != nil { + return "", fmt.Errorf("impersonate: unable to parse response: %w", err) + } + return signJWTResp.SignedJWT, nil +} + +func (u userTokenProvider) exchangeToken(ctx context.Context, signedJWT string) (*auth.Token, error) { + v := url.Values{} + v.Set("grant_type", "assertion") + v.Set("assertion_type", "http://oauth.net/grant_type/jwt/1.0/bearer") + v.Set("assertion", signedJWT) + req, err := http.NewRequestWithContext(ctx, "POST", fmt.Sprintf("%s/token", oauth2Endpoint), strings.NewReader(v.Encode())) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + u.logger.DebugContext(ctx, "impersonated user token exchange request", "request", internallog.HTTPRequest(req, []byte(v.Encode()))) + resp, body, err := internal.DoRequest(u.client, req) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to exchange token: %w", err) + } + u.logger.DebugContext(ctx, "impersonated user token exchange response", "response", internallog.HTTPResponse(resp, body)) + if c := resp.StatusCode; c < 200 || c > 299 { + return nil, fmt.Errorf("impersonate: status code %d: %s", c, body) + } + + var tokenResp exchangeTokenResponse + if err := json.Unmarshal(body, &tokenResp); err != nil { + return nil, fmt.Errorf("impersonate: unable to parse response: %w", err) + } + + return &auth.Token{ + Value: tokenResp.AccessToken, + Type: tokenResp.TokenType, + Expiry: time.Now().Add(time.Second * time.Duration(tokenResp.ExpiresIn)), + }, nil +} diff --git a/vendor/cloud.google.com/go/auth/internal/version.go b/vendor/cloud.google.com/go/auth/internal/version.go index 8deb9cdeb29..146f6c768cf 100644 --- a/vendor/cloud.google.com/go/auth/internal/version.go +++ b/vendor/cloud.google.com/go/auth/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.23.0" +const Version = "0.23.2" diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go index 4eac3c74b6a..20b33dedf1e 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go @@ -39,6 +39,7 @@ const ( GCE CloudRun CloudRunJob + CloudRunWorkerPool CloudFunctions AppEngineStandard AppEngineFlex @@ -58,6 +59,8 @@ func (d *Detector) CloudPlatform() Platform { return CloudRun case d.onCloudRunJob(): return CloudRunJob + case d.onCloudRunWorkerPool(): + return CloudRunWorkerPool case d.onAppEngineStandard(): return AppEngineStandard case d.onAppEngine(): diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go index f137b1fae6a..49f8818999f 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go @@ -28,14 +28,19 @@ const ( // // Cloud Run jobs env vars: // https://cloud.google.com/run/docs/container-contract#jobs-env-vars - cloudFunctionsTargetEnv = "FUNCTION_TARGET" - cloudRunConfigurationEnv = "K_CONFIGURATION" - cloudRunJobsEnv = "CLOUD_RUN_JOB" - faasServiceEnv = "K_SERVICE" - faasRevisionEnv = "K_REVISION" - cloudRunJobExecutionEnv = "CLOUD_RUN_EXECUTION" - cloudRunJobTaskIndexEnv = "CLOUD_RUN_TASK_INDEX" - regionMetadataAttr = "instance/region" + // + // Cloud Run worker pool env vars: + // https://cloud.google.com/run/docs/container-contract#worker-pools-env-vars + cloudFunctionsTargetEnv = "FUNCTION_TARGET" + cloudRunConfigurationEnv = "K_CONFIGURATION" + cloudRunJobsEnv = "CLOUD_RUN_JOB" + faasServiceEnv = "K_SERVICE" + faasRevisionEnv = "K_REVISION" + cloudRunJobExecutionEnv = "CLOUD_RUN_EXECUTION" + cloudRunJobTaskIndexEnv = "CLOUD_RUN_TASK_INDEX" + cloudRunWorkerPoolEnv = "CLOUD_RUN_WORKER_POOL" + cloudRunRevisionEnv = "CLOUD_RUN_REVISION" + regionMetadataAttr = "instance/region" ) func (d *Detector) onCloudFunctions() bool { @@ -53,6 +58,11 @@ func (d *Detector) onCloudRunJob() bool { return found } +func (d *Detector) onCloudRunWorkerPool() bool { + _, found := d.os.LookupEnv(cloudRunWorkerPoolEnv) + return found +} + // FaaSName returns the name of the Cloud Run, Cloud Run jobs or Cloud Functions service. func (d *Detector) FaaSName() (string, error) { if name, found := d.os.LookupEnv(faasServiceEnv); found { @@ -61,11 +71,17 @@ func (d *Detector) FaaSName() (string, error) { if name, found := d.os.LookupEnv(cloudRunJobsEnv); found { return name, nil } + if name, found := d.os.LookupEnv(cloudRunWorkerPoolEnv); found { + return name, nil + } return "", errEnvVarNotFound } // FaaSVersion returns the revision of the Cloud Run or Cloud Functions service. func (d *Detector) FaaSVersion() (string, error) { + if version, found := d.os.LookupEnv(cloudRunRevisionEnv); found { + return version, nil + } if version, found := d.os.LookupEnv(faasRevisionEnv); found { return version, nil } diff --git a/vendor/github.com/andybalholm/brotli/.gitignore b/vendor/github.com/andybalholm/brotli/.gitignore index 7fd17523154..d8798915fe2 100644 --- a/vendor/github.com/andybalholm/brotli/.gitignore +++ b/vendor/github.com/andybalholm/brotli/.gitignore @@ -1,2 +1,3 @@ cpu.out brotli.test +corpus diff --git a/vendor/github.com/andybalholm/brotli/flate/LICENSE b/vendor/github.com/andybalholm/brotli/flate/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/andybalholm/brotli/flate/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/andybalholm/brotli/flate/README.md b/vendor/github.com/andybalholm/brotli/flate/README.md deleted file mode 100644 index 0603ba1ffc7..00000000000 --- a/vendor/github.com/andybalholm/brotli/flate/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This package is a flate/gzip compressor that reuses the matchfinder package that I’ve been developing for brotli. -It is copied and adapted from the standard library compress/flate package. diff --git a/vendor/github.com/andybalholm/brotli/flate/gzip.go b/vendor/github.com/andybalholm/brotli/flate/gzip.go deleted file mode 100644 index 16c628714f1..00000000000 --- a/vendor/github.com/andybalholm/brotli/flate/gzip.go +++ /dev/null @@ -1,65 +0,0 @@ -package flate - -import ( - "hash/crc32" - "time" - - "github.com/andybalholm/brotli/matchfinder" -) - -func NewGZIPEncoder() matchfinder.Encoder { - return &gzipEncoder{ - f: NewEncoder(), - } -} - -type gzipEncoder struct { - f matchfinder.Encoder - length uint32 - crc uint32 - wroteHeader bool -} - -func (g *gzipEncoder) Reset() { - g.f.Reset() - g.length = 0 - g.crc = 0 - g.wroteHeader = false -} - -func appendUint32(dst []byte, n uint32) []byte { - return append(dst, - byte(n), - byte(n>>8), - byte(n>>16), - byte(n>>24), - ) -} - -func (g *gzipEncoder) Encode(dst []byte, src []byte, matches []matchfinder.Match, lastBlock bool) []byte { - if !g.wroteHeader { - dst = append(dst, - 0x1f, 0x8b, // magic number - 8, // CM = flate - 0, // FLG - ) - dst = appendUint32(dst, uint32(time.Now().Unix())) - dst = append(dst, - 0, // XFL - 255, // OS (unspecified) - ) - g.wroteHeader = true - } - - dst = g.f.Encode(dst, src, matches, lastBlock) - - g.length += uint32(len(src)) - g.crc = crc32.Update(g.crc, crc32.IEEETable, src) - - if lastBlock { - dst = appendUint32(dst, g.crc) - dst = appendUint32(dst, g.length) - } - - return dst -} diff --git a/vendor/github.com/andybalholm/brotli/flate/huffman_bit_writer.go b/vendor/github.com/andybalholm/brotli/flate/huffman_bit_writer.go deleted file mode 100644 index c60dfd44ecc..00000000000 --- a/vendor/github.com/andybalholm/brotli/flate/huffman_bit_writer.go +++ /dev/null @@ -1,517 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package flate - -import ( - "github.com/andybalholm/brotli/matchfinder" -) - -const ( - // The largest offset code. - offsetCodeCount = 30 - - // The special code used to mark the end of a block. - endBlockMarker = 256 - - // The first length code. - lengthCodesStart = 257 - - // The number of codegen codes. - codegenCodeCount = 19 - badCode = 255 - - maxNumLit = 286 - maxStoreBlockSize = 65535 - baseMatchLength = 3 // The smallest match length per the RFC section 3.2.5 - baseMatchOffset = 1 // The smallest match offset -) - -// The number of extra bits needed by length code X - LENGTH_CODES_START. -var lengthExtraBits = []int8{ - /* 257 */ 0, 0, 0, - /* 260 */ 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, - /* 270 */ 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, - /* 280 */ 4, 5, 5, 5, 5, 0, -} - -// The length indicated by length code X - LENGTH_CODES_START. -var lengthBase = []int{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, - 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, - 64, 80, 96, 112, 128, 160, 192, 224, 255, -} - -// offset code word extra bits. -var offsetExtraBits = []int8{ - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, - 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, - 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, -} - -var offsetBase = []int{ - 0x000000, 0x000001, 0x000002, 0x000003, 0x000004, - 0x000006, 0x000008, 0x00000c, 0x000010, 0x000018, - 0x000020, 0x000030, 0x000040, 0x000060, 0x000080, - 0x0000c0, 0x000100, 0x000180, 0x000200, 0x000300, - 0x000400, 0x000600, 0x000800, 0x000c00, 0x001000, - 0x001800, 0x002000, 0x003000, 0x004000, 0x006000, -} - -// The odd order in which the codegen code sizes are written. -var codegenOrder = []uint32{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15} - -type huffmanBitWriter struct { - dst []byte - - // Data waiting to be written is the low nbits of bits. - bits uint64 - nbits uint - codegenFreq [codegenCodeCount]int32 - literalFreq []int32 - offsetFreq []int32 - codegen []uint8 - literalEncoding *huffmanEncoder - offsetEncoding *huffmanEncoder - codegenEncoding *huffmanEncoder -} - -func NewEncoder() matchfinder.Encoder { - return &huffmanBitWriter{ - literalFreq: make([]int32, maxNumLit), - offsetFreq: make([]int32, offsetCodeCount), - codegen: make([]uint8, maxNumLit+offsetCodeCount+1), - literalEncoding: newHuffmanEncoder(maxNumLit), - codegenEncoding: newHuffmanEncoder(codegenCodeCount), - offsetEncoding: newHuffmanEncoder(offsetCodeCount), - } -} - -func (w *huffmanBitWriter) Reset() { - w.bits, w.nbits = 0, 0 -} - -func (w *huffmanBitWriter) flush() { - dst := w.dst - for w.nbits != 0 { - dst = append(dst, byte(w.bits)) - w.bits >>= 8 - if w.nbits > 8 { // Avoid underflow - w.nbits -= 8 - } else { - w.nbits = 0 - } - } - w.bits = 0 - w.dst = dst -} - -func (w *huffmanBitWriter) writeBits(b int32, nb uint) { - w.bits |= uint64(b) << w.nbits - w.nbits += nb - if w.nbits >= 48 { - bits := w.bits - w.bits >>= 48 - w.nbits -= 48 - w.dst = append(w.dst, - byte(bits), - byte(bits>>8), - byte(bits>>16), - byte(bits>>24), - byte(bits>>32), - byte(bits>>40), - ) - } -} - -func (w *huffmanBitWriter) writeBytes(bytes []byte) { - if w.nbits&7 != 0 { - panic("writeBytes with unfinished bits") - } - for w.nbits != 0 { - w.dst = append(w.dst, byte(w.bits)) - w.bits >>= 8 - w.nbits -= 8 - } - w.dst = append(w.dst, bytes...) -} - -// RFC 1951 3.2.7 specifies a special run-length encoding for specifying -// the literal and offset lengths arrays (which are concatenated into a single -// array). This method generates that run-length encoding. -// -// The result is written into the codegen array, and the frequencies -// of each code is written into the codegenFreq array. -// Codes 0-15 are single byte codes. Codes 16-18 are followed by additional -// information. Code badCode is an end marker -// -// numLiterals The number of literals in literalEncoding -// numOffsets The number of offsets in offsetEncoding -// litenc, offenc The literal and offset encoder to use -func (w *huffmanBitWriter) generateCodegen(numLiterals int, numOffsets int, litEnc, offEnc *huffmanEncoder) { - for i := range w.codegenFreq { - w.codegenFreq[i] = 0 - } - // Note that we are using codegen both as a temporary variable for holding - // a copy of the frequencies, and as the place where we put the result. - // This is fine because the output is always shorter than the input used - // so far. - codegen := w.codegen // cache - // Copy the concatenated code sizes to codegen. Put a marker at the end. - cgnl := codegen[:numLiterals] - for i := range cgnl { - cgnl[i] = uint8(litEnc.codes[i].len) - } - - cgnl = codegen[numLiterals : numLiterals+numOffsets] - for i := range cgnl { - cgnl[i] = uint8(offEnc.codes[i].len) - } - codegen[numLiterals+numOffsets] = badCode - - size := codegen[0] - count := 1 - outIndex := 0 - for inIndex := 1; size != badCode; inIndex++ { - // INVARIANT: We have seen "count" copies of size that have not yet - // had output generated for them. - nextSize := codegen[inIndex] - if nextSize == size { - count++ - continue - } - // We need to generate codegen indicating "count" of size. - if size != 0 { - codegen[outIndex] = size - outIndex++ - w.codegenFreq[size]++ - count-- - for count >= 3 { - n := 6 - if n > count { - n = count - } - codegen[outIndex] = 16 - outIndex++ - codegen[outIndex] = uint8(n - 3) - outIndex++ - w.codegenFreq[16]++ - count -= n - } - } else { - for count >= 11 { - n := 138 - if n > count { - n = count - } - codegen[outIndex] = 18 - outIndex++ - codegen[outIndex] = uint8(n - 11) - outIndex++ - w.codegenFreq[18]++ - count -= n - } - if count >= 3 { - // count >= 3 && count <= 10 - codegen[outIndex] = 17 - outIndex++ - codegen[outIndex] = uint8(count - 3) - outIndex++ - w.codegenFreq[17]++ - count = 0 - } - } - count-- - for ; count >= 0; count-- { - codegen[outIndex] = size - outIndex++ - w.codegenFreq[size]++ - } - // Set up invariant for next time through the loop. - size = nextSize - count = 1 - } - // Marker indicating the end of the codegen. - codegen[outIndex] = badCode -} - -// dynamicSize returns the size of dynamically encoded data in bits. -func (w *huffmanBitWriter) dynamicSize(litEnc, offEnc *huffmanEncoder, extraBits int) (size, numCodegens int) { - numCodegens = len(w.codegenFreq) - for numCodegens > 4 && w.codegenFreq[codegenOrder[numCodegens-1]] == 0 { - numCodegens-- - } - header := 3 + 5 + 5 + 4 + (3 * numCodegens) + - w.codegenEncoding.bitLength(w.codegenFreq[:]) + - int(w.codegenFreq[16])*2 + - int(w.codegenFreq[17])*3 + - int(w.codegenFreq[18])*7 - size = header + - litEnc.bitLength(w.literalFreq) + - offEnc.bitLength(w.offsetFreq) + - extraBits - - return size, numCodegens -} - -// fixedSize returns the size of dynamically encoded data in bits. -func (w *huffmanBitWriter) fixedSize(extraBits int) int { - return 3 + - fixedLiteralEncoding.bitLength(w.literalFreq) + - fixedOffsetEncoding.bitLength(w.offsetFreq) + - extraBits -} - -// storedSize calculates the stored size, including header. -// The function returns the size in bits and whether the block -// fits inside a single block. -func (w *huffmanBitWriter) storedSize(in []byte) (int, bool) { - if in == nil { - return 0, false - } - if len(in) <= maxStoreBlockSize { - return (len(in) + 5) * 8, true - } - return 0, false -} - -func (w *huffmanBitWriter) writeCode(c hcode) { - w.bits |= uint64(c.code) << w.nbits - w.nbits += uint(c.len) - if w.nbits >= 48 { - bits := w.bits - w.bits >>= 48 - w.nbits -= 48 - w.dst = append(w.dst, - byte(bits), - byte(bits>>8), - byte(bits>>16), - byte(bits>>24), - byte(bits>>32), - byte(bits>>40), - ) - } -} - -// Write the header of a dynamic Huffman block to the output stream. -// -// numLiterals The number of literals specified in codegen -// numOffsets The number of offsets specified in codegen -// numCodegens The number of codegens used in codegen -func (w *huffmanBitWriter) writeDynamicHeader(numLiterals int, numOffsets int, numCodegens int, isEof bool) { - var firstBits int32 = 4 - if isEof { - firstBits = 5 - } - w.writeBits(firstBits, 3) - w.writeBits(int32(numLiterals-257), 5) - w.writeBits(int32(numOffsets-1), 5) - w.writeBits(int32(numCodegens-4), 4) - - for i := 0; i < numCodegens; i++ { - value := uint(w.codegenEncoding.codes[codegenOrder[i]].len) - w.writeBits(int32(value), 3) - } - - i := 0 - for { - var codeWord int = int(w.codegen[i]) - i++ - if codeWord == badCode { - break - } - w.writeCode(w.codegenEncoding.codes[uint32(codeWord)]) - - switch codeWord { - case 16: - w.writeBits(int32(w.codegen[i]), 2) - i++ - case 17: - w.writeBits(int32(w.codegen[i]), 3) - i++ - case 18: - w.writeBits(int32(w.codegen[i]), 7) - i++ - } - } -} - -func (w *huffmanBitWriter) writeStoredHeader(length int, isEof bool) { - var flag int32 - if isEof { - flag = 1 - } - w.writeBits(flag, 3) - w.flush() - w.writeBits(int32(length), 16) - w.writeBits(int32(^uint16(length)), 16) -} - -func (w *huffmanBitWriter) writeFixedHeader(isEof bool) { - // Indicate that we are a fixed Huffman block - var value int32 = 2 - if isEof { - value = 3 - } - w.writeBits(value, 3) -} - -// writeBlock will write a block of tokens with the smallest encoding. -func (w *huffmanBitWriter) writeBlock(matches []matchfinder.Match, eof bool, input []byte) { - numLiterals, numOffsets := w.makeStatistics(matches, input) - - var extraBits int - storedSize, storable := w.storedSize(input) - if storable { - // We only bother calculating the costs of the extra bits required by - // the length of offset fields (which will be the same for both fixed - // and dynamic encoding), if we need to compare those two encodings - // against stored encoding. - for lengthCode := lengthCodesStart + 8; lengthCode < numLiterals; lengthCode++ { - // First eight length codes have extra size = 0. - extraBits += int(w.literalFreq[lengthCode]) * int(lengthExtraBits[lengthCode-lengthCodesStart]) - } - for offsetCode := 4; offsetCode < numOffsets; offsetCode++ { - // First four offset codes have extra size = 0. - extraBits += int(w.offsetFreq[offsetCode]) * int(offsetExtraBits[offsetCode]) - } - } - - // Figure out smallest code. - // Fixed Huffman baseline. - var literalEncoding = fixedLiteralEncoding - var offsetEncoding = fixedOffsetEncoding - var size = w.fixedSize(extraBits) - - // Dynamic Huffman? - var numCodegens int - - // Generate codegen and codegenFrequencies, which indicates how to encode - // the literalEncoding and the offsetEncoding. - w.generateCodegen(numLiterals, numOffsets, w.literalEncoding, w.offsetEncoding) - w.codegenEncoding.generate(w.codegenFreq[:], 7) - dynamicSize, numCodegens := w.dynamicSize(w.literalEncoding, w.offsetEncoding, extraBits) - - if dynamicSize < size { - size = dynamicSize - literalEncoding = w.literalEncoding - offsetEncoding = w.offsetEncoding - } - - // Stored bytes? - if storable && storedSize < size { - w.writeStoredHeader(len(input), eof) - w.writeBytes(input) - return - } - - // Huffman. - if literalEncoding == fixedLiteralEncoding { - w.writeFixedHeader(eof) - } else { - w.writeDynamicHeader(numLiterals, numOffsets, numCodegens, eof) - } - - // Write the tokens. - w.writeTokens(matches, input, literalEncoding.codes, offsetEncoding.codes) - w.writeCode(literalEncoding.codes[endBlockMarker]) -} - -// makeStatistics indexes a slice of tokens, and updates -// literalFreq and offsetFreq, and generates literalEncoding -// and offsetEncoding. -// The number of literal and offset tokens is returned. -func (w *huffmanBitWriter) makeStatistics(matches []matchfinder.Match, input []byte) (numLiterals, numOffsets int) { - for i := range w.literalFreq { - w.literalFreq[i] = 0 - } - for i := range w.offsetFreq { - w.offsetFreq[i] = 0 - } - - pos := 0 - for _, m := range matches { - for _, c := range input[pos : pos+m.Unmatched] { - w.literalFreq[c]++ - } - pos += m.Unmatched - - if m.Length == 0 { - continue - } - w.literalFreq[lengthCodesStart+lengthCode(m.Length)]++ - w.offsetFreq[offsetCode(m.Distance)]++ - pos += m.Length - } - w.literalFreq[endBlockMarker]++ - - // get the number of literals - numLiterals = len(w.literalFreq) - for w.literalFreq[numLiterals-1] == 0 { - numLiterals-- - } - // get the number of offsets - numOffsets = len(w.offsetFreq) - for numOffsets > 0 && w.offsetFreq[numOffsets-1] == 0 { - numOffsets-- - } - if numOffsets == 0 { - // We haven't found a single match. If we want to go with the dynamic encoding, - // we should count at least one offset to be sure that the offset huffman tree could be encoded. - w.offsetFreq[0] = 1 - numOffsets = 1 - } - w.literalEncoding.generate(w.literalFreq, 15) - w.offsetEncoding.generate(w.offsetFreq, 15) - return -} - -// writeTokens writes a slice of tokens to the output. -// codes for literal and offset encoding must be supplied. -func (w *huffmanBitWriter) writeTokens(matches []matchfinder.Match, input []byte, leCodes, oeCodes []hcode) { - pos := 0 - for _, m := range matches { - for _, c := range input[pos : pos+m.Unmatched] { - w.writeCode(leCodes[c]) - } - pos += m.Unmatched - - // Write the length - length := m.Length - if length == 0 { - continue - } - lengthCode := lengthCode(length) - w.writeCode(leCodes[lengthCode+lengthCodesStart]) - extraLengthBits := uint(lengthExtraBits[lengthCode]) - if extraLengthBits > 0 { - extraLength := int32(length - baseMatchLength - lengthBase[lengthCode]) - w.writeBits(extraLength, extraLengthBits) - } - - // Write the offset - offset := m.Distance - offsetCode := offsetCode(offset) - w.writeCode(oeCodes[offsetCode]) - extraOffsetBits := uint(offsetExtraBits[offsetCode]) - if extraOffsetBits > 0 { - extraOffset := int32(offset - baseMatchOffset - offsetBase[offsetCode]) - w.writeBits(extraOffset, extraOffsetBits) - } - pos += m.Length - } -} - -func (w *huffmanBitWriter) Encode(dst []byte, src []byte, matches []matchfinder.Match, lastBlock bool) []byte { - w.dst = dst - - w.writeBlock(matches, lastBlock, src) - if lastBlock { - w.flush() - } - - dst = w.dst - w.dst = nil - return dst -} diff --git a/vendor/github.com/andybalholm/brotli/flate/huffman_code.go b/vendor/github.com/andybalholm/brotli/flate/huffman_code.go deleted file mode 100644 index 1d73f47d82a..00000000000 --- a/vendor/github.com/andybalholm/brotli/flate/huffman_code.go +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package flate - -import ( - "math" - "math/bits" - "sort" -) - -// hcode is a huffman code with a bit code and bit length. -type hcode struct { - code, len uint16 -} - -type huffmanEncoder struct { - codes []hcode - freqcache []literalNode - bitCount [17]int32 - lns byLiteral // stored to avoid repeated allocation in generate - lfs byFreq // stored to avoid repeated allocation in generate -} - -type literalNode struct { - literal uint16 - freq int32 -} - -// A levelInfo describes the state of the constructed tree for a given depth. -type levelInfo struct { - // Our level. for better printing - level int32 - - // The frequency of the last node at this level - lastFreq int32 - - // The frequency of the next character to add to this level - nextCharFreq int32 - - // The frequency of the next pair (from level below) to add to this level. - // Only valid if the "needed" value of the next lower level is 0. - nextPairFreq int32 - - // The number of chains remaining to generate for this level before moving - // up to the next level - needed int32 -} - -// set sets the code and length of an hcode. -func (h *hcode) set(code uint16, length uint16) { - h.len = length - h.code = code -} - -func maxNode() literalNode { return literalNode{math.MaxUint16, math.MaxInt32} } - -func newHuffmanEncoder(size int) *huffmanEncoder { - return &huffmanEncoder{codes: make([]hcode, size)} -} - -// Generates a HuffmanCode corresponding to the fixed literal table -func generateFixedLiteralEncoding() *huffmanEncoder { - h := newHuffmanEncoder(maxNumLit) - codes := h.codes - var ch uint16 - for ch = 0; ch < maxNumLit; ch++ { - var bits uint16 - var size uint16 - switch { - case ch < 144: - // size 8, 000110000 .. 10111111 - bits = ch + 48 - size = 8 - case ch < 256: - // size 9, 110010000 .. 111111111 - bits = ch + 400 - 144 - size = 9 - case ch < 280: - // size 7, 0000000 .. 0010111 - bits = ch - 256 - size = 7 - default: - // size 8, 11000000 .. 11000111 - bits = ch + 192 - 280 - size = 8 - } - codes[ch] = hcode{code: reverseBits(bits, byte(size)), len: size} - } - return h -} - -func generateFixedOffsetEncoding() *huffmanEncoder { - h := newHuffmanEncoder(30) - codes := h.codes - for ch := range codes { - codes[ch] = hcode{code: reverseBits(uint16(ch), 5), len: 5} - } - return h -} - -var fixedLiteralEncoding *huffmanEncoder = generateFixedLiteralEncoding() -var fixedOffsetEncoding *huffmanEncoder = generateFixedOffsetEncoding() - -func (h *huffmanEncoder) bitLength(freq []int32) int { - var total int - for i, f := range freq { - if f != 0 { - total += int(f) * int(h.codes[i].len) - } - } - return total -} - -const maxBitsLimit = 16 - -// Return the number of literals assigned to each bit size in the Huffman encoding -// -// This method is only called when list.length >= 3 -// The cases of 0, 1, and 2 literals are handled by special case code. -// -// list An array of the literals with non-zero frequencies -// and their associated frequencies. The array is in order of increasing -// frequency, and has as its last element a special element with frequency -// MaxInt32 -// maxBits The maximum number of bits that should be used to encode any literal. -// Must be less than 16. -// return An integer array in which array[i] indicates the number of literals -// that should be encoded in i bits. -func (h *huffmanEncoder) bitCounts(list []literalNode, maxBits int32) []int32 { - if maxBits >= maxBitsLimit { - panic("flate: maxBits too large") - } - n := int32(len(list)) - list = list[0 : n+1] - list[n] = maxNode() - - // The tree can't have greater depth than n - 1, no matter what. This - // saves a little bit of work in some small cases - if maxBits > n-1 { - maxBits = n - 1 - } - - // Create information about each of the levels. - // A bogus "Level 0" whose sole purpose is so that - // level1.prev.needed==0. This makes level1.nextPairFreq - // be a legitimate value that never gets chosen. - var levels [maxBitsLimit]levelInfo - // leafCounts[i] counts the number of literals at the left - // of ancestors of the rightmost node at level i. - // leafCounts[i][j] is the number of literals at the left - // of the level j ancestor. - var leafCounts [maxBitsLimit][maxBitsLimit]int32 - - for level := int32(1); level <= maxBits; level++ { - // For every level, the first two items are the first two characters. - // We initialize the levels as if we had already figured this out. - levels[level] = levelInfo{ - level: level, - lastFreq: list[1].freq, - nextCharFreq: list[2].freq, - nextPairFreq: list[0].freq + list[1].freq, - } - leafCounts[level][level] = 2 - if level == 1 { - levels[level].nextPairFreq = math.MaxInt32 - } - } - - // We need a total of 2*n - 2 items at top level and have already generated 2. - levels[maxBits].needed = 2*n - 4 - - level := maxBits - for { - l := &levels[level] - if l.nextPairFreq == math.MaxInt32 && l.nextCharFreq == math.MaxInt32 { - // We've run out of both leafs and pairs. - // End all calculations for this level. - // To make sure we never come back to this level or any lower level, - // set nextPairFreq impossibly large. - l.needed = 0 - levels[level+1].nextPairFreq = math.MaxInt32 - level++ - continue - } - - prevFreq := l.lastFreq - if l.nextCharFreq < l.nextPairFreq { - // The next item on this row is a leaf node. - n := leafCounts[level][level] + 1 - l.lastFreq = l.nextCharFreq - // Lower leafCounts are the same of the previous node. - leafCounts[level][level] = n - l.nextCharFreq = list[n].freq - } else { - // The next item on this row is a pair from the previous row. - // nextPairFreq isn't valid until we generate two - // more values in the level below - l.lastFreq = l.nextPairFreq - // Take leaf counts from the lower level, except counts[level] remains the same. - copy(leafCounts[level][:level], leafCounts[level-1][:level]) - levels[l.level-1].needed = 2 - } - - if l.needed--; l.needed == 0 { - // We've done everything we need to do for this level. - // Continue calculating one level up. Fill in nextPairFreq - // of that level with the sum of the two nodes we've just calculated on - // this level. - if l.level == maxBits { - // All done! - break - } - levels[l.level+1].nextPairFreq = prevFreq + l.lastFreq - level++ - } else { - // If we stole from below, move down temporarily to replenish it. - for levels[level-1].needed > 0 { - level-- - } - } - } - - // Somethings is wrong if at the end, the top level is null or hasn't used - // all of the leaves. - if leafCounts[maxBits][maxBits] != n { - panic("leafCounts[maxBits][maxBits] != n") - } - - bitCount := h.bitCount[:maxBits+1] - bits := 1 - counts := &leafCounts[maxBits] - for level := maxBits; level > 0; level-- { - // chain.leafCount gives the number of literals requiring at least "bits" - // bits to encode. - bitCount[bits] = counts[level] - counts[level-1] - bits++ - } - return bitCount -} - -// Look at the leaves and assign them a bit count and an encoding as specified -// in RFC 1951 3.2.2 -func (h *huffmanEncoder) assignEncodingAndSize(bitCount []int32, list []literalNode) { - code := uint16(0) - for n, bits := range bitCount { - code <<= 1 - if n == 0 || bits == 0 { - continue - } - // The literals list[len(list)-bits] .. list[len(list)-bits] - // are encoded using "bits" bits, and get the values - // code, code + 1, .... The code values are - // assigned in literal order (not frequency order). - chunk := list[len(list)-int(bits):] - - h.lns.sort(chunk) - for _, node := range chunk { - h.codes[node.literal] = hcode{code: reverseBits(code, uint8(n)), len: uint16(n)} - code++ - } - list = list[0 : len(list)-int(bits)] - } -} - -// Update this Huffman Code object to be the minimum code for the specified frequency count. -// -// freq An array of frequencies, in which frequency[i] gives the frequency of literal i. -// maxBits The maximum number of bits to use for any literal. -func (h *huffmanEncoder) generate(freq []int32, maxBits int32) { - if h.freqcache == nil { - // Allocate a reusable buffer with the longest possible frequency table. - // Possible lengths are codegenCodeCount, offsetCodeCount and maxNumLit. - // The largest of these is maxNumLit, so we allocate for that case. - h.freqcache = make([]literalNode, maxNumLit+1) - } - list := h.freqcache[:len(freq)+1] - // Number of non-zero literals - count := 0 - // Set list to be the set of all non-zero literals and their frequencies - for i, f := range freq { - if f != 0 { - list[count] = literalNode{uint16(i), f} - count++ - } else { - list[count] = literalNode{} - h.codes[i].len = 0 - } - } - list[len(freq)] = literalNode{} - - list = list[:count] - if count <= 2 { - // Handle the small cases here, because they are awkward for the general case code. With - // two or fewer literals, everything has bit length 1. - for i, node := range list { - // "list" is in order of increasing literal value. - h.codes[node.literal].set(uint16(i), 1) - } - return - } - h.lfs.sort(list) - - // Get the number of literals for each bit count - bitCount := h.bitCounts(list, maxBits) - // And do the assignment - h.assignEncodingAndSize(bitCount, list) -} - -type byLiteral []literalNode - -func (s *byLiteral) sort(a []literalNode) { - *s = byLiteral(a) - sort.Sort(s) -} - -func (s byLiteral) Len() int { return len(s) } - -func (s byLiteral) Less(i, j int) bool { - return s[i].literal < s[j].literal -} - -func (s byLiteral) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -type byFreq []literalNode - -func (s *byFreq) sort(a []literalNode) { - *s = byFreq(a) - sort.Sort(s) -} - -func (s byFreq) Len() int { return len(s) } - -func (s byFreq) Less(i, j int) bool { - if s[i].freq == s[j].freq { - return s[i].literal < s[j].literal - } - return s[i].freq < s[j].freq -} - -func (s byFreq) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -func reverseBits(number uint16, bitLength byte) uint16 { - return bits.Reverse16(number << (16 - bitLength)) -} diff --git a/vendor/github.com/andybalholm/brotli/flate/token.go b/vendor/github.com/andybalholm/brotli/flate/token.go deleted file mode 100644 index 415b1b5e464..00000000000 --- a/vendor/github.com/andybalholm/brotli/flate/token.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package flate - -import "log" - -// The length code for length X (MIN_MATCH_LENGTH <= X <= MAX_MATCH_LENGTH) -// is lengthCodes[length - MIN_MATCH_LENGTH] -var lengthCodes = [...]uint32{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, - 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, - 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, - 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, - 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, - 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, - 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 28, -} - -var offsetCodes = [...]uint32{ - 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, - 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, -} - -func lengthCode(len int) uint32 { - if len > 258 { - panic("match too long") - } - return lengthCodes[len-baseMatchLength] -} - -// Returns the offset code corresponding to a specific offset -func offsetCode(off int) uint32 { - if off > 32768 { - log.Println(off) - panic("match distance too high") - } - off -= baseMatchOffset - if off < len(offsetCodes) { - return offsetCodes[off] - } - if off>>7 < len(offsetCodes) { - return offsetCodes[off>>7] + 14 - } - return offsetCodes[off>>14] + 28 -} diff --git a/vendor/github.com/andybalholm/brotli/flate/writer.go b/vendor/github.com/andybalholm/brotli/flate/writer.go deleted file mode 100644 index 1e49d489779..00000000000 --- a/vendor/github.com/andybalholm/brotli/flate/writer.go +++ /dev/null @@ -1,66 +0,0 @@ -package flate - -import ( - "io" - - "github.com/andybalholm/brotli/matchfinder" -) - -// NewWriter returns a new matchfinder.Writer that compresses data at the given level, -// in flate encoding. Levels 1–9 are available; levels outside this range will -// be replaced with the closest level available. -func NewWriter(w io.Writer, level int) *matchfinder.Writer { - return newWriter(w, level, NewEncoder()) -} - -// NewGZIPWriter returns a new matchfinder.Writer that compresses data at the given -// level, in gzip encoding. Levels 1–9 are available; levels outside this range -// will be replaced by the closest level available. -func NewGZIPWriter(w io.Writer, level int) *matchfinder.Writer { - return newWriter(w, level, NewGZIPEncoder()) -} - -func newWriter(w io.Writer, level int, e matchfinder.Encoder) *matchfinder.Writer { - var mf matchfinder.MatchFinder - if level < 2 { - mf = &matchfinder.ZFast{MaxDistance: 1 << 15} - } else if level == 2 { - mf = &matchfinder.ZDFast{MaxDistance: 1 << 15} - } else if level == 3 { - mf = &matchfinder.ZM{MaxDistance: 1 << 15} - } else if level == 4 { - mf = &matchfinder.Trio{MaxDistance: 1 << 15} - } else if level < 8 { - chainLen := 32 - switch level { - case 5: - chainLen = 8 - case 6: - chainLen = 16 - } - mf = &matchfinder.M4{ - MaxDistance: 1 << 15, - ChainLength: chainLen, - HashLen: 5, - DistanceBitCost: 66, - } - } else { - chainLen := 32 - hashLen := 5 - if level == 8 { - chainLen = 4 - } - mf = &matchfinder.Pathfinder{ - MaxDistance: 1 << 15, - ChainLength: chainLen, - HashLen: hashLen, - } - } - - return &matchfinder.Writer{ - Dest: w, - MatchFinder: mf, - Encoder: e, - BlockSize: 1 << 16, - } -} diff --git a/vendor/github.com/andybalholm/brotli/http.go b/vendor/github.com/andybalholm/brotli/http.go index 4640519a0fc..621eb0c2992 100644 --- a/vendor/github.com/andybalholm/brotli/http.go +++ b/vendor/github.com/andybalholm/brotli/http.go @@ -1,11 +1,10 @@ package brotli import ( + "compress/gzip" "io" "net/http" "strings" - - "github.com/andybalholm/brotli/flate" ) // HTTPCompressor chooses a compression method (brotli, gzip, or none) based on @@ -25,10 +24,12 @@ func HTTPCompressorWithLevel(w http.ResponseWriter, r *http.Request, level int) switch encoding { case "br": w.Header().Set("Content-Encoding", "br") - return NewWriterV2(w, level) + return NewWriterLevel(w, level) case "gzip": - w.Header().Set("Content-Encoding", "gzip") - return flate.NewGZIPWriter(w, level) + if gzw, err := gzip.NewWriterLevel(w, level); err == nil { + w.Header().Set("Content-Encoding", "gzip") + return gzw + } } return nopCloser{w} } diff --git a/vendor/github.com/andybalholm/brotli/matchfinder/zdfast.go b/vendor/github.com/andybalholm/brotli/matchfinder/zdfast.go index 6890409b581..6120390b314 100644 --- a/vendor/github.com/andybalholm/brotli/matchfinder/zdfast.go +++ b/vendor/github.com/andybalholm/brotli/matchfinder/zdfast.go @@ -63,7 +63,7 @@ func (z *ZDFast) FindMatches(dst []Match, src []byte) []Match { if cap(z.history) == 0 { historySize := max(2*z.MaxDistance, 1<<20, len(src)) z.history = make([]byte, 0, historySize) - } else { + } else if len(z.history) > z.MaxDistance { // Move down offset := len(z.history) - z.MaxDistance copy(z.history[:z.MaxDistance], z.history[offset:]) @@ -132,14 +132,14 @@ mainLoop: coffsetL := s - (candidateL.offset - z.current) coffsetS := s - (candidateS.offset - z.current) - if coffsetL < int32(z.MaxDistance) && uint32(cv) == candidateL.val { + if coffsetL < int32(z.MaxDistance) && uint32(cv) == candidateL.val && candidateL.offset != 0 { t = candidateL.offset - z.current if binary.LittleEndian.Uint32(src[t:]) == uint32(cv) { // found a long match (likely at least 8 bytes) break } } - if coffsetS < int32(z.MaxDistance) && uint32(cv) == candidateS.val { + if coffsetS < int32(z.MaxDistance) && uint32(cv) == candidateS.val && candidateS.offset != 0 { t = candidateS.offset - z.current if binary.LittleEndian.Uint32(src[t:]) != uint32(cv) { goto noMatch diff --git a/vendor/github.com/andybalholm/brotli/matchfinder/zfast.go b/vendor/github.com/andybalholm/brotli/matchfinder/zfast.go index 6f2ad8d0783..14fc739befc 100644 --- a/vendor/github.com/andybalholm/brotli/matchfinder/zfast.go +++ b/vendor/github.com/andybalholm/brotli/matchfinder/zfast.go @@ -60,7 +60,7 @@ func (z *ZFast) FindMatches(dst []Match, src []byte) []Match { if cap(z.history) == 0 { historySize := max(2*z.MaxDistance, 1<<20, len(src)) z.history = make([]byte, 0, historySize) - } else { + } else if len(z.history) > z.MaxDistance { // Move down offset := len(z.history) - z.MaxDistance copy(z.history[:z.MaxDistance], z.history[offset:]) @@ -126,14 +126,14 @@ mainLoop: coffset0 := s - (candidate.offset - z.current) coffset1 := s - (candidate2.offset - z.current) + 1 - if coffset0 < int32(z.MaxDistance) && uint32(cv) == candidate.val { + if coffset0 < int32(z.MaxDistance) && uint32(cv) == candidate.val && candidate.offset != 0 { t = candidate.offset - z.current if binary.LittleEndian.Uint32(src[t:]) == uint32(cv) { // found a regular match break } } - if coffset1 < int32(z.MaxDistance) && uint32(cv>>8) == candidate2.val { + if coffset1 < int32(z.MaxDistance) && uint32(cv>>8) == candidate2.val && candidate2.offset != 0 { t = candidate2.offset - z.current if binary.LittleEndian.Uint32(src[t:]) == uint32(cv>>8) { s++ diff --git a/vendor/github.com/antchfx/xpath/build.go b/vendor/github.com/antchfx/xpath/build.go index 7172608cd6d..65a7fd37a37 100644 --- a/vendor/github.com/antchfx/xpath/build.go +++ b/vendor/github.com/antchfx/xpath/build.go @@ -692,6 +692,19 @@ func (b *builder) processNode(root node, flags flag, props *builderProp) (q quer } q = &groupQuery{Input: q} b.firstInput = q + case nodeVariable: + // Variables have no binding in a compiled expression, so they cannot + // resolve to a query. A bare "$x" already surfaces as an undeclared + // variable error because the nil result reaches the caller, but a + // variable nested in a larger expression (e.g. "$x/@attr") would be + // swallowed here and left as a nil sub-query that panics at select + // time. Report it as undeclared instead. + n := root.(*variableNode) + name := n.Name + if n.Prefix != "" { + name = n.Prefix + ":" + name + } + err = fmt.Errorf("undeclared variable in XPath expression: $%s", name) } b.parseDepth-- return diff --git a/vendor/github.com/antchfx/xpath/func.go b/vendor/github.com/antchfx/xpath/func.go index ffbee656765..d82c4cc7db7 100644 --- a/vendor/github.com/antchfx/xpath/func.go +++ b/vendor/github.com/antchfx/xpath/func.go @@ -123,16 +123,16 @@ func asNumber(t iterator, o interface{}) float64 { if node == nil { return math.NaN() } - if v, err := strconv.ParseFloat(node.Value(), 64); err == nil { - return v - } + return stringToNumber(node.Value()) case float64: return typ case string: - v, err := strconv.ParseFloat(typ, 64) - if err == nil { - return v + return stringToNumber(typ) + case bool: + if typ { + return 1 } + return 0 } return math.NaN() } @@ -156,11 +156,26 @@ func floorFunc(arg query) func(query, iterator) interface{} { } } +// round implements XPath 1.0 round() (REC §4.4): halves round toward +Infinity +// and NaN/±Infinity pass through, so the result stays a number. +func round(f float64) float64 { + if math.IsNaN(f) || math.IsInf(f, 0) { + return f + } + if f >= -0.5 && f < 0.5 { + return f * 0 // keep the sign of zero per §4.4 + } + r := math.Floor(f) + if f-r >= 0.5 { + r++ + } + return r +} + // roundFunc is a XPath Node Set functions round(node-set). func roundFunc(arg query) func(query, iterator) interface{} { return func(_ query, t iterator) interface{} { val := asNumber(t, functionArgs(arg).Evaluate(t)) - //return math.Round(val) return round(val) } } @@ -245,6 +260,32 @@ func asBool(t iterator, v interface{}) bool { } } +func stringToNumber(s string) float64 { + s = strings.TrimSpace(s) + f, err := strconv.ParseFloat(s, 64) + if err != nil { + return math.NaN() + } + return f +} + +// formatNumber converts a number to a string per the XPath 1.0 spec (REC 4.2): +// no exponent for finite values, "Infinity"/"-Infinity", "NaN", and "0" for -0. +func formatNumber(f float64) string { + switch { + case math.IsNaN(f): + return "NaN" + case math.IsInf(f, 1): + return "Infinity" + case math.IsInf(f, -1): + return "-Infinity" + case f == 0: + return "0" + default: + return strconv.FormatFloat(f, 'f', -1, 64) + } +} + func asString(t iterator, v interface{}) string { switch v := v.(type) { case nil: @@ -255,7 +296,7 @@ func asString(t iterator, v interface{}) string { } return "false" case float64: - return strconv.FormatFloat(v, 'g', -1, 64) + return formatNumber(v) case string: return v case query: @@ -621,16 +662,7 @@ func concatFunc(args ...query) func(query, iterator) interface{} { b := builderPool.Get().(stringBuilder) for _, v := range args { v = functionArgs(v) - - switch v := v.Evaluate(t).(type) { - case string: - b.WriteString(v) - case query: - node := v.Select(t) - if node != nil { - b.WriteString(node.Value()) - } - } + b.WriteString(asString(t, v.Evaluate(t))) } result := b.String() b.Reset() diff --git a/vendor/github.com/antchfx/xpath/func_go110.go b/vendor/github.com/antchfx/xpath/func_go110.go index d6ca4513931..4eb082977c7 100644 --- a/vendor/github.com/antchfx/xpath/func_go110.go +++ b/vendor/github.com/antchfx/xpath/func_go110.go @@ -2,14 +2,7 @@ package xpath -import ( - "math" - "strings" -) - -func round(f float64) int { - return int(math.Round(f)) -} +import "strings" func newStringBuilder() stringBuilder { return &strings.Builder{} diff --git a/vendor/github.com/antchfx/xpath/func_pre_go110.go b/vendor/github.com/antchfx/xpath/func_pre_go110.go index 335141f79f5..441fb2f1053 100644 --- a/vendor/github.com/antchfx/xpath/func_pre_go110.go +++ b/vendor/github.com/antchfx/xpath/func_pre_go110.go @@ -2,20 +2,7 @@ package xpath -import ( - "bytes" - "math" -) - -// math.Round() is supported by Go 1.10+, -// This method just compatible for version <1.10. -// https://github.com/golang/go/issues/20100 -func round(f float64) int { - if math.Abs(f) < 0.5 { - return 0 - } - return int(f + math.Copysign(0.5, f)) -} +import "bytes" func newStringBuilder() stringBuilder { return &bytes.Buffer{} diff --git a/vendor/github.com/antchfx/xpath/operator.go b/vendor/github.com/antchfx/xpath/operator.go index 2820152b369..91e5a616deb 100644 --- a/vendor/github.com/antchfx/xpath/operator.go +++ b/vendor/github.com/antchfx/xpath/operator.go @@ -1,8 +1,6 @@ package xpath -import ( - "strconv" -) +import "math" // The XPath number operator function list. @@ -39,16 +37,10 @@ func cmpStringStringF(op string, a, b string) bool { switch op { case "=": return a == b - case ">": - return a > b - case "<": - return a < b - case ">=": - return a >= b - case "<=": - return a <= b case "!=": return a != b + case ">", "<", ">=", "<=": + return cmpNumberNumberF(op, stringToNumber(a), stringToNumber(b)) } return false } @@ -72,11 +64,7 @@ func cmpNumericNumeric(t iterator, op string, m, n interface{}) bool { func cmpNumericString(t iterator, op string, m, n interface{}) bool { a := m.(float64) b := n.(string) - num, err := strconv.ParseFloat(b, 64) - if err != nil { - panic(err) - } - return cmpNumberNumberF(op, a, num) + return cmpNumberNumberF(op, a, stringToNumber(b)) } func cmpNumericNodeSet(t iterator, op string, m, n interface{}) bool { @@ -88,11 +76,7 @@ func cmpNumericNodeSet(t iterator, op string, m, n interface{}) bool { if node == nil { break } - num, err := strconv.ParseFloat(node.Value(), 64) - if err != nil { - panic(err) - } - if cmpNumberNumberF(op, a, num) { + if cmpNumberNumberF(op, a, stringToNumber(node.Value())) { return true } } @@ -107,11 +91,7 @@ func cmpNodeSetNumeric(t iterator, op string, m, n interface{}) bool { if node == nil { break } - num, err := strconv.ParseFloat(node.Value(), 64) - if err != nil { - panic(err) - } - if cmpNumberNumberF(op, num, b) { + if cmpNumberNumberF(op, stringToNumber(node.Value()), b) { return true } } @@ -126,7 +106,7 @@ func cmpNodeSetString(t iterator, op string, m, n interface{}) bool { if node == nil { break } - if cmpStringStringF(op, b, node.Value()) { + if cmpStringStringF(op, node.Value(), b) { return true } } @@ -163,11 +143,7 @@ func cmpNodeSetNodeSet(t iterator, op string, m, n interface{}) bool { func cmpStringNumeric(t iterator, op string, m, n interface{}) bool { a := m.(string) b := n.(float64) - num, err := strconv.ParseFloat(a, 64) - if err != nil { - panic(err) - } - return cmpNumberNumberF(op, b, num) + return cmpNumberNumberF(op, stringToNumber(a), b) } func cmpStringString(t iterator, op string, m, n interface{}) bool { @@ -283,6 +259,7 @@ var divFunc = func(t iterator, m, n interface{}) interface{} { // modFunc is an 'MOD' operator. var modFunc = func(t iterator, m, n interface{}) interface{} { return numericExpr(t, m, n, func(a, b float64) float64 { - return float64(int(a) % int(b)) + // XPath 1.0 REC §3.5: truncating IEEE remainder; mod by zero is NaN. + return math.Mod(a, b) }) } diff --git a/vendor/github.com/antchfx/xpath/parse.go b/vendor/github.com/antchfx/xpath/parse.go index 53931259115..cfa7e3d79f8 100644 --- a/vendor/github.com/antchfx/xpath/parse.go +++ b/vendor/github.com/antchfx/xpath/parse.go @@ -903,8 +903,12 @@ func (s *scanner) scanName() string { } func isName(r rune) bool { + // '*' is not a name character (XPath 1.0 §3.7): a NCName immediately followed by '*' + // (e.g. `price*0.01`) must be scanned as name · MultiplyOperator · number, not as a single + // name "price*0.01". The '*' of a namespace wildcard (`prefix:*`) is handled explicitly in the + // scanner (the ':' branch, `if s.curr == '*'`), so dropping it here does not affect that case. return string(r) != ":" && string(r) != "/" && - (unicode.Is(first, r) || unicode.Is(second, r) || string(r) == "*") + (unicode.Is(first, r) || unicode.Is(second, r)) } func isDigit(r rune) bool { diff --git a/vendor/github.com/antchfx/xpath/query.go b/vendor/github.com/antchfx/xpath/query.go index 8c5535e1827..b12353f50c6 100644 --- a/vendor/github.com/antchfx/xpath/query.go +++ b/vendor/github.com/antchfx/xpath/query.go @@ -1018,8 +1018,17 @@ func (n *numericQuery) Select(t iterator) NodeNavigator { } func (n *numericQuery) Evaluate(t iterator) interface{} { - m := n.Left.Evaluate(t) - k := n.Right.Evaluate(t) + // Snapshot the operator's context so each operand evaluates and coerces + // against equivalent context. filterQuery (predicates) mutates t.Current() + // while selecting the left operand; without restore, a context-sensitive + // right operand (e.g. count(self::*)) observes the moved navigator. + // Eager asNumber materializes node-set coercion before restore so Do's + // lazy conversion cannot re-Select against the wrong context either. + root := t.Current().Copy() + m := asNumber(t, n.Left.Evaluate(t)) + t.Current().MoveTo(root) + k := asNumber(t, n.Right.Evaluate(t)) + t.Current().MoveTo(root) return n.Do(t, m, k) } @@ -1353,6 +1362,7 @@ func (m *mergeQuery) Select(t iterator) NodeNavigator { func (m *mergeQuery) Evaluate(t iterator) interface{} { m.Input.Evaluate(t) + m.iterator = nil return m } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md index 6d861cc105a..6723895d1a0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md @@ -1,3 +1,19 @@ +# v1.13.19 (2026-08-26) + +* **Dependency Update**: Update to smithy-go v1.28.0. + +# v1.13.18 (2026-08-25) + +* **Dependency Update**: Update to smithy-go v1.27.10. + +# v1.13.17 (2026-08-14) + +* **Dependency Update**: Update to smithy-go v1.27.8. + +# v1.13.16 (2026-08-10) + +* **Dependency Update**: Update to smithy-go v1.27.7. + # v1.13.15 (2026-07-31.2) * **Dependency Update**: Upgrade to smithy-go v1.27.6 to fix various serde issues in HTTP binding services. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go index 9f45b654947..f5bc392a462 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go @@ -3,4 +3,4 @@ package acceptencoding // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.15" +const goModuleVersion = "1.13.19" diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index e727efad5eb..0d26e973c5b 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,62 @@ +# Release (2026-08-26) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.1 + * **Bug Fix**: Fix broken AddLogger middleware since its insert point was removed. + +# Release (2026-08-25.2) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.28.0 + * **Feature**: Set `Content-Length` inline when the request body is set via `SetStream`. The `ComputeContentLength` middleware is now deprecated. + +# Release (2026-08-25) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.10 + * **Bug Fix**: Fix a data race on the underlying writer when an event stream is closed while an event write is in flight. + * **Bug Fix**: Restore draining the HTTP response body in `CloseResponseBody` to avoid issues with TCP connection reuse. + +# Release (2026-08-21) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.9 + * **Bug Fix**: Fix a generic event stream exception not carrying the error code and message from its payload. + * **Bug Fix**: Fix an event stream not being closed when its connection is lost, which would cause a caller writing to the stream to block indefinitely. + * **Bug Fix**: Fix deserialization of an empty list producing a nil slice instead of an empty one. + * **Bug Fix**: Restore draining the HTTP response body in `CloseResponseBody` to avoid issues with TCP connection reuse. + +# Release (2026-08-14) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.8 + * **Bug Fix**: Restore draining the HTTP response body in `CloseResponseBody` to avoid issues with TCP connection reuse. + +# Release (2026-08-07) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.27.7 + * **Bug Fix**: Don't serialize unset JSON documents as `nil` in structure members. + * **Bug Fix**: Fix a deserialization panic around collection members in recursive shape configs. + # Release (2026-07-31) ## General Highlights diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go index e9988cb18f6..c945a45db81 100644 --- a/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.27.6" +const goModuleVersion = "1.28.1" diff --git a/vendor/github.com/aws/smithy-go/schema.go b/vendor/github.com/aws/smithy-go/schema.go index 6293d34b1e3..8e9c209a580 100644 --- a/vendor/github.com/aws/smithy-go/schema.go +++ b/vendor/github.com/aws/smithy-go/schema.go @@ -71,8 +71,9 @@ type Schema struct { directMask uint64 // bitmask: bit i set means indexed[i] was declared directly on this schema targetID ShapeID // for member schemas, the target's shape ID - listMember *Schema - mapKey, mapValue *Schema + // resolved on the fly and cached + listMember atomic.Pointer[Schema] + mapKey, mapValue atomic.Pointer[Schema] ext [numExtensionSlots]unsafe.Pointer // lazily-computed codec extensions, accessed atomically } @@ -126,9 +127,6 @@ func (s *Schema) AddMember(name string, target *Schema, ts ...Trait) *Schema { traits: cloneTraits(target.traits), directMask: 0, // inherited traits are not direct targetID: target.id, - listMember: target.listMember, - mapKey: target.mapKey, - mapValue: target.mapValue, } // member-declared traits override and are direct @@ -143,14 +141,6 @@ func (s *Schema) AddMember(name string, target *Schema, ts ...Trait) *Schema { atomic.StorePointer(&s.ext[i], nil) } - switch name { - case "member": - s.listMember = m - case "key": - s.mapKey = m - case "value": - s.mapValue = m - } return m } @@ -176,17 +166,31 @@ func cloneTraits(src map[ShapeID]Trait) map[ShapeID]Trait { // ListMember returns the "member" schema for list types. func (s *Schema) ListMember() *Schema { - return s.listMember + return s.lookup(&s.listMember, "member") } // MapKey returns the "key" schema for map types. func (s *Schema) MapKey() *Schema { - return s.mapKey + return s.lookup(&s.mapKey, "key") } // MapValue returns the "value" schema for map types. func (s *Schema) MapValue() *Schema { - return s.mapValue + return s.lookup(&s.mapValue, "value") +} + +func (s *Schema) lookup(cached *atomic.Pointer[Schema], name string) *Schema { + if v := cached.Load(); v != nil { + return v + } + + m, ok := s.members[name] + if !ok { + return nil + } + + cached.Store(m) + return m } // MemberName returns the member component of the schema's shape ID. diff --git a/vendor/github.com/aws/smithy-go/schema_ext.go b/vendor/github.com/aws/smithy-go/schema_ext.go index 7503b30b806..e98427ae345 100644 --- a/vendor/github.com/aws/smithy-go/schema_ext.go +++ b/vendor/github.com/aws/smithy-go/schema_ext.go @@ -9,13 +9,14 @@ import ( // (JSON, CBOR, etc.) uses a distinct slot to cache precomputed data. type ExtensionID int -const numExtensionSlots = 4 +const numExtensionSlots = 5 const ( - ExtJSON ExtensionID = iota // transport/http/protocol/internal/json - ExtCBOR // transport/http/protocol/internal/cbor - ExtXML // transport/http/protocol/internal/xml - ExtQuery // transport/http/protocol/internal/query + ExtJSON ExtensionID = iota // transport/http/protocol/internal/json + ExtCBOR // transport/http/protocol/internal/cbor + ExtXML // transport/http/protocol/internal/xml + ExtQuery // transport/http/protocol/internal/query + ExtHTTPBinding // transport/http/protocol/internal/httpbinding ) // SchemaExtension retrieves or lazily computes the extension for the given diff --git a/vendor/github.com/aws/smithy-go/transport/http/eventstream.go b/vendor/github.com/aws/smithy-go/transport/http/eventstream.go index 251db8ac35b..970ade30e20 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/eventstream.go +++ b/vendor/github.com/aws/smithy-go/transport/http/eventstream.go @@ -56,7 +56,10 @@ func NewEventStreamWriter(protocol ClientProtocol, schema *smithy.Schema, stream } func (w *EventStreamWriter) writeStream() { - defer w.Close() + defer func() { + w.err.SetError(w.eventStream.Close()) + }() + defer w.signalClose() for { select { @@ -100,11 +103,14 @@ func (w *EventStreamWriter) Send(ctx context.Context, variant *smithy.Schema, ev // Close signals end-of-stream and closes the underlying writer. Close is // safe for concurrent calls. func (w *EventStreamWriter) Close() error { + w.signalClose() + return w.err.Err() +} + +func (w *EventStreamWriter) signalClose() { w.closeOnce.Do(func() { close(w.done) - w.err.SetError(w.eventStream.Close()) }) - return w.err.Err() } // Err returns the first error encountered during writing. diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go index 914338f2e75..a7e70b1cb50 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go @@ -8,9 +8,35 @@ import ( "github.com/aws/smithy-go/middleware" ) +// CloseResponseBody closes the HTTP response body. It leaves the body open only +// for a successful response whose payload is a caller-owned stream (isStreaming +// with a nil opErr); on error, or for a non-streaming response, it closes the +// body — an error response body is diagnostic, not a caller-owned stream. +func CloseResponseBody(ctx context.Context, resp *Response, isStreaming bool, opErr error) { + if resp == nil || resp.Body == nil { + return + } + if isStreaming && opErr == nil { + return + } + + // Drain to EOF before closing; a body closed while unread prevents + // connection reuse. + if _, copyErr := io.Copy(io.Discard, resp.Body); copyErr != nil { + middleware.GetLogger(ctx).Logf(logging.Warn, "failed to discard remaining HTTP response body, this may affect connection reuse") + } + + if closeErr := resp.Body.Close(); closeErr != nil { + middleware.GetLogger(ctx).Logf(logging.Warn, "failed to close HTTP response body, this may affect connection reuse") + } +} + // AddErrorCloseResponseBodyMiddleware adds the middleware to automatically // close the response body of an operation request if the request response // failed. +// +// Deprecated: generated operation deserializers now close the response body +// via CloseResponseBody, so this middleware is no longer used. func AddErrorCloseResponseBodyMiddleware(stack *middleware.Stack) error { return stack.Deserialize.Insert(&errorCloseResponseBodyMiddleware{}, "OperationDeserializer", middleware.Before) } @@ -42,6 +68,9 @@ func (m *errorCloseResponseBodyMiddleware) HandleDeserialize( // AddCloseResponseBodyMiddleware adds the middleware to automatically close // the response body of an operation request, after the response had been // deserialized. +// +// Deprecated: generated operation deserializers now close the response body +// via CloseResponseBody, so this middleware is no longer used. func AddCloseResponseBodyMiddleware(stack *middleware.Stack) error { return stack.Deserialize.Insert(&closeResponseBody{}, "OperationDeserializer", middleware.Before) } diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go index 9969389bb29..7a1c47fe367 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go @@ -14,6 +14,9 @@ type ComputeContentLength struct { // AddComputeContentLengthMiddleware adds ComputeContentLength to the middleware // stack's Build step. +// +// Deprecated: Content-Length is now set when the request body is set via +// Request.SetStream, so this middleware is no longer used. func AddComputeContentLengthMiddleware(stack *middleware.Stack) error { return stack.Build.Add(&ComputeContentLength{}, middleware.After) } diff --git a/vendor/github.com/aws/smithy-go/transport/http/request.go b/vendor/github.com/aws/smithy-go/transport/http/request.go index 5cbf6f10acc..87acdfe57c1 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/request.go +++ b/vendor/github.com/aws/smithy-go/transport/http/request.go @@ -118,6 +118,9 @@ func (r *Request) IsStreamSeekable() bool { // SetStream returns a clone of the request with the stream set to the provided // reader. May return an error if the provided reader is seekable but returns // an error. +// +// ContentLength is set to the stream's length when it can be determined, and +// left unchanged otherwise. func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) { rc = r.Clone() @@ -151,6 +154,12 @@ func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) { rc.isStreamSeekable = isStreamSeekable rc.streamStartPos = streamStartPos + if n, ok, err := rc.StreamLength(); err != nil { + return rc, err + } else if ok { + rc.ContentLength = n + } + return rc, err } diff --git a/vendor/github.com/bytedance/gopkg/lang/dirtmake/bytes.go b/vendor/github.com/bytedance/gopkg/lang/dirtmake/bytes.go index 1daa2790407..d539b3b2f4b 100644 --- a/vendor/github.com/bytedance/gopkg/lang/dirtmake/bytes.go +++ b/vendor/github.com/bytedance/gopkg/lang/dirtmake/bytes.go @@ -12,6 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !tinygo + +// Bytes provides optimized memory allocation using runtime.mallocgc. +// This implementation is excluded from TinyGo builds (including WASM environments) +// because TinyGo doesn't support the same unsafe operations and runtime symbols +// as standard Go. For TinyGo compatibility, use the implementation in bytes_tinygo.go. + package dirtmake import ( diff --git a/vendor/github.com/bytedance/gopkg/lang/dirtmake/bytes_tinygo.go b/vendor/github.com/bytedance/gopkg/lang/dirtmake/bytes_tinygo.go new file mode 100644 index 00000000000..3d90240c70d --- /dev/null +++ b/vendor/github.com/bytedance/gopkg/lang/dirtmake/bytes_tinygo.go @@ -0,0 +1,24 @@ +// Copyright 2024 ByteDance Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build tinygo + +package dirtmake + +// Bytes allocates a byte slice for TinyGo environment. +// Uses make() to avoid go:linkname with runtime.mallocgc, which causes +// "undefined symbol: runtime.mallocgc" errors in TinyGo. +func Bytes(len, cap int) (b []byte) { + return make([]byte, len, cap) +} diff --git a/vendor/github.com/bytedance/sonic/AGENTS.md b/vendor/github.com/bytedance/sonic/AGENTS.md new file mode 100644 index 00000000000..1163b70bbf9 --- /dev/null +++ b/vendor/github.com/bytedance/sonic/AGENTS.md @@ -0,0 +1,33 @@ +# Repository Guidelines + +## Project Structure & Module Organization + +Sonic is a Go JSON library with JIT, SIMD, and native-code acceleration. Public APIs live at the repository root and in `ast/`, `decoder/`, `encoder/`, `option/`, `unquote/`, and `utf8/`. Implementation details live under `internal/`, including JIT, native dispatch, runtime helpers, caching, and encoder/decoder internals. C sources are in `native/`; generated Go native wrappers are under `internal/native/`. The workspace in `go.work` includes the root module plus `compatibility/`, `external_jsonlib_test/`, `fuzz/`, `generic_test/`, `issue_test/`, and `loader/`. Test data and examples live in `testdata/`, `examples/`, `fuzz/corpus/`, and package-local `*_test.go` files. + +## Build, Test, and Development Commands + +- `go test ./...`: run the main module tests. +- `SONIC_USE_OPTDEC=1 SONIC_USE_FASTMAP=1 SONIC_ENCODER_USE_VM=1 go test ./...`: exercise the optimized/VM path used in CI. +- `cd loader && go test ./...`: test the loader submodule. +- `go test ./issue_test` and `go test ./generic_test`: run regression and compatibility suites from the workspace. +- `go test ./compatibility`: run the Go 1.27 `encoding/json` semantic drift catalog (see `docs/sonic-go127-compatibility.md`). +- `./scripts/test_race.sh`: run the expected race-detection regression check. +- `./scripts/fuzz.sh fuzz`, then `./scripts/fuzz.sh run` or `runopt`: initialize and run fuzzing. +- `./scripts/bench.sh`: run core encoder, decoder, AST, and external JSON benchmark suites. +- `./scripts/build-x86.sh [clang]`: regenerate x86 native outputs after changing `native/*.c`. + +## Coding Style & Naming Conventions + +Use `gofmt` for all Go files and follow Go Code Review Comments. Keep generated native output synchronized with its C source. Go tests use `TestXxx`, `BenchmarkXxx`, and `FuzzXxx`. Issue regressions follow `issue_test/issueNNN_test.go`. Shell scripts should be executable, use bash consistently, and keep environment toggles explicit. Write repository documentation in English by default; use another language only when the target audience or existing document explicitly requires it. + +## Testing Guidelines + +Add focused package tests beside changed Go code. For parser, encoder, JIT, SIMD, or loader changes, run both default and optimized/VM paths. For user-reported behavior fixes, add or update an `issue_test` case. For fuzz-sensitive parsing changes, seed `fuzz/corpus/` or `fuzz/testdata/` when useful. + +## Commit & Pull Request Guidelines + +History and the PR template use Conventional Commits, for example `feat: support Go 1.26`, `fix(decoder): handle ...`, `opt: ast node set`, `ci: add ...`, or `chore: update go mod`. Branch names should use prefixes such as `feature/`, `bugfix/`, `optimize/`, `doc/`, `ci/`, `test/`, or `refactor/`; validate with `./scripts/check_branch_name.sh`. PRs should describe user-visible impact, link issues when applicable, include tests or benchmark data for performance changes, and update user documentation when behavior changes. + +## Security & Compatibility Notes + +Do not disclose security bugs in public issues; follow `CONTRIBUTING.md` and contact the maintainers. Supported Go versions are documented in `README.md`; be careful with linkname behavior on newer Go releases and use `scripts/go_flags.sh` patterns when needed. diff --git a/vendor/github.com/bytedance/sonic/README.md b/vendor/github.com/bytedance/sonic/README.md index 56b6f5cfd4c..8ded7ca65e4 100644 --- a/vendor/github.com/bytedance/sonic/README.md +++ b/vendor/github.com/bytedance/sonic/README.md @@ -6,7 +6,7 @@ A blazingly fast JSON serializing & deserializing library, accelerated by JI ## Requirement -- Go: 1.18~1.26 +- Go: 1.18~1.27 - Notice: Go1.24.0 is not supported due to the [issue](https://github.com/golang/go/issues/71672); please use a higher Go version or pass the build flag `-ldflags="-checklinkname=0"`. - OS: Linux / MacOS / Windows - CPU: AMD64 / (ARM64, need go1.20 above) diff --git a/vendor/github.com/bytedance/sonic/README_ZH_CN.md b/vendor/github.com/bytedance/sonic/README_ZH_CN.md index 0fa1c704234..8ffbefd0308 100644 --- a/vendor/github.com/bytedance/sonic/README_ZH_CN.md +++ b/vendor/github.com/bytedance/sonic/README_ZH_CN.md @@ -6,7 +6,7 @@ ## 依赖 -- Go: 1.18~1.26 +- Go: 1.18~1.27 - 注意:Go1.24.0 由于 [issue](https://github.com/golang/go/issues/71672) 不可用,请升级到更高 Go 版本,或添加编译选项 `--ldflags="-checklinkname=0"` - OS: Linux / MacOS / Windows - CPU: AMD64 / (ARM64, 需要 Go1.20 以上) diff --git a/vendor/github.com/bytedance/sonic/ast/api.go b/vendor/github.com/bytedance/sonic/ast/api.go index e2881511439..4d6de961bc4 100644 --- a/vendor/github.com/bytedance/sonic/ast/api.go +++ b/vendor/github.com/bytedance/sonic/ast/api.go @@ -1,5 +1,5 @@ -//go:build (amd64 && go1.17 && !go1.27) || (arm64 && go1.20 && !go1.27) -// +build amd64,go1.17,!go1.27 arm64,go1.20,!go1.27 +//go:build (amd64 && go1.17 && !go1.28) || (arm64 && go1.20 && !go1.28) +// +build amd64,go1.17,!go1.28 arm64,go1.20,!go1.28 /* * Copyright 2022 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/ast/api_compat.go b/vendor/github.com/bytedance/sonic/ast/api_compat.go index e88591bd0dd..834c7d21554 100644 --- a/vendor/github.com/bytedance/sonic/ast/api_compat.go +++ b/vendor/github.com/bytedance/sonic/ast/api_compat.go @@ -1,5 +1,5 @@ -//go:build (!amd64 && !arm64) || go1.27 || !go1.17 || (arm64 && !go1.20) -// +build !amd64,!arm64 go1.27 !go1.17 arm64,!go1.20 +//go:build (!amd64 && !arm64) || go1.28 || !go1.17 || (arm64 && !go1.20) +// +build !amd64,!arm64 go1.28 !go1.17 arm64,!go1.20 /* * Copyright 2022 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/ast/search.go b/vendor/github.com/bytedance/sonic/ast/search.go index 2a373e58107..441449b57fc 100644 --- a/vendor/github.com/bytedance/sonic/ast/search.go +++ b/vendor/github.com/bytedance/sonic/ast/search.go @@ -98,7 +98,7 @@ func (self *Searcher) getByPath(path ...interface{}) (Node, error) { return newRawNode(raw, t, self.ConcurrentRead), nil } -// GetByPath searches a path and returns relaction and types of target +// _GetByPath returns the start and end byte offsets and type of the target node. func _GetByPath(src string, path ...interface{}) (start int, end int, typ int, err error) { p := NewParserObj(src) s, e := p.getByPath(false, path...) diff --git a/vendor/github.com/bytedance/sonic/compat.go b/vendor/github.com/bytedance/sonic/compat.go index dcf9ef4eab3..83cc6c210b7 100644 --- a/vendor/github.com/bytedance/sonic/compat.go +++ b/vendor/github.com/bytedance/sonic/compat.go @@ -1,5 +1,5 @@ -//go:build (!amd64 && !arm64) || go1.27 || !go1.17 || (arm64 && !go1.20) -// +build !amd64,!arm64 go1.27 !go1.17 arm64,!go1.20 +//go:build (!amd64 && !arm64) || go1.28 || !go1.17 || (arm64 && !go1.20) +// +build !amd64,!arm64 go1.28 !go1.17 arm64,!go1.20 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/decoder/decoder_compat.go b/vendor/github.com/bytedance/sonic/decoder/decoder_compat.go index 12a7cede4dc..98b5ce62057 100644 --- a/vendor/github.com/bytedance/sonic/decoder/decoder_compat.go +++ b/vendor/github.com/bytedance/sonic/decoder/decoder_compat.go @@ -1,5 +1,5 @@ -//go:build (!amd64 && !arm64) || go1.27 || !go1.17 || (arm64 && !go1.20) -// +build !amd64,!arm64 go1.27 !go1.17 arm64,!go1.20 +//go:build (!amd64 && !arm64) || go1.28 || !go1.17 || (arm64 && !go1.20) +// +build !amd64,!arm64 go1.28 !go1.17 arm64,!go1.20 /* * Copyright 2023 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/decoder/decoder_native.go b/vendor/github.com/bytedance/sonic/decoder/decoder_native.go index 8b51623b6bc..d8010f9ad7e 100644 --- a/vendor/github.com/bytedance/sonic/decoder/decoder_native.go +++ b/vendor/github.com/bytedance/sonic/decoder/decoder_native.go @@ -1,5 +1,5 @@ -//go:build (amd64 && go1.17 && !go1.27) || (arm64 && go1.20 && !go1.27) -// +build amd64,go1.17,!go1.27 arm64,go1.20,!go1.27 +//go:build (amd64 && go1.17 && !go1.28) || (arm64 && go1.20 && !go1.28) +// +build amd64,go1.17,!go1.28 arm64,go1.20,!go1.28 /* * Copyright 2023 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/encoder/encoder_compat.go b/vendor/github.com/bytedance/sonic/encoder/encoder_compat.go index ae4a76e54d1..4efe9196ce1 100644 --- a/vendor/github.com/bytedance/sonic/encoder/encoder_compat.go +++ b/vendor/github.com/bytedance/sonic/encoder/encoder_compat.go @@ -1,5 +1,5 @@ -//go:build (!amd64 && !arm64) || go1.27 || !go1.17 || (arm64 && !go1.20) -// +build !amd64,!arm64 go1.27 !go1.17 arm64,!go1.20 +//go:build (!amd64 && !arm64) || go1.28 || !go1.17 || (arm64 && !go1.20) +// +build !amd64,!arm64 go1.28 !go1.17 arm64,!go1.20 /* * Copyright 2023 ByteDance Inc. @@ -230,6 +230,9 @@ func EncodeIndented(val interface{}, prefix string, indent string, opts Options) enc.SetIndent(prefix, indent) err := enc.Encode(val) out := w.Bytes() + if len(out) > 0 && out[len(out)-1] == '\n' { + out = out[:len(out)-1] + } return out, err } diff --git a/vendor/github.com/bytedance/sonic/encoder/encoder_native.go b/vendor/github.com/bytedance/sonic/encoder/encoder_native.go index d62fb37d457..acbfaaf4983 100644 --- a/vendor/github.com/bytedance/sonic/encoder/encoder_native.go +++ b/vendor/github.com/bytedance/sonic/encoder/encoder_native.go @@ -1,5 +1,5 @@ -//go:build (amd64 && go1.17 && !go1.27) || (arm64 && go1.20 && !go1.27) -// +build amd64,go1.17,!go1.27 arm64,go1.20,!go1.27 +//go:build (amd64 && go1.17 && !go1.28) || (arm64 && go1.20 && !go1.28) +// +build amd64,go1.17,!go1.28 arm64,go1.20,!go1.28 /* * Copyright 2023 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/go.work b/vendor/github.com/bytedance/sonic/go.work index 34c99064670..df723a63e5c 100644 --- a/vendor/github.com/bytedance/sonic/go.work +++ b/vendor/github.com/bytedance/sonic/go.work @@ -2,6 +2,7 @@ go 1.18 use ( . + ./compatibility ./external_jsonlib_test ./fuzz ./generic_test diff --git a/vendor/github.com/bytedance/sonic/internal/compat/warn.go b/vendor/github.com/bytedance/sonic/internal/compat/warn.go index 7b2ecb0b9ad..67c023a3466 100644 --- a/vendor/github.com/bytedance/sonic/internal/compat/warn.go +++ b/vendor/github.com/bytedance/sonic/internal/compat/warn.go @@ -1,12 +1,13 @@ -// +build !amd64,!arm64 go1.27 !go1.17 arm64,!go1.20 +//go:build (!amd64 && !arm64) || go1.28 || !go1.17 || (arm64 && !go1.20) +// +build !amd64,!arm64 go1.28 !go1.17 arm64,!go1.20 package compat import ( - "fmt" - "os" + "fmt" + "os" ) func Warn(prefix string) { - fmt.Fprintf(os.Stderr, "WARNING: %s only supports (go1.17~1.26 and amd64 CPU) or (go1.20~1.26 and arm64 CPU), but your environment is not suitable and will fallback to encoding/json\n", prefix) + fmt.Fprintf(os.Stderr, "WARNING: %s only supports (go1.17~1.27 and amd64 CPU) or (go1.20~1.27 and arm64 CPU), but your environment is not suitable and will fallback to encoding/json\n", prefix) } diff --git a/vendor/github.com/bytedance/sonic/internal/decoder/api/decoder_amd64.go b/vendor/github.com/bytedance/sonic/internal/decoder/api/decoder_amd64.go index aea6bfc4686..b5161a12105 100644 --- a/vendor/github.com/bytedance/sonic/internal/decoder/api/decoder_amd64.go +++ b/vendor/github.com/bytedance/sonic/internal/decoder/api/decoder_amd64.go @@ -1,5 +1,5 @@ -//go:build go1.17 && !go1.27 -// +build go1.17,!go1.27 +//go:build go1.17 && !go1.28 +// +build go1.17,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/internal/decoder/api/decoder_arm64.go b/vendor/github.com/bytedance/sonic/internal/decoder/api/decoder_arm64.go index 42f6d68d83b..b1e751005e3 100644 --- a/vendor/github.com/bytedance/sonic/internal/decoder/api/decoder_arm64.go +++ b/vendor/github.com/bytedance/sonic/internal/decoder/api/decoder_arm64.go @@ -1,5 +1,5 @@ -//go:build go1.17 && !go1.27 -// +build go1.17,!go1.27 +//go:build go1.17 && !go1.28 +// +build go1.17,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/asm_stubs_amd64_go121.go b/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/asm_stubs_amd64_go121.go index 7908c1d6d93..38a04b53f65 100644 --- a/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/asm_stubs_amd64_go121.go +++ b/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/asm_stubs_amd64_go121.go @@ -1,5 +1,5 @@ -//go:build go1.21 && !go1.27 -// +build go1.21,!go1.27 +//go:build go1.21 && !go1.28 +// +build go1.21,!go1.28 // Copyright 2023 CloudWeGo Authors // diff --git a/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/assembler_regabi_amd64.go b/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/assembler_regabi_amd64.go index f228f7c049f..ca2a53844b9 100644 --- a/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/assembler_regabi_amd64.go +++ b/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/assembler_regabi_amd64.go @@ -1,5 +1,5 @@ -//go:build go1.17 && !go1.27 -// +build go1.17,!go1.27 +//go:build go1.17 && !go1.28 +// +build go1.17,!go1.28 /* * Copyright 2021 ByteDance Inc. @@ -987,8 +987,12 @@ func (self *_Assembler) mem_clear_rem(size int64, ptrfree bool) { self.Emit("MOVQ", jit.Sib(_ST, _AX, 1, 0), _AX) // MOVQ (ST)(AX), AX self.Emit("SUBQ", _VP, _AX) // SUBQ VP, AX self.Emit("ADDQ", _AX, _BX) // ADDQ AX, BX + // A full array leaves VP one past its end. Even a zero-length pointer + // clear can inspect that address in the runtime's write barrier. + self.Sjmp("JZ", "_clear_rem_end_{n}") self.Emit("MOVQ", _VP, _AX) // MOVQ VP, (SP) self.mem_clear_fn(ptrfree) // CALL_GO memclr{Has,NoHeap}Pointers + self.Link("_clear_rem_end_{n}") } /** Map Assigning Routines **/ @@ -1013,7 +1017,7 @@ func init() { } func (self *_Assembler) mapaccess_ptr(t reflect.Type) { - if rt.MapType(rt.UnpackType(t)).IndirectElem() { + if rt.IsMapIndirectElem(t) { self.vfollow(t.Elem()) } } diff --git a/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/generic_regabi_amd64.go b/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/generic_regabi_amd64.go index 7ddf631d61a..1ebc8afbe6c 100644 --- a/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/generic_regabi_amd64.go +++ b/vendor/github.com/bytedance/sonic/internal/decoder/jitdec/generic_regabi_amd64.go @@ -1,5 +1,5 @@ -//go:build go1.17 && !go1.27 -// +build go1.17,!go1.27 +//go:build go1.17 && !go1.28 +// +build go1.17,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go b/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go index 3a3241c112d..f58ca0ca464 100644 --- a/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go +++ b/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec.go @@ -1,5 +1,5 @@ -//go:build (amd64 && go1.16 && !go1.27) || (arm64 && go1.20 && !go1.27) -// +build amd64,go1.16,!go1.27 arm64,go1.20,!go1.27 +//go:build (amd64 && go1.16 && !go1.28) || (arm64 && go1.20 && !go1.28) +// +build amd64,go1.16,!go1.28 arm64,go1.20,!go1.28 /** * Copyright 2024 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec_compat.go b/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec_compat.go index b2530822889..9f2bbf51a41 100644 --- a/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec_compat.go +++ b/vendor/github.com/bytedance/sonic/internal/encoder/alg/spec_compat.go @@ -1,5 +1,5 @@ -//go:build (!amd64 && !arm64) || go1.27 || !go1.16 || (arm64 && !go1.20) -// +build !amd64,!arm64 go1.27 !go1.16 arm64,!go1.20 +//go:build (!amd64 && !arm64) || go1.28 || !go1.16 || (arm64 && !go1.20) +// +build !amd64,!arm64 go1.28 !go1.16 arm64,!go1.20 /** * Copyright 2024 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/internal/encoder/x86/asm_stubs_amd64_go121.go b/vendor/github.com/bytedance/sonic/internal/encoder/x86/asm_stubs_amd64_go121.go index 818e983071f..4748a6385cc 100644 --- a/vendor/github.com/bytedance/sonic/internal/encoder/x86/asm_stubs_amd64_go121.go +++ b/vendor/github.com/bytedance/sonic/internal/encoder/x86/asm_stubs_amd64_go121.go @@ -1,5 +1,5 @@ -//go:build go1.21 && !go1.27 -// +build go1.21,!go1.27 +//go:build go1.21 && !go1.28 +// +build go1.21,!go1.28 // Copyright 2023 CloudWeGo Authors // diff --git a/vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_export_amd64.go b/vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_export_amd64.go index 6df60428646..69d81f3de84 100644 --- a/vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_export_amd64.go +++ b/vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_export_amd64.go @@ -1,5 +1,5 @@ -//go:build go1.17 && !go1.27 -// +build go1.17,!go1.27 +//go:build go1.17 && !go1.28 +// +build go1.17,!go1.28 package x86 diff --git a/vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_regabi_amd64.go b/vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_regabi_amd64.go index a62579b7c44..b1c84eb107d 100644 --- a/vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_regabi_amd64.go +++ b/vendor/github.com/bytedance/sonic/internal/encoder/x86/assembler_regabi_amd64.go @@ -1,5 +1,5 @@ -//go:build go1.17 && !go1.27 -// +build go1.17,!go1.27 +//go:build go1.17 && !go1.28 +// +build go1.17,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/internal/encoder/x86/debug_go117.go b/vendor/github.com/bytedance/sonic/internal/encoder/x86/debug_go117.go index 79a86f42330..aa4a599bfea 100644 --- a/vendor/github.com/bytedance/sonic/internal/encoder/x86/debug_go117.go +++ b/vendor/github.com/bytedance/sonic/internal/encoder/x86/debug_go117.go @@ -1,5 +1,5 @@ -//go:build go1.17 && !go1.27 -// +build go1.17,!go1.27 +//go:build go1.17 && !go1.28 +// +build go1.17,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/internal/rt/base64_amd64.go b/vendor/github.com/bytedance/sonic/internal/rt/base64_amd64.go index f2f1ad8fbd9..59ab11ce811 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/base64_amd64.go +++ b/vendor/github.com/bytedance/sonic/internal/rt/base64_amd64.go @@ -1,5 +1,5 @@ -//go:build amd64 && go1.17 && !go1.27 -// +build amd64,go1.17,!go1.27 +//go:build amd64 && go1.17 && !go1.28 +// +build amd64,go1.17,!go1.28 package rt diff --git a/vendor/github.com/bytedance/sonic/internal/rt/base64_compat.go b/vendor/github.com/bytedance/sonic/internal/rt/base64_compat.go index 88e28ca3a3e..4e23722da64 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/base64_compat.go +++ b/vendor/github.com/bytedance/sonic/internal/rt/base64_compat.go @@ -1,5 +1,5 @@ -//go:build !amd64 || !go1.17 || go1.27 -// +build !amd64 !go1.17 go1.27 +//go:build !amd64 || !go1.17 || go1.28 +// +build !amd64 !go1.17 go1.28 package rt diff --git a/vendor/github.com/bytedance/sonic/internal/rt/gcwb.go b/vendor/github.com/bytedance/sonic/internal/rt/gcwb.go index fb7e1cc3704..eafef90a0ee 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/gcwb.go +++ b/vendor/github.com/bytedance/sonic/internal/rt/gcwb.go @@ -1,5 +1,5 @@ -//go:build go1.21 && !go1.27 -// +build go1.21,!go1.27 +//go:build go1.21 && !go1.28 +// +build go1.21,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/internal/rt/map_go124.go b/vendor/github.com/bytedance/sonic/internal/rt/map.go similarity index 60% rename from vendor/github.com/bytedance/sonic/internal/rt/map_go124.go rename to vendor/github.com/bytedance/sonic/internal/rt/map.go index 6aed228d132..39ac70e5283 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/map_go124.go +++ b/vendor/github.com/bytedance/sonic/internal/rt/map.go @@ -1,12 +1,11 @@ -//go:build go1.24 && !go1.26 && !goexperiment.swissmap -// +build go1.24,!go1.26,!goexperiment.swissmap - package rt import ( "unsafe" ) +// GoMapIterator mirrors the pre-Go 1.24 hiter layout. Go 1.24+ runtime +// provides a linkname compatibility shim whose real iterator pointer lands in H. type GoMapIterator struct { K unsafe.Pointer V unsafe.Pointer @@ -23,6 +22,7 @@ type GoMapIterator struct { I uint8 Bucket uintptr CheckBucket uintptr - // different from go1.23 + // Required by the Go 1.24-1.25 GOEXPERIMENT=noswissmap hiter layout. + // Newer legacy linkname shims ignore this trailing storage. ClearSeq uint64 } diff --git a/vendor/github.com/bytedance/sonic/internal/rt/map_go126.go b/vendor/github.com/bytedance/sonic/internal/rt/map_go126.go deleted file mode 100644 index 1b6b4df79a4..00000000000 --- a/vendor/github.com/bytedance/sonic/internal/rt/map_go126.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build go1.26 || goexperiment.swissmap -// +build go1.26 goexperiment.swissmap - -package rt - -import ( - "unsafe" -) - -type GoMapIterator struct { - K unsafe.Pointer - V unsafe.Pointer - T *GoMapType - It unsafe.Pointer -} diff --git a/vendor/github.com/bytedance/sonic/internal/rt/map_legacy.go b/vendor/github.com/bytedance/sonic/internal/rt/map_legacy.go deleted file mode 100644 index e03ada92fa3..00000000000 --- a/vendor/github.com/bytedance/sonic/internal/rt/map_legacy.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build !go1.24 -// +build !go1.24 - -package rt - -import ( - "unsafe" -) - -type GoMapIterator struct { - K unsafe.Pointer - V unsafe.Pointer - T *GoMapType - H unsafe.Pointer - Buckets unsafe.Pointer - Bptr *unsafe.Pointer - Overflow *[]unsafe.Pointer - OldOverflow *[]unsafe.Pointer - StartBucket uintptr - Offset uint8 - Wrapped bool - B uint8 - I uint8 - Bucket uintptr - CheckBucket uintptr -} diff --git a/vendor/github.com/bytedance/sonic/internal/rt/maptype_indirectelem_go126.go b/vendor/github.com/bytedance/sonic/internal/rt/maptype_indirectelem_go126.go deleted file mode 100644 index 92058e3941c..00000000000 --- a/vendor/github.com/bytedance/sonic/internal/rt/maptype_indirectelem_go126.go +++ /dev/null @@ -1,24 +0,0 @@ -//go:build go1.26 || goexperiment.swissmap -// +build go1.26 goexperiment.swissmap - -package rt - -import "unsafe" - -const mapIndirectElemGo126 = 1 << 3 - -type goMapTypeGo126 struct { - GoType - Key *GoType - Elem *GoType - Group *GoType - Hasher func(unsafe.Pointer, uintptr) uintptr - GroupSize uintptr - SlotSize uintptr - ElemOff uintptr - Flags uint32 -} - -func (self *GoMapType) IndirectElem() bool { - return (*goMapTypeGo126)(unsafe.Pointer(self)).Flags&mapIndirectElemGo126 != 0 -} diff --git a/vendor/github.com/bytedance/sonic/internal/rt/maptype_indirectelem_legacy.go b/vendor/github.com/bytedance/sonic/internal/rt/maptype_indirectelem_legacy.go deleted file mode 100644 index a044ab6f703..00000000000 --- a/vendor/github.com/bytedance/sonic/internal/rt/maptype_indirectelem_legacy.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build !go1.26 && !goexperiment.swissmap -// +build !go1.26,!goexperiment.swissmap - -package rt - -func (self *GoMapType) IndirectElem() bool { - return self.Flags&2 != 0 -} diff --git a/vendor/github.com/bytedance/sonic/internal/rt/stubs.go b/vendor/github.com/bytedance/sonic/internal/rt/stubs.go index bcbce6562fd..673dc4bc4f3 100644 --- a/vendor/github.com/bytedance/sonic/internal/rt/stubs.go +++ b/vendor/github.com/bytedance/sonic/internal/rt/stubs.go @@ -67,7 +67,11 @@ func ClearMemory(et *GoType, ptr unsafe.Pointer, size uintptr) { const _max_map_element_size uintptr = 128 func IsMapfast(vt reflect.Type) bool { - return vt.Elem().Size() <= _max_map_element_size + return !IsMapIndirectElem(vt) +} + +func IsMapIndirectElem(vt reflect.Type) bool { + return vt.Elem().Size() > _max_map_element_size } //go:linkname Mallocgc runtime.mallocgc diff --git a/vendor/github.com/bytedance/sonic/loader/funcdata_compat.go b/vendor/github.com/bytedance/sonic/loader/funcdata_compat.go index 68d50a66332..749c97c1af3 100644 --- a/vendor/github.com/bytedance/sonic/loader/funcdata_compat.go +++ b/vendor/github.com/bytedance/sonic/loader/funcdata_compat.go @@ -1,5 +1,5 @@ -//go:build !go1.17 || go1.27 -// +build !go1.17 go1.27 +//go:build !go1.17 +// +build !go1.17 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/loader/funcdata_go127.go b/vendor/github.com/bytedance/sonic/loader/funcdata_go127.go new file mode 100644 index 00000000000..312374c5995 --- /dev/null +++ b/vendor/github.com/bytedance/sonic/loader/funcdata_go127.go @@ -0,0 +1,130 @@ +//go:build go1.27 && !go1.28 +// +build go1.27,!go1.28 + +/* + * Copyright 2021 ByteDance Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package loader + +import ( + "unsafe" + + "github.com/bytedance/sonic/loader/internal/rt" +) + +const ( + _Magic uint32 = 0xFFFFFFF1 +) + +// In Go 1.27 the moduledata layout changed around the type/itab linker rework: +// - `types, etypes` gained a `typedesclen` field in between; +// - `itaboffset, itabsize` were added after etypes; +// - the `typelinks []int32` and `itablinks []*itab` slices were removed; +// - `typemap` was retyped from map[typeOff]*_type to map[*_type]*_type. +// +// See runtime/symtab.go in the go1.27 release branch. +type moduledata struct { + pcHeader *pcHeader + funcnametab []byte + cutab []uint32 + filetab []byte + pctab []byte + pclntable []byte + ftab []funcTab + findfunctab uintptr + minpc, maxpc uintptr // first func address, last func address + last func size + + text, etext uintptr // start/end of text, (etext-text) must be greater than MIN_FUNC + noptrdata, enoptrdata uintptr + data, edata uintptr + bss, ebss uintptr + noptrbss, enoptrbss uintptr + covctrs, ecovctrs uintptr + end, gcdata, gcbss uintptr + types, typedesclen, etypes uintptr + itaboffset, itabsize uintptr + rodata uintptr + gofunc uintptr // go.func.* is actual funcinfo object in image + epclntab uintptr + + textsectmap []textSection // see runtime/symtab.go: textAddr() + + ptab []ptabEntry + + pluginpath string + pkghashes []modulehash + + // This slice records the initializing tasks that need to be + // done to start up the program. It is built by the linker. + inittasks []unsafe.Pointer + + modulename string + modulehashes []modulehash + + hasmain uint8 // 1 if module contains the main function, 0 otherwise + bad bool // module failed to load and should be ignored + + gcdatamask, gcbssmask bitVector + + typemap map[*rt.GoType]*rt.GoType // *_type to use from previous module + + next *moduledata +} + +type _func struct { + entryOff uint32 // start pc, as offset from moduledata.text/pcHeader.textStart + nameOff int32 // function name, as index into moduledata.funcnametab. + + args int32 // in/out args size + deferreturn uint32 // offset of start of a deferreturn call instruction from entry, if any. + + pcsp uint32 + pcfile uint32 + pcln uint32 + npcdata uint32 + cuOffset uint32 // runtime.cutab offset of this function's CU + startLine int32 // line number of start of function (func keyword/TEXT directive) + funcID uint8 // set for certain special runtime functions + flag uint8 + _ [1]byte // pad + nfuncdata uint8 // + + // The end of the struct is followed immediately by two variable-length + // arrays that reference the pcdata and funcdata locations for this + // function. + + // pcdata contains the offset into moduledata.pctab for the start of + // that index's table. e.g., + // &moduledata.pctab[_func.pcdata[_PCDATA_UnsafePoint]] is the start of + // the unsafe point table. + // + // An offset of 0 indicates that there is no table. + // + // pcdata [npcdata]uint32 + + // funcdata contains the offset past moduledata.gofunc which contains a + // pointer to that index's funcdata. e.g., + // *(moduledata.gofunc + _func.funcdata[_FUNCDATA_ArgsPointerMaps]) is + // the argument pointer map. + // + // An offset of ^uint32(0) indicates that there is no entry. + // + // funcdata [nfuncdata]uint32 +} + +func setEpclntab(mod *moduledata, val uintptr) { + mod.epclntab = val +} diff --git a/vendor/github.com/bytedance/sonic/loader/moduledata.go b/vendor/github.com/bytedance/sonic/loader/moduledata.go index 7a22c04a356..98597eb5129 100644 --- a/vendor/github.com/bytedance/sonic/loader/moduledata.go +++ b/vendor/github.com/bytedance/sonic/loader/moduledata.go @@ -1,5 +1,5 @@ -// go:build go1.18 && !go1.27 -// +build go1.18,!go1.27 +//go:build go1.18 && !go1.28 +// +build go1.18,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/sonic.go b/vendor/github.com/bytedance/sonic/sonic.go index c6a825ab2ed..95a1c69c506 100644 --- a/vendor/github.com/bytedance/sonic/sonic.go +++ b/vendor/github.com/bytedance/sonic/sonic.go @@ -1,5 +1,5 @@ -//go:build (amd64 && go1.17 && !go1.27) || (arm64 && go1.20 && !go1.27) -// +build amd64,go1.17,!go1.27 arm64,go1.20,!go1.27 +//go:build (amd64 && go1.17 && !go1.28) || (arm64 && go1.20 && !go1.28) +// +build amd64,go1.17,!go1.28 arm64,go1.20,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/unquote/unquote.go b/vendor/github.com/bytedance/sonic/unquote/unquote.go index fa18b631e35..644e793f474 100644 --- a/vendor/github.com/bytedance/sonic/unquote/unquote.go +++ b/vendor/github.com/bytedance/sonic/unquote/unquote.go @@ -1,5 +1,5 @@ -//go:build (amd64 && go1.17 && !go1.27) || (arm64 && go1.20 && !go1.27) -// +build amd64,go1.17,!go1.27 arm64,go1.20,!go1.27 +//go:build (amd64 && go1.17 && !go1.28) || (arm64 && go1.20 && !go1.28) +// +build amd64,go1.17,!go1.28 arm64,go1.20,!go1.28 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/unquote/unquote_fallback.go b/vendor/github.com/bytedance/sonic/unquote/unquote_fallback.go index 81a5bfca4a4..f9fcaf59b7a 100644 --- a/vendor/github.com/bytedance/sonic/unquote/unquote_fallback.go +++ b/vendor/github.com/bytedance/sonic/unquote/unquote_fallback.go @@ -1,5 +1,5 @@ -//go:build (!amd64 && !arm64) || go1.27 || !go1.17 || (arm64 && !go1.20) -// +build !amd64,!arm64 go1.27 !go1.17 arm64,!go1.20 +//go:build (!amd64 && !arm64) || go1.28 || !go1.17 || (arm64 && !go1.20) +// +build !amd64,!arm64 go1.28 !go1.17 arm64,!go1.20 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/utf8/utf8.go b/vendor/github.com/bytedance/sonic/utf8/utf8.go index 3ed307168d8..b48c5cb6ef9 100644 --- a/vendor/github.com/bytedance/sonic/utf8/utf8.go +++ b/vendor/github.com/bytedance/sonic/utf8/utf8.go @@ -1,5 +1,5 @@ -//go:build (amd64 && go1.17 && !go1.27) || (arm64 && go1.20 && !go1.27) -// +build amd64,go1.17,!go1.27 arm64,go1.20,!go1.27 +//go:build (amd64 && go1.17 && !go1.28) || (arm64 && go1.20 && !go1.28) +// +build amd64,go1.17,!go1.28 arm64,go1.20,!go1.28 /* * Copyright 2022 ByteDance Inc. diff --git a/vendor/github.com/bytedance/sonic/utf8/utf8_fallback.go b/vendor/github.com/bytedance/sonic/utf8/utf8_fallback.go index b3d0ddee033..25c337e8775 100644 --- a/vendor/github.com/bytedance/sonic/utf8/utf8_fallback.go +++ b/vendor/github.com/bytedance/sonic/utf8/utf8_fallback.go @@ -1,5 +1,5 @@ -//go:build (!amd64 && !arm64) || go1.27 || !go1.17 || (arm64 && !go1.20) -// +build !amd64,!arm64 go1.27 !go1.17 arm64,!go1.20 +//go:build (!amd64 && !arm64) || go1.28 || !go1.17 || (arm64 && !go1.20) +// +build !amd64,!arm64 go1.28 !go1.17 arm64,!go1.20 /* * Copyright 2021 ByteDance Inc. diff --git a/vendor/github.com/cloudwego/base64x/_typos.toml b/vendor/github.com/cloudwego/base64x/_typos.toml index 47b5bead831..e2a15fb6289 100644 --- a/vendor/github.com/cloudwego/base64x/_typos.toml +++ b/vendor/github.com/cloudwego/base64x/_typos.toml @@ -2,3 +2,15 @@ [files] extend-exclude = ["go.mod", "go.sum", "check_branch_name.sh"] + +[default.extend-words] +asure = "asure" +brillig = "brillig" +easure = "easure" +fo = "fo" +leasure = "leasure" +shll = "shll" +slithy = "slithy" +sur = "sur" +toves = "toves" +Twas = "Twas" diff --git a/vendor/github.com/cloudwego/base64x/base64x.go b/vendor/github.com/cloudwego/base64x/base64x.go index 533e87253d2..a40922dbb68 100644 --- a/vendor/github.com/cloudwego/base64x/base64x.go +++ b/vendor/github.com/cloudwego/base64x/base64x.go @@ -16,12 +16,6 @@ package base64x -import ( - `encoding/base64` - - "github.com/cloudwego/base64x/internal/native" -) - // An Encoding is a radix 64 encoding/decoding scheme, defined by a // 64-character alphabet. The most common encoding is the "base64" // encoding defined in RFC 4648 and used in MIME (RFC 2045) and PEM @@ -30,10 +24,10 @@ import ( type Encoding int const ( - _MODE_URL = 1 << 0 - _MODE_RAW = 1 << 1 - _MODE_AVX2 = 1 << 2 - _MODE_JSON = 1 << 3 + _MODE_URL = 1 << 0 + _MODE_RAW = 1 << 1 + _MODE_AVX2 = 1 << 2 + _MODE_JSON = 1 << 3 ) // StdEncoding is the standard base64 encoding, as defined in @@ -57,10 +51,10 @@ const RawStdEncoding Encoding = _MODE_RAW const RawURLEncoding Encoding = _MODE_RAW | _MODE_URL // JSONStdEncoding is the StdEncoding and encoded as JSON string as RFC 8259. -const JSONStdEncoding Encoding = _MODE_JSON; +const JSONStdEncoding Encoding = _MODE_JSON var ( - archFlags = 0 + archFlags = 0 ) /** Encoder Functions **/ @@ -75,13 +69,13 @@ var ( // If out is not large enough to contain the encoded result, // it will panic. func (self Encoding) Encode(out []byte, src []byte) { - if len(src) != 0 { - if buf := out[:0:len(out)]; self.EncodedLen(len(src)) <= len(out) { - self.EncodeUnsafe(&buf, src) - } else { - panic("encoder output buffer is too small") - } - } + if len(src) != 0 { + if buf := out[:0:len(out)]; self.EncodedLen(len(src)) <= len(out) { + self.EncodeUnsafe(&buf, src) + } else { + panic("encoder output buffer is too small") + } + } } // EncodeUnsafe behaves like Encode, except it does NOT check if @@ -89,27 +83,27 @@ func (self Encoding) Encode(out []byte, src []byte) { // // It will also update the length of out. func (self Encoding) EncodeUnsafe(out *[]byte, src []byte) { - native.B64Encode(out, &src, int(self) | archFlags) + encode(out, src, int(self)|archFlags) } // EncodeToString returns the base64 encoding of src. func (self Encoding) EncodeToString(src []byte) string { - nbs := len(src) - ret := make([]byte, 0, self.EncodedLen(nbs)) + nbs := len(src) + ret := make([]byte, 0, self.EncodedLen(nbs)) - /* encode in native code */ - self.EncodeUnsafe(&ret, src) - return mem2str(ret) + /* encode in native code */ + self.EncodeUnsafe(&ret, src) + return mem2str(ret) } // EncodedLen returns the length in bytes of the base64 encoding // of an input buffer of length n. func (self Encoding) EncodedLen(n int) int { - if (self & _MODE_RAW) == 0 { - return (n + 2) / 3 * 4 - } else { - return (n * 8 + 5) / 6 - } + if (self & _MODE_RAW) == 0 { + return (n + 2) / 3 * 4 + } else { + return (n*8 + 5) / 6 + } } /** Decoder Functions **/ @@ -124,13 +118,13 @@ func (self Encoding) EncodedLen(n int) int { // If out is not large enough to contain the encoded result, // it will panic. func (self Encoding) Decode(out []byte, src []byte) (int, error) { - if len(src) == 0 { - return 0, nil - } else if buf := out[:0:len(out)]; self.DecodedLen(len(src)) <= len(out) { - return self.DecodeUnsafe(&buf, src) - } else { - panic("decoder output buffer is too small") - } + if len(src) == 0 { + return 0, nil + } else if buf := out[:0:len(out)]; self.DecodedLen(len(src)) <= len(out) { + return self.DecodeUnsafe(&buf, src) + } else { + panic("decoder output buffer is too small") + } } // DecodeUnsafe behaves like Decode, except it does NOT check if @@ -138,32 +132,28 @@ func (self Encoding) Decode(out []byte, src []byte) (int, error) { // // It will also update the length of out. func (self Encoding) DecodeUnsafe(out *[]byte, src []byte) (int, error) { - if n := native.B64Decode(out, mem2addr(src), len(src), int(self) | archFlags); n >= 0 { - return n, nil - } else { - return 0, base64.CorruptInputError(-n - 1) - } + return decode(out, src, int(self)|archFlags) } // DecodeString returns the bytes represented by the base64 string s. func (self Encoding) DecodeString(s string) ([]byte, error) { - src := str2mem(s) - ret := make([]byte, 0, self.DecodedLen(len(s))) - - /* decode into the allocated buffer */ - if _, err := self.DecodeUnsafe(&ret, src); err != nil { - return nil, err - } else { - return ret, nil - } + src := str2mem(s) + ret := make([]byte, 0, self.DecodedLen(len(s))) + + /* decode into the allocated buffer */ + if _, err := self.DecodeUnsafe(&ret, src); err != nil { + return nil, err + } else { + return ret, nil + } } // DecodedLen returns the maximum length in bytes of the decoded data // corresponding to n bytes of base64-encoded data. func (self Encoding) DecodedLen(n int) int { - if (self & _MODE_RAW) == 0 { - return n / 4 * 3 - } else { - return n * 6 / 8 - } + if (self & _MODE_RAW) == 0 { + return n / 4 * 3 + } else { + return n * 6 / 8 + } } diff --git a/vendor/github.com/cloudwego/base64x/base64x_fallback.go b/vendor/github.com/cloudwego/base64x/base64x_fallback.go new file mode 100644 index 00000000000..32816664a22 --- /dev/null +++ b/vendor/github.com/cloudwego/base64x/base64x_fallback.go @@ -0,0 +1,83 @@ +//go:build !amd64 || noasm || appengine +// +build !amd64 noasm appengine + +/* + * Copyright 2024 CloudWeGo Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package base64x + +import ( + "encoding/base64" + "encoding/json" +) + +func encodingForMode(mode int) *base64.Encoding { + switch mode & (_MODE_URL | _MODE_RAW) { + case _MODE_URL: + return base64.URLEncoding + case _MODE_RAW: + return base64.RawStdEncoding + case _MODE_URL | _MODE_RAW: + return base64.RawURLEncoding + default: + return base64.StdEncoding + } +} + +func encode(out *[]byte, src []byte, mode int) { + enc := encodingForMode(mode) + dst := *out + start := len(dst) + need := enc.EncodedLen(len(src)) + dst = dst[:start+need] + enc.Encode(dst[start:], src) + *out = dst +} + +func decode(out *[]byte, src []byte, mode int) (int, error) { + input := src + if mode&_MODE_JSON != 0 { + unquoted, err := unquoteJSONBase64(src) + if err != nil { + return 0, err + } + input = unquoted + } + + enc := encodingForMode(mode) + dst := *out + start := len(dst) + buf := dst[start:cap(dst)] + n, err := enc.Decode(buf, input) + if err != nil { + return 0, err + } + *out = dst[:start+n] + return n, nil +} + +func unquoteJSONBase64(src []byte) ([]byte, error) { + quoted := make([]byte, 0, len(src)+2) + quoted = append(quoted, '"') + quoted = append(quoted, src...) + quoted = append(quoted, '"') + + var decoded string + if err := json.Unmarshal(quoted, &decoded); err != nil { + return nil, err + } + return []byte(decoded), nil +} diff --git a/vendor/github.com/cloudwego/base64x/base64x_native.go b/vendor/github.com/cloudwego/base64x/base64x_native.go new file mode 100644 index 00000000000..56437294ae7 --- /dev/null +++ b/vendor/github.com/cloudwego/base64x/base64x_native.go @@ -0,0 +1,38 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + +/* + * Copyright 2024 CloudWeGo Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package base64x + +import ( + "encoding/base64" + + "github.com/cloudwego/base64x/internal/native" +) + +func encode(out *[]byte, src []byte, mode int) { + native.B64Encode(out, &src, mode) +} + +func decode(out *[]byte, src []byte, mode int) (int, error) { + n := native.B64Decode(out, mem2addr(src), len(src), mode) + if n >= 0 { + return n, nil + } + return 0, base64.CorruptInputError(-n - 1) +} diff --git a/vendor/github.com/cloudwego/base64x/base64x_subr_amd64.go b/vendor/github.com/cloudwego/base64x/base64x_subr_amd64.go index 022984bda47..06ae945cbfb 100644 --- a/vendor/github.com/cloudwego/base64x/base64x_subr_amd64.go +++ b/vendor/github.com/cloudwego/base64x/base64x_subr_amd64.go @@ -1,18 +1,24 @@ +// Copyright 2024 CloudWeGo Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//go:build amd64 +// +build amd64 package base64x -import ( - "github.com/cloudwego/base64x/internal/native" -) - // HACK: maintain these only to prevent breakchange, because sonic-go linkname these var ( _subr__b64decode uintptr _subr__b64encode uintptr ) - -func init() { - _subr__b64decode = native.S_b64decode - _subr__b64encode = native.S_b64encode -} diff --git a/vendor/github.com/cloudwego/base64x/base64x_subr_native_amd64.go b/vendor/github.com/cloudwego/base64x/base64x_subr_native_amd64.go new file mode 100644 index 00000000000..094ad8419ae --- /dev/null +++ b/vendor/github.com/cloudwego/base64x/base64x_subr_native_amd64.go @@ -0,0 +1,27 @@ +// Copyright 2024 CloudWeGo Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + +package base64x + +import ( + "github.com/cloudwego/base64x/internal/native" +) + +func init() { + _subr__b64decode = native.S_b64decode + _subr__b64encode = native.S_b64encode +} diff --git a/vendor/github.com/cloudwego/base64x/faststr.go b/vendor/github.com/cloudwego/base64x/faststr.go index 083d864f7de..ac5b4935706 100644 --- a/vendor/github.com/cloudwego/base64x/faststr.go +++ b/vendor/github.com/cloudwego/base64x/faststr.go @@ -17,25 +17,25 @@ package base64x import ( - `reflect` - `unsafe` + "reflect" + "unsafe" ) func mem2str(v []byte) (s string) { - (*reflect.StringHeader)(unsafe.Pointer(&s)).Len = (*reflect.SliceHeader)(unsafe.Pointer(&v)).Len - (*reflect.StringHeader)(unsafe.Pointer(&s)).Data = (*reflect.SliceHeader)(unsafe.Pointer(&v)).Data - return + (*reflect.StringHeader)(unsafe.Pointer(&s)).Len = (*reflect.SliceHeader)(unsafe.Pointer(&v)).Len + (*reflect.StringHeader)(unsafe.Pointer(&s)).Data = (*reflect.SliceHeader)(unsafe.Pointer(&v)).Data + return } func str2mem(s string) (v []byte) { - (*reflect.SliceHeader)(unsafe.Pointer(&v)).Cap = (*reflect.StringHeader)(unsafe.Pointer(&s)).Len - (*reflect.SliceHeader)(unsafe.Pointer(&v)).Len = (*reflect.StringHeader)(unsafe.Pointer(&s)).Len - (*reflect.SliceHeader)(unsafe.Pointer(&v)).Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data - return + (*reflect.SliceHeader)(unsafe.Pointer(&v)).Cap = (*reflect.StringHeader)(unsafe.Pointer(&s)).Len + (*reflect.SliceHeader)(unsafe.Pointer(&v)).Len = (*reflect.StringHeader)(unsafe.Pointer(&s)).Len + (*reflect.SliceHeader)(unsafe.Pointer(&v)).Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data + return } func mem2addr(v []byte) unsafe.Pointer { - return *(*unsafe.Pointer)(unsafe.Pointer(&v)) + return *(*unsafe.Pointer)(unsafe.Pointer(&v)) } // NoEscape hides a pointer from escape analysis. NoEscape is @@ -43,9 +43,10 @@ func mem2addr(v []byte) unsafe.Pointer { // output depends on the input. NoEscape is inlined and currently // compiles down to zero instructions. // USE CAREFULLY! +// //go:nosplit //goland:noinspection GoVetUnsafePointer func noEscape(p unsafe.Pointer) unsafe.Pointer { - x := uintptr(p) - return unsafe.Pointer(x ^ 0) + x := uintptr(p) + return unsafe.Pointer(x ^ 0) } diff --git a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode.go b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode.go index e4f5de4f605..cb5243c897d 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode.go @@ -1,3 +1,6 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by Bash, DO NOT EDIT. /* @@ -19,9 +22,9 @@ package avx2 import ( - `unsafe` + "unsafe" - `github.com/cloudwego/base64x/internal/rt` + "github.com/cloudwego/base64x/internal/rt" ) var F_b64decode func(out unsafe.Pointer, src unsafe.Pointer, len int, mod int) (ret int) @@ -30,6 +33,5 @@ var S_b64decode uintptr //go:nosplit func B64decode(out *[]byte, src unsafe.Pointer, len int, mode int) (ret int) { - return F_b64decode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), len, mode) + return F_b64decode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), len, mode) } - diff --git a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode_subr.go b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode_subr.go index 373b8ac5d58..3d822511d7f 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode_subr.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode_subr.go @@ -1,45 +1,47 @@ -// +build !noasm !appengine +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by asm2asm, DO NOT EDIT. package avx2 import ( - `github.com/bytedance/sonic/loader` + "github.com/bytedance/sonic/loader" ) const ( - _entry__b64decode = 464 + _entry__b64decode = 464 ) const ( - _stack__b64decode = 136 + _stack__b64decode = 136 ) const ( - _size__b64decode = 13488 + _size__b64decode = 13488 ) var ( - _pcsp__b64decode = [][2]uint32{ - {0x1, 0}, - {0x6, 8}, - {0x8, 16}, - {0xa, 24}, - {0xc, 32}, - {0xd, 40}, - {0x11, 48}, - {0x349e, 136}, - {0x349f, 48}, - {0x34a1, 40}, - {0x34a3, 32}, - {0x34a5, 24}, - {0x34a7, 16}, - {0x34a8, 8}, - {0x34b0, 0}, - } + _pcsp__b64decode = [][2]uint32{ + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x349e, 136}, + {0x349f, 48}, + {0x34a1, 40}, + {0x34a3, 32}, + {0x34a5, 24}, + {0x34a7, 16}, + {0x34a8, 8}, + {0x34b0, 0}, + } ) var _cfunc_b64decode = []loader.CFunc{ - {"_b64decode_entry", 0, _entry__b64decode, 0, nil}, - {"_b64decode", _entry__b64decode, _size__b64decode, _stack__b64decode, _pcsp__b64decode}, + {"_b64decode_entry", 0, _entry__b64decode, 0, nil}, + {"_b64decode", _entry__b64decode, _size__b64decode, _stack__b64decode, _pcsp__b64decode}, } diff --git a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode_text_amd64.go b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode_text_amd64.go index 4513288e182..9173dd2e8ec 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode_text_amd64.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64decode_text_amd64.go @@ -1,4 +1,6 @@ -// +build amd64 +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by asm2asm, DO NOT EDIT. package avx2 @@ -291,13 +293,13 @@ var _text_b64decode = []byte{ 0x06, //0x000001cf .byte 6 //0x000001d0 .p2align 4, 0x90 //0x000001d0 _b64decode - 0x55, //0x000001d0 pushq %rbp + 0x55, //0x000001d0 pushq %rbp 0x48, 0x89, 0xe5, //0x000001d1 movq %rsp, %rbp 0x41, 0x57, //0x000001d4 pushq %r15 0x41, 0x56, //0x000001d6 pushq %r14 0x41, 0x55, //0x000001d8 pushq %r13 0x41, 0x54, //0x000001da pushq %r12 - 0x53, //0x000001dc pushq %rbx + 0x53, //0x000001dc pushq %rbx 0x48, 0x83, 0xec, 0x58, //0x000001dd subq $88, %rsp 0x48, 0x85, 0xd2, //0x000001e1 testq %rdx, %rdx 0x0f, 0x84, 0x85, 0x00, 0x00, 0x00, //0x000001e4 je LBB0_6 @@ -3933,14 +3935,14 @@ var _text_b64decode = []byte{ 0x48, 0x29, 0xc8, //0x00003667 subq %rcx, %rax //0x0000366a LBB0_865 0x48, 0x83, 0xc4, 0x58, //0x0000366a addq $88, %rsp - 0x5b, //0x0000366e popq %rbx + 0x5b, //0x0000366e popq %rbx 0x41, 0x5c, //0x0000366f popq %r12 0x41, 0x5d, //0x00003671 popq %r13 0x41, 0x5e, //0x00003673 popq %r14 0x41, 0x5f, //0x00003675 popq %r15 - 0x5d, //0x00003677 popq %rbp - 0xc5, 0xf8, 0x77, //0x00003678 vzeroupper - 0xc3, //0x0000367b retq + 0x5d, //0x00003677 popq %rbp + 0xc5, 0xf8, 0x77, //0x00003678 vzeroupper + 0xc3, //0x0000367b retq 0x00, 0x00, 0x00, 0x00, //0x0000367c .p2align 4, 0x00 //0x00003680 _VecDecodeCharsetStd 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //0x00003680 QUAD $0xffffffffffffffff; QUAD $0xffffffffffffffff // .ascii 16, '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' @@ -3978,4 +3980,3 @@ var _text_b64decode = []byte{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //0x00003860 QUAD $0xffffffffffffffff; QUAD $0xffffffffffffffff // .ascii 16, '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //0x00003870 QUAD $0xffffffffffffffff; QUAD $0xffffffffffffffff // .ascii 16, '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' } - diff --git a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode.go b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode.go index e89c1bbc33e..eb17d8894f9 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode.go @@ -1,3 +1,6 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by Bash, DO NOT EDIT. /* @@ -19,9 +22,9 @@ package avx2 import ( - `unsafe` + "unsafe" - `github.com/cloudwego/base64x/internal/rt` + "github.com/cloudwego/base64x/internal/rt" ) var F_b64encode func(out unsafe.Pointer, src unsafe.Pointer, mod int) @@ -30,5 +33,5 @@ var S_b64encode uintptr //go:nosplit func B64encode(out *[]byte, src *[]byte, mode int) { - F_b64encode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), mode) + F_b64encode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), mode) } diff --git a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode_subr.go b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode_subr.go index 877737d5629..736ef22299a 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode_subr.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode_subr.go @@ -1,41 +1,43 @@ -// +build !noasm !appengine +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by asm2asm, DO NOT EDIT. package avx2 import ( - `github.com/bytedance/sonic/loader` + "github.com/bytedance/sonic/loader" ) const ( - _entry__b64encode = 288 + _entry__b64encode = 288 ) const ( - _stack__b64encode = 40 + _stack__b64encode = 40 ) const ( - _size__b64encode = 832 + _size__b64encode = 832 ) var ( - _pcsp__b64encode = [][2]uint32{ - {0x1, 0}, - {0x6, 8}, - {0x8, 16}, - {0xa, 24}, - {0xb, 32}, - {0x32a, 40}, - {0x32c, 32}, - {0x32e, 24}, - {0x330, 16}, - {0x331, 8}, - {0x340, 0}, - } + _pcsp__b64encode = [][2]uint32{ + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xb, 32}, + {0x32a, 40}, + {0x32c, 32}, + {0x32e, 24}, + {0x330, 16}, + {0x331, 8}, + {0x340, 0}, + } ) var _cfunc_b64encode = []loader.CFunc{ - {"_b64encode_entry", 0, _entry__b64encode, 0, nil}, - {"_b64encode", _entry__b64encode, _size__b64encode, _stack__b64encode, _pcsp__b64encode}, + {"_b64encode_entry", 0, _entry__b64encode, 0, nil}, + {"_b64encode", _entry__b64encode, _size__b64encode, _stack__b64encode, _pcsp__b64encode}, } diff --git a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode_text_amd64.go b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode_text_amd64.go index 7554bbef174..97a2f286d12 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode_text_amd64.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/avx2/b64encode_text_amd64.go @@ -1,4 +1,6 @@ -// +build amd64 +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by asm2asm, DO NOT EDIT. package avx2 @@ -166,12 +168,12 @@ var _text_b64encode = []byte{ 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, //0x00000110 QUAD $0x0d0d0d0d0d0d0d0d; QUAD $0x0d0d0d0d0d0d0d0d // .space 16, '\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r' //0x00000120 .p2align 4, 0x90 //0x00000120 _b64encode - 0x55, //0x00000120 pushq %rbp + 0x55, //0x00000120 pushq %rbp 0x48, 0x89, 0xe5, //0x00000121 movq %rsp, %rbp 0x41, 0x57, //0x00000124 pushq %r15 0x41, 0x56, //0x00000126 pushq %r14 0x41, 0x54, //0x00000128 pushq %r12 - 0x53, //0x0000012a pushq %rbx + 0x53, //0x0000012a pushq %rbx 0x4c, 0x8b, 0x4e, 0x08, //0x0000012b movq $8(%rsi), %r9 0x4d, 0x85, 0xc9, //0x0000012f testq %r9, %r9 0x0f, 0x84, 0x11, 0x03, 0x00, 0x00, //0x00000132 je LBB0_26 @@ -364,13 +366,13 @@ var _text_b64encode = []byte{ 0x4d, 0x29, 0xc6, //0x00000442 subq %r8, %r14 0x4c, 0x01, 0x77, 0x08, //0x00000445 addq %r14, $8(%rdi) //0x00000449 LBB0_26 - 0x5b, //0x00000449 popq %rbx + 0x5b, //0x00000449 popq %rbx 0x41, 0x5c, //0x0000044a popq %r12 0x41, 0x5e, //0x0000044c popq %r14 0x41, 0x5f, //0x0000044e popq %r15 - 0x5d, //0x00000450 popq %rbp - 0xc5, 0xf8, 0x77, //0x00000451 vzeroupper - 0xc3, //0x00000454 retq + 0x5d, //0x00000450 popq %rbp + 0xc5, 0xf8, 0x77, //0x00000451 vzeroupper + 0xc3, //0x00000454 retq 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x00000455 .p2align 4, 0x00 //0x00000460 _TabEncodeCharsetStd 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, //0x00000460 QUAD $0x4847464544434241; QUAD $0x504f4e4d4c4b4a49 // .ascii 16, 'ABCDEFGHIJKLMNOP' @@ -384,4 +386,3 @@ var _text_b64encode = []byte{ 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, //0x000004c0 QUAD $0x6e6d6c6b6a696867; QUAD $0x767574737271706f // .ascii 16, 'ghijklmnopqrstuv' 0x77, 0x78, 0x79, 0x7a, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2d, 0x5f, //0x000004d0 QUAD $0x333231307a797877; QUAD $0x5f2d393837363534 // .ascii 16, 'wxyz0123456789-_' } - diff --git a/vendor/github.com/cloudwego/base64x/internal/native/avx2/native_export.go b/vendor/github.com/cloudwego/base64x/internal/native/avx2/native_export.go index 51f68fe2ba4..39a7cbafaf6 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/avx2/native_export.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/avx2/native_export.go @@ -1,3 +1,5 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine // Code generated by Bash, DO NOT EDIT. @@ -20,10 +22,10 @@ package avx2 import ( - `github.com/bytedance/sonic/loader` + "github.com/bytedance/sonic/loader" ) func Use() { - loader.WrapGoC(_text_b64encode, _cfunc_b64encode, []loader.GoC{{"_b64encode", &S_b64encode, &F_b64encode}}, "avx2", "avx2/b64encode.c") - loader.WrapGoC(_text_b64decode, _cfunc_b64decode, []loader.GoC{{"_b64decode", &S_b64decode, &F_b64decode}}, "avx2", "avx2/b64decode.c") -} \ No newline at end of file + loader.WrapGoC(_text_b64encode, _cfunc_b64encode, []loader.GoC{{"_b64encode", &S_b64encode, &F_b64encode}}, "avx2", "avx2/b64encode.c") + loader.WrapGoC(_text_b64decode, _cfunc_b64decode, []loader.GoC{{"_b64decode", &S_b64decode, &F_b64decode}}, "avx2", "avx2/b64decode.c") +} diff --git a/vendor/github.com/cloudwego/base64x/internal/native/b64decode.tmpl b/vendor/github.com/cloudwego/base64x/internal/native/b64decode.tmpl index 5b7ebebea92..cd61808e073 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/b64decode.tmpl +++ b/vendor/github.com/cloudwego/base64x/internal/native/b64decode.tmpl @@ -1,3 +1,6 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by Bash, DO NOT EDIT. /* @@ -32,4 +35,3 @@ var S_b64decode uintptr func B64decode(out *[]byte, src unsafe.Pointer, len int, mode int) (ret int) { return F_b64decode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), len, mode) } - diff --git a/vendor/github.com/cloudwego/base64x/internal/native/b64encode.tmpl b/vendor/github.com/cloudwego/base64x/internal/native/b64encode.tmpl index edecd8761ce..5cb3513f64a 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/b64encode.tmpl +++ b/vendor/github.com/cloudwego/base64x/internal/native/b64encode.tmpl @@ -1,3 +1,6 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by Bash, DO NOT EDIT. /* diff --git a/vendor/github.com/cloudwego/base64x/internal/native/dispatch.go b/vendor/github.com/cloudwego/base64x/internal/native/dispatch.go index c4f489b10a0..73a9a188555 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/dispatch.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/dispatch.go @@ -1,17 +1,34 @@ +// Copyright 2024 CloudWeGo Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + package native import ( "unsafe" - - `github.com/klauspost/cpuid/v2` - "github.com/cloudwego/base64x/internal/rt" + "github.com/cloudwego/base64x/internal/native/avx2" "github.com/cloudwego/base64x/internal/native/sse" + "github.com/cloudwego/base64x/internal/rt" + "github.com/klauspost/cpuid/v2" ) var ( - hasAVX2 = cpuid.CPU.Has(cpuid.AVX2) - hasSSE = cpuid.CPU.Has(cpuid.SSE) + hasAVX2 = cpuid.CPU.Has(cpuid.AVX2) + hasSSE = cpuid.CPU.Has(cpuid.SSE) ) var ( @@ -44,7 +61,7 @@ func useSSE() { //go:nosplit func B64Decode(out *[]byte, src unsafe.Pointer, len int, mod int) (ret int) { - return F_b64decode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), len, mod) + return F_b64decode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), len, mod) } //go:nosplit diff --git a/vendor/github.com/cloudwego/base64x/internal/native/native_export.tmpl b/vendor/github.com/cloudwego/base64x/internal/native/native_export.tmpl index 06dd28ad194..984034f2e12 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/native_export.tmpl +++ b/vendor/github.com/cloudwego/base64x/internal/native/native_export.tmpl @@ -1,3 +1,5 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine // Code generated by Bash, DO NOT EDIT. @@ -26,4 +28,4 @@ import ( func Use() { loader.WrapGoC(_text_b64encode, _cfunc_b64encode, []loader.GoC{{"_b64encode", &S_b64encode, &F_b64encode}}, "{{PACKAGE}}", "{{PACKAGE}}/b64encode.c") loader.WrapGoC(_text_b64decode, _cfunc_b64decode, []loader.GoC{{"_b64decode", &S_b64decode, &F_b64decode}}, "{{PACKAGE}}", "{{PACKAGE}}/b64decode.c") -} \ No newline at end of file +} diff --git a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode.go b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode.go index 3e097f97793..7c01375d685 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode.go @@ -1,3 +1,6 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by Bash, DO NOT EDIT. /* @@ -19,9 +22,9 @@ package sse import ( - `unsafe` + "unsafe" - `github.com/cloudwego/base64x/internal/rt` + "github.com/cloudwego/base64x/internal/rt" ) var F_b64decode func(out unsafe.Pointer, src unsafe.Pointer, len int, mod int) (ret int) @@ -30,6 +33,5 @@ var S_b64decode uintptr //go:nosplit func B64decode(out *[]byte, src unsafe.Pointer, len int, mode int) (ret int) { - return F_b64decode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), len, mode) + return F_b64decode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), len, mode) } - diff --git a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode_subr.go b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode_subr.go index 25ba9802dc1..b0774ee5a86 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode_subr.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode_subr.go @@ -1,45 +1,47 @@ -// +build !noasm !appengine +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by asm2asm, DO NOT EDIT. package sse import ( - `github.com/bytedance/sonic/loader` + "github.com/bytedance/sonic/loader" ) const ( - _entry__b64decode = 0 + _entry__b64decode = 0 ) const ( - _stack__b64decode = 144 + _stack__b64decode = 144 ) const ( - _size__b64decode = 9968 + _size__b64decode = 9968 ) var ( - _pcsp__b64decode = [][2]uint32{ - {0x1, 0}, - {0x6, 8}, - {0x8, 16}, - {0xa, 24}, - {0xc, 32}, - {0xd, 40}, - {0x11, 48}, - {0x26e1, 144}, - {0x26e2, 48}, - {0x26e4, 40}, - {0x26e6, 32}, - {0x26e8, 24}, - {0x26ea, 16}, - {0x26eb, 8}, - {0x26f0, 0}, - } + _pcsp__b64decode = [][2]uint32{ + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0xa, 24}, + {0xc, 32}, + {0xd, 40}, + {0x11, 48}, + {0x26e1, 144}, + {0x26e2, 48}, + {0x26e4, 40}, + {0x26e6, 32}, + {0x26e8, 24}, + {0x26ea, 16}, + {0x26eb, 8}, + {0x26f0, 0}, + } ) var _cfunc_b64decode = []loader.CFunc{ - {"_b64decode_entry", 0, _entry__b64decode, 0, nil}, - {"_b64decode", _entry__b64decode, _size__b64decode, _stack__b64decode, _pcsp__b64decode}, + {"_b64decode_entry", 0, _entry__b64decode, 0, nil}, + {"_b64decode", _entry__b64decode, _size__b64decode, _stack__b64decode, _pcsp__b64decode}, } diff --git a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode_text_amd64.go b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode_text_amd64.go index 49569e05e90..b7fe72236ba 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode_text_amd64.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64decode_text_amd64.go @@ -1,4 +1,6 @@ -// +build amd64 +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by asm2asm, DO NOT EDIT. package sse @@ -6,13 +8,13 @@ package sse var _text_b64decode = []byte{ // .p2align 4, 0x90 // _b64decode - 0x55, // pushq %rbp + 0x55, // pushq %rbp 0x48, 0x89, 0xe5, //0x00000001 movq %rsp, %rbp 0x41, 0x57, //0x00000004 pushq %r15 0x41, 0x56, //0x00000006 pushq %r14 0x41, 0x55, //0x00000008 pushq %r13 0x41, 0x54, //0x0000000a pushq %r12 - 0x53, //0x0000000c pushq %rbx + 0x53, //0x0000000c pushq %rbx 0x48, 0x83, 0xec, 0x60, //0x0000000d subq $96, %rsp 0x48, 0x85, 0xd2, //0x00000011 testq %rdx, %rdx 0x0f, 0x84, 0x54, 0x1a, 0x00, 0x00, //0x00000014 je LBB0_432 @@ -2744,13 +2746,13 @@ var _text_b64decode = []byte{ 0x48, 0x29, 0xc8, //0x000026da subq %rcx, %rax //0x000026dd LBB0_644 0x48, 0x83, 0xc4, 0x60, //0x000026dd addq $96, %rsp - 0x5b, //0x000026e1 popq %rbx + 0x5b, //0x000026e1 popq %rbx 0x41, 0x5c, //0x000026e2 popq %r12 0x41, 0x5d, //0x000026e4 popq %r13 0x41, 0x5e, //0x000026e6 popq %r14 0x41, 0x5f, //0x000026e8 popq %r15 - 0x5d, //0x000026ea popq %rbp - 0xc3, //0x000026eb retq + 0x5d, //0x000026ea popq %rbp + 0xc3, //0x000026eb retq 0x00, 0x00, 0x00, 0x00, //0x000026ec .p2align 4, 0x00 //0x000026f0 _VecDecodeCharsetStd 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //0x000026f0 QUAD $0xffffffffffffffff; QUAD $0xffffffffffffffff // .ascii 16, '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' @@ -2788,4 +2790,3 @@ var _text_b64decode = []byte{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //0x000028d0 QUAD $0xffffffffffffffff; QUAD $0xffffffffffffffff // .ascii 16, '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //0x000028e0 QUAD $0xffffffffffffffff; QUAD $0xffffffffffffffff // .ascii 16, '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' } - diff --git a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode.go b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode.go index e5f7a8723ae..9609ec98fd8 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode.go @@ -1,3 +1,6 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by Bash, DO NOT EDIT. /* @@ -19,9 +22,9 @@ package sse import ( - `unsafe` + "unsafe" - `github.com/cloudwego/base64x/internal/rt` + "github.com/cloudwego/base64x/internal/rt" ) var F_b64encode func(out unsafe.Pointer, src unsafe.Pointer, mod int) @@ -30,5 +33,5 @@ var S_b64encode uintptr //go:nosplit func B64encode(out *[]byte, src *[]byte, mode int) { - F_b64encode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), mode) + F_b64encode(rt.NoEscape(unsafe.Pointer(out)), rt.NoEscape(unsafe.Pointer(src)), mode) } diff --git a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode_subr.go b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode_subr.go index 720122e39d4..deb12c0053e 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode_subr.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode_subr.go @@ -1,39 +1,41 @@ -// +build !noasm !appengine +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by asm2asm, DO NOT EDIT. package sse import ( - `github.com/bytedance/sonic/loader` + "github.com/bytedance/sonic/loader" ) const ( - _entry__b64encode = 0 + _entry__b64encode = 0 ) const ( - _stack__b64encode = 32 + _stack__b64encode = 32 ) const ( - _size__b64encode = 448 + _size__b64encode = 448 ) var ( - _pcsp__b64encode = [][2]uint32{ - {0x1, 0}, - {0x6, 8}, - {0x8, 16}, - {0x9, 24}, - {0x1ab, 32}, - {0x1ad, 24}, - {0x1af, 16}, - {0x1b0, 8}, - {0x1c0, 0}, - } + _pcsp__b64encode = [][2]uint32{ + {0x1, 0}, + {0x6, 8}, + {0x8, 16}, + {0x9, 24}, + {0x1ab, 32}, + {0x1ad, 24}, + {0x1af, 16}, + {0x1b0, 8}, + {0x1c0, 0}, + } ) var _cfunc_b64encode = []loader.CFunc{ - {"_b64encode_entry", 0, _entry__b64encode, 0, nil}, - {"_b64encode", _entry__b64encode, _size__b64encode, _stack__b64encode, _pcsp__b64encode}, + {"_b64encode_entry", 0, _entry__b64encode, 0, nil}, + {"_b64encode", _entry__b64encode, _size__b64encode, _stack__b64encode, _pcsp__b64encode}, } diff --git a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode_text_amd64.go b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode_text_amd64.go index 2ce8624c10b..84cd54dca1a 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode_text_amd64.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/sse/b64encode_text_amd64.go @@ -1,4 +1,6 @@ -// +build amd64 +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine + // Code generated by asm2asm, DO NOT EDIT. package sse @@ -6,11 +8,11 @@ package sse var _text_b64encode = []byte{ // .p2align 4, 0x90 // _b64encode - 0x55, // pushq %rbp + 0x55, // pushq %rbp 0x48, 0x89, 0xe5, //0x00000001 movq %rsp, %rbp 0x41, 0x57, //0x00000004 pushq %r15 0x41, 0x56, //0x00000006 pushq %r14 - 0x53, //0x00000008 pushq %rbx + 0x53, //0x00000008 pushq %rbx 0x4c, 0x8b, 0x4e, 0x08, //0x00000009 movq $8(%rsi), %r9 0x4d, 0x85, 0xc9, //0x0000000d testq %r9, %r9 0x0f, 0x84, 0x94, 0x01, 0x00, 0x00, //0x00000010 je LBB0_15 @@ -127,11 +129,11 @@ var _text_b64encode = []byte{ 0x4d, 0x29, 0xc6, //0x000001a3 subq %r8, %r14 0x4c, 0x01, 0x77, 0x08, //0x000001a6 addq %r14, $8(%rdi) //0x000001aa LBB0_15 - 0x5b, //0x000001aa popq %rbx + 0x5b, //0x000001aa popq %rbx 0x41, 0x5e, //0x000001ab popq %r14 0x41, 0x5f, //0x000001ad popq %r15 - 0x5d, //0x000001af popq %rbp - 0xc3, //0x000001b0 retq + 0x5d, //0x000001af popq %rbp + 0xc3, //0x000001b0 retq 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //0x000001b1 .p2align 4, 0x00 //0x000001c0 _TabEncodeCharsetStd 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, //0x000001c0 QUAD $0x4847464544434241; QUAD $0x504f4e4d4c4b4a49 // .ascii 16, 'ABCDEFGHIJKLMNOP' @@ -145,4 +147,3 @@ var _text_b64encode = []byte{ 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, //0x00000220 QUAD $0x6e6d6c6b6a696867; QUAD $0x767574737271706f // .ascii 16, 'ghijklmnopqrstuv' 0x77, 0x78, 0x79, 0x7a, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2d, 0x5f, //0x00000230 QUAD $0x333231307a797877; QUAD $0x5f2d393837363534 // .ascii 16, 'wxyz0123456789-_' } - diff --git a/vendor/github.com/cloudwego/base64x/internal/native/sse/native_export.go b/vendor/github.com/cloudwego/base64x/internal/native/sse/native_export.go index dd6ae111b30..6a9d9e74452 100644 --- a/vendor/github.com/cloudwego/base64x/internal/native/sse/native_export.go +++ b/vendor/github.com/cloudwego/base64x/internal/native/sse/native_export.go @@ -1,3 +1,5 @@ +//go:build amd64 && !noasm && !appengine +// +build amd64,!noasm,!appengine // Code generated by Bash, DO NOT EDIT. @@ -20,10 +22,10 @@ package sse import ( - `github.com/bytedance/sonic/loader` + "github.com/bytedance/sonic/loader" ) func Use() { - loader.WrapGoC(_text_b64encode, _cfunc_b64encode, []loader.GoC{{"_b64encode", &S_b64encode, &F_b64encode}}, "sse", "sse/b64encode.c") - loader.WrapGoC(_text_b64decode, _cfunc_b64decode, []loader.GoC{{"_b64decode", &S_b64decode, &F_b64decode}}, "sse", "sse/b64decode.c") -} \ No newline at end of file + loader.WrapGoC(_text_b64encode, _cfunc_b64encode, []loader.GoC{{"_b64encode", &S_b64encode, &F_b64encode}}, "sse", "sse/b64encode.c") + loader.WrapGoC(_text_b64decode, _cfunc_b64decode, []loader.GoC{{"_b64decode", &S_b64decode, &F_b64decode}}, "sse", "sse/b64decode.c") +} diff --git a/vendor/github.com/cloudwego/base64x/internal/rt/asm_amd64.s b/vendor/github.com/cloudwego/base64x/internal/rt/asm_amd64.s index 86d264230f2..778383576d7 100644 --- a/vendor/github.com/cloudwego/base64x/internal/rt/asm_amd64.s +++ b/vendor/github.com/cloudwego/base64x/internal/rt/asm_amd64.s @@ -1,3 +1,17 @@ +// Copyright 2024 CloudWeGo Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // +build !noasm !appengine // Code generated by asm2asm, DO NOT EDIT· diff --git a/vendor/github.com/cloudwego/base64x/internal/rt/asm_arm64.s b/vendor/github.com/cloudwego/base64x/internal/rt/asm_arm64.s index a168a826643..646475c2eba 100644 --- a/vendor/github.com/cloudwego/base64x/internal/rt/asm_arm64.s +++ b/vendor/github.com/cloudwego/base64x/internal/rt/asm_arm64.s @@ -1,3 +1,17 @@ +// Copyright 2024 CloudWeGo Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // +build !noasm !appengine // Code generated by asm2asm, DO NOT EDIT. diff --git a/vendor/github.com/cloudwego/base64x/internal/rt/fastmem.go b/vendor/github.com/cloudwego/base64x/internal/rt/fastmem.go index e68ff41d10b..247572f753f 100644 --- a/vendor/github.com/cloudwego/base64x/internal/rt/fastmem.go +++ b/vendor/github.com/cloudwego/base64x/internal/rt/fastmem.go @@ -20,17 +20,17 @@ import ( "unsafe" ) - // NoEscape hides a pointer from escape analysis. NoEscape is // the identity function but escape analysis doesn't think the // output depends on the input. NoEscape is inlined and currently // compiles down to zero instructions. // USE CAREFULLY! +// //go:nosplit //goland:noinspection GoVetUnsafePointer func NoEscape(p unsafe.Pointer) unsafe.Pointer { - x := uintptr(p) - return unsafe.Pointer(x ^ 0) + x := uintptr(p) + return unsafe.Pointer(x ^ 0) } //go:nosplit @@ -38,5 +38,5 @@ func MoreStack(size uintptr) //go:nosplit func Add(ptr unsafe.Pointer, off uintptr) unsafe.Pointer { - return unsafe.Pointer(uintptr(ptr) + off) + return unsafe.Pointer(uintptr(ptr) + off) } diff --git a/vendor/github.com/ebitengine/purego/func.go b/vendor/github.com/ebitengine/purego/func.go index 0da2c26919a..9b9f0b23787 100644 --- a/vendor/github.com/ebitengine/purego/func.go +++ b/vendor/github.com/ebitengine/purego/func.go @@ -10,7 +10,6 @@ import ( "math" "reflect" "runtime" - "sync" "unsafe" "github.com/ebitengine/purego/internal/strings" @@ -22,10 +21,6 @@ const ( align8ByteSize = 8 // 8-byte alignment boundary ) -var thePool = sync.Pool{New: func() any { - return new(syscall15Args) -}} - // RegisterLibFunc is a wrapper around RegisterFunc that uses the C function returned from Dlsym(handle, name). // It panics if it can't find the name symbol. func RegisterLibFunc(fptr any, handle uintptr, name string) { @@ -310,8 +305,7 @@ func RegisterFunc(fptr any, cfn uintptr) { keepAlive = addValue(v, keepAlive, addInt, addFloat, addStack, &numInts, &numFloats, &numStack) } - syscall := thePool.Get().(*syscall15Args) - defer thePool.Put(syscall) + syscall := &syscall15Args{} if runtime.GOARCH == "loong64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "riscv64" || runtime.GOARCH == "s390x" { syscall.Set(cfn, sysargs[:], floats[:], 0) @@ -321,7 +315,6 @@ func RegisterFunc(fptr any, cfn uintptr) { syscall.Set(cfn, sysargs[:], floats[:], arm64_r8) runtime_cgocall(syscall15XABI0, unsafe.Pointer(syscall)) } else { - *syscall = syscall15Args{} // This is a fallback for Windows amd64, 386, and arm. Note this may not support floats syscall.a1, syscall.a2, _ = syscall_syscall15X(cfn, sysargs[0], sysargs[1], sysargs[2], sysargs[3], sysargs[4], sysargs[5], sysargs[6], sysargs[7], sysargs[8], sysargs[9], sysargs[10], sysargs[11], diff --git a/vendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_freebsd.go b/vendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_freebsd.go index d69775596fd..11af74db69a 100644 --- a/vendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_freebsd.go +++ b/vendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_freebsd.go @@ -16,16 +16,16 @@ import "unsafe" //go:cgo_import_dynamic purego_sigfillset sigfillset "libc.so.7" //go:cgo_import_dynamic purego_nanosleep nanosleep "libc.so.7" //go:cgo_import_dynamic purego_abort abort "libc.so.7" -//go:cgo_import_dynamic purego_pthread_attr_init pthread_attr_init "libpthread.so" -//go:cgo_import_dynamic purego_pthread_create pthread_create "libpthread.so" -//go:cgo_import_dynamic purego_pthread_detach pthread_detach "libpthread.so" -//go:cgo_import_dynamic purego_pthread_sigmask pthread_sigmask "libpthread.so" -//go:cgo_import_dynamic purego_pthread_mutex_lock pthread_mutex_lock "libpthread.so" -//go:cgo_import_dynamic purego_pthread_mutex_unlock pthread_mutex_unlock "libpthread.so" -//go:cgo_import_dynamic purego_pthread_cond_broadcast pthread_cond_broadcast "libpthread.so" -//go:cgo_import_dynamic purego_pthread_setspecific pthread_setspecific "libpthread.so" -//go:cgo_import_dynamic purego_pthread_attr_getstacksize pthread_attr_getstacksize "libpthread.so" -//go:cgo_import_dynamic purego_pthread_attr_destroy pthread_attr_destroy "libpthread.so" +//go:cgo_import_dynamic purego_pthread_attr_init pthread_attr_init "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_create pthread_create "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_detach pthread_detach "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_sigmask pthread_sigmask "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_mutex_lock pthread_mutex_lock "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_mutex_unlock pthread_mutex_unlock "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_cond_broadcast pthread_cond_broadcast "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_setspecific pthread_setspecific "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_attr_getstacksize pthread_attr_getstacksize "libthr.so.3" +//go:cgo_import_dynamic purego_pthread_attr_destroy pthread_attr_destroy "libthr.so.3" //go:nosplit //go:norace diff --git a/vendor/github.com/ebitengine/purego/syscall_sysv.go b/vendor/github.com/ebitengine/purego/syscall_sysv.go index e35b32e71d1..f6e9e29bc35 100644 --- a/vendor/github.com/ebitengine/purego/syscall_sysv.go +++ b/vendor/github.com/ebitengine/purego/syscall_sysv.go @@ -16,10 +16,7 @@ import ( var syscall15XABI0 uintptr func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) { - args := thePool.Get().(*syscall15Args) - defer thePool.Put(args) - - *args = syscall15Args{ + args := &syscall15Args{ fn: fn, a1: a1, a2: a2, a3: a3, a4: a4, a5: a5, a6: a6, a7: a7, a8: a8, a9: a9, a10: a10, a11: a11, a12: a12, a13: a13, a14: a14, a15: a15, diff --git a/vendor/github.com/elastic/lunes/CHANGELOG.md b/vendor/github.com/elastic/lunes/CHANGELOG.md index c9c9f4ebecb..5eab2ec2c9e 100644 --- a/vendor/github.com/elastic/lunes/CHANGELOG.md +++ b/vendor/github.com/elastic/lunes/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.2.1 + - Fixed handling of variable-width clock elements (`3`, `4`, `5`) so layouts stay in sync when hours, minutes, or seconds use one or two digits ([#15](https://github.com/elastic/lunes/issues/15)). + - Failed reads of `_2`, `_2006`, and `__2` now returns `ErrLayoutMismatch` errors. + - Fixed typo in the `ErrUnsupportedLayoutElem` message (`is not support by` to `is not supported by`). + ## 0.2.0 - Updated Unicode CLDR locale data to v48 for broader language coverage and corrected region aliases. - Added lazy loading of locale tables, reducing initial memory footprint and improving startup performance. diff --git a/vendor/github.com/elastic/lunes/NOTICE.txt b/vendor/github.com/elastic/lunes/NOTICE.txt index 294e1a3a26b..780a2284b59 100644 --- a/vendor/github.com/elastic/lunes/NOTICE.txt +++ b/vendor/github.com/elastic/lunes/NOTICE.txt @@ -1,5 +1,5 @@ Lunes -Copyright 2022-2025 Elasticsearch BV +Copyright 2022-2026 Elasticsearch BV This product includes software developed by The Apache Software Foundation (http://www.apache.org/). diff --git a/vendor/github.com/elastic/lunes/README.md b/vendor/github.com/elastic/lunes/README.md index fce081713ab..e426ee0ad8f 100644 --- a/vendor/github.com/elastic/lunes/README.md +++ b/vendor/github.com/elastic/lunes/README.md @@ -26,7 +26,7 @@ Once the official Go i18n features for time parsing are ready, it should be repl t, err := lunes.Parse("Monday Jan _2 2006 15:04:05", "lunes oct 27 1988 11:53:29", lunes.LocaleEsES) // parse in specific time zones. -t, err := lunes.ParseInLocation("Monday Jan _2 2006 15:04:05", "lunes oct 27 1988 11:53:29", time.UTC, lunes.LocaleEsES) +t, err := lunes.ParseInLocation("Monday Jan _2 2006 15:04:05", "lunes oct 27 1988 11:53:29", lunes.LocaleEsES, time.UTC) ``` ```go diff --git a/vendor/github.com/elastic/lunes/catalog-info.yaml b/vendor/github.com/elastic/lunes/catalog-info.yaml index f29a2b7d377..1a846eb6836 100644 --- a/vendor/github.com/elastic/lunes/catalog-info.yaml +++ b/vendor/github.com/elastic/lunes/catalog-info.yaml @@ -12,46 +12,3 @@ spec: owner: group:logstash system: platform-ingest lifecycle: production - ---- -# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json -apiVersion: backstage.io/v1alpha1 -kind: Resource -metadata: - name: buildkite-pipeline-lunes - description: Buildkite Pipeline for lunes - links: - - title: Pipeline - url: https://buildkite.com/elastic/lunes - -spec: - type: buildkite-pipeline - owner: group:logstash - system: platform-ingest - implementation: - apiVersion: buildkite.elastic.dev/v1 - kind: Pipeline - metadata: - name: lunes - description: Buildkite pipeline for the lunes library - spec: - branch_configuration: "main" - repository: elastic/lunes - pipeline_file: ".buildkite/pipeline.yml" - maximum_timeout_in_minutes: 60 - provider_settings: - build_pull_request_forks: false - build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot - build_tags: true - filter_enabled: true - filter_condition: >- - build.pull_request.id == null || (build.creator.name == 'elasticmachine' && build.pull_request.id != null) - cancel_intermediate_builds: true - cancel_intermediate_builds_branch_filter: '!main' - skip_intermediate_builds: true - skip_intermediate_builds_branch_filter: '!main' - teams: - logstash: - access_level: MANAGE_BUILD_AND_READ - everyone: - access_level: READ_ONLY diff --git a/vendor/github.com/elastic/lunes/lunes.go b/vendor/github.com/elastic/lunes/lunes.go index 8074b2a3d86..471fffc6d0b 100644 --- a/vendor/github.com/elastic/lunes/lunes.go +++ b/vendor/github.com/elastic/lunes/lunes.go @@ -267,25 +267,26 @@ func TranslateWithLocale(layout string, value string, locale Locale) (string, er written = true } case '_': // _2, _2006, __2 - // Although no translations happens here, it is still necessary to calculate the - // variable size of `_` values, so the layoutOffset stays synchronized with + // Although no translations happen here, it is still necessary to calculate the + // variable size of `_` values, so the layoutOffset stays synchronized with // its layout element counterpart. if len(layout) >= layoutOffset+2 && layout[layoutOffset+1] == '2' { - var layoutElemSize int + var layoutElem string // _2006 is really a literal _, followed by the long year placeholder if len(layout) >= layoutOffset+5 && layout[layoutOffset+1:layoutOffset+5] == "2006" { if len(value) >= valueOffset+5 { - layoutElemSize = 5 // _2006 + layoutElem = "_2006" } } else { if len(value) >= valueOffset+2 { - layoutElemSize = 2 // _2 + layoutElem = "_2" } } + layoutElemSize := len(layoutElem) if layoutElemSize > 0 { layoutOffset += layoutElemSize - valueOffset, err = writeNextNonSpaceValue(value, valueOffset, layoutElemSize, &sb) + valueOffset, err = writeNextNonSpaceValue(value, valueOffset, layoutElemSize, layoutElem, &sb) if err != nil { return "", err } @@ -296,13 +297,23 @@ func TranslateWithLocale(layout string, value string, locale Locale) (string, er if len(layout) >= layoutOffset+3 && layout[layoutOffset+1] == '_' && layout[layoutOffset+2] == '2' { if len(value) >= valueOffset+3 { layoutOffset += 3 - valueOffset, err = writeNextNonSpaceValue(value, valueOffset, 3, &sb) + valueOffset, err = writeNextNonSpaceValue(value, valueOffset, 3, "__2", &sb) if err != nil { return "", err } written = true } } + case '3', '4', '5': // variable-width h/m/s from reference time, skip when second digit of 03/04/05 + if layoutOffset == 0 || layout[layoutOffset-1] != '0' { + layoutElem := layout[layoutOffset] + valueOffset, err = writeFlexibleClockDigits(layoutElem, value, valueOffset, &sb) + if err != nil { + return "", err + } + layoutOffset++ + written = true + } } if !written { @@ -326,8 +337,26 @@ func TranslateWithLocale(layout string, value string, locale Locale) (string, er return sb.String(), nil } -func writeNextNonSpaceValue(value string, offset int, max int, sb *strings.Builder) (int, error) { - nextValOffset, skippedSpaces, val, err := nextNonSpaceValue(value, offset, max) +func writeFlexibleClockDigits(layoutElem byte, value string, valueOffset int, sb *strings.Builder) (int, error) { + newOffset, skippedSpaces := skipLeadingSpace(value, valueOffset) + if newOffset >= len(value) || value[newOffset] < '0' || value[newOffset] > '9' { + return valueOffset, newLayoutMismatchError(string(layoutElem), value) + } + + end := newOffset + 1 + if end < len(value) && value[end] >= '0' && value[end] <= '9' { + end++ + } + + if skippedSpaces > 0 { + sb.WriteString(strings.Repeat(" ", skippedSpaces)) + } + sb.WriteString(value[newOffset:end]) + return end, nil +} + +func writeNextNonSpaceValue(value string, offset int, max int, layoutElem string, sb *strings.Builder) (int, error) { + nextValOffset, skippedSpaces, val, err := nextNonSpaceValue(value, offset, max, layoutElem) if err != nil { return offset, err } @@ -345,7 +374,7 @@ func writeNextNonSpaceValue(value string, offset int, max int, sb *strings.Build } func writeLayoutValue(layoutElem string, lookupTab, stdTab []string, valueOffset int, value string, sb *strings.Builder) (int, error) { - newOffset, skippedSpaces, foundStdValue, val := lookup(lookupTab, valueOffset, value, stdTab) + newOffset, skippedSpaces, foundStdValue, matched := lookup(lookupTab, valueOffset, value, stdTab) if foundStdValue == "" { return valueOffset, newLayoutMismatchError(layoutElem, value) } @@ -359,51 +388,48 @@ func writeLayoutValue(layoutElem string, lookupTab, stdTab []string, valueOffset return valueOffset, err } - newOffset += len(val) + newOffset += len(matched) return newOffset, nil } -func nextNonSpaceValue(value string, offset int, max int) (newOffset, skippedSpaces int, val string, err error) { +func nextNonSpaceValue(value string, offset int, max int, layoutElem string) (newOffset, skippedSpaces int, foundVal string, err error) { newOffset = offset for newOffset < len(value) && unicode.IsSpace(rune(value[newOffset])) { newOffset++ } skippedSpaces = newOffset - offset - if newOffset > len(value) { - return offset, skippedSpaces, "", errors.New("next non-space value not found") + if newOffset >= len(value) { + return offset, skippedSpaces, "", newLayoutMismatchError(layoutElem, value) } + var sb strings.Builder + sb.Grow(len(value) - newOffset) for newOffset < len(value) { if !unicode.IsSpace(rune(value[newOffset])) { - val += string(value[newOffset]) + sb.WriteByte(value[newOffset]) newOffset++ } else { - return newOffset, skippedSpaces, val, nil + return newOffset, skippedSpaces, sb.String(), nil } - if len(val) == max { - return newOffset, skippedSpaces, val, nil + if sb.Len() == max { + return newOffset, skippedSpaces, sb.String(), nil } } - return newOffset, skippedSpaces, val, nil + return newOffset, skippedSpaces, sb.String(), nil } -func lookup(lookupTab []string, offset int, val string, stdTab []string) (newOffset, skippedSpaces int, stdValue string, value string) { - newOffset = offset - for newOffset < len(val) && unicode.IsSpace(rune(val[newOffset])) { - newOffset++ - } - - skippedSpaces = newOffset - offset - if newOffset > len(val) { - return offset, skippedSpaces, "", val +func lookup(lookupTab []string, offset int, val string, stdTab []string) (newOffset, skippedSpaces int, stdValue string, matched string) { + newOffset, skippedSpaces = skipLeadingSpace(val, offset) + if newOffset >= len(val) { + return newOffset, skippedSpaces, "", val } for i, v := range lookupTab { // Already matched a more specific/longer value - if stdValue != "" && len(v) <= len(value) { + if stdValue != "" && len(v) <= len(matched) { continue } @@ -415,11 +441,19 @@ func lookup(lookupTab []string, offset int, val string, stdTab []string) (newOff candidate := val[newOffset:end] if len(candidate) == len(v) && strings.EqualFold(candidate, v) { stdValue = stdTab[i] - value = candidate + matched = candidate } } - return newOffset, skippedSpaces, stdValue, value + return newOffset, skippedSpaces, stdValue, matched +} + +func skipLeadingSpace(s string, i int) (newI int, skippedBytes int) { + start := i + for i < len(s) && unicode.IsSpace(rune(s[i])) { + i++ + } + return i, i - start } func startsWithLowerCase(value string) bool { @@ -463,7 +497,7 @@ type ErrUnsupportedLayoutElem struct { } func (u *ErrUnsupportedLayoutElem) Error() string { - return fmt.Sprintf(`layout element "%s" is not support by the language "%s"`, u.LayoutElem, u.Language) + return fmt.Sprintf(`layout element "%s" is not supported by the language "%s"`, u.LayoutElem, u.Language) } func (u *ErrUnsupportedLayoutElem) Is(err error) bool { diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.pb.go new file mode 100644 index 00000000000..614bec58151 --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.pb.go @@ -0,0 +1,162 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v7.35.1 +// source: envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.proto + +package http_11_proxyv3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// HTTP/1.1 proxy transport socket establishes an upstream connection to a proxy address +// instead of the target host's address. This behavior is triggered when the transport +// socket is configured and proxy information is provided. +// +// Behavior when proxying: +// ======================= +// When an upstream connection is established, instead of connecting directly to the endpoint +// address, the client will connect to the specified proxy address, send an HTTP/1.1 “CONNECT“ request +// indicating the endpoint address, and process the response. If the response has HTTP status 200, +// the connection will be passed down to the underlying transport socket. +// +// Configuring proxy information: +// ============================== +// Set “typed_filter_metadata“ in :ref:`LbEndpoint.Metadata ` or :ref:`LocalityLbEndpoints.Metadata `. +// using the key “envoy.http11_proxy_transport_socket.proxy_address“ and the +// proxy address in “config::core::v3::Address“ format. +// +// If the “default_proxy_address“ is set and proxy address is not found in +// “typed_filter_metadata“, the default proxy address is used. +type Http11ProxyUpstreamTransport struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The underlying transport socket being wrapped. Defaults to plaintext (raw_buffer) if unset. + TransportSocket *v3.TransportSocket `protobuf:"bytes,1,opt,name=transport_socket,json=transportSocket,proto3" json:"transport_socket,omitempty"` + // Specifies the default proxy address to use if the proxy address is not present in the + // “typed_filter_metadata“ of the endpoint. + DefaultProxyAddress *v3.Address `protobuf:"bytes,2,opt,name=default_proxy_address,json=defaultProxyAddress,proto3" json:"default_proxy_address,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Http11ProxyUpstreamTransport) Reset() { + *x = Http11ProxyUpstreamTransport{} + mi := &file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Http11ProxyUpstreamTransport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Http11ProxyUpstreamTransport) ProtoMessage() {} + +func (x *Http11ProxyUpstreamTransport) ProtoReflect() protoreflect.Message { + mi := &file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Http11ProxyUpstreamTransport.ProtoReflect.Descriptor instead. +func (*Http11ProxyUpstreamTransport) Descriptor() ([]byte, []int) { + return file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDescGZIP(), []int{0} +} + +func (x *Http11ProxyUpstreamTransport) GetTransportSocket() *v3.TransportSocket { + if x != nil { + return x.TransportSocket + } + return nil +} + +func (x *Http11ProxyUpstreamTransport) GetDefaultProxyAddress() *v3.Address { + if x != nil { + return x.DefaultProxyAddress + } + return nil +} + +var File_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto protoreflect.FileDescriptor + +const file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDesc = "" + + "\n" + + "Renvoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.proto\x123envoy.extensions.transport_sockets.http_11_proxy.v3\x1a\"envoy/config/core/v3/address.proto\x1a\x1fenvoy/config/core/v3/base.proto\x1a\x1dudpa/annotations/status.proto\"\xc3\x01\n" + + "\x1cHttp11ProxyUpstreamTransport\x12P\n" + + "\x10transport_socket\x18\x01 \x01(\v2%.envoy.config.core.v3.TransportSocketR\x0ftransportSocket\x12Q\n" + + "\x15default_proxy_address\x18\x02 \x01(\v2\x1d.envoy.config.core.v3.AddressR\x13defaultProxyAddressB\xd5\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" + + "Aio.envoyproxy.envoy.extensions.transport_sockets.http_11_proxy.v3B\x1aUpstreamHttp11ConnectProtoP\x01Zjgithub.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3;http_11_proxyv3b\x06proto3" + +var ( + file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDescOnce sync.Once + file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDescData []byte +) + +func file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDescGZIP() []byte { + file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDescOnce.Do(func() { + file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDesc), len(file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDesc))) + }) + return file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDescData +} + +var file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_goTypes = []any{ + (*Http11ProxyUpstreamTransport)(nil), // 0: envoy.extensions.transport_sockets.http_11_proxy.v3.Http11ProxyUpstreamTransport + (*v3.TransportSocket)(nil), // 1: envoy.config.core.v3.TransportSocket + (*v3.Address)(nil), // 2: envoy.config.core.v3.Address +} +var file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_depIdxs = []int32{ + 1, // 0: envoy.extensions.transport_sockets.http_11_proxy.v3.Http11ProxyUpstreamTransport.transport_socket:type_name -> envoy.config.core.v3.TransportSocket + 2, // 1: envoy.extensions.transport_sockets.http_11_proxy.v3.Http11ProxyUpstreamTransport.default_proxy_address:type_name -> envoy.config.core.v3.Address + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { + file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_init() +} +func file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_init() { + if File_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDesc), len(file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_goTypes, + DependencyIndexes: file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_depIdxs, + MessageInfos: file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_msgTypes, + }.Build() + File_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto = out.File + file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_goTypes = nil + file_envoy_extensions_transport_sockets_http_11_proxy_v3_upstream_http_11_connect_proto_depIdxs = nil +} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.pb.validate.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.pb.validate.go new file mode 100644 index 00000000000..b795a3cff1d --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.pb.validate.go @@ -0,0 +1,198 @@ +//go:build !disable_pgv +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.proto + +package http_11_proxyv3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Http11ProxyUpstreamTransport with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *Http11ProxyUpstreamTransport) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Http11ProxyUpstreamTransport with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// Http11ProxyUpstreamTransportMultiError, or nil if none found. +func (m *Http11ProxyUpstreamTransport) ValidateAll() error { + return m.validate(true) +} + +func (m *Http11ProxyUpstreamTransport) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetTransportSocket()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Http11ProxyUpstreamTransportValidationError{ + field: "TransportSocket", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Http11ProxyUpstreamTransportValidationError{ + field: "TransportSocket", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTransportSocket()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Http11ProxyUpstreamTransportValidationError{ + field: "TransportSocket", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetDefaultProxyAddress()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Http11ProxyUpstreamTransportValidationError{ + field: "DefaultProxyAddress", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Http11ProxyUpstreamTransportValidationError{ + field: "DefaultProxyAddress", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDefaultProxyAddress()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Http11ProxyUpstreamTransportValidationError{ + field: "DefaultProxyAddress", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return Http11ProxyUpstreamTransportMultiError(errors) + } + + return nil +} + +// Http11ProxyUpstreamTransportMultiError is an error wrapping multiple +// validation errors returned by Http11ProxyUpstreamTransport.ValidateAll() if +// the designated constraints aren't met. +type Http11ProxyUpstreamTransportMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Http11ProxyUpstreamTransportMultiError) Error() string { + msgs := make([]string, 0, len(m)) + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m Http11ProxyUpstreamTransportMultiError) AllErrors() []error { return m } + +// Http11ProxyUpstreamTransportValidationError is the validation error returned +// by Http11ProxyUpstreamTransport.Validate if the designated constraints +// aren't met. +type Http11ProxyUpstreamTransportValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Http11ProxyUpstreamTransportValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Http11ProxyUpstreamTransportValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Http11ProxyUpstreamTransportValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Http11ProxyUpstreamTransportValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Http11ProxyUpstreamTransportValidationError) ErrorName() string { + return "Http11ProxyUpstreamTransportValidationError" +} + +// Error satisfies the builtin error interface +func (e Http11ProxyUpstreamTransportValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sHttp11ProxyUpstreamTransport.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Http11ProxyUpstreamTransportValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Http11ProxyUpstreamTransportValidationError{} diff --git a/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect_vtproto.pb.go b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect_vtproto.pb.go new file mode 100644 index 00000000000..d692a0c6ddb --- /dev/null +++ b/vendor/github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect_vtproto.pb.go @@ -0,0 +1,127 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.proto + +package http_11_proxyv3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *Http11ProxyUpstreamTransport) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Http11ProxyUpstreamTransport) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *Http11ProxyUpstreamTransport) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.DefaultProxyAddress != nil { + if vtmsg, ok := interface{}(m.DefaultProxyAddress).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.DefaultProxyAddress) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x12 + } + if m.TransportSocket != nil { + if vtmsg, ok := interface{}(m.TransportSocket).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.TransportSocket) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Http11ProxyUpstreamTransport) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TransportSocket != nil { + if size, ok := interface{}(m.TransportSocket).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.TransportSocket) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.DefaultProxyAddress != nil { + if size, ok := interface{}(m.DefaultProxyAddress).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(m.DefaultProxyAddress) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} diff --git a/vendor/github.com/foxboron/go-tpm-keyfiles/der.go b/vendor/github.com/foxboron/go-tpm-keyfiles/der.go index 40c733d0773..d13b3ada03a 100644 --- a/vendor/github.com/foxboron/go-tpm-keyfiles/der.go +++ b/vendor/github.com/foxboron/go-tpm-keyfiles/der.go @@ -17,7 +17,7 @@ var ( // id-tpmkey OBJECT IDENTIFIER ::= // {joint-iso-itu-t(2) international-organizations(23) 133 10 1} // Probably not used, but here for reference - oidTPMKey = encasn1.ObjectIdentifier{2, 23, 133, 10, 2} + // oidTPMKey = encasn1.ObjectIdentifier{2, 23, 133, 10, 2} OIDOldLoadableKey = encasn1.ObjectIdentifier{2, 23, 133, 10, 2} @@ -278,7 +278,6 @@ func Marshal(key *TPMKey) []byte { var b cryptobyte.Builder b.AddASN1(asn1.SEQUENCE, func(b *cryptobyte.Builder) { - b.AddASN1ObjectIdentifier(key.Keytype) if key.EmptyAuth { diff --git a/vendor/github.com/foxboron/go-tpm-keyfiles/importablekey.go b/vendor/github.com/foxboron/go-tpm-keyfiles/importablekey.go index 869922ccc3e..f435f2479b4 100644 --- a/vendor/github.com/foxboron/go-tpm-keyfiles/importablekey.go +++ b/vendor/github.com/foxboron/go-tpm-keyfiles/importablekey.go @@ -2,116 +2,42 @@ package keyfile import ( "bytes" - "crypto" - "crypto/aes" - "crypto/cipher" + "crypto/ecdh" "crypto/ecdsa" - "crypto/elliptic" - "crypto/hmac" "crypto/rand" "crypto/rsa" "fmt" - "hash" - "math/big" "github.com/foxboron/go-tpm-keyfiles/template" "github.com/google/go-tpm/tpm2" "github.com/google/go-tpm/tpm2/transport" ) -// ECC coordinates need to maintain a specific size based on the curve, so we pad the front with zeros. -// This is particularly an issue for NIST-P521 coordinates, as they are frequently missing their first byte. -func eccIntToBytes(curve elliptic.Curve, i *big.Int) []byte { - bytes := i.Bytes() - curveBytes := (curve.Params().BitSize + 7) / 8 - return append(make([]byte, curveBytes-len(bytes)), bytes...) -} - -func createECCSeed(pub *tpm2.TPMTPublic) (seed, encryptedSeed []byte, err error) { - curve := elliptic.P256() - - // We need access to the values so we don't use ecdh to generate the key - priv, x, y, err := elliptic.GenerateKey(curve, rand.Reader) - if err != nil { - return nil, nil, err - } - privKey := &ecdsa.PrivateKey{ - PublicKey: ecdsa.PublicKey{ - Curve: elliptic.P256(), - X: new(big.Int).SetBytes(x.Bytes()), - Y: new(big.Int).SetBytes(y.Bytes()), - }, - D: new(big.Int).SetBytes(priv), - } - privKeyECDH, err := privKey.ECDH() - if err != nil { - return nil, nil, fmt.Errorf("failed creating ecdh key: %v", err) - } - - ecc, err := pub.Unique.ECC() - if err != nil { - return nil, nil, fmt.Errorf("failed getting ECC values from public: %v", err) - } - - if len(ecc.X.Buffer) == 0 || len(ecc.Y.Buffer) == 0 { - return nil, nil, fmt.Errorf("public TPM2TPublic does not have a valid ECC public key") - } - - pubKey := &ecdsa.PublicKey{ - Curve: elliptic.P256(), - X: new(big.Int).SetBytes(ecc.X.Buffer), - Y: new(big.Int).SetBytes(ecc.Y.Buffer), - } - - pubkeyECDH, err := pubKey.ECDH() - if err != nil { - return nil, nil, fmt.Errorf("failed getting ECDH from produced public key: %v", err) - } - - z, _ := privKeyECDH.ECDH(pubkeyECDH) - xBytes := eccIntToBytes(curve, x) - seed = tpm2.KDFe( - crypto.SHA256, - z, - "DUPLICATE", - xBytes, - eccIntToBytes(curve, pubKey.X), - crypto.SHA256.Size()*8) - - encryptedSeed = tpm2.Marshal(tpm2.TPMSECCPoint{ - X: tpm2.TPM2BECCParameter{Buffer: x.FillBytes(make([]byte, len(x.Bytes())))}, - Y: tpm2.TPM2BECCParameter{Buffer: y.FillBytes(make([]byte, len(y.Bytes())))}, - }) - - return seed, encryptedSeed, err -} - -func createWrap(pub *tpm2.TPMTPublic, pk any, userauth []byte) (tpm2.TPM2BPublic, []byte, []byte, error) { - var err error - var seed []byte - var encryptedSeed []byte - - switch pub.Type { - case tpm2.TPMAlgECC: - seed, encryptedSeed, err = createECCSeed(pub) - if err != nil { - return tpm2.TPM2BPublic{}, nil, nil, err - } - default: - return tpm2.TPM2BPublic{}, nil, nil, fmt.Errorf("only support ECC parents for import wrapping: %v", pub.Type) - } - +func makeSealedBlob(pk any, userauth []byte) (*tpm2.TPMTPublic, []byte, error) { var public *tpm2.TPMTPublic var sensitive tpm2.TPMTSensitive switch pk := pk.(type) { case ecdsa.PrivateKey: public = template.EcdsaToTPMTPublic(&pk.PublicKey, tpm2.TPMAlgSHA256) + bb, err := pk.Bytes() + if err != nil { + return nil, nil, err + } + sensitive = tpm2.TPMTSensitive{ + SensitiveType: tpm2.TPMAlgECC, + Sensitive: tpm2.NewTPMUSensitiveComposite( + tpm2.TPMAlgECC, + &tpm2.TPM2BECCParameter{Buffer: bb}, + ), + } + case ecdh.PrivateKey: + public = template.ECDHToTPMTPublic(pk.PublicKey(), tpm2.TPMAlgSHA256) sensitive = tpm2.TPMTSensitive{ SensitiveType: tpm2.TPMAlgECC, Sensitive: tpm2.NewTPMUSensitiveComposite( tpm2.TPMAlgECC, - &tpm2.TPM2BECCParameter{Buffer: pk.D.FillBytes(make([]byte, len(pk.D.Bytes())))}, + &tpm2.TPM2BECCParameter{Buffer: pk.Bytes()}, ), } case rsa.PrivateKey: @@ -133,63 +59,34 @@ func createWrap(pub *tpm2.TPMTPublic, pk any, userauth []byte) (tpm2.TPM2BPublic } } - sens2B := tpm2.Marshal(sensitive) - sens2B = tpm2.Marshal(tpm2.TPM2BPrivate{Buffer: sens2B}) + return public, tpm2.Marshal(sensitive), nil +} - b2name, err := tpm2.ObjectName(public) +func NewImportablekey(rempub *tpm2.TPMTPublic, pk any, fn ...TPMKeyOption) (*TPMKey, error) { + key := NewTPMKey(OIDImportableKey, tpm2.TPM2BPublic{}, tpm2.TPM2BPrivate{}, fn...) + + pub, sensitive, err := makeSealedBlob(pk, key.userAuth) if err != nil { - return tpm2.TPM2BPublic{}, nil, nil, err + return nil, err } - // AES symm encryption key - symmetricKey := tpm2.KDFa( - crypto.SHA256, - seed, - "STORAGE", - b2name.Buffer, - /*contextV=*/ nil, - 128) + kem, err := tpm2.ImportEncapsulationKey(rempub) + if err != nil { + return nil, err + } - c, err := aes.NewCipher(symmetricKey) + name, err := tpm2.ObjectName(pub) if err != nil { - return tpm2.TPM2BPublic{}, nil, nil, err + return nil, err } - encryptedSecret := make([]byte, len(sens2B)) - // The TPM spec requires an all-zero IV. - iv := make([]byte, len(symmetricKey)) - cipher.NewCFBEncrypter(c, iv).XORKeyStream(encryptedSecret, sens2B) - - macKey := tpm2.KDFa( - crypto.SHA256, - seed, - "INTEGRITY", - /*contextU=*/ nil, - /*contextV=*/ nil, - crypto.SHA256.Size()*8) - - mac := hmac.New(func() hash.Hash { return crypto.SHA256.New() }, macKey) - mac.Write(encryptedSecret) - mac.Write(b2name.Buffer) - - hmacSum := mac.Sum(nil) - - // The duplicate structure is a sized TPM2BPrivate for the Digest - // and a encrypted secret which is read based off on the size - // of the encrypted metadata. - dup := tpm2.Marshal(tpm2.TPM2BPrivate{Buffer: hmacSum}) - dup = append(dup, encryptedSecret...) - - return tpm2.New2B(*public), dup, encryptedSeed, nil -} -func NewImportablekey(rempub *tpm2.TPMTPublic, pk any, fn ...TPMKeyOption) (*TPMKey, error) { - key := NewTPMKey(OIDImportableKey, tpm2.TPM2BPublic{}, tpm2.TPM2BPrivate{}, fn...) - pub, dup, encSeed, err := createWrap(rempub, pk, key.userAuth) + dup, encSeed, err := tpm2.CreateDuplicate(rand.Reader, kem, name.Buffer, sensitive) if err != nil { return nil, err } + key.AddOptions( - WithPubkey(pub), + WithPubkey(tpm2.New2B(*pub)), WithPrivkey(tpm2.TPM2BPrivate{Buffer: dup}), WithSecret(tpm2.TPM2BEncryptedSecret{Buffer: encSeed}), ) diff --git a/vendor/github.com/foxboron/go-tpm-keyfiles/keyfile.go b/vendor/github.com/foxboron/go-tpm-keyfiles/keyfile.go index b412c695fad..57b6cad34b9 100644 --- a/vendor/github.com/foxboron/go-tpm-keyfiles/keyfile.go +++ b/vendor/github.com/foxboron/go-tpm-keyfiles/keyfile.go @@ -3,13 +3,11 @@ package keyfile import ( "bytes" "crypto" - "crypto/ecdh" "crypto/ecdsa" "crypto/rsa" encasn1 "encoding/asn1" "fmt" - "github.com/foxboron/go-tpm-keyfiles/template" "github.com/google/go-tpm/tpm2" "github.com/google/go-tpm/tpm2/transport" ) @@ -110,7 +108,7 @@ func (t *TPMKey) Bytes() []byte { // PublicKey returns the ecdsa.Publickey or rsa.Publickey of the TPMKey func (t *TPMKey) PublicKey() (crypto.PublicKey, error) { - return template.FromTPMPublicToPubkey(t.contents()) + return tpm2.Pub(*t.contents()) } // Wraps TPMSigner with some sane defaults @@ -145,10 +143,3 @@ func (t *TPMKey) Verify(alg crypto.Hash, hashed []byte, sig []byte) (bool, error } return true, nil } - -func (t *TPMKey) Derive(tpm transport.TPMCloser, sessionkey *ecdh.PublicKey, ownerAuth, auth []byte) ([]byte, error) { - // TODO: This should only be available for ECC keys - sess := NewTPMSession(tpm) - defer sess.FlushHandle() - return DeriveECDH(sess, t, sessionkey, ownerAuth, auth) -} diff --git a/vendor/github.com/foxboron/go-tpm-keyfiles/signer.go b/vendor/github.com/foxboron/go-tpm-keyfiles/signer.go index b82e4b89d41..7856f5207bc 100644 --- a/vendor/github.com/foxboron/go-tpm-keyfiles/signer.go +++ b/vendor/github.com/foxboron/go-tpm-keyfiles/signer.go @@ -52,6 +52,18 @@ func (t *TPMKeySigner) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpts) } switch opts.HashFunc() { + case 0: + // p11-kit sends us hashfunc 0 but we can infer from length the correct hash + switch len(digest) { + case 32: + digestalg = tpm2.TPMAlgSHA256 + case 48: + digestalg = tpm2.TPMAlgSHA384 + case 64: + digestalg = tpm2.TPMAlgSHA512 + default: + return nil, fmt.Errorf("%s is not a supported hashing algorithm", opts.HashFunc()) + } case crypto.SHA256: digestalg = tpm2.TPMAlgSHA256 case crypto.SHA384: @@ -65,7 +77,7 @@ func (t *TPMKeySigner) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpts) signalg = t.key.KeyAlgo() if _, ok := opts.(*rsa.PSSOptions); ok { if signalg != tpm2.TPMAlgRSA { - return nil, fmt.Errorf("Attempting to use PSSOptions with non-RSA (alg %x) key", signalg) + return nil, fmt.Errorf("attempting to use PSSOptions with non-RSA (alg %x) key", signalg) } signalg = tpm2.TPMAlgRSAPSS } @@ -128,7 +140,7 @@ func (t *TPMHandleSigner) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpt signalg = t.keyAlgo if _, ok := opts.(*rsa.PSSOptions); ok { if signalg != tpm2.TPMAlgRSA { - return nil, fmt.Errorf("Attempting to use PSSOptions with non-RSA (alg %x) key", signalg) + return nil, fmt.Errorf("attempting to use PSSOptions with non-RSA (alg %x) key", signalg) } signalg = tpm2.TPMAlgRSAPSS } diff --git a/vendor/github.com/foxboron/go-tpm-keyfiles/template/template.go b/vendor/github.com/foxboron/go-tpm-keyfiles/template/template.go index d579f87dec5..67526f44490 100644 --- a/vendor/github.com/foxboron/go-tpm-keyfiles/template/template.go +++ b/vendor/github.com/foxboron/go-tpm-keyfiles/template/template.go @@ -1,26 +1,30 @@ package template import ( - "crypto" + "crypto/ecdh" "crypto/ecdsa" - "crypto/elliptic" "crypto/rsa" + "crypto/x509" + "encoding/pem" "fmt" - "math/big" "github.com/google/go-tpm/tpm2" ) -func EcdsaToTPMTPublic(pubkey *ecdsa.PublicKey, sha tpm2.TPMAlgID) *tpm2.TPMTPublic { +func ECDHToTPMTPublic(pubkey *ecdh.PublicKey, sha tpm2.TPMAlgID) *tpm2.TPMTPublic { var ecc tpm2.TPMECCCurve - switch pubkey.Curve { - case elliptic.P256(): + switch pubkey.Curve() { + case ecdh.P256(): ecc = tpm2.TPMECCNistP256 - case elliptic.P384(): + case ecdh.P384(): ecc = tpm2.TPMECCNistP384 - case elliptic.P521(): + case ecdh.P521(): ecc = tpm2.TPMECCNistP521 } + x, y, err := tpm2.ECCPoint(pubkey) + if err != nil { + panic(err) + } return &tpm2.TPMTPublic{ Type: tpm2.TPMAlgECC, NameAlg: sha, @@ -42,16 +46,24 @@ func EcdsaToTPMTPublic(pubkey *ecdsa.PublicKey, sha tpm2.TPMAlgID) *tpm2.TPMTPub tpm2.TPMAlgECC, &tpm2.TPMSECCPoint{ X: tpm2.TPM2BECCParameter{ - Buffer: pubkey.X.FillBytes(make([]byte, len(pubkey.X.Bytes()))), + Buffer: x.Bytes(), }, Y: tpm2.TPM2BECCParameter{ - Buffer: pubkey.Y.FillBytes(make([]byte, len(pubkey.Y.Bytes()))), + Buffer: y.Bytes(), }, }, ), } } +func EcdsaToTPMTPublic(pubkey *ecdsa.PublicKey, sha tpm2.TPMAlgID) *tpm2.TPMTPublic { + pk, err := pubkey.ECDH() + if err != nil { + panic(err) + } + return ECDHToTPMTPublic(pk, sha) +} + func RSAToTPMTPublic(pubkey *rsa.PublicKey, bits int) *tpm2.TPMTPublic { return &tpm2.TPMTPublic{ Type: tpm2.TPMAlgRSA, @@ -77,59 +89,66 @@ func RSAToTPMTPublic(pubkey *rsa.PublicKey, bits int) *tpm2.TPMTPublic { } } -func fromTPMPublicToECDSA(pub *tpm2.TPMTPublic) (*ecdsa.PublicKey, error) { - ecc, err := pub.Unique.ECC() +func ECDSAToSRK(pubkey *ecdsa.PublicKey, sha tpm2.TPMAlgID) *tpm2.TPMTPublic { + pk, err := pubkey.ECDH() if err != nil { - return nil, err + panic(err) } + return ECDHToSRK(pk, sha) +} - eccdeets, err := pub.Parameters.ECCDetail() +func ECDHToSRK(pubkey *ecdh.PublicKey, sha tpm2.TPMAlgID) *tpm2.TPMTPublic { + x, y, err := tpm2.ECCPoint(pubkey) if err != nil { - return nil, err + panic(err) } + tmpl := tpm2.ECCSRKTemplate + tmpl.Unique = tpm2.NewTPMUPublicID( + tpm2.TPMAlgECC, + &tpm2.TPMSECCPoint{ + X: tpm2.TPM2BECCParameter{ + Buffer: x.Bytes(), + }, + Y: tpm2.TPM2BECCParameter{ + Buffer: y.Bytes(), + }, + }, + ) + return &tmpl +} - var ecdsaKey *ecdsa.PublicKey - - switch eccdeets.CurveID { - case tpm2.TPMECCNistP256: - ecdsaKey = &ecdsa.PublicKey{Curve: elliptic.P256(), - X: big.NewInt(0).SetBytes(ecc.X.Buffer), - Y: big.NewInt(0).SetBytes(ecc.Y.Buffer), - } - case tpm2.TPMECCNistP384: - ecdsaKey = &ecdsa.PublicKey{Curve: elliptic.P384(), - X: big.NewInt(0).SetBytes(ecc.X.Buffer), - Y: big.NewInt(0).SetBytes(ecc.Y.Buffer), - } - case tpm2.TPMECCNistP521: - ecdsaKey = &ecdsa.PublicKey{Curve: elliptic.P521(), - X: big.NewInt(0).SetBytes(ecc.X.Buffer), - Y: big.NewInt(0).SetBytes(ecc.Y.Buffer), - } - } - return ecdsaKey, nil +func RSAToSRK(pubkey *rsa.PublicKey, _ int) *tpm2.TPMTPublic { + // TODO: Use bits + tmpl := tpm2.RSASRKTemplate + tmpl.Unique = tpm2.NewTPMUPublicID( + tpm2.TPMAlgRSA, + &tpm2.TPM2BPublicKeyRSA{Buffer: pubkey.N.Bytes()}, + ) + return &tmpl } -func fromTPMPublicToRSA(pub *tpm2.TPMTPublic) (*rsa.PublicKey, error) { - rsaDetail, err := pub.Parameters.RSADetail() - if err != nil { - return nil, fmt.Errorf("failed getting rsa details: %v", err) +// PublicToSRK turns a simple public key to the assumed SRK public template +func PublicToSRK(pKey []byte) (*tpm2.TPMTPublic, error) { + block, _ := pem.Decode([]byte(pKey)) + + if block == nil || block.Type != "PUBLIC KEY" { + return nil, fmt.Errorf("failed to decode PEM block containing public key") } - rsaUnique, err := pub.Unique.RSA() + + key, err := x509.ParsePKIXPublicKey(block.Bytes) if err != nil { - return nil, fmt.Errorf("failed getting unique rsa: %v", err) + return nil, fmt.Errorf("failed parsing pem key: %v", err) } - return tpm2.RSAPub(rsaDetail, rsaUnique) -} - -// FromTPMPublicToPubkey transform a tpm2.TPMTPublic to crypto.PublicKey -func FromTPMPublicToPubkey(pub *tpm2.TPMTPublic) (crypto.PublicKey, error) { - switch pub.Type { - case tpm2.TPMAlgECC: - return fromTPMPublicToECDSA(pub) - case tpm2.TPMAlgRSA: - return fromTPMPublicToRSA(pub) + switch p := key.(type) { + case *ecdsa.PublicKey: + return ECDSAToSRK(p, tpm2.TPMAlgSHA256), nil + case *ecdh.PublicKey: + return ECDHToSRK(p, tpm2.TPMAlgSHA256), nil + case *rsa.PublicKey: + // TODO: Support other bit lengths + return RSAToSRK(p, 2048), nil + default: + return nil, fmt.Errorf("unsupported keytype") } - return nil, fmt.Errorf("no a supported public key") } diff --git a/vendor/github.com/foxboron/go-tpm-keyfiles/tpm.go b/vendor/github.com/foxboron/go-tpm-keyfiles/tpm.go index 5180c4c5530..27862fe653e 100644 --- a/vendor/github.com/foxboron/go-tpm-keyfiles/tpm.go +++ b/vendor/github.com/foxboron/go-tpm-keyfiles/tpm.go @@ -3,77 +3,67 @@ package keyfile import ( "bytes" "crypto" - "crypto/ecdh" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rsa" - "crypto/sha256" "errors" "fmt" - "io" "slices" "github.com/google/go-tpm/tpm2" "github.com/google/go-tpm/tpm2/transport" - "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/cryptobyte" "golang.org/x/crypto/cryptobyte/asn1" - "golang.org/x/crypto/hkdf" ) -var ( - // If a permanent handle (MSO 0x40) is specified then the implementation MUST run - // TPM2_CreatePrimary on the handle using the TCG specified Elliptic Curve - // template [TCG-Provision] (section 7.5.1 for the Storage and other seeds or - // 7.4.1 for the endorsement seed) which refers to the TCG EK Credential Profile - // [TCG-EK-Profile] . Since there are several possible templates, implementations - // MUST always use the H template (the one with zero size unique fields). The - // template used MUST be H-2 (EK Credential Profile section B.4.5) for the NIST - // P-256 curve if rsaParent is absent or the H-1 (EK Credential Profile section - // B.4.4) RSA template with a key length of 2048 if rsaParent is present and true - // and use the primary key so generated as the parent. - ECCSRK_H2_Template = tpm2.TPMTPublic{ - Type: tpm2.TPMAlgECC, - NameAlg: tpm2.TPMAlgSHA256, - ObjectAttributes: tpm2.TPMAObject{ - FixedTPM: true, - FixedParent: true, - SensitiveDataOrigin: true, - UserWithAuth: true, - NoDA: true, - Restricted: true, - Decrypt: true, +// If a permanent handle (MSO 0x40) is specified then the implementation MUST run +// TPM2_CreatePrimary on the handle using the TCG specified Elliptic Curve +// template [TCG-Provision] (section 7.5.1 for the Storage and other seeds or +// 7.4.1 for the endorsement seed) which refers to the TCG EK Credential Profile +// [TCG-EK-Profile] . Since there are several possible templates, implementations +// MUST always use the H template (the one with zero size unique fields). The +// template used MUST be H-2 (EK Credential Profile section B.4.5) for the NIST +// P-256 curve if rsaParent is absent or the H-1 (EK Credential Profile section +// B.4.4) RSA template with a key length of 2048 if rsaParent is present and true +// and use the primary key so generated as the parent. +var ECCSRK_H2_Template = tpm2.TPMTPublic{ + Type: tpm2.TPMAlgECC, + NameAlg: tpm2.TPMAlgSHA256, + ObjectAttributes: tpm2.TPMAObject{ + FixedTPM: true, + FixedParent: true, + SensitiveDataOrigin: true, + UserWithAuth: true, + NoDA: true, + Restricted: true, + Decrypt: true, + }, + Parameters: tpm2.NewTPMUPublicParms( + tpm2.TPMAlgECC, + &tpm2.TPMSECCParms{ + Symmetric: tpm2.TPMTSymDefObject{ + Algorithm: tpm2.TPMAlgAES, + KeyBits: tpm2.NewTPMUSymKeyBits( + tpm2.TPMAlgAES, + tpm2.TPMKeyBits(128), + ), + Mode: tpm2.NewTPMUSymMode( + tpm2.TPMAlgAES, + tpm2.TPMAlgCFB, + ), + }, + CurveID: tpm2.TPMECCNistP256, }, - Parameters: tpm2.NewTPMUPublicParms( - tpm2.TPMAlgECC, - &tpm2.TPMSECCParms{ - Symmetric: tpm2.TPMTSymDefObject{ - Algorithm: tpm2.TPMAlgAES, - KeyBits: tpm2.NewTPMUSymKeyBits( - tpm2.TPMAlgAES, - tpm2.TPMKeyBits(128), - ), - Mode: tpm2.NewTPMUSymMode( - tpm2.TPMAlgAES, - tpm2.TPMAlgCFB, - ), - }, - CurveID: tpm2.TPMECCNistP256, + ), + Unique: tpm2.NewTPMUPublicID( + tpm2.TPMAlgECC, + &tpm2.TPMSECCPoint{ + X: tpm2.TPM2BECCParameter{ + Buffer: make([]byte, 0), }, - ), - Unique: tpm2.NewTPMUPublicID( - tpm2.TPMAlgECC, - &tpm2.TPMSECCPoint{ - X: tpm2.TPM2BECCParameter{ - Buffer: make([]byte, 0), - }, - Y: tpm2.TPM2BECCParameter{ - Buffer: make([]byte, 0), - }, + Y: tpm2.TPM2BECCParameter{ + Buffer: make([]byte, 0), }, - ), - } -) + }, + ), +} // This is a helper to deal with TPM Session encryption. type TPMSession struct { @@ -368,7 +358,6 @@ func Sign(sess *TPMSession, key *TPMKey, ownerauth, auth, digest []byte, digesta } func TPMSign(tpm transport.TPMCloser, handle handle, digest []byte, digestalgo tpm2.TPMAlgID, keysize int, keyalgo tpm2.TPMAlgID, sess ...tpm2.Session) (*tpm2.TPMTSignature, error) { - // Seperate function to include our own sigscheme? var sigscheme tpm2.TPMTSigScheme switch keyalgo { @@ -379,7 +368,7 @@ func TPMSign(tpm transport.TPMCloser, handle handle, digest []byte, digestalgo t case tpm2.TPMAlgRSAPSS: sigscheme = newRSAPSSSigScheme(digestalgo) default: - return nil, fmt.Errorf("Unexpected key algorithm 0x%x", keyalgo) + return nil, fmt.Errorf("unexpected key algorithm 0x%x", keyalgo) } // If we encounter RSA with SHA512 keys we use TPM_Decrypt to sign @@ -388,7 +377,7 @@ func TPMSign(tpm transport.TPMCloser, handle handle, digest []byte, digestalgo t // TODO: Refactor this part // Taken from crypto/rsa pkcsPadding := func(hashed []byte, privkeySize int, h crypto.Hash) []byte { - var hashPrefixes = map[crypto.Hash][]byte{ + hashPrefixes := map[crypto.Hash][]byte{ crypto.SHA256: {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20}, crypto.SHA384: {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30}, crypto.SHA512: {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40}, @@ -484,7 +473,7 @@ type handle interface { // Helper to flush handles func FlushHandle(tpm transport.TPM, h handle) { - //TODO: We should probably handle the error here + // TODO: We should probably handle the error here flushSrk := tpm2.FlushContext{FlushHandle: h} flushSrk.Execute(tpm) } @@ -694,84 +683,3 @@ func ChangeAuth(tpm transport.TPMCloser, ownerauth []byte, key *TPMKey, oldpin, return nil } - -const p256Label = "github.com/foxboron/go-tpm-keyfile/v1/p256" - -func kdf(sharedKey, publicKey *ecdh.PublicKey, shared []byte) ([]byte, error) { - // NOTE: - // This should probably be compatible with whatever openssl is doing, - // but I have no clue. So this is just what age is doing for figuring out - // shared tokens - sharedKeyB := sharedKey.Bytes() - publicKeyB := publicKey.Bytes() - - // We use the concatinated bytes of the shared key and the public key for the - // key derivative functions. - salt := make([]byte, 0, len(sharedKeyB)+len(publicKeyB)) - salt = append(salt, sharedKeyB...) - salt = append(salt, publicKeyB...) - - h := hkdf.New(sha256.New, shared, salt, []byte(p256Label)) - wrappingKey := make([]byte, chacha20poly1305.KeySize) - if _, err := io.ReadFull(h, wrappingKey); err != nil { - return nil, err - } - return wrappingKey, nil -} - -func DeriveECDH(sess *TPMSession, key *TPMKey, sessionkey *ecdh.PublicKey, ownerauth, auth []byte) ([]byte, error) { - var publickey *ecdh.PublicKey - pubkey, err := key.PublicKey() - if err != nil { - return nil, fmt.Errorf("failed getting pubkey: %v", err) - } - switch pk := pubkey.(type) { - case *ecdsa.PublicKey: - publickey, err = pk.ECDH() - if err != nil { - return nil, fmt.Errorf("can't get ecdh key") - } - case *rsa.PublicKey: - return nil, fmt.Errorf("only ecdh key scan use DeriveECDH") - } - - parenthandle, err := GetParentHandle(sess, key.Parent, ownerauth) - if err != nil { - return nil, err - } - defer sess.FlushHandle() - - handle, err := LoadKeyWithParent(sess, *parenthandle, key) - if err != nil { - return nil, err - } - defer FlushHandle(sess.GetTPM(), handle) - - if len(auth) != 0 { - handle.Auth = tpm2.PasswordAuth(auth) - } - - x, y := elliptic.Unmarshal(elliptic.P256(), sessionkey.Bytes()) - - // ECDHZGen command for the TPM, turns the sesion key into something we understand. - ecdhRsp, err := tpm2.ECDHZGen{ - KeyHandle: *handle, - InPoint: tpm2.New2B( - tpm2.TPMSECCPoint{ - X: tpm2.TPM2BECCParameter{Buffer: x.FillBytes(make([]byte, 32))}, - Y: tpm2.TPM2BECCParameter{Buffer: y.FillBytes(make([]byte, 32))}, - }, - ), - }.Execute(sess.GetTPM(), sess.GetHMAC()) - if err != nil { - fmt.Println("here") - return nil, err - } - - shared, err := ecdhRsp.OutPoint.Contents() - if err != nil { - return nil, fmt.Errorf("failed getting ecdh point: %v", err) - } - - return kdf(sessionkey, publickey, shared.X.Buffer) -} diff --git a/vendor/github.com/fxamacker/cbor/v2/.golangci.yml b/vendor/github.com/fxamacker/cbor/v2/.golangci.yml index 38cb9ae101b..08081fbde50 100644 --- a/vendor/github.com/fxamacker/cbor/v2/.golangci.yml +++ b/vendor/github.com/fxamacker/cbor/v2/.golangci.yml @@ -1,104 +1,116 @@ -# Do not delete linter settings. Linters like gocritic can be enabled on the command line. - -linters-settings: - depguard: - rules: - prevent_unmaintained_packages: - list-mode: strict - files: - - $all - - "!$test" - allow: - - $gostd - - github.com/x448/float16 - deny: - - pkg: io/ioutil - desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil" - dupl: - threshold: 100 - funlen: - lines: 100 - statements: 50 - goconst: - ignore-tests: true - min-len: 2 - min-occurrences: 3 - gocritic: - enabled-tags: - - diagnostic - - experimental - - opinionated - - performance - - style - disabled-checks: - - commentedOutCode - - dupImport # https://github.com/go-critic/go-critic/issues/845 - - ifElseChain - - octalLiteral - - paramTypeCombine - - whyNoLint - gofmt: - simplify: false - goimports: - local-prefixes: github.com/fxamacker/cbor - golint: - min-confidence: 0 - govet: - check-shadowing: true - lll: - line-length: 140 - maligned: - suggest-new: true - misspell: - locale: US - staticcheck: - checks: ["all"] - +version: "2" linters: - disable-all: true + default: none enable: - asciicheck - bidichk - depguard - errcheck - - exportloopref + - forbidigo - goconst - gocritic - gocyclo - - gofmt - - goimports - goprintffuncname - gosec - - gosimple - govet - ineffassign - misspell - nilerr - revive - staticcheck - - stylecheck - - typecheck - unconvert - unused - + settings: + depguard: + rules: + prevent_unmaintained_packages: + list-mode: strict + files: + - $all + - '!$test' + allow: + - $gostd + - github.com/x448/float16 + deny: + - pkg: io/ioutil + desc: 'replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil' + dupl: + threshold: 100 + funlen: + lines: 100 + statements: 50 + goconst: + min-len: 2 + min-occurrences: 3 + gocritic: + disabled-checks: + - commentedOutCode + - dupImport + - ifElseChain + - octalLiteral + - paramTypeCombine + - whyNoLint + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + govet: + enable: + - shadow + lll: + line-length: 140 + misspell: + locale: US + staticcheck: + checks: + - all + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - path: decode.go + text: string ` overflows ` has (\d+) occurrences, make it a constant + - path: decode.go + text: string ` \(range is \[` has (\d+) occurrences, make it a constant + - path: decode.go + text: string `, ` has (\d+) occurrences, make it a constant + - path: decode.go + text: string ` overflows Go's int64` has (\d+) occurrences, make it a constant + - path: decode.go + text: string `\]\)` has (\d+) occurrences, make it a constant + - path: valid.go + text: string ` for type ` has (\d+) occurrences, make it a constant + - path: valid.go + text: 'string `cbor: ` has (\d+) occurrences, make it a constant' + - linters: + - goconst + path: (.+)_test\.go + paths: + - third_party$ + - builtin$ + - examples$ issues: - # max-issues-per-linter default is 50. Set to 0 to disable limit. max-issues-per-linter: 0 - # max-same-issues default is 3. Set to 0 to disable limit. max-same-issues: 0 - - exclude-rules: - - path: decode.go - text: "string ` overflows ` has (\\d+) occurrences, make it a constant" - - path: decode.go - text: "string ` \\(range is \\[` has (\\d+) occurrences, make it a constant" - - path: decode.go - text: "string `, ` has (\\d+) occurrences, make it a constant" - - path: decode.go - text: "string ` overflows Go's int64` has (\\d+) occurrences, make it a constant" - - path: decode.go - text: "string `\\]\\)` has (\\d+) occurrences, make it a constant" - - path: valid.go - text: "string ` for type ` has (\\d+) occurrences, make it a constant" - - path: valid.go - text: "string `cbor: ` has (\\d+) occurrences, make it a constant" +formatters: + enable: + - gofmt + - goimports + settings: + gofmt: + simplify: false + goimports: + local-prefixes: + - github.com/fxamacker/cbor + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/vendor/github.com/fxamacker/cbor/v2/README.md b/vendor/github.com/fxamacker/cbor/v2/README.md index d072b81c730..7aca561095d 100644 --- a/vendor/github.com/fxamacker/cbor/v2/README.md +++ b/vendor/github.com/fxamacker/cbor/v2/README.md @@ -683,7 +683,7 @@ because RFC 8949 treats CBOR data item with remaining bytes as malformed. Other useful functions: - `Diagnose`, `DiagnoseFirst` produce human-readable [Extended Diagnostic Notation](https://www.rfc-editor.org/rfc/rfc8610.html#appendix-G) from CBOR data. - `UnmarshalFirst` decodes first CBOR data item and return any remaining bytes. -- `Wellformed` returns true if the CBOR data item is well-formed. +- `Wellformed` returns nil error if the CBOR data item is well-formed. Interfaces identical or comparable to Go `encoding` packages include: `Marshaler`, `Unmarshaler`, `BinaryMarshaler`, and `BinaryUnmarshaler`. @@ -702,28 +702,29 @@ Default limits may need to be increased for systems handling very large data (e. ## Status -[v2.9.0](https://github.com/fxamacker/cbor/releases/tag/v2.9.0) (Jul 13, 2025) improved interoperability/transcoding between CBOR & JSON, refactored tests, and improved docs. -- Add opt-in support for `encoding.TextMarshaler` and `encoding.TextUnmarshaler` to encode and decode from CBOR text string. -- Add opt-in support for `json.Marshaler` and `json.Unmarshaler` via user-provided transcoding function. -- Update docs for TimeMode, Tag, RawTag, and add example for Embedded JSON Tag for CBOR. +v2.9.2 (Sunday, May 3, 2026) refactors and hardens the streaming encoder by adding stricter checks for encoding to CBOR indefinite-length data. This prevents improper use of this library from producing malformed CBOR indefinite-length data that would be rejected by the decoder. -v2.9.0 passed fuzz tests and is production quality. +This release includes other bugfixes, defensive checks, and added more tests. -The minimum version of Go required to build: -- v2.8.0 and newer releases require go 1.20+. -- v2.7.1 and older releases require go 1.17+. +v2.9.2 passed fuzz tests (billions of executions) and is production quality. -For more details, see [release notes](https://github.com/fxamacker/cbor/releases). +For more details, see [v2.9.2 release notes](https://github.com/fxamacker/cbor/releases). ### Prior Releases -[v2.8.0](https://github.com/fxamacker/cbor/releases/tag/v2.8.0) (March 30, 2025) is a small release primarily to add `omitzero` option to struct field tags and fix bugs. It passed fuzz tests (billions of executions) and is production quality. +Releases and commits tend to be on Sundays because my work schedule didn't leave time to work on this during weekdays (sometimes consecutive weekends and consecutive Christmas breaks, too). Monday morning releases were to allow more fuzzing to run overnight before clicking the release button. -[v2.7.0](https://github.com/fxamacker/cbor/releases/tag/v2.7.0) (June 23, 2024) adds features and improvements that help large projects (e.g. Kubernetes) use CBOR as an alternative to JSON and Protocol Buffers. Other improvements include speedups, improved memory use, bug fixes, new serialization options, etc. It passed fuzz tests (5+ billion executions) and is production quality. +[v2.9.1](https://github.com/fxamacker/cbor/releases/tag/v2.9.1) (Monday, Mar 30, 2026) includes important bugfixes, defensive checks, improved code quality, and more tests. Although not public, the fuzzer was also improved by adding more fuzz tests. It passed fuzz tests (billions of executions) and is production quality. -[v2.6.0](https://github.com/fxamacker/cbor/releases/tag/v2.6.0) (February 2024) adds important new features, optimizations, and bug fixes. It is especially useful to systems that need to convert data between CBOR and JSON. New options and optimizations improve handling of bignum, integers, maps, and strings. +[v2.9.0](https://github.com/fxamacker/cbor/releases/tag/v2.9.0) (Sunday, Jul 13, 2025) improved interoperability/transcoding between CBOR & JSON, refactored tests, and improved docs. It passed fuzz tests (billions of executions) and is production quality. -[v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) was released on Sunday, August 13, 2023 with new features and important bug fixes. It is fuzz tested and production quality after extended beta [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023). +[v2.8.0](https://github.com/fxamacker/cbor/releases/tag/v2.8.0) (Sunday, March 30, 2025) is a small release primarily to add `omitzero` option to struct field tags and fix bugs. It passed fuzz tests (billions of executions) and is production quality. + +[v2.7.0](https://github.com/fxamacker/cbor/releases/tag/v2.7.0) (Monday, June 23, 2024) adds features and improvements that help large projects (e.g. Kubernetes) use CBOR as an alternative to JSON and Protocol Buffers. Other improvements include speedups, improved memory use, bug fixes, new serialization options, etc. It passed fuzz tests (5+ billion executions) and is production quality. + +[v2.6.0](https://github.com/fxamacker/cbor/releases/tag/v2.6.0) (Sunday, Feb 11, 2024) adds important new features, optimizations, and bug fixes. It is especially useful to systems that need to convert data between CBOR and JSON. New options and optimizations improve handling of bignum, integers, maps, and strings. + +[v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Sunday, August 13, 2023) adds new features and important bug fixes. It is fuzz tested and production quality after extended beta [v2.5.0-beta](https://github.com/fxamacker/cbor/releases/tag/v2.5.0-beta) (Dec 2022) -> [v2.5.0](https://github.com/fxamacker/cbor/releases/tag/v2.5.0) (Aug 2023). __IMPORTANT__: 👉 Before upgrading from v2.4 or older release, please read the notable changes highlighted in the release notes. v2.5.0 is a large release with bug fixes to error handling for extraneous data in `Unmarshal`, etc. that should be reviewed before upgrading. diff --git a/vendor/github.com/fxamacker/cbor/v2/cache.go b/vendor/github.com/fxamacker/cbor/v2/cache.go index 5051f110fbb..5743f3eb25e 100644 --- a/vendor/github.com/fxamacker/cbor/v2/cache.go +++ b/vendor/github.com/fxamacker/cbor/v2/cache.go @@ -92,94 +92,126 @@ func newTypeInfo(t reflect.Type) *typeInfo { } type decodingStructType struct { - fields fields - fieldIndicesByName map[string]int - err error - toArray bool + fields decodingFields + fieldIndicesByName map[string]int // Only populated if toArray is false + fieldIndicesByIntKey map[int64]int // Only populated if toArray is false + err error + toArray bool } -// The stdlib errors.Join was introduced in Go 1.20, and we still support Go 1.17, so instead, -// here's a very basic implementation of an aggregated error. -type multierror []error - -func (m multierror) Error() string { - var sb strings.Builder - for i, err := range m { - sb.WriteString(err.Error()) - if i < len(m)-1 { - sb.WriteString(", ") - } - } - return sb.String() -} - -func getDecodingStructType(t reflect.Type) *decodingStructType { +func getDecodingStructType(t reflect.Type) (*decodingStructType, error) { if v, _ := decodingStructTypeCache.Load(t); v != nil { - return v.(*decodingStructType) + structType := v.(*decodingStructType) + if structType.err != nil { + return nil, structType.err + } + return structType, nil } flds, structOptions := getFields(t) toArray := hasToArrayOption(structOptions) - var errs []error - for i := 0; i < len(flds); i++ { - if flds[i].keyAsInt { - nameAsInt, numErr := strconv.Atoi(flds[i].name) - if numErr != nil { - errs = append(errs, errors.New("cbor: failed to parse field name \""+flds[i].name+"\" to int ("+numErr.Error()+")")) - break + if toArray { + return getDecodingStructToArrayType(t, flds) + } + + fieldIndicesByName := make(map[string]int, len(flds)) + var fieldIndicesByIntKey map[int64]int + + decFlds := make(decodingFields, len(flds)) + for i, f := range flds { + // nameAsInt is set in getFields() except for fields with an unparsable tagged name. + // Atoi() is called here to catch and save parsing errors. + if f.keyAsInt && f.nameAsInt == 0 { + if _, numErr := strconv.Atoi(f.name); numErr != nil { + structType := &decodingStructType{ + err: errors.New("cbor: failed to parse field name \"" + f.name + "\" to int (" + numErr.Error() + ")"), + } + decodingStructTypeCache.Store(t, structType) + return nil, structType.err } - flds[i].nameAsInt = int64(nameAsInt) } - flds[i].typInfo = getTypeInfo(flds[i].typ) - } + if f.keyAsInt { + if fieldIndicesByIntKey == nil { + fieldIndicesByIntKey = make(map[int64]int, len(flds)) + } + // The duplication check is only a safeguard, since getFields() already deduplicates fields. + if _, ok := fieldIndicesByIntKey[f.nameAsInt]; ok { + structType := &decodingStructType{ + err: fmt.Errorf("cbor: two or more fields of %v have the same keyasint value %d", t, f.nameAsInt), + } + decodingStructTypeCache.Store(t, structType) + return nil, structType.err + } + fieldIndicesByIntKey[f.nameAsInt] = i + } else { + // The duplication check is only a safeguard, since getFields() already deduplicates fields. + if _, ok := fieldIndicesByName[f.name]; ok { + structType := &decodingStructType{ + err: fmt.Errorf("cbor: two or more fields of %v have the same name %q", t, f.name), + } + decodingStructTypeCache.Store(t, structType) + return nil, structType.err + } + fieldIndicesByName[f.name] = i + } - fieldIndicesByName := make(map[string]int, len(flds)) - for i, fld := range flds { - if _, ok := fieldIndicesByName[fld.name]; ok { - errs = append(errs, fmt.Errorf("cbor: two or more fields of %v have the same name %q", t, fld.name)) - continue + decFlds[i] = &decodingField{ + field: *f, + typInfo: getTypeInfo(f.typ), } - fieldIndicesByName[fld.name] = i } - var err error - { - var multi multierror - for _, each := range errs { - if each != nil { - multi = append(multi, each) + structType := &decodingStructType{ + fields: decFlds, + fieldIndicesByName: fieldIndicesByName, + fieldIndicesByIntKey: fieldIndicesByIntKey, + } + decodingStructTypeCache.Store(t, structType) + return structType, nil +} + +func getDecodingStructToArrayType(t reflect.Type, flds fields) (*decodingStructType, error) { + decFlds := make(decodingFields, len(flds)) + for i, f := range flds { + // nameAsInt is set in getFields() except for fields with an unparsable tagged name. + // Atoi() is called here to catch and save parsing errors. + if f.keyAsInt && f.nameAsInt == 0 { + if _, numErr := strconv.Atoi(f.name); numErr != nil { + structType := &decodingStructType{ + err: errors.New("cbor: failed to parse field name \"" + f.name + "\" to int (" + numErr.Error() + ")"), + } + decodingStructTypeCache.Store(t, structType) + return nil, structType.err } } - if len(multi) == 1 { - err = multi[0] - } else if len(multi) > 1 { - err = multi + + decFlds[i] = &decodingField{ + field: *f, + typInfo: getTypeInfo(f.typ), } } structType := &decodingStructType{ - fields: flds, - fieldIndicesByName: fieldIndicesByName, - err: err, - toArray: toArray, + fields: decFlds, + toArray: true, } decodingStructTypeCache.Store(t, structType) - return structType + return structType, nil } type encodingStructType struct { - fields fields - bytewiseFields fields - lengthFirstFields fields - omitEmptyFieldsIdx []int + fields encodingFields + bytewiseFields encodingFields // Only populated if toArray is false + lengthFirstFields encodingFields // Only populated if toArray is false + omitEmptyFieldsIdx []int // Only populated if toArray is false err error toArray bool } -func (st *encodingStructType) getFields(em *encMode) fields { +func (st *encodingStructType) getFields(em *encMode) encodingFields { switch em.sort { case SortNone, SortFastShuffle: return st.fields @@ -191,7 +223,7 @@ func (st *encodingStructType) getFields(em *encMode) fields { } type bytewiseFieldSorter struct { - fields fields + fields encodingFields } func (x *bytewiseFieldSorter) Len() int { @@ -203,11 +235,11 @@ func (x *bytewiseFieldSorter) Swap(i, j int) { } func (x *bytewiseFieldSorter) Less(i, j int) bool { - return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) <= 0 + return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) < 0 } type lengthFirstFieldSorter struct { - fields fields + fields encodingFields } func (x *lengthFirstFieldSorter) Len() int { @@ -222,13 +254,16 @@ func (x *lengthFirstFieldSorter) Less(i, j int) bool { if len(x.fields[i].cborName) != len(x.fields[j].cborName) { return len(x.fields[i].cborName) < len(x.fields[j].cborName) } - return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) <= 0 + return bytes.Compare(x.fields[i].cborName, x.fields[j].cborName) < 0 } func getEncodingStructType(t reflect.Type) (*encodingStructType, error) { if v, _ := encodingStructTypeCache.Load(t); v != nil { structType := v.(*encodingStructType) - return structType, structType.err + if structType.err != nil { + return nil, structType.err + } + return structType, nil } flds, structOptions := getFields(t) @@ -237,111 +272,119 @@ func getEncodingStructType(t reflect.Type) (*encodingStructType, error) { return getEncodingStructToArrayType(t, flds) } - var err error var hasKeyAsInt bool var hasKeyAsStr bool var omitEmptyIdx []int + + encFlds := make(encodingFields, len(flds)) + e := getEncodeBuffer() - for i := 0; i < len(flds); i++ { + defer putEncodeBuffer(e) + + for i, f := range flds { + encFlds[i] = &encodingField{field: *f} + ef := encFlds[i] + // Get field's encodeFunc - flds[i].ef, flds[i].ief, flds[i].izf = getEncodeFunc(flds[i].typ) - if flds[i].ef == nil { - err = &UnsupportedTypeError{t} - break + ef.ef, ef.ief, ef.izf = getEncodeFunc(f.typ) + if ef.ef == nil { + structType := &encodingStructType{err: &UnsupportedTypeError{t}} + encodingStructTypeCache.Store(t, structType) + return nil, structType.err } // Encode field name - if flds[i].keyAsInt { - nameAsInt, numErr := strconv.Atoi(flds[i].name) - if numErr != nil { - err = errors.New("cbor: failed to parse field name \"" + flds[i].name + "\" to int (" + numErr.Error() + ")") - break + if f.keyAsInt { + if f.nameAsInt == 0 { + // nameAsInt is set in getFields() except for fields with an unparsable tagged name. + // Atoi() is called here to catch and save parsing errors. + if _, numErr := strconv.Atoi(f.name); numErr != nil { + structType := &encodingStructType{ + err: errors.New("cbor: failed to parse field name \"" + f.name + "\" to int (" + numErr.Error() + ")"), + } + encodingStructTypeCache.Store(t, structType) + return nil, structType.err + } } - flds[i].nameAsInt = int64(nameAsInt) + nameAsInt := f.nameAsInt if nameAsInt >= 0 { - encodeHead(e, byte(cborTypePositiveInt), uint64(nameAsInt)) + encodeHead(e, byte(cborTypePositiveInt), uint64(nameAsInt)) //nolint:gosec } else { n := nameAsInt*(-1) - 1 - encodeHead(e, byte(cborTypeNegativeInt), uint64(n)) + encodeHead(e, byte(cborTypeNegativeInt), uint64(n)) //nolint:gosec } - flds[i].cborName = make([]byte, e.Len()) - copy(flds[i].cborName, e.Bytes()) + ef.cborName = make([]byte, e.Len()) + copy(ef.cborName, e.Bytes()) e.Reset() hasKeyAsInt = true } else { - encodeHead(e, byte(cborTypeTextString), uint64(len(flds[i].name))) - flds[i].cborName = make([]byte, e.Len()+len(flds[i].name)) - n := copy(flds[i].cborName, e.Bytes()) - copy(flds[i].cborName[n:], flds[i].name) + encodeHead(e, byte(cborTypeTextString), uint64(len(f.name))) + ef.cborName = make([]byte, e.Len()+len(f.name)) + n := copy(ef.cborName, e.Bytes()) + copy(ef.cborName[n:], f.name) e.Reset() // If cborName contains a text string, then cborNameByteString contains a // string that has the byte string major type but is otherwise identical to // cborName. - flds[i].cborNameByteString = make([]byte, len(flds[i].cborName)) - copy(flds[i].cborNameByteString, flds[i].cborName) + ef.cborNameByteString = make([]byte, len(ef.cborName)) + copy(ef.cborNameByteString, ef.cborName) // Reset encoded CBOR type to byte string, preserving the "additional // information" bits: - flds[i].cborNameByteString[0] = byte(cborTypeByteString) | - getAdditionalInformation(flds[i].cborNameByteString[0]) + ef.cborNameByteString[0] = byte(cborTypeByteString) | + getAdditionalInformation(ef.cborNameByteString[0]) hasKeyAsStr = true } // Check if field can be omitted when empty - if flds[i].omitEmpty { + if f.omitEmpty { omitEmptyIdx = append(omitEmptyIdx, i) } } - putEncodeBuffer(e) - - if err != nil { - structType := &encodingStructType{err: err} - encodingStructTypeCache.Store(t, structType) - return structType, structType.err - } // Sort fields by canonical order - bytewiseFields := make(fields, len(flds)) - copy(bytewiseFields, flds) + bytewiseFields := make(encodingFields, len(encFlds)) + copy(bytewiseFields, encFlds) sort.Sort(&bytewiseFieldSorter{bytewiseFields}) lengthFirstFields := bytewiseFields if hasKeyAsInt && hasKeyAsStr { - lengthFirstFields = make(fields, len(flds)) - copy(lengthFirstFields, flds) + lengthFirstFields = make(encodingFields, len(encFlds)) + copy(lengthFirstFields, encFlds) sort.Sort(&lengthFirstFieldSorter{lengthFirstFields}) } structType := &encodingStructType{ - fields: flds, + fields: encFlds, bytewiseFields: bytewiseFields, lengthFirstFields: lengthFirstFields, omitEmptyFieldsIdx: omitEmptyIdx, } encodingStructTypeCache.Store(t, structType) - return structType, structType.err + return structType, nil } func getEncodingStructToArrayType(t reflect.Type, flds fields) (*encodingStructType, error) { - for i := 0; i < len(flds); i++ { - // Get field's encodeFunc - flds[i].ef, flds[i].ief, flds[i].izf = getEncodeFunc(flds[i].typ) - if flds[i].ef == nil { + encFlds := make(encodingFields, len(flds)) + for i, f := range flds { + encFlds[i] = &encodingField{field: *f} + encFlds[i].ef, encFlds[i].ief, encFlds[i].izf = getEncodeFunc(f.typ) + if encFlds[i].ef == nil { structType := &encodingStructType{err: &UnsupportedTypeError{t}} encodingStructTypeCache.Store(t, structType) - return structType, structType.err + return nil, structType.err } } structType := &encodingStructType{ - fields: flds, + fields: encFlds, toArray: true, } encodingStructTypeCache.Store(t, structType) - return structType, structType.err + return structType, nil } func getEncodeFunc(t reflect.Type) (encodeFunc, isEmptyFunc, isZeroFunc) { diff --git a/vendor/github.com/fxamacker/cbor/v2/decode.go b/vendor/github.com/fxamacker/cbor/v2/decode.go index f0bdc3b38dd..a430eccba10 100644 --- a/vendor/github.com/fxamacker/cbor/v2/decode.go +++ b/vendor/github.com/fxamacker/cbor/v2/decode.go @@ -16,7 +16,6 @@ import ( "math/big" "reflect" "strconv" - "strings" "time" "unicode/utf8" @@ -326,14 +325,14 @@ func (dmkm DupMapKeyMode) valid() bool { return dmkm >= 0 && dmkm < maxDupMapKeyMode } -// IndefLengthMode specifies whether to allow indefinite length items. +// IndefLengthMode specifies whether to allow indefinite-length items. type IndefLengthMode int const ( - // IndefLengthAllowed allows indefinite length items. + // IndefLengthAllowed allows indefinite-length items. IndefLengthAllowed IndefLengthMode = iota - // IndefLengthForbidden disallows indefinite length items. + // IndefLengthForbidden disallows indefinite-length items. IndefLengthForbidden maxIndefLengthMode @@ -378,6 +377,7 @@ const ( // - int64 if value fits // - big.Int or *big.Int (see BigIntDecMode) if value < math.MinInt64 // - return UnmarshalTypeError if value > math.MaxInt64 + // // Deprecated: IntDecConvertSigned should not be used. // Please use other options, such as IntDecConvertSignedOrError, IntDecConvertSignedOrBigInt, IntDecConvertNone. IntDecConvertSigned @@ -811,7 +811,7 @@ type DecOptions struct { // Default is 128*1024=131072 and it can be set to [16, 2147483647] MaxMapPairs int - // IndefLength specifies whether to allow indefinite length CBOR items. + // IndefLength specifies whether to allow indefinite-length CBOR items. IndefLength IndefLengthMode // TagsMd specifies whether to allow CBOR tags (major type 6). @@ -1055,7 +1055,7 @@ func (opts DecOptions) decMode() (*decMode, error) { //nolint:gocritic // ignore } if !opts.ExtraReturnErrors.valid() { - return nil, errors.New("cbor: invalid ExtraReturnErrors " + strconv.Itoa(int(opts.ExtraReturnErrors))) + return nil, errors.New("cbor: invalid ExtraReturnErrors " + strconv.Itoa(int(opts.ExtraReturnErrors))) //nolint:gosec } if opts.DefaultMapType != nil && opts.DefaultMapType.Kind() != reflect.Map { @@ -1149,8 +1149,8 @@ func (opts DecOptions) decMode() (*decMode, error) { //nolint:gocritic // ignore unrecognizedTagToAny: opts.UnrecognizedTagToAny, timeTagToAny: opts.TimeTagToAny, simpleValues: simpleValues, - nanDec: opts.NaN, - infDec: opts.Inf, + nan: opts.NaN, + inf: opts.Inf, byteStringToTime: opts.ByteStringToTime, byteStringExpectedFormat: opts.ByteStringExpectedFormat, bignumTag: opts.BignumTag, @@ -1230,8 +1230,8 @@ type decMode struct { unrecognizedTagToAny UnrecognizedTagToAnyMode timeTagToAny TimeTagToAnyMode simpleValues *SimpleValueRegistry - nanDec NaNMode - infDec InfMode + nan NaNMode + inf InfMode byteStringToTime ByteStringToTimeMode byteStringExpectedFormat ByteStringExpectedFormatMode bignumTag BignumTagMode @@ -1272,8 +1272,8 @@ func (dm *decMode) DecOptions() DecOptions { UnrecognizedTagToAny: dm.unrecognizedTagToAny, TimeTagToAny: dm.timeTagToAny, SimpleValues: simpleValues, - NaN: dm.nanDec, - Inf: dm.infDec, + NaN: dm.nan, + Inf: dm.inf, ByteStringToTime: dm.byteStringToTime, ByteStringExpectedFormat: dm.byteStringExpectedFormat, BignumTag: dm.bignumTag, @@ -1583,11 +1583,11 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin _, ai, val := d.getHead() switch ai { case additionalInformationAsFloat16: - f := float64(float16.Frombits(uint16(val)).Float32()) + f := float64(float16.Frombits(uint16(val)).Float32()) //nolint:gosec return fillFloat(t, f, v) case additionalInformationAsFloat32: - f := float64(math.Float32frombits(uint32(val))) + f := float64(math.Float32frombits(uint32(val))) //nolint:gosec return fillFloat(t, f, v) case additionalInformationAsFloat64: @@ -1595,10 +1595,10 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin return fillFloat(t, f, v) default: // ai <= 24 - if d.dm.simpleValues.rejected[SimpleValue(val)] { + if d.dm.simpleValues.rejected[SimpleValue(val)] { //nolint:gosec return &UnacceptableDataItemError{ CBORType: t.String(), - Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized", + Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized", //nolint:gosec } } @@ -1677,20 +1677,23 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin return d.parseToValue(v, tInfo) case cborTypeArray: - if tInfo.nonPtrKind == reflect.Slice { + switch tInfo.nonPtrKind { + case reflect.Slice: return d.parseArrayToSlice(v, tInfo) - } else if tInfo.nonPtrKind == reflect.Array { + case reflect.Array: return d.parseArrayToArray(v, tInfo) - } else if tInfo.nonPtrKind == reflect.Struct { + case reflect.Struct: return d.parseArrayToStruct(v, tInfo) } + d.skip() return &UnmarshalTypeError{CBORType: t.String(), GoType: tInfo.nonPtrType.String()} case cborTypeMap: - if tInfo.nonPtrKind == reflect.Struct { + switch tInfo.nonPtrKind { + case reflect.Struct: return d.parseMapToStruct(v, tInfo) - } else if tInfo.nonPtrKind == reflect.Map { + case reflect.Map: return d.parseMapToMap(v, tInfo) } d.skip() @@ -1745,8 +1748,8 @@ func (d *decoder) parseToTime() (time.Time, bool, error) { // Read tag number _, _, tagNum := d.getHead() if tagNum != 0 && tagNum != 1 { - d.skip() // skip tag content - return time.Time{}, false, errors.New("cbor: wrong tag number for time.Time, got " + strconv.Itoa(int(tagNum)) + ", expect 0 or 1") + d.skip() // skip tag content + return time.Time{}, false, errors.New("cbor: wrong tag number for time.Time, got " + strconv.Itoa(int(tagNum)) + ", expect 0 or 1") //nolint:gosec } } } else { @@ -1766,6 +1769,7 @@ func (d *decoder) parseToTime() (time.Time, bool, error) { } return t, true, nil } + d.skip() return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()} case cborTypeTextString: @@ -1815,10 +1819,10 @@ func (d *decoder) parseToTime() (time.Time, bool, error) { var f float64 switch ai { case additionalInformationAsFloat16: - f = float64(float16.Frombits(uint16(val)).Float32()) + f = float64(float16.Frombits(uint16(val)).Float32()) //nolint:gosec case additionalInformationAsFloat32: - f = float64(math.Float32frombits(uint32(val))) + f = float64(math.Float32frombits(uint32(val))) //nolint:gosec case additionalInformationAsFloat64: f = math.Float64frombits(val) @@ -1832,9 +1836,17 @@ func (d *decoder) parseToTime() (time.Time, bool, error) { return time.Time{}, true, nil } seconds, fractional := math.Modf(f) + if seconds > math.MaxInt64 || seconds < math.MinInt64 { + return time.Time{}, false, &UnmarshalTypeError{ + CBORType: t.String(), + GoType: typeTime.String(), + errorMsg: fmt.Sprintf("%v overflows Go's int64", f), + } + } return time.Unix(int64(seconds), int64(fractional*1e9)), true, nil default: + d.skip() return time.Time{}, false, &UnmarshalTypeError{CBORType: t.String(), GoType: typeTime.String()} } } @@ -2145,14 +2157,14 @@ func (d *decoder) parse(skipSelfDescribedTag bool) (any, error) { //nolint:gocyc case cborTypePrimitives: _, ai, val := d.getHead() - if ai <= 24 && d.dm.simpleValues.rejected[SimpleValue(val)] { + if ai <= 24 && d.dm.simpleValues.rejected[SimpleValue(val)] { //nolint:gosec return nil, &UnacceptableDataItemError{ CBORType: t.String(), - Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized", + Message: "simple value " + strconv.FormatInt(int64(val), 10) + " is not recognized", //nolint:gosec } } if ai < 20 || ai == 24 { - return SimpleValue(val), nil + return SimpleValue(val), nil //nolint:gosec } switch ai { @@ -2165,11 +2177,11 @@ func (d *decoder) parse(skipSelfDescribedTag bool) (any, error) { //nolint:gocyc return nil, nil case additionalInformationAsFloat16: - f := float64(float16.Frombits(uint16(val)).Float32()) + f := float64(float16.Frombits(uint16(val)).Float32()) //nolint:gosec return f, nil case additionalInformationAsFloat32: - f := float64(math.Float32frombits(uint32(val))) + f := float64(math.Float32frombits(uint32(val))) //nolint:gosec return f, nil case additionalInformationAsFloat64: @@ -2202,16 +2214,16 @@ func (d *decoder) parse(skipSelfDescribedTag bool) (any, error) { //nolint:gocyc func (d *decoder) parseByteString() ([]byte, bool) { _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() if !indefiniteLength { - b := d.data[d.off : d.off+int(val)] - d.off += int(val) + b := d.data[d.off : d.off+int(val)] //nolint:gosec + d.off += int(val) //nolint:gosec return b, false } - // Process indefinite length string chunks. + // Process indefinite-length string chunks. b := []byte{} for !d.foundBreak() { _, _, val = d.getHead() - b = append(b, d.data[d.off:d.off+int(val)]...) - d.off += int(val) + b = append(b, d.data[d.off:d.off+int(val)]...) //nolint:gosec + d.off += int(val) //nolint:gosec } return b, true } @@ -2253,7 +2265,7 @@ func (d *decoder) applyByteStringTextConversion( default: // If this happens, there is a bug: the decoder has pushed an invalid // "expected later encoding" tag to the stack. - panic(fmt.Sprintf("unrecognized expected later encoding tag: %d", d.expectedLaterEncodingTags)) + panic(fmt.Sprintf("unrecognized expected later encoding tag: %d", d.expectedLaterEncodingTags[len(d.expectedLaterEncodingTags)-1])) } case reflect.Slice: @@ -2300,19 +2312,19 @@ func (d *decoder) applyByteStringTextConversion( func (d *decoder) parseTextString() ([]byte, error) { _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() if !indefiniteLength { - b := d.data[d.off : d.off+int(val)] - d.off += int(val) + b := d.data[d.off : d.off+int(val)] //nolint:gosec + d.off += int(val) //nolint:gosec if d.dm.utf8 == UTF8RejectInvalid && !utf8.Valid(b) { return nil, &SemanticError{"cbor: invalid UTF-8 string"} } return b, nil } - // Process indefinite length string chunks. + // Process indefinite-length string chunks. b := []byte{} for !d.foundBreak() { _, _, val = d.getHead() - x := d.data[d.off : d.off+int(val)] - d.off += int(val) + x := d.data[d.off : d.off+int(val)] //nolint:gosec + d.off += int(val) //nolint:gosec if d.dm.utf8 == UTF8RejectInvalid && !utf8.Valid(x) { for !d.foundBreak() { d.skip() // Skip remaining chunk on error @@ -2327,7 +2339,7 @@ func (d *decoder) parseTextString() ([]byte, error) { func (d *decoder) parseArray() ([]any, error) { _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() hasSize := !indefiniteLength - count := int(val) + count := int(val) //nolint:gosec if !hasSize { count = d.numOfItemsUntilBreak() // peek ahead to get array size to preallocate slice for better performance } @@ -2349,7 +2361,7 @@ func (d *decoder) parseArray() ([]any, error) { func (d *decoder) parseArrayToSlice(v reflect.Value, tInfo *typeInfo) error { _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() hasSize := !indefiniteLength - count := int(val) + count := int(val) //nolint:gosec if !hasSize { count = d.numOfItemsUntilBreak() // peek ahead to get array size to preallocate slice for better performance } @@ -2371,7 +2383,7 @@ func (d *decoder) parseArrayToSlice(v reflect.Value, tInfo *typeInfo) error { func (d *decoder) parseArrayToArray(v reflect.Value, tInfo *typeInfo) error { _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() hasSize := !indefiniteLength - count := int(val) + count := int(val) //nolint:gosec gi := 0 vLen := v.Len() var err error @@ -2400,7 +2412,7 @@ func (d *decoder) parseArrayToArray(v reflect.Value, tInfo *typeInfo) error { func (d *decoder) parseMap() (any, error) { _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() hasSize := !indefiniteLength - count := int(val) + count := int(val) //nolint:gosec m := make(map[any]any) var k, e any var err, lastErr error @@ -2465,7 +2477,7 @@ func (d *decoder) parseMap() (any, error) { func (d *decoder) parseMapToMap(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() hasSize := !indefiniteLength - count := int(val) + count := int(val) //nolint:gosec if v.IsNil() { mapsize := count if !hasSize { @@ -2566,9 +2578,9 @@ func (d *decoder) parseMapToMap(v reflect.Value, tInfo *typeInfo) error { //noli } func (d *decoder) parseArrayToStruct(v reflect.Value, tInfo *typeInfo) error { - structType := getDecodingStructType(tInfo.nonPtrType) - if structType.err != nil { - return structType.err + structType, structTypeErr := getDecodingStructType(tInfo.nonPtrType) + if structTypeErr != nil { + return structTypeErr } if !structType.toArray { @@ -2584,7 +2596,7 @@ func (d *decoder) parseArrayToStruct(v reflect.Value, tInfo *typeInfo) error { start := d.off _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() hasSize := !indefiniteLength - count := int(val) + count := int(val) //nolint:gosec if !hasSize { count = d.numOfItemsUntilBreak() // peek ahead to get array size } @@ -2637,11 +2649,72 @@ func (d *decoder) parseArrayToStruct(v reflect.Value, tInfo *typeInfo) error { return err } -// parseMapToStruct needs to be fast so gocyclo can be ignored for now. +// skipMapEntriesFromIndex skips remaining map entries starting from index i. +func (d *decoder) skipMapEntriesFromIndex(i, count int, hasSize bool) { + for ; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ { + d.skip() + d.skip() + } +} + +// skipMapForDupKey skips the current map value and all remaining map entries, +// then returns a DupMapKeyError for the given key at map index i. +func (d *decoder) skipMapForDupKey(dupKey any, i, count int, hasSize bool) error { + // Skip the value of the duplicate key. + d.skip() + // Skip all remaining map entries. + d.skipMapEntriesFromIndex(i+1, count, hasSize) + return &DupMapKeyError{dupKey, i} +} + +// skipMapForUnknownField skips the current map value and all remaining map entries, +// then returns a UnknownFieldError for the given key at map index i. +func (d *decoder) skipMapForUnknownField(i, count int, hasSize bool) error { + // Skip the value of the unknown key. + d.skip() + // Skip all remaining map entries. + d.skipMapEntriesFromIndex(i+1, count, hasSize) + return &UnknownFieldError{i} +} + +// decodeToStructField decodes the next CBOR value into the struct field f in v. +// If the field cannot be resolved, the CBOR value is skipped. +func (d *decoder) decodeToStructField(v reflect.Value, f *decodingField, tInfo *typeInfo) error { + var fv reflect.Value + + if len(f.idx) == 1 { + fv = v.Field(f.idx[0]) + } else { + var err error + fv, err = getFieldValue(v, f.idx, func(v reflect.Value) (reflect.Value, error) { + // Return a new value for embedded field null pointer to point to, or return error. + if !v.CanSet() { + return reflect.Value{}, errors.New("cbor: cannot set embedded pointer to unexported struct: " + v.Type().String()) + } + v.Set(reflect.New(v.Type().Elem())) + return v, nil + }) + if !fv.IsValid() { + d.skip() + return err + } + } + + err := d.parseToValue(fv, f.typInfo) + if err != nil { + if typeError, ok := err.(*UnmarshalTypeError); ok { + typeError.StructFieldName = tInfo.nonPtrType.String() + "." + f.name + } + return err + } + + return nil +} + func (d *decoder) parseMapToStruct(v reflect.Value, tInfo *typeInfo) error { //nolint:gocyclo - structType := getDecodingStructType(tInfo.nonPtrType) - if structType.err != nil { - return structType.err + structType, structTypeErr := getDecodingStructType(tInfo.nonPtrType) + if structTypeErr != nil { + return structTypeErr } if structType.toArray { @@ -2654,14 +2727,12 @@ func (d *decoder) parseMapToStruct(v reflect.Value, tInfo *typeInfo) error { //n } } - var err, lastErr error - // Get CBOR map size _, _, val, indefiniteLength := d.getHeadWithIndefiniteLengthFlag() hasSize := !indefiniteLength - count := int(val) + count := int(val) //nolint:gosec - // Keeps track of matched struct fields + // Keep track of matched struct fields to detect duplicate map keys. var foundFldIdx []bool { const maxStackFields = 128 @@ -2675,99 +2746,80 @@ func (d *decoder) parseMapToStruct(v reflect.Value, tInfo *typeInfo) error { //n } } - // Keeps track of CBOR map keys to detect duplicate map key - keyCount := 0 - var mapKeys map[any]struct{} - - errOnUnknownField := (d.dm.extraReturnErrors & ExtraDecErrorUnknownField) > 0 + // Keep track of unmatched CBOR map keys to detect duplicate map keys. + var unmatchedMapKeys map[any]struct{} -MapEntryLoop: - for j := 0; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ { - var f *field + var err error - // If duplicate field detection is enabled and the key at index j did not match any - // field, k will hold the map key. - var k any + caseInsensitive := d.dm.fieldNameMatching == FieldNameMatchingPreferCaseSensitive + for i := 0; (hasSize && i < count) || (!hasSize && !d.foundBreak()); i++ { t := d.nextCBORType() - if t == cborTypeTextString || (t == cborTypeByteString && d.dm.fieldNameByteString == FieldNameByteStringAllowed) { + + // Reclassify disallowed byte string keys so they fall to the default case. + // keyType is only used for branch control. + keyType := t + if t == cborTypeByteString && d.dm.fieldNameByteString != FieldNameByteStringAllowed { + keyType = 0xff + } + + switch keyType { + case cborTypeTextString, cborTypeByteString: var keyBytes []byte if t == cborTypeTextString { - keyBytes, lastErr = d.parseTextString() - if lastErr != nil { + var parseErr error + keyBytes, parseErr = d.parseTextString() + if parseErr != nil { if err == nil { - err = lastErr + err = parseErr } - d.skip() // skip value + d.skip() // Skip value continue } } else { // cborTypeByteString keyBytes, _ = d.parseByteString() } - // Check for exact match on field name. - if i, ok := structType.fieldIndicesByName[string(keyBytes)]; ok { - fld := structType.fields[i] + // Find matching struct field (exact match, then case-insensitive fallback). + if fldIdx, ok := findStructFieldByKey(structType, keyBytes, caseInsensitive); ok { + fld := structType.fields[fldIdx] - if !foundFldIdx[i] { - f = fld - foundFldIdx[i] = true - } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF { - err = &DupMapKeyError{fld.name, j} - d.skip() // skip value - j++ - // skip the rest of the map - for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ { - d.skip() - d.skip() + switch checkDupField(d.dm, foundFldIdx, fldIdx) { + case mapActionParseValueAndContinue: + if fieldErr := d.decodeToStructField(v, fld, tInfo); fieldErr != nil && err == nil { + err = fieldErr } - return err - } else { - // discard repeated match + continue + case mapActionSkipAllAndReturnError: + return d.skipMapForDupKey(string(keyBytes), i, count, hasSize) + case mapActionSkipValueAndContinue: d.skip() - continue MapEntryLoop + continue } } - // Find field with case-insensitive match - if f == nil && d.dm.fieldNameMatching == FieldNameMatchingPreferCaseSensitive { - keyLen := len(keyBytes) - keyString := string(keyBytes) - for i := 0; i < len(structType.fields); i++ { - fld := structType.fields[i] - if len(fld.name) == keyLen && strings.EqualFold(fld.name, keyString) { - if !foundFldIdx[i] { - f = fld - foundFldIdx[i] = true - } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF { - err = &DupMapKeyError{keyString, j} - d.skip() // skip value - j++ - // skip the rest of the map - for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ { - d.skip() - d.skip() - } - return err - } else { - // discard repeated match - d.skip() - continue MapEntryLoop - } - break - } - } + // No matching struct field found. + if unmatchedErr := handleUnmatchedMapKey(d, string(keyBytes), i, count, hasSize, &unmatchedMapKeys); unmatchedErr != nil { + return unmatchedErr } - if d.dm.dupMapKey == DupMapKeyEnforcedAPF && f == nil { - k = string(keyBytes) - } - } else if t <= cborTypeNegativeInt { // uint/int + case cborTypePositiveInt, cborTypeNegativeInt: var nameAsInt int64 if t == cborTypePositiveInt { _, _, val := d.getHead() - nameAsInt = int64(val) + if val > math.MaxInt64 { + if err == nil { + err = &UnmarshalTypeError{ + CBORType: t.String(), + GoType: reflect.TypeOf(int64(0)).String(), + errorMsg: strconv.FormatUint(val, 10) + " overflows Go's int64", + } + } + d.skip() // skip value + continue + } + nameAsInt = int64(val) //nolint:gosec } else { _, _, val := d.getHead() if val > math.MaxInt64 { @@ -2781,39 +2833,35 @@ MapEntryLoop: d.skip() // skip value continue } - nameAsInt = int64(-1) ^ int64(val) - } - - // Find field - for i := 0; i < len(structType.fields); i++ { - fld := structType.fields[i] - if fld.keyAsInt && fld.nameAsInt == nameAsInt { - if !foundFldIdx[i] { - f = fld - foundFldIdx[i] = true - } else if d.dm.dupMapKey == DupMapKeyEnforcedAPF { - err = &DupMapKeyError{nameAsInt, j} - d.skip() // skip value - j++ - // skip the rest of the map - for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ { - d.skip() - d.skip() - } - return err - } else { - // discard repeated match - d.skip() - continue MapEntryLoop + nameAsInt = int64(-1) ^ int64(val) //nolint:gosec + } + + // Find field by integer key + if fldIdx, ok := structType.fieldIndicesByIntKey[nameAsInt]; ok { + fld := structType.fields[fldIdx] + + switch checkDupField(d.dm, foundFldIdx, fldIdx) { + case mapActionParseValueAndContinue: + if fieldErr := d.decodeToStructField(v, fld, tInfo); fieldErr != nil && err == nil { + err = fieldErr } - break + continue + case mapActionSkipAllAndReturnError: + return d.skipMapForDupKey(nameAsInt, i, count, hasSize) + case mapActionSkipValueAndContinue: + d.skip() + continue } } - if d.dm.dupMapKey == DupMapKeyEnforcedAPF && f == nil { - k = nameAsInt + // No matching struct field found. + if unmatchedErr := handleUnmatchedMapKey(d, nameAsInt, i, count, hasSize, &unmatchedMapKeys); unmatchedErr != nil { + return unmatchedErr } - } else { + + default: + // CBOR map keys that can't be matched to any struct field. + if err == nil { err = &UnmarshalTypeError{ CBORType: t.String(), @@ -2821,97 +2869,31 @@ MapEntryLoop: errorMsg: "map key is of type " + t.String() + " and cannot be used to match struct field name", } } + + var otherKey any if d.dm.dupMapKey == DupMapKeyEnforcedAPF { // parse key - k, lastErr = d.parse(true) - if lastErr != nil { + var parseErr error + otherKey, parseErr = d.parse(true) + if parseErr != nil { d.skip() // skip value continue } // Detect if CBOR map key can be used as Go map key. - if !isHashableValue(reflect.ValueOf(k)) { + if !isHashableValue(reflect.ValueOf(otherKey)) { d.skip() // skip value continue } } else { d.skip() // skip key } - } - if f == nil { - if errOnUnknownField { - err = &UnknownFieldError{j} - d.skip() // Skip value - j++ - // skip the rest of the map - for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ { - d.skip() - d.skip() - } - return err - } - - // Two map keys that match the same struct field are immediately considered - // duplicates. This check detects duplicates between two map keys that do - // not match a struct field. If unknown field errors are enabled, then this - // check is never reached. - if d.dm.dupMapKey == DupMapKeyEnforcedAPF { - if mapKeys == nil { - mapKeys = make(map[any]struct{}, 1) - } - mapKeys[k] = struct{}{} - newKeyCount := len(mapKeys) - if newKeyCount == keyCount { - err = &DupMapKeyError{k, j} - d.skip() // skip value - j++ - // skip the rest of the map - for ; (hasSize && j < count) || (!hasSize && !d.foundBreak()); j++ { - d.skip() - d.skip() - } - return err - } - keyCount = newKeyCount - } - - d.skip() // Skip value - continue - } - - // Get field value by index - var fv reflect.Value - if len(f.idx) == 1 { - fv = v.Field(f.idx[0]) - } else { - fv, lastErr = getFieldValue(v, f.idx, func(v reflect.Value) (reflect.Value, error) { - // Return a new value for embedded field null pointer to point to, or return error. - if !v.CanSet() { - return reflect.Value{}, errors.New("cbor: cannot set embedded pointer to unexported struct: " + v.Type().String()) - } - v.Set(reflect.New(v.Type().Elem())) - return v, nil - }) - if lastErr != nil && err == nil { - err = lastErr - } - if !fv.IsValid() { - d.skip() - continue - } - } - - if lastErr = d.parseToValue(fv, f.typInfo); lastErr != nil { - if err == nil { - if typeError, ok := lastErr.(*UnmarshalTypeError); ok { - typeError.StructFieldName = tInfo.nonPtrType.String() + "." + f.name - err = typeError - } else { - err = lastErr - } + if unmatchedErr := handleUnmatchedMapKey(d, otherKey, i, count, hasSize, &unmatchedMapKeys); unmatchedErr != nil { + return unmatchedErr } } } + return err } @@ -2958,15 +2940,15 @@ func (d *decoder) skip() { switch t { case cborTypeByteString, cborTypeTextString: - d.off += int(val) + d.off += int(val) //nolint:gosec case cborTypeArray: - for i := 0; i < int(val); i++ { + for i := 0; i < int(val); i++ { //nolint:gosec d.skip() } case cborTypeMap: - for i := 0; i < int(val)*2; i++ { + for i := 0; i < int(val)*2; i++ { //nolint:gosec d.skip() } diff --git a/vendor/github.com/fxamacker/cbor/v2/decode_map_utils.go b/vendor/github.com/fxamacker/cbor/v2/decode_map_utils.go new file mode 100644 index 00000000000..3c8c423ad1a --- /dev/null +++ b/vendor/github.com/fxamacker/cbor/v2/decode_map_utils.go @@ -0,0 +1,98 @@ +// Copyright (c) Faye Amacker. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +package cbor + +import "strings" + +// mapAction represents the next action during decoding a CBOR map to a Go struct. +type mapAction int + +const ( + mapActionParseValueAndContinue mapAction = iota // The caller should process the map value. + mapActionSkipValueAndContinue // The caller should skip the map value. + mapActionSkipAllAndReturnError // The caller should skip the rest of the map and return an error. +) + +// checkDupField checks if a struct field at index i has already been matched and returns the next action. +// If not matched, it marks the field as matched and returns mapActionParseValueAndContinue. +// If matched and DupMapKeyEnforcedAPF is specified in the given dm, it returns mapActionSkipAllAndReturnError. +// If matched and DupMapKeyEnforcedAPF is not specified in the given dm, it returns mapActionSkipValueAndContinue. +func checkDupField(dm *decMode, foundFldIdx []bool, i int) mapAction { + if !foundFldIdx[i] { + foundFldIdx[i] = true + return mapActionParseValueAndContinue + } + if dm.dupMapKey == DupMapKeyEnforcedAPF { + return mapActionSkipAllAndReturnError + } + return mapActionSkipValueAndContinue +} + +// findStructFieldByKey finds a struct field matching keyBytes by name. +// It tries an exact match first. If no exact match is found and +// caseInsensitive is true, it falls back to a case-insensitive search. +// findStructFieldByKey returns the field index and true, or -1 and false. +func findStructFieldByKey( + structType *decodingStructType, + keyBytes []byte, + caseInsensitive bool, +) (int, bool) { + if fldIdx, ok := structType.fieldIndicesByName[string(keyBytes)]; ok { + return fldIdx, true + } + if caseInsensitive { + return findFieldCaseInsensitive(structType.fields, string(keyBytes)) + } + return -1, false +} + +// findFieldCaseInsensitive returns the index of the first field whose name +// case-insensitively matches key, or -1 and false if no field matches. +func findFieldCaseInsensitive(flds decodingFields, key string) (int, bool) { + keyLen := len(key) + for i, f := range flds { + if f.keyAsInt { + continue + } + if len(f.name) == keyLen && strings.EqualFold(f.name, key) { + return i, true + } + } + return -1, false +} + +// handleUnmatchedMapKey handles a map entry whose key does not match any struct +// field. It can return UnknownFieldError or DupMapKeyError. +// handleUnmatchedMapKey consumes the CBOR value, so the caller doesn't need to skip any values. +// If an error is returned, the caller should abort parsing the map and return the error. +// If no error is returned, the caller should continue to process the next map pair. +func handleUnmatchedMapKey( + d *decoder, + key any, + i int, + count int, + hasSize bool, + // *map[any]struct{} is used here because we use lazy initialization for uks + uks *map[any]struct{}, //nolint:gocritic +) error { + errOnUnknownField := (d.dm.extraReturnErrors & ExtraDecErrorUnknownField) > 0 + + if errOnUnknownField { + return d.skipMapForUnknownField(i, count, hasSize) + } + + if d.dm.dupMapKey == DupMapKeyEnforcedAPF { + if *uks == nil { + *uks = make(map[any]struct{}) + } + if _, dup := (*uks)[key]; dup { + return d.skipMapForDupKey(key, i, count, hasSize) + } + (*uks)[key] = struct{}{} + } + + // Skip value. + d.skip() + return nil +} diff --git a/vendor/github.com/fxamacker/cbor/v2/diagnose.go b/vendor/github.com/fxamacker/cbor/v2/diagnose.go index 44afb866089..42a67ad11fa 100644 --- a/vendor/github.com/fxamacker/cbor/v2/diagnose.go +++ b/vendor/github.com/fxamacker/cbor/v2/diagnose.go @@ -51,11 +51,8 @@ const ( maxByteStringEncoding ) -func (bse ByteStringEncoding) valid() error { - if bse >= maxByteStringEncoding { - return errors.New("cbor: invalid ByteStringEncoding " + strconv.Itoa(int(bse))) - } - return nil +func (bse ByteStringEncoding) valid() bool { + return bse < maxByteStringEncoding } // DiagOptions specifies Diag options. @@ -104,8 +101,8 @@ func (opts DiagOptions) DiagMode() (DiagMode, error) { } func (opts DiagOptions) diagMode() (*diagMode, error) { - if err := opts.ByteStringEncoding.valid(); err != nil { - return nil, err + if !opts.ByteStringEncoding.valid() { + return nil, errors.New("cbor: invalid ByteStringEncoding " + strconv.Itoa(int(opts.ByteStringEncoding))) } decMode, err := DecOptions{ @@ -360,7 +357,7 @@ func (di *diagnose) item() error { //nolint:gocyclo case cborTypeArray: _, _, val := di.d.getHead() - count := int(val) + count := int(val) //nolint:gosec di.w.WriteByte('[') for i := 0; i < count; i++ { @@ -376,7 +373,7 @@ func (di *diagnose) item() error { //nolint:gocyclo case cborTypeMap: _, _, val := di.d.getHead() - count := int(val) + count := int(val) //nolint:gosec di.w.WriteByte('{') for i := 0; i < count; i++ { @@ -477,8 +474,8 @@ func (di *diagnose) item() error { //nolint:gocyclo func (di *diagnose) writeU16(val rune) { di.w.WriteString("\\u") var in [2]byte - in[0] = byte(val >> 8) - in[1] = byte(val) + in[0] = byte(val >> 8) //nolint:gosec + in[1] = byte(val) //nolint:gosec sz := hex.EncodedLen(len(in)) di.w.Grow(sz) dst := di.w.Bytes()[di.w.Len() : di.w.Len()+sz] @@ -608,7 +605,7 @@ func (di *diagnose) encodeTextString(val string, quote byte) error { c, size := utf8.DecodeRuneInString(val[i:]) switch { - case c == utf8.RuneError: + case c == utf8.RuneError && size == 1: return &SemanticError{"cbor: invalid UTF-8 string"} case c < utf16SurrSelf: @@ -631,7 +628,7 @@ func (di *diagnose) encodeFloat(ai byte, val uint64) error { f64 := float64(0) switch ai { case additionalInformationAsFloat16: - f16 := float16.Frombits(uint16(val)) + f16 := float16.Frombits(uint16(val)) //nolint:gosec switch { case f16.IsNaN(): di.w.WriteString("NaN") @@ -647,7 +644,7 @@ func (di *diagnose) encodeFloat(ai byte, val uint64) error { } case additionalInformationAsFloat32: - f32 := math.Float32frombits(uint32(val)) + f32 := math.Float32frombits(uint32(val)) //nolint:gosec switch { case f32 != f32: di.w.WriteString("NaN") diff --git a/vendor/github.com/fxamacker/cbor/v2/doc.go b/vendor/github.com/fxamacker/cbor/v2/doc.go index c758b737489..e4c1d27b8dd 100644 --- a/vendor/github.com/fxamacker/cbor/v2/doc.go +++ b/vendor/github.com/fxamacker/cbor/v2/doc.go @@ -56,20 +56,30 @@ modes won't accidentally change at runtime after they're created. Modes are intended to be reused and are safe for concurrent use. -EncMode and DecMode Interfaces +EncMode, UserBufferEncMode, and DecMode Interfaces // EncMode interface uses immutable options and is safe for concurrent use. type EncMode interface { - Marshal(v interface{}) ([]byte, error) + Marshal(v any) ([]byte, error) NewEncoder(w io.Writer) *Encoder - EncOptions() EncOptions // returns copy of options + EncOptions() EncOptions + } + + // UserBufferEncMode extends EncMode with MarshalToBuffer, which supports + // user specified buffer rather than encoding into the built-in buffer pool. + type UserBufferEncMode interface { + EncMode + MarshalToBuffer(v any, buf *bytes.Buffer) error } // DecMode interface uses immutable options and is safe for concurrent use. type DecMode interface { - Unmarshal(data []byte, v interface{}) error + Unmarshal(data []byte, v any) error + UnmarshalFirst(data []byte, v any) (rest []byte, err error) + Valid(data []byte) error // Deprecated: use Wellformed instead. + Wellformed(data []byte) error NewDecoder(r io.Reader) *Decoder - DecOptions() DecOptions // returns copy of options + DecOptions() DecOptions } Using Default Encoding Mode diff --git a/vendor/github.com/fxamacker/cbor/v2/encode.go b/vendor/github.com/fxamacker/cbor/v2/encode.go index c550617c387..e65a29d8a6f 100644 --- a/vendor/github.com/fxamacker/cbor/v2/encode.go +++ b/vendor/github.com/fxamacker/cbor/v2/encode.go @@ -30,7 +30,7 @@ import ( // If value implements the Marshaler interface, Marshal calls its // MarshalCBOR method. // -// If value implements encoding.BinaryMarshaler, Marhsal calls its +// If value implements encoding.BinaryMarshaler, Marshal calls its // MarshalBinary method and encode it as CBOR byte string. // // Boolean values encode as CBOR booleans (type 7). @@ -343,7 +343,7 @@ const ( // non-UTC timezone then a "localtime - UTC" numeric offset will be included as specified in RFC3339. // NOTE: User applications can avoid including the RFC3339 numeric offset by: // - providing a time.Time value set to UTC, or - // - using the TimeUnix, TimeUnixMicro, or TimeUnixDynamic option instead of TimeRFC3339. + // - using the TimeUnix, TimeUnixMicro, TimeUnixDynamic, or TimeRFC3339NanoUTC option. TimeRFC3339 // TimeRFC3339Nano causes time.Time to encode to a CBOR time (tag 0) with a text string content @@ -351,9 +351,13 @@ const ( // non-UTC timezone then a "localtime - UTC" numeric offset will be included as specified in RFC3339. // NOTE: User applications can avoid including the RFC3339 numeric offset by: // - providing a time.Time value set to UTC, or - // - using the TimeUnix, TimeUnixMicro, or TimeUnixDynamic option instead of TimeRFC3339Nano. + // - using the TimeUnix, TimeUnixMicro, TimeUnixDynamic, or TimeRFC3339NanoUTC option. TimeRFC3339Nano + // TimeRFC3339NanoUTC causes time.Time to encode to a CBOR time (tag 0) with a text string content + // representing UTC time using nanosecond precision in RFC3339 format. + TimeRFC3339NanoUTC + maxTimeMode ) @@ -436,7 +440,7 @@ const ( // FieldNameToTextString encodes struct fields to CBOR text string (major type 3). FieldNameToTextString FieldNameMode = iota - // FieldNameToTextString encodes struct fields to CBOR byte string (major type 2). + // FieldNameToByteString encodes struct fields to CBOR byte string (major type 2). FieldNameToByteString maxFieldNameMode @@ -567,7 +571,7 @@ type EncOptions struct { // RFC3339 format gets tag number 0, and numeric epoch time tag number 1. TimeTag EncTagMode - // IndefLength specifies whether to allow indefinite length CBOR items. + // IndefLength specifies whether to allow indefinite-length CBOR items. IndefLength IndefLengthMode // NilContainers specifies how to encode nil slices and maps. @@ -1132,10 +1136,11 @@ func encodeFloat(e *bytes.Buffer, em *encMode, v reflect.Value) error { if fopt == ShortestFloat16 { var f16 float16.Float16 p := float16.PrecisionFromfloat32(f32) - if p == float16.PrecisionExact { + switch p { + case float16.PrecisionExact: // Roundtrip float32->float16->float32 test isn't needed. f16 = float16.Fromfloat32(f32) - } else if p == float16.PrecisionUnknown { + case float16.PrecisionUnknown: // Try roundtrip float32->float16->float32 to determine if float32 can fit into float16. f16 = float16.Fromfloat32(f32) if f16.Float32() == f32 { @@ -1293,10 +1298,10 @@ func encodeByteString(e *bytes.Buffer, em *encMode, v reflect.Value) error { if slen == 0 { return e.WriteByte(byte(cborTypeByteString)) } - encodeHead(e, byte(cborTypeByteString), uint64(slen)) + encodeHead(e, byte(cborTypeByteString), uint64(slen)) //nolint:gosec if vk == reflect.Array { for i := 0; i < slen; i++ { - e.WriteByte(byte(v.Index(i).Uint())) + e.WriteByte(byte(v.Index(i).Uint())) //nolint:gosec } return nil } @@ -1333,7 +1338,7 @@ func (ae arrayEncodeFunc) encode(e *bytes.Buffer, em *encMode, v reflect.Value) if alen == 0 { return e.WriteByte(byte(cborTypeArray)) } - encodeHead(e, byte(cborTypeArray), uint64(alen)) + encodeHead(e, byte(cborTypeArray), uint64(alen)) //nolint:gosec for i := 0; i < alen; i++ { if err := ae.f(e, em, v.Index(i)); err != nil { return err @@ -1364,7 +1369,7 @@ func (me mapEncodeFunc) encode(e *bytes.Buffer, em *encMode, v reflect.Value) er return e.WriteByte(byte(cborTypeMap)) } - encodeHead(e, byte(cborTypeMap), uint64(mlen)) + encodeHead(e, byte(cborTypeMap), uint64(mlen)) //nolint:gosec if em.sort == SortNone || em.sort == SortFastShuffle || mlen <= 1 { return me.e(e, em, v, nil) } @@ -1427,7 +1432,7 @@ func (x *bytewiseKeyValueSorter) Swap(i, j int) { func (x *bytewiseKeyValueSorter) Less(i, j int) bool { kvi, kvj := x.kvs[i], x.kvs[j] - return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) <= 0 + return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) < 0 } type lengthFirstKeyValueSorter struct { @@ -1448,7 +1453,7 @@ func (x *lengthFirstKeyValueSorter) Less(i, j int) bool { if keyLengthDifference := (kvi.valueOffset - kvi.offset) - (kvj.valueOffset - kvj.offset); keyLengthDifference != 0 { return keyLengthDifference < 0 } - return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) <= 0 + return bytes.Compare(x.data[kvi.offset:kvi.valueOffset], x.data[kvj.offset:kvj.valueOffset]) < 0 } var keyValuePool = sync.Pool{} @@ -1535,8 +1540,8 @@ func encodeStruct(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) { // Head is rewritten later if actual encoded field count is different from struct field count. encodedHeadLen := encodeHead(e, byte(cborTypeMap), uint64(len(flds))) - kvbegin := e.Len() - kvcount := 0 + kvBeginOffset := e.Len() + kvCount := 0 for offset := 0; offset < len(flds); offset++ { f := flds[(start+offset)%len(flds)] @@ -1582,10 +1587,10 @@ func encodeStruct(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) { return err } - kvcount++ + kvCount++ } - if len(flds) == kvcount { + if len(flds) == kvCount { // Encoded element count in head is the same as actual element count. return nil } @@ -1593,8 +1598,8 @@ func encodeStruct(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) { // Overwrite the bytes that were reserved for the head before encoding the map entries. var actualHeadLen int { - headbuf := *bytes.NewBuffer(e.Bytes()[kvbegin-encodedHeadLen : kvbegin-encodedHeadLen : kvbegin]) - actualHeadLen = encodeHead(&headbuf, byte(cborTypeMap), uint64(kvcount)) + headbuf := *bytes.NewBuffer(e.Bytes()[kvBeginOffset-encodedHeadLen : kvBeginOffset-encodedHeadLen : kvBeginOffset]) + actualHeadLen = encodeHead(&headbuf, byte(cborTypeMap), uint64(kvCount)) } if actualHeadLen == encodedHeadLen { @@ -1607,8 +1612,8 @@ func encodeStruct(e *bytes.Buffer, em *encMode, v reflect.Value) (err error) { // encoded. The encoded entries are offset to the right by the number of excess reserved // bytes. Shift the entries left to remove the gap. excessReservedBytes := encodedHeadLen - actualHeadLen - dst := e.Bytes()[kvbegin-excessReservedBytes : e.Len()-excessReservedBytes] - src := e.Bytes()[kvbegin:e.Len()] + dst := e.Bytes()[kvBeginOffset-excessReservedBytes : e.Len()-excessReservedBytes] + src := e.Bytes()[kvBeginOffset:e.Len()] copy(dst, src) // After shifting, the excess bytes are at the end of the output buffer and they are @@ -1633,7 +1638,7 @@ func encodeTime(e *bytes.Buffer, em *encMode, v reflect.Value) error { } if em.timeTag == EncTagRequired { tagNumber := 1 - if em.time == TimeRFC3339 || em.time == TimeRFC3339Nano { + if em.time == TimeRFC3339 || em.time == TimeRFC3339Nano || em.time == TimeRFC3339NanoUTC { tagNumber = 0 } encodeHead(e, byte(cborTypeTag), uint64(tagNumber)) @@ -1650,7 +1655,7 @@ func encodeTime(e *bytes.Buffer, em *encMode, v reflect.Value) error { case TimeUnixDynamic: t = t.UTC().Round(time.Microsecond) - secs, nsecs := t.Unix(), uint64(t.Nanosecond()) + secs, nsecs := t.Unix(), uint64(t.Nanosecond()) //nolint:gosec if nsecs == 0 { return encodeInt(e, em, reflect.ValueOf(secs)) } @@ -1661,6 +1666,10 @@ func encodeTime(e *bytes.Buffer, em *encMode, v reflect.Value) error { s := t.Format(time.RFC3339) return encodeString(e, em, reflect.ValueOf(s)) + case TimeRFC3339NanoUTC: + s := t.UTC().Format(time.RFC3339Nano) + return encodeString(e, em, reflect.ValueOf(s)) + default: // TimeRFC3339Nano s := t.Format(time.RFC3339Nano) return encodeString(e, em, reflect.ValueOf(s)) diff --git a/vendor/github.com/fxamacker/cbor/v2/simplevalue.go b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go index 30f72814f60..9912e855c24 100644 --- a/vendor/github.com/fxamacker/cbor/v2/simplevalue.go +++ b/vendor/github.com/fxamacker/cbor/v2/simplevalue.go @@ -93,6 +93,6 @@ func (sv *SimpleValue) unmarshalCBOR(data []byte) error { // It is safe to cast val to uint8 here because // - data is already verified to be well-formed CBOR simple value and // - val is <= math.MaxUint8. - *sv = SimpleValue(val) + *sv = SimpleValue(val) //nolint:gosec return nil } diff --git a/vendor/github.com/fxamacker/cbor/v2/stream.go b/vendor/github.com/fxamacker/cbor/v2/stream.go index 7ac6d7d6712..282b3f7ddc9 100644 --- a/vendor/github.com/fxamacker/cbor/v2/stream.go +++ b/vendor/github.com/fxamacker/cbor/v2/stream.go @@ -6,6 +6,7 @@ package cbor import ( "bytes" "errors" + "fmt" "io" "reflect" ) @@ -157,11 +158,32 @@ func (dec *Decoder) overwriteBuf(newBuf []byte) { dec.off = 0 } +// indefDataItem tracks open indefinite-length data item during encoding. +// typ is the CBOR type of the indefinite-length data item. +// count is the number of items written so far. +// For indefinite-length maps, count must be even (key/value pairs) when +// the container is closed. +type indefDataItem struct { + typ cborType + count int +} + +// IndefiniteLengthMapOddItemCountError indicates that EndIndefinite was +// called on an open indefinite-length map with an odd number of items. +type IndefiniteLengthMapOddItemCountError struct { + count int +} + +func (e *IndefiniteLengthMapOddItemCountError) Error() string { + return fmt.Sprintf("cbor: cannot end indefinite-length map with %d item(s)", e.count) +} + // Encoder writes CBOR values to io.Writer. type Encoder struct { - w io.Writer - em *encMode - indefTypes []cborType + w io.Writer + em *encMode + indefs []indefDataItem + scratch [1]byte // reused for single-byte writes (indefinite-length head and break code) } // NewEncoder returns a new encoder that writes to w using the default encoding options. @@ -171,89 +193,166 @@ func NewEncoder(w io.Writer) *Encoder { // Encode writes the CBOR encoding of v. func (enc *Encoder) Encode(v any) error { - if len(enc.indefTypes) > 0 && v != nil { - indefType := enc.indefTypes[len(enc.indefTypes)-1] - if indefType == cborTypeTextString { - k := reflect.TypeOf(v).Kind() - if k != reflect.String { - return errors.New("cbor: cannot encode item type " + k.String() + " for indefinite-length text string") - } - } else if indefType == cborTypeByteString { - t := reflect.TypeOf(v) - k := t.Kind() - if (k != reflect.Array && k != reflect.Slice) || t.Elem().Kind() != reflect.Uint8 { - return errors.New("cbor: cannot encode item type " + k.String() + " for indefinite-length byte string") - } + if len(enc.indefs) > 0 { + err := validateIndefiniteLengthChunkByType(enc.indefs[len(enc.indefs)-1].typ, v) + if err != nil { + return err } } buf := getEncodeBuffer() err := encode(buf, enc.em, reflect.ValueOf(v)) + + // Validate the encoded chunk against the indefinite-length data item using a byte-based check. + // This reliably detects chunks from cbor.Marshaler, registered tags, StringToByteString, etc., + // which may produce a chunk inconsistent with the parent's major type. + // Applies only to indefinite-length byte/text string parents (RFC 8949 Section 3.2.3). + if err == nil && len(enc.indefs) > 0 { + err = validateIndefiniteLengthChunkByData(enc.indefs[len(enc.indefs)-1].typ, buf.Bytes(), v) + } + if err == nil { _, err = enc.w.Write(buf.Bytes()) } putEncodeBuffer(buf) - return err + + if err != nil { + return err + } + + if len(enc.indefs) > 0 { + enc.indefs[len(enc.indefs)-1].count++ + } + + return nil } -// StartIndefiniteByteString starts byte string encoding of indefinite length. +// StartIndefiniteByteString starts indefinite-length byte string encoding. // Subsequent calls of (*Encoder).Encode() encodes definite length byte strings // ("chunks") as one contiguous string until EndIndefinite is called. func (enc *Encoder) StartIndefiniteByteString() error { return enc.startIndefinite(cborTypeByteString) } -// StartIndefiniteTextString starts text string encoding of indefinite length. +// StartIndefiniteTextString starts indefinite-length text string encoding. // Subsequent calls of (*Encoder).Encode() encodes definite length text strings // ("chunks") as one contiguous string until EndIndefinite is called. func (enc *Encoder) StartIndefiniteTextString() error { return enc.startIndefinite(cborTypeTextString) } -// StartIndefiniteArray starts array encoding of indefinite length. +// StartIndefiniteArray starts indefinite-length array encoding. // Subsequent calls of (*Encoder).Encode() encodes elements of the array // until EndIndefinite is called. func (enc *Encoder) StartIndefiniteArray() error { return enc.startIndefinite(cborTypeArray) } -// StartIndefiniteMap starts array encoding of indefinite length. +// StartIndefiniteMap starts indefinite-length map encoding. // Subsequent calls of (*Encoder).Encode() encodes elements of the map // until EndIndefinite is called. func (enc *Encoder) StartIndefiniteMap() error { return enc.startIndefinite(cborTypeMap) } -// EndIndefinite closes last opened indefinite length value. +// EndIndefinite closes last opened indefinite-length value. +// It returns *IndefiniteLengthMapOddItemCountError without writing the +// "break" code if the open indefinite-length map has an odd number of +// items; the encoder state is unchanged so the caller can write the +// missing value and retry. func (enc *Encoder) EndIndefinite() error { - if len(enc.indefTypes) == 0 { + if len(enc.indefs) == 0 { return errors.New("cbor: cannot encode \"break\" code outside indefinite length values") } - _, err := enc.w.Write([]byte{cborBreakFlag}) - if err == nil { - enc.indefTypes = enc.indefTypes[:len(enc.indefTypes)-1] + + // Verify that indefinite-length map has even number of elements + top := enc.indefs[len(enc.indefs)-1] + if top.typ == cborTypeMap && top.count%2 != 0 { + return &IndefiniteLengthMapOddItemCountError{count: top.count} } - return err -} -var cborIndefHeader = map[cborType][]byte{ - cborTypeByteString: {cborByteStringWithIndefiniteLengthHead}, - cborTypeTextString: {cborTextStringWithIndefiniteLengthHead}, - cborTypeArray: {cborArrayWithIndefiniteLengthHead}, - cborTypeMap: {cborMapWithIndefiniteLengthHead}, + // Write break code + enc.scratch[0] = cborBreakFlag + _, err := enc.w.Write(enc.scratch[:]) + if err != nil { + return err + } + + enc.indefs = enc.indefs[:len(enc.indefs)-1] + + // Increment parent container's item count because the child + // (indefinite-length data item) is fully written to the stream. + if len(enc.indefs) > 0 { + enc.indefs[len(enc.indefs)-1].count++ + } + + return nil } func (enc *Encoder) startIndefinite(typ cborType) error { if enc.em.indefLength == IndefLengthForbidden { return &IndefiniteLengthError{typ} } - _, err := enc.w.Write(cborIndefHeader[typ]) - if err == nil { - enc.indefTypes = append(enc.indefTypes, typ) + + // Verify that new indefinite-length data item is not a chunk in indefinite-length byte/text string. + if len(enc.indefs) > 0 { + parent := enc.indefs[len(enc.indefs)-1].typ + if parent == cborTypeByteString || parent == cborTypeTextString { + return errors.New("cbor: cannot encode indefinite-length " + typ.String() + + " as chunk of indefinite-length " + parent.String()) + } } - return err + + // Write indefinite-length head. + enc.scratch[0] = byte(typ) | additionalInformationAsIndefiniteLengthFlag + _, err := enc.w.Write(enc.scratch[:]) + if err != nil { + return err + } + + enc.indefs = append(enc.indefs, indefDataItem{typ: typ}) + return nil +} + +// validateIndefiniteLengthChunkByType rejects chunks based solely on their Go type. +func validateIndefiniteLengthChunkByType(indefiniteLengthCborType cborType, v any) error { + if indefiniteLengthCborType != cborTypeByteString && + indefiniteLengthCborType != cborTypeTextString { + return nil + } + if v == nil { + return errors.New("cbor: cannot encode nil for indefinite-length " + indefiniteLengthCborType.String()) + } + return nil +} + +// validateIndefiniteLengthChunkByData checks that chunk is a definite-length +// CBOR data item with a matching major type. +// No-op for indefinite-length array/map, where any data item is valid. +func validateIndefiniteLengthChunkByData(indefiniteLengthCborType cborType, chunk []byte, v any) error { + if indefiniteLengthCborType != cborTypeByteString && + indefiniteLengthCborType != cborTypeTextString { + return nil + } + + if len(chunk) == 0 { + return errors.New("cbor: cannot encode item type " + reflect.TypeOf(v).Kind().String() + + " for indefinite-length " + indefiniteLengthCborType.String()) + } + + t, ai := parseInitialByte(chunk[0]) + if t != indefiniteLengthCborType { + return errors.New("cbor: cannot encode item type " + reflect.TypeOf(v).Kind().String() + + " for indefinite-length " + indefiniteLengthCborType.String()) + } + + if ai == additionalInformationAsIndefiniteLengthFlag { + return errors.New("cbor: cannot encode indefinite-length " + indefiniteLengthCborType.String() + + " as chunk of indefinite-length " + indefiniteLengthCborType.String()) + } + return nil } // RawMessage is a raw encoded CBOR value. @@ -262,7 +361,9 @@ type RawMessage []byte // MarshalCBOR returns m or CBOR nil if m is nil. func (m RawMessage) MarshalCBOR() ([]byte, error) { if len(m) == 0 { - return cborNil, nil + b := make([]byte, len(cborNil)) + copy(b, cborNil) + return b, nil } return m, nil } diff --git a/vendor/github.com/fxamacker/cbor/v2/structfields.go b/vendor/github.com/fxamacker/cbor/v2/structfields.go index cf0a922cd7c..b2d71f2e9aa 100644 --- a/vendor/github.com/fxamacker/cbor/v2/structfields.go +++ b/vendor/github.com/fxamacker/cbor/v2/structfields.go @@ -6,27 +6,43 @@ package cbor import ( "reflect" "sort" + "strconv" "strings" ) +// field holds shared struct field metadata returned by getFields(). type field struct { - name string - nameAsInt int64 // used to decoder to match field name with CBOR int + name string + nameAsInt int64 // used to match field name with CBOR int + idx []int + typ reflect.Type // used during cache building only + keyAsInt bool // used to encode/decode field name as int + tagged bool // used to choose dominant field (at the same level tagged fields dominate untagged fields) + omitEmpty bool // used to skip empty field + omitZero bool // used to skip zero field +} + +type fields []*field + +// encodingField extends field with encoding-specific data. +type encodingField struct { + field cborName []byte - cborNameByteString []byte // major type 2 name encoding iff cborName has major type 3 - idx []int - typ reflect.Type + cborNameByteString []byte // major type 2 name encoding if cborName has major type 3 ef encodeFunc ief isEmptyFunc izf isZeroFunc - typInfo *typeInfo // used to decoder to reuse type info - tagged bool // used to choose dominant field (at the same level tagged fields dominate untagged fields) - omitEmpty bool // used to skip empty field - omitZero bool // used to skip zero field - keyAsInt bool // used to encode/decode field name as int } -type fields []*field +type encodingFields []*encodingField + +// decodingField extends field with decoding-specific data. +type decodingField struct { + field + typInfo *typeInfo // used by decoder to reuse type info +} + +type decodingFields []*decodingField // indexFieldSorter sorts fields by field idx at each level, breaking ties with idx depth. type indexFieldSorter struct { @@ -48,7 +64,7 @@ func (x *indexFieldSorter) Less(i, j int) bool { return iIdx[k] < jIdx[k] } } - return len(iIdx) <= len(jIdx) + return len(iIdx) < len(jIdx) } // nameLevelAndTagFieldSorter sorts fields by field name, idx depth, and presence of tag. @@ -69,6 +85,10 @@ func (x *nameLevelAndTagFieldSorter) Less(i, j int) bool { if fi.name != fj.name { return fi.name < fj.name } + // Fields with the same name but different keyAsInt are in separate namespaces. + if fi.keyAsInt != fj.keyAsInt { + return fi.keyAsInt + } if len(fi.idx) != len(fj.idx) { return len(fi.idx) < len(fj.idx) } @@ -117,22 +137,37 @@ func getFields(t reflect.Type) (flds fields, structOptions string) { } } + // Normalize keyasint field names to their canonical integer string form. + // This ensures that "01", "+1", and "1" are treated as the same key + // during deduplication. + for _, f := range flds { + if f.keyAsInt { + nameAsInt, err := strconv.Atoi(f.name) + if err != nil { + continue // Leave invalid names for callers to report. + } + f.nameAsInt = int64(nameAsInt) + f.name = strconv.Itoa(nameAsInt) + } + } + sort.Sort(&nameLevelAndTagFieldSorter{flds}) // Keep visible fields. j := 0 // index of next unique field for i := 0; i < len(flds); { name := flds[i].name + keyAsInt := flds[i].keyAsInt if i == len(flds)-1 || // last field - name != flds[i+1].name || // field i has unique field name + name != flds[i+1].name || flds[i+1].keyAsInt != keyAsInt || // field i has unique (name, keyAsInt) len(flds[i].idx) < len(flds[i+1].idx) || // field i is at a less nested level than field i+1 (flds[i].tagged && !flds[i+1].tagged) { // field i is tagged while field i+1 is not flds[j] = flds[i] j++ } - // Skip fields with the same field name. - for i++; i < len(flds) && name == flds[i].name; i++ { //nolint:revive + // Skip fields with the same (name, keyAsInt). + for i++; i < len(flds) && name == flds[i].name && keyAsInt == flds[i].keyAsInt; i++ { //nolint:revive } } if j != len(flds) { diff --git a/vendor/github.com/fxamacker/cbor/v2/tag.go b/vendor/github.com/fxamacker/cbor/v2/tag.go index bd8b773f54b..ee46e742136 100644 --- a/vendor/github.com/fxamacker/cbor/v2/tag.go +++ b/vendor/github.com/fxamacker/cbor/v2/tag.go @@ -155,6 +155,7 @@ type TagSet interface { Add(opts TagOptions, contentType reflect.Type, num uint64, nestedNum ...uint64) error // Remove removes given tag content type from TagSet. + // Remove is a no-op if contentType is nil. Remove(contentType reflect.Type) tagProvider @@ -245,7 +246,11 @@ func (t *syncTagSet) Add(opts TagOptions, contentType reflect.Type, num uint64, } // Remove removes given tag content type from TagSet. +// Remove is a no-op if contentType is nil. func (t *syncTagSet) Remove(contentType reflect.Type) { + if contentType == nil { + return + } for contentType.Kind() == reflect.Pointer { contentType = contentType.Elem() } diff --git a/vendor/github.com/fxamacker/cbor/v2/valid.go b/vendor/github.com/fxamacker/cbor/v2/valid.go index b40793b95e3..850b95019c5 100644 --- a/vendor/github.com/fxamacker/cbor/v2/valid.go +++ b/vendor/github.com/fxamacker/cbor/v2/valid.go @@ -54,7 +54,7 @@ func (e *MaxMapPairsError) Error() string { return "cbor: exceeded max number of key-value pairs " + strconv.Itoa(e.maxMapPairs) + " for CBOR map" } -// IndefiniteLengthError indicates found disallowed indefinite length items. +// IndefiniteLengthError indicates found disallowed indefinite-length items. type IndefiniteLengthError struct { t cborType } @@ -113,7 +113,7 @@ func (d *decoder) wellformedInternal(depth int, checkBuiltinTags bool) (int, err } return d.wellformedIndefiniteString(t, depth, checkBuiltinTags) } - valInt := int(val) + valInt := int(val) //nolint:gosec if valInt < 0 { // Detect integer overflow return 0, errors.New("cbor: " + t.String() + " length " + strconv.FormatUint(val, 10) + " is too large, causing integer overflow") @@ -136,7 +136,7 @@ func (d *decoder) wellformedInternal(depth int, checkBuiltinTags bool) (int, err return d.wellformedIndefiniteArrayOrMap(t, depth, checkBuiltinTags) } - valInt := int(val) + valInt := int(val) //nolint:gosec if valInt < 0 { // Detect integer overflow return 0, errors.New("cbor: " + t.String() + " length " + strconv.FormatUint(val, 10) + " is too large, it would cause integer overflow") @@ -212,7 +212,7 @@ func (d *decoder) wellformedInternal(depth int, checkBuiltinTags bool) (int, err return depth, nil } -// wellformedIndefiniteString checks indefinite length byte/text string's well-formedness and returns max depth and error. +// wellformedIndefiniteString checks indefinite-length byte/text string's well-formedness and returns max depth and error. func (d *decoder) wellformedIndefiniteString(t cborType, depth int, checkBuiltinTags bool) (int, error) { var err error for { @@ -223,7 +223,7 @@ func (d *decoder) wellformedIndefiniteString(t cborType, depth int, checkBuiltin d.off++ break } - // Peek ahead to get next type and indefinite length status. + // Peek ahead to get next type and indefinite-length status. nt, ai := parseInitialByte(d.data[d.off]) if t != nt { return 0, &SyntaxError{"cbor: wrong element type " + nt.String() + " for indefinite-length " + t.String()} @@ -238,7 +238,7 @@ func (d *decoder) wellformedIndefiniteString(t cborType, depth int, checkBuiltin return depth, nil } -// wellformedIndefiniteArrayOrMap checks indefinite length array/map's well-formedness and returns max depth and error. +// wellformedIndefiniteArrayOrMap checks indefinite-length array/map's well-formedness and returns max depth and error. func (d *decoder) wellformedIndefiniteArrayOrMap(t cborType, depth int, checkBuiltinTags bool) (int, error) { var err error maxDepth := depth @@ -326,7 +326,7 @@ func (d *decoder) wellformedHead() (t cborType, ai byte, val uint64, err error) val = uint64(binary.BigEndian.Uint16(d.data[d.off : d.off+argumentSize])) d.off += argumentSize if t == cborTypePrimitives { - if err := d.acceptableFloat(float64(float16.Frombits(uint16(val)).Float32())); err != nil { + if err := d.acceptableFloat(float64(float16.Frombits(uint16(val)).Float32())); err != nil { //nolint:gosec return 0, 0, 0, err } } @@ -341,7 +341,7 @@ func (d *decoder) wellformedHead() (t cborType, ai byte, val uint64, err error) val = uint64(binary.BigEndian.Uint32(d.data[d.off : d.off+argumentSize])) d.off += argumentSize if t == cborTypePrimitives { - if err := d.acceptableFloat(float64(math.Float32frombits(uint32(val)))); err != nil { + if err := d.acceptableFloat(float64(math.Float32frombits(uint32(val)))); err != nil { //nolint:gosec return 0, 0, 0, err } } @@ -379,12 +379,12 @@ func (d *decoder) wellformedHead() (t cborType, ai byte, val uint64, err error) func (d *decoder) acceptableFloat(f float64) error { switch { - case d.dm.nanDec == NaNDecodeForbidden && math.IsNaN(f): + case d.dm.nan == NaNDecodeForbidden && math.IsNaN(f): return &UnacceptableDataItemError{ CBORType: cborTypePrimitives.String(), Message: "floating-point NaN", } - case d.dm.infDec == InfDecodeForbidden && math.IsInf(f, 0): + case d.dm.inf == InfDecodeForbidden && math.IsInf(f, 0): return &UnacceptableDataItemError{ CBORType: cborTypePrimitives.String(), Message: "floating-point infinity", diff --git a/vendor/github.com/go-jose/go-jose/v4/asymmetric.go b/vendor/github.com/go-jose/go-jose/v4/asymmetric.go index 7784cd4584e..2b5607617ef 100644 --- a/vendor/github.com/go-jose/go-jose/v4/asymmetric.go +++ b/vendor/github.com/go-jose/go-jose/v4/asymmetric.go @@ -21,6 +21,7 @@ import ( "crypto/aes" "crypto/ecdsa" "crypto/ed25519" + "crypto/elliptic" "crypto/rand" "crypto/rsa" "crypto/sha1" @@ -195,11 +196,11 @@ func (ctx rsaEncrypterVerifier) encryptKey(cek []byte, alg KeyAlgorithm) (recipi func (ctx rsaEncrypterVerifier) encrypt(cek []byte, alg KeyAlgorithm) ([]byte, error) { switch alg { case RSA1_5: - return rsa.EncryptPKCS1v15(RandReader, ctx.publicKey, cek) + return rsa.EncryptPKCS1v15(randReader, ctx.publicKey, cek) case RSA_OAEP: - return rsa.EncryptOAEP(sha1.New(), RandReader, ctx.publicKey, cek, []byte{}) + return rsa.EncryptOAEP(sha1.New(), randReader, ctx.publicKey, cek, []byte{}) case RSA_OAEP_256: - return rsa.EncryptOAEP(sha256.New(), RandReader, ctx.publicKey, cek, []byte{}) + return rsa.EncryptOAEP(sha256.New(), randReader, ctx.publicKey, cek, []byte{}) } return nil, ErrUnsupportedAlgorithm @@ -288,9 +289,9 @@ func (ctx rsaDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm // TODO(https://github.com/go-jose/go-jose/issues/40): As of go1.20, the // random parameter is legacy and ignored, and it can be nil. // https://cs.opensource.google/go/go/+/refs/tags/go1.20:src/crypto/rsa/pkcs1v15.go;l=263;bpv=0;bpt=1 - out, err = rsa.SignPKCS1v15(RandReader, ctx.privateKey, hash, hashed) + out, err = rsa.SignPKCS1v15(randReader, ctx.privateKey, hash, hashed) case PS256, PS384, PS512: - out, err = rsa.SignPSS(RandReader, ctx.privateKey, hash, hashed, &rsa.PSSOptions{ + out, err = rsa.SignPSS(randReader, ctx.privateKey, hash, hashed, &rsa.PSSOptions{ SaltLength: rsa.PSSSaltLengthEqualsHash, }) } @@ -391,7 +392,7 @@ func (ctx ecKeyGenerator) keySize() int { // Get a content encryption key for ECDH-ES func (ctx ecKeyGenerator) genKey() ([]byte, rawHeader, error) { - priv, err := ecdsa.GenerateKey(ctx.publicKey.Curve, RandReader) + priv, err := ecdsa.GenerateKey(ctx.publicKey.Curve, randReader) if err != nil { return nil, rawHeader{}, err } @@ -483,7 +484,7 @@ func (ctx edDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm) return Signature{}, ErrUnsupportedAlgorithm } - sig, err := ctx.privateKey.Sign(RandReader, payload, crypto.Hash(0)) + sig, err := ctx.privateKey.Sign(randReader, payload, crypto.Hash(0)) if err != nil { return Signature{}, err } @@ -533,7 +534,7 @@ func (ctx ecDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm) _, _ = hasher.Write(payload) hashed := hasher.Sum(nil) - r, s, err := ecdsa.Sign(RandReader, ctx.privateKey, hashed) + r, s, err := ecdsa.Sign(randReader, ctx.privateKey, hashed) if err != nil { return Signature{}, err } @@ -571,12 +572,21 @@ func (ctx ecEncrypterVerifier) verifyPayload(payload []byte, signature []byte, a case ES256: keySize = 32 hash = crypto.SHA256 + if ctx.publicKey.Curve != elliptic.P256() { + return fmt.Errorf("go-jose/go-jose: signature uses different algorithm than public key") + } case ES384: keySize = 48 hash = crypto.SHA384 + if ctx.publicKey.Curve != elliptic.P384() { + return fmt.Errorf("go-jose/go-jose: signature uses different algorithm than public key") + } case ES512: keySize = 66 hash = crypto.SHA512 + if ctx.publicKey.Curve != elliptic.P521() { + return fmt.Errorf("go-jose/go-jose: signature uses different algorithm than public key") + } default: return ErrUnsupportedAlgorithm } diff --git a/vendor/github.com/go-jose/go-jose/v4/cipher/cbc_hmac.go b/vendor/github.com/go-jose/go-jose/v4/cipher/cbc_hmac.go index af029cec0ba..a301ad9e203 100644 --- a/vendor/github.com/go-jose/go-jose/v4/cipher/cbc_hmac.go +++ b/vendor/github.com/go-jose/go-jose/v4/cipher/cbc_hmac.go @@ -51,6 +51,8 @@ func NewCBCHMAC(key []byte, newBlockCipher func([]byte) (cipher.Block, error)) ( hash = sha512.New384 case 32: hash = sha512.New + default: + return nil, errors.New("go-jose/go-jose: invalid key size for CBC-HMAC") } return &cbcAEAD{ @@ -176,7 +178,9 @@ func padBuffer(buffer []byte, blockSize int) []byte { // Remove padding func unpadBuffer(buffer []byte, blockSize int) ([]byte, error) { - if len(buffer)%blockSize != 0 { + // A padded buffer can't be empty because an empty input is padded with + // `blockSize` bytes, resulting in a non-empty ciphertext. + if len(buffer) == 0 || len(buffer)%blockSize != 0 { return nil, errors.New("go-jose/go-jose: invalid padding") } diff --git a/vendor/github.com/go-jose/go-jose/v4/crypter.go b/vendor/github.com/go-jose/go-jose/v4/crypter.go index 31290fc8715..e3df79c2dc5 100644 --- a/vendor/github.com/go-jose/go-jose/v4/crypter.go +++ b/vendor/github.com/go-jose/go-jose/v4/crypter.go @@ -258,6 +258,10 @@ func (ctx *genericEncrypter) addRecipient(recipient Recipient) (err error) { } recipientInfo, err = makeJWERecipient(recipient.Algorithm, recipient.Key) + if err != nil { + return err + } + if recipient.KeyID != "" { recipientInfo.keyID = recipient.KeyID } @@ -270,10 +274,8 @@ func (ctx *genericEncrypter) addRecipient(recipient Recipient) (err error) { } } - if err == nil { - ctx.recipients = append(ctx.recipients, recipientInfo) - } - return err + ctx.recipients = append(ctx.recipients, recipientInfo) + return nil } func makeJWERecipient(alg KeyAlgorithm, encryptionKey interface{}) (recipientKeyInfo, error) { @@ -490,21 +492,19 @@ func (obj JSONWebEncryption) Decrypt(decryptionKey interface{}) ([]byte, error) recipientHeaders := obj.mergedHeaders(&recipient) cek, err := decrypter.decryptKey(recipientHeaders, &recipient, generator) - if err == nil { - // Found a valid CEK -- let's try to decrypt. - plaintext, err = cipher.decrypt(cek, authData, parts) + if err != nil { + return nil, ErrCryptoFailure } - if plaintext == nil { + // Found a valid CEK -- let's try to decrypt. + plaintext, err = cipher.decrypt(cek, authData, parts) + if err != nil { return nil, ErrCryptoFailure } - // The "zip" header parameter may only be present in the protected header. - if comp := obj.protected.getCompression(); comp != "" { - plaintext, err = decompress(comp, plaintext) - if err != nil { - return nil, fmt.Errorf("go-jose/go-jose: failed to decompress plaintext: %v", err) - } + plaintext, err = obj.decompress(plaintext) + if err != nil { + return nil, err } return plaintext, nil @@ -559,31 +559,38 @@ func (obj JSONWebEncryption) DecryptMulti(decryptionKey interface{}) (int, Heade var plaintext []byte var headers rawHeader + if len(obj.recipients) == 0 { + return -1, Header{}, nil, errors.New("go-jose/go-jose: no recipients") + } + + // Loop sets `err` in the function scope; don't shadow it. for i, recipient := range obj.recipients { recipientHeaders := obj.mergedHeaders(&recipient) - cek, err := decrypter.decryptKey(recipientHeaders, &recipient, generator) - if err == nil { - // Found a valid CEK -- let's try to decrypt. - plaintext, err = cipher.decrypt(cek, authData, parts) - if err == nil { - index = i - headers = recipientHeaders - break - } + var cek []byte + cek, err = decrypter.decryptKey(recipientHeaders, &recipient, generator) + if err != nil { + continue } + + // Found a valid CEK -- let's try to decrypt. + plaintext, err = cipher.decrypt(cek, authData, parts) + if err != nil { + continue + } + + index = i + headers = recipientHeaders + break } - if plaintext == nil { + if err != nil { return -1, Header{}, nil, ErrCryptoFailure } - // The "zip" header parameter may only be present in the protected header. - if comp := obj.protected.getCompression(); comp != "" { - plaintext, err = decompress(comp, plaintext) - if err != nil { - return -1, Header{}, nil, fmt.Errorf("go-jose/go-jose: failed to decompress plaintext: %v", err) - } + plaintext, err = obj.decompress(plaintext) + if err != nil { + return -1, Header{}, nil, err } sanitized, err := headers.sanitized() @@ -593,3 +600,22 @@ func (obj JSONWebEncryption) DecryptMulti(decryptionKey interface{}) (int, Heade return index, sanitized, plaintext, err } + +// decompress decompresses plaintext using the protected "zip" header, if present. +// It returns plaintext unchanged when there is no protected header or "zip" value. +func (obj JSONWebEncryption) decompress(plaintext []byte) ([]byte, error) { + if obj.protected == nil { + return plaintext, nil + } + + comp := obj.protected.getCompression() + if comp == "" { + return plaintext, nil + } + + plaintext, err := decompress(comp, plaintext) + if err != nil { + return nil, fmt.Errorf("go-jose/go-jose: failed to decompress plaintext: %v", err) + } + return plaintext, nil +} diff --git a/vendor/github.com/go-jose/go-jose/v4/json/scanner.go b/vendor/github.com/go-jose/go-jose/v4/json/scanner.go index ee6622e8cf8..3bd29f397a9 100644 --- a/vendor/github.com/go-jose/go-jose/v4/json/scanner.go +++ b/vendor/github.com/go-jose/go-jose/v4/json/scanner.go @@ -140,6 +140,10 @@ const ( parseArrayValue // parsing array value ) +// This limits the max nesting depth to prevent stack overflow. +// This is permitted by https://tools.ietf.org/html/rfc7159#section-9 +const maxNestingDepth = 10000 + // reset prepares the scanner for use. // It must be called before calling s.step. func (s *scanner) reset() { @@ -170,8 +174,13 @@ func (s *scanner) eof() int { } // pushParseState pushes a new parse state p onto the parse stack. -func (s *scanner) pushParseState(p int) { - s.parseState = append(s.parseState, p) +// an error state is returned if maxNestingDepth was exceeded, otherwise successState is returned. +func (s *scanner) pushParseState(c byte, newParseState int, successState int) int { + s.parseState = append(s.parseState, newParseState) + if len(s.parseState) <= maxNestingDepth { + return successState + } + return s.error(c, "exceeded max depth") } // popParseState pops a parse state (already obtained) off the stack @@ -211,12 +220,10 @@ func stateBeginValue(s *scanner, c byte) int { switch c { case '{': s.step = stateBeginStringOrEmpty - s.pushParseState(parseObjectKey) - return scanBeginObject + return s.pushParseState(c, parseObjectKey, scanBeginObject) case '[': s.step = stateBeginValueOrEmpty - s.pushParseState(parseArrayValue) - return scanBeginArray + return s.pushParseState(c, parseArrayValue, scanBeginArray) case '"': s.step = stateInString return scanBeginLiteral diff --git a/vendor/github.com/go-jose/go-jose/v4/jwe.go b/vendor/github.com/go-jose/go-jose/v4/jwe.go index 6102f910005..ae173461b70 100644 --- a/vendor/github.com/go-jose/go-jose/v4/jwe.go +++ b/vendor/github.com/go-jose/go-jose/v4/jwe.go @@ -153,6 +153,10 @@ func ParseEncryptedJSON( keyEncryptionAlgorithms []KeyAlgorithm, contentEncryption []ContentEncryption, ) (*JSONWebEncryption, error) { + if len(input) == 0 { + return nil, errEmptyInput + } + var parsed rawJSONWebEncryption err := json.Unmarshal([]byte(input), &parsed) if err != nil { @@ -291,6 +295,10 @@ func ParseEncryptedCompact( var parts [5]string var ok bool + if len(input) == 0 { + return nil, errEmptyInput + } + for i := range 4 { parts[i], input, ok = strings.Cut(input, ".") if !ok { diff --git a/vendor/github.com/go-jose/go-jose/v4/jwk.go b/vendor/github.com/go-jose/go-jose/v4/jwk.go index 164d6a16197..f712ec7ec8f 100644 --- a/vendor/github.com/go-jose/go-jose/v4/jwk.go +++ b/vendor/github.com/go-jose/go-jose/v4/jwk.go @@ -107,7 +107,7 @@ func (k JSONWebKey) MarshalJSON() ([]byte, error) { switch key := k.Key.(type) { case ed25519.PublicKey: - raw = fromEdPublicKey(key) + raw, err = fromEdPublicKey(key) case *ecdsa.PublicKey: raw, err = fromEcPublicKey(key) case *rsa.PublicKey: @@ -207,21 +207,29 @@ func (k *JSONWebKey) UnmarshalJSON(data []byte) (err error) { case "EC": if raw.D != nil { key, err = raw.ecPrivateKey() - if err == nil { - keyPub = key.(*ecdsa.PrivateKey).Public() + if err != nil { + return err } + keyPub = key.(*ecdsa.PrivateKey).Public() } else { key, err = raw.ecPublicKey() + if err != nil { + return err + } keyPub = key } case "RSA": if raw.D != nil { key, err = raw.rsaPrivateKey() - if err == nil { - keyPub = key.(*rsa.PrivateKey).Public() + if err != nil { + return err } + keyPub = key.(*rsa.PrivateKey).Public() } else { key, err = raw.rsaPublicKey() + if err != nil { + return err + } keyPub = key } case "oct": @@ -229,25 +237,28 @@ func (k *JSONWebKey) UnmarshalJSON(data []byte) (err error) { return errors.New("go-jose/go-jose: invalid JWK, found 'oct' (symmetric) key with cert chain") } key, err = raw.symmetricKey() + if err != nil { + return err + } case "OKP": if raw.Crv == "Ed25519" { if raw.D != nil { key, err = raw.edPrivateKey() - if err == nil { - keyPub = key.(ed25519.PrivateKey).Public() + if err != nil { + return err } + keyPub = key.(ed25519.PrivateKey).Public() } else { key, err = raw.edPublicKey() + if err != nil { + return err + } keyPub = key } } case "": // kty MUST be present - err = fmt.Errorf("go-jose/go-jose: missing json web key type") - } - - if err != nil { - return + return fmt.Errorf("go-jose/go-jose: missing json web key type") } if key == nil { @@ -388,11 +399,12 @@ func rsaThumbprintInput(n *big.Int, e int) (string, error) { func edThumbprintInput(ed ed25519.PublicKey) (string, error) { crv := "Ed25519" - if len(ed) > 32 { - return "", errors.New("go-jose/go-jose: invalid elliptic key (too large)") + err := validateEd25519PublicKey(ed) + if err != nil { + return "", err } return fmt.Sprintf(edThumbprintTemplate, crv, - newFixedSizeBuffer(ed, 32).base64()), nil + newFixedSizeBuffer(ed, ed25519.PublicKeySize).base64()), nil } // Thumbprint computes the JWK Thumbprint of a key using the @@ -504,12 +516,16 @@ func (key rawJSONWebKey) rsaPublicKey() (*rsa.PublicKey, error) { }, nil } -func fromEdPublicKey(pub ed25519.PublicKey) *rawJSONWebKey { +func fromEdPublicKey(pub ed25519.PublicKey) (*rawJSONWebKey, error) { + err := validateEd25519PublicKey(pub) + if err != nil { + return nil, err + } return &rawJSONWebKey{ Kty: "OKP", Crv: "Ed25519", X: newBuffer(pub), - } + }, nil } func fromRsaPublicKey(pub *rsa.PublicKey) *rawJSONWebKey { @@ -604,21 +620,36 @@ func (key rawJSONWebKey) edPrivateKey() (ed25519.PrivateKey, error) { return nil, fmt.Errorf("go-jose/go-jose: invalid Ed25519 private key, missing %s value(s)", strings.Join(missing, ", ")) } - privateKey := make([]byte, ed25519.PrivateKeySize) - copy(privateKey[0:32], key.D.bytes()) - copy(privateKey[32:], key.X.bytes()) - rv := ed25519.PrivateKey(privateKey) - return rv, nil + publicKey := key.X.bytes() + err := validateEd25519PublicKey(publicKey) + if err != nil { + return nil, err + } + + seed := key.D.bytes() + if len(seed) != ed25519.SeedSize { + return nil, fmt.Errorf("go-jose/go-jose: invalid Ed25519 private key, wrong length for d") + } + + privateKey := ed25519.NewKeyFromSeed(seed) + derivedPublicKey := privateKey.Public().(ed25519.PublicKey) + if !bytes.Equal(derivedPublicKey, publicKey) { + return nil, errors.New("go-jose/go-jose: invalid Ed25519 private key, x does not match d") + } + + return privateKey, nil } func (key rawJSONWebKey) edPublicKey() (ed25519.PublicKey, error) { if key.X == nil { return nil, fmt.Errorf("go-jose/go-jose: invalid Ed key, missing x value") } - publicKey := make([]byte, ed25519.PublicKeySize) - copy(publicKey[0:32], key.X.bytes()) - rv := ed25519.PublicKey(publicKey) - return rv, nil + publicKey := key.X.bytes() + err := validateEd25519PublicKey(publicKey) + if err != nil { + return nil, err + } + return ed25519.PublicKey(bytes.Clone(publicKey)), nil } func (key rawJSONWebKey) rsaPrivateKey() (*rsa.PrivateKey, error) { @@ -669,9 +700,17 @@ func (key rawJSONWebKey) rsaPrivateKey() (*rsa.PrivateKey, error) { } func fromEdPrivateKey(ed ed25519.PrivateKey) (*rawJSONWebKey, error) { - raw := fromEdPublicKey(ed25519.PublicKey(ed[32:])) + if len(ed) != ed25519.PrivateKeySize { + return nil, errors.New("go-jose/go-jose: invalid Ed25519 private key length") + } - raw.D = newBuffer(ed[0:32]) + publicKey := ed.Public().(ed25519.PublicKey) + raw, err := fromEdPublicKey(publicKey) + if err != nil { + return nil, err + } + + raw.D = newBuffer(ed.Seed()) return raw, nil } @@ -810,7 +849,7 @@ var ( ErrJWKSKidNotFound = errors.New("go-jose/go-jose: JWK with matching kid not found in JWK Set") ) -func tryJWKS(key interface{}, headers ...Header) (interface{}, error) { +func tryJWKS(key interface{}, header Header) (interface{}, error) { var jwks JSONWebKeySet switch jwksType := key.(type) { @@ -823,16 +862,8 @@ func tryJWKS(key interface{}, headers ...Header) (interface{}, error) { return key, nil } - // Determine the KID to search for from the headers. - var kid string - for _, header := range headers { - if header.KeyID != "" { - kid = header.KeyID - break - } - } - - // If no KID is specified in the headers, reject. + // If no KID is specified in the header, reject. + kid := header.KeyID if kid == "" { return nil, ErrJWKSKidNotFound } @@ -846,3 +877,107 @@ func tryJWKS(key interface{}, headers ...Header) (interface{}, error) { return keys[0].Key, nil } + +// weakEd25519PublicKeys contains the low-order Ed25519 encodings accepted by +// Go's verifier that must not be accepted as JOSE verification keys. +var weakEd25519PublicKeys = map[[ed25519.PublicKeySize]byte]struct{}{ + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }: {}, + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + }: {}, + { + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }: {}, + { + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + }: {}, + { + 0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, + 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, + 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, + 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x05, + }: {}, + { + 0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, + 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, + 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, + 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x85, + }: {}, + { + 0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, + 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, + 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, + 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0x7a, + }: {}, + { + 0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, + 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, + 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, + 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0xfa, + }: {}, + { + 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, + }: {}, + { + 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }: {}, + { + 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, + }: {}, + { + 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }: {}, + { + 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, + }: {}, + { + 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + }: {}, +} + +func validateEd25519PublicKey(publicKey ed25519.PublicKey) error { + if len(publicKey) != ed25519.PublicKeySize { + return fmt.Errorf("go-jose/go-jose: invalid Ed25519 public key, wrong length for x") + } + + var encoded [ed25519.PublicKeySize]byte + copy(encoded[:], publicKey) + _, ok := weakEd25519PublicKeys[encoded] + if ok { + return errors.New("go-jose/go-jose: invalid Ed25519 public key, low-order point") + } + + return nil +} diff --git a/vendor/github.com/go-jose/go-jose/v4/jws.go b/vendor/github.com/go-jose/go-jose/v4/jws.go index c40bd3ec10a..0444a5da05c 100644 --- a/vendor/github.com/go-jose/go-jose/v4/jws.go +++ b/vendor/github.com/go-jose/go-jose/v4/jws.go @@ -22,6 +22,7 @@ import ( "errors" "fmt" "strings" + "unicode" "github.com/go-jose/go-jose/v4/json" ) @@ -89,12 +90,12 @@ func ParseSigned( signature string, signatureAlgorithms []SignatureAlgorithm, ) (*JSONWebSignature, error) { - signature = stripWhitespace(signature) - if strings.HasPrefix(signature, "{") { + trimmed := strings.TrimLeftFunc(signature, unicode.IsSpace) + if strings.HasPrefix(trimmed, "{") { return ParseSignedJSON(signature, signatureAlgorithms) } - return parseSignedCompact(signature, nil, signatureAlgorithms) + return parseSignedCompact(stripWhitespace(signature), nil, signatureAlgorithms) } // ParseSignedCompact parses a message in JWS Compact Serialization. Validation fails if the JWS is @@ -186,6 +187,10 @@ func ParseSignedJSON( input string, signatureAlgorithms []SignatureAlgorithm, ) (*JSONWebSignature, error) { + if len(input) == 0 { + return nil, errEmptyInput + } + var parsed rawJSONWebSignature err := json.Unmarshal([]byte(input), &parsed) if err != nil { @@ -369,6 +374,10 @@ func parseSignedCompact( payload []byte, signatureAlgorithms []SignatureAlgorithm, ) (*JSONWebSignature, error) { + if len(input) == 0 { + return nil, errEmptyInput + } + protected, s, ok := strings.Cut(input, tokenDelim) if !ok { // no period found return nil, fmt.Errorf("go-jose/go-jose: compact JWS format must have three parts") diff --git a/vendor/github.com/go-jose/go-jose/v4/opaque.go b/vendor/github.com/go-jose/go-jose/v4/opaque.go index 429427232e8..91a42fc1dca 100644 --- a/vendor/github.com/go-jose/go-jose/v4/opaque.go +++ b/vendor/github.com/go-jose/go-jose/v4/opaque.go @@ -46,6 +46,11 @@ func newOpaqueSigner(alg SignatureAlgorithm, signer OpaqueSigner) (recipientSigI return recipientSigInfo{}, ErrUnsupportedAlgorithm } + pk := signer.Public() + if pk != nil && !pk.IsPublic() { + return recipientSigInfo{}, ErrNotPublic + } + return recipientSigInfo{ sigAlg: alg, publicKey: signer.Public, diff --git a/vendor/github.com/go-jose/go-jose/v4/shared.go b/vendor/github.com/go-jose/go-jose/v4/shared.go index 35130b3aa87..3df242ca6a4 100644 --- a/vendor/github.com/go-jose/go-jose/v4/shared.go +++ b/vendor/github.com/go-jose/go-jose/v4/shared.go @@ -80,6 +80,12 @@ var ( // ErrUnsupportedCriticalHeader is returned when a header is marked critical but not supported by go-jose. ErrUnsupportedCriticalHeader = errors.New("go-jose/go-jose: unsupported critical header") + + // errEmptyInput is returned when go-jose was asked to parse an empty string. + errEmptyInput = errors.New("go-jose/go-jose: empty input") + + // ErrNotPublic indicates a private key was passed where a public key was expected + ErrNotPublic = errors.New("go-jose/go-jose: public key was unexpectedly not public") ) // Key management algorithms diff --git a/vendor/github.com/go-jose/go-jose/v4/signing.go b/vendor/github.com/go-jose/go-jose/v4/signing.go index 5dbd04c2788..5baf75cb2e8 100644 --- a/vendor/github.com/go-jose/go-jose/v4/signing.go +++ b/vendor/github.com/go-jose/go-jose/v4/signing.go @@ -130,6 +130,8 @@ type payloadVerifier interface { verifyPayload(payload []byte, signature []byte, alg SignatureAlgorithm) error } +var errInvalidVerificationKey = errors.New("go-jose/go-jose: invalid verification key") + type genericSigner struct { recipients []recipientSigInfo nonceSource NonceSource @@ -138,11 +140,21 @@ type genericSigner struct { } type recipientSigInfo struct { - sigAlg SignatureAlgorithm + sigAlg SignatureAlgorithm + // publicKey returns a synthetic JSONWebKey for the signer. + // For opaque signers, it calls OpaqueSigner.Public(). publicKey func() *JSONWebKey signer payloadSigner } +// getPublicKey gets the public key, with a nil check on the func. +func (r recipientSigInfo) getPublicKey() *JSONWebKey { + if r.publicKey == nil { + return nil + } + return r.publicKey() +} + func staticPublicKey(jwk *JSONWebKey) func() *JSONWebKey { return func() *JSONWebKey { return jwk @@ -178,14 +190,23 @@ func NewMultiSigner(sigs []SigningKey, opts *SignerOptions) (Signer, error) { func newVerifier(verificationKey interface{}) (payloadVerifier, error) { switch verificationKey := verificationKey.(type) { case ed25519.PublicKey: + if len(verificationKey) == 0 { + return nil, errInvalidVerificationKey + } return &edEncrypterVerifier{ publicKey: verificationKey, }, nil case *rsa.PublicKey: + if verificationKey == nil { + return nil, errInvalidVerificationKey + } return &rsaEncrypterVerifier{ publicKey: verificationKey, }, nil case *ecdsa.PublicKey: + if verificationKey == nil { + return nil, errInvalidVerificationKey + } return &ecEncrypterVerifier{ publicKey: verificationKey, }, nil @@ -196,6 +217,9 @@ func newVerifier(verificationKey interface{}) (payloadVerifier, error) { case JSONWebKey: return newVerifier(verificationKey.Key) case *JSONWebKey: + if verificationKey == nil { + return nil, errInvalidVerificationKey + } return newVerifier(verificationKey.Key) case OpaqueVerifier: return &opaqueVerifier{verifier: verificationKey}, nil @@ -240,18 +264,18 @@ func newJWKSigner(alg SignatureAlgorithm, signingKey JSONWebKey) (recipientSigIn if err != nil { return recipientSigInfo{}, err } - if recipient.publicKey != nil && recipient.publicKey() != nil { + if recipientPubKey := recipient.getPublicKey(); recipientPubKey != nil { + // This should be impossible, but let's check anyway. + if !recipientPubKey.IsPublic() { + return recipientSigInfo{}, ErrNotPublic + } + // recipient.publicKey is a JWK synthesized for embedding when recipientSigInfo // was created for the inner key (such as a RSA or ECDSA public key). It contains // the pub key for embedding, but doesn't have extra params like key id. publicKey := signingKey - publicKey.Key = recipient.publicKey().Key + publicKey.Key = recipientPubKey.Key recipient.publicKey = staticPublicKey(&publicKey) - - // This should be impossible, but let's check anyway. - if !recipient.publicKey().IsPublic() { - return recipientSigInfo{}, errors.New("go-jose/go-jose: public key was unexpectedly not public") - } } return recipient, nil } @@ -266,7 +290,7 @@ func (ctx *genericSigner) Sign(payload []byte) (*JSONWebSignature, error) { headerAlgorithm: string(recipient.sigAlg), } - if recipient.publicKey != nil && recipient.publicKey() != nil { + if recipientPubKey := recipient.getPublicKey(); recipientPubKey != nil { // We want to embed the JWK or set the kid header, but not both. Having a protected // header that contains an embedded JWK while also simultaneously containing the kid // header is confusing, and at least in ACME the two are considered to be mutually @@ -274,11 +298,11 @@ func (ctx *genericSigner) Sign(payload []byte) (*JSONWebSignature, error) { // result of the JOSE spec. We've decided that this library will only include one or // the other to avoid this confusion. // - // See https://github.com/go-jose/go-jose/issues/157 for more context. + // See https://github.com/square/go-jose/issues/157 for more context. if ctx.embedJWK { - protected[headerJWK] = recipient.publicKey() + protected[headerJWK] = recipientPubKey } else { - keyID := recipient.publicKey().KeyID + keyID := recipientPubKey.KeyID if keyID != "" { protected[headerKeyID] = keyID } @@ -390,7 +414,13 @@ func (obj JSONWebSignature) UnsafePayloadWithoutVerification() []byte { // The verificationKey argument must have one of the types allowed for the // verificationKey argument of JSONWebSignature.Verify(). func (obj JSONWebSignature) DetachedVerify(payload []byte, verificationKey interface{}) error { - key, err := tryJWKS(verificationKey, obj.headers()...) + if len(obj.Signatures) > 1 { + return errors.New("go-jose/go-jose: too many signatures in payload; expecting only one") + } + + signature := obj.Signatures[0] + + key, err := tryJWKS(verificationKey, signature.Header) if err != nil { return err } @@ -399,12 +429,6 @@ func (obj JSONWebSignature) DetachedVerify(payload []byte, verificationKey inter return err } - if len(obj.Signatures) > 1 { - return errors.New("go-jose/go-jose: too many signatures in payload; expecting only one") - } - - signature := obj.Signatures[0] - if signature.header != nil { // Per https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1.11, // 4.1.11. "crit" (Critical) Header Parameter @@ -432,11 +456,11 @@ func (obj JSONWebSignature) DetachedVerify(payload []byte, verificationKey inter headers := signature.mergedHeaders() alg := headers.getSignatureAlgorithm() err = verifier.verifyPayload(input, signature.Signature, alg) - if err == nil { - return nil + if err != nil { + return ErrCryptoFailure } - return ErrCryptoFailure + return nil } // VerifyMulti validates (one of the multiple) signatures on the object and @@ -467,16 +491,6 @@ func (obj JSONWebSignature) VerifyMulti(verificationKey interface{}) (int, Signa // The verificationKey argument must have one of the types allowed for the // verificationKey argument of JSONWebSignature.Verify(). func (obj JSONWebSignature) DetachedVerifyMulti(payload []byte, verificationKey interface{}) (int, Signature, error) { - key, err := tryJWKS(verificationKey, obj.headers()...) - if err != nil { - return -1, Signature{}, err - } - verifier, err := newVerifier(key) - if err != nil { - return -1, Signature{}, err - } - -outer: for i, signature := range obj.Signatures { if signature.header != nil { // Per https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1.11, @@ -484,20 +498,31 @@ outer: // "When used, this Header Parameter MUST be integrity // protected; therefore, it MUST occur only within the JWS // Protected Header." - err = signature.header.checkNoCritical() + err := signature.header.checkNoCritical() if err != nil { - continue outer + continue } } if signature.protected != nil { // Check for only supported critical headers - err = signature.protected.checkSupportedCritical(supportedCritical) + err := signature.protected.checkSupportedCritical(supportedCritical) if err != nil { - continue outer + continue } } + // If the verification key is a JWK Set, pick a key based on this signature's + // "kid" header. If no match, skip this signature. + key, err := tryJWKS(verificationKey, signature.Header) + if err != nil { + continue + } + verifier, err := newVerifier(key) + if err != nil { + continue + } + input, err := obj.computeAuthData(payload, &signature) if err != nil { continue @@ -506,18 +531,12 @@ outer: headers := signature.mergedHeaders() alg := headers.getSignatureAlgorithm() err = verifier.verifyPayload(input, signature.Signature, alg) - if err == nil { - return i, signature, nil + if err != nil { + continue } + + return i, signature, nil } return -1, Signature{}, ErrCryptoFailure } - -func (obj JSONWebSignature) headers() []Header { - headers := make([]Header, len(obj.Signatures)) - for i, sig := range obj.Signatures { - headers[i] = sig.Header - } - return headers -} diff --git a/vendor/github.com/go-jose/go-jose/v4/symmetric.go b/vendor/github.com/go-jose/go-jose/v4/symmetric.go index f2ff29e1797..ca597d6a127 100644 --- a/vendor/github.com/go-jose/go-jose/v4/symmetric.go +++ b/vendor/github.com/go-jose/go-jose/v4/symmetric.go @@ -34,8 +34,8 @@ import ( josecipher "github.com/go-jose/go-jose/v4/cipher" ) -// RandReader is a cryptographically secure random number generator (stubbed out in tests). -var RandReader = rand.Reader +// randReader is a cryptographically secure random number generator (stubbed out in tests). +var randReader = rand.Reader const ( // RFC7518 recommends a minimum of 1,000 iterations: @@ -153,7 +153,7 @@ func getPbkdf2Params(alg KeyAlgorithm) (int, func() hash.Hash) { // getRandomSalt generates a new salt of the given size. func getRandomSalt(size int) ([]byte, error) { salt := make([]byte, size) - _, err := io.ReadFull(RandReader, salt) + _, err := io.ReadFull(randReader, salt) if err != nil { return nil, err } @@ -198,7 +198,7 @@ func newSymmetricSigner(sigAlg SignatureAlgorithm, key []byte) (recipientSigInfo // Generate a random key for the given content cipher func (ctx randomKeyGenerator) genKey() ([]byte, rawHeader, error) { key := make([]byte, ctx.size) - _, err := io.ReadFull(RandReader, key) + _, err := io.ReadFull(randReader, key) if err != nil { return nil, rawHeader{}, err } @@ -238,7 +238,7 @@ func (ctx aeadContentCipher) encrypt(key, aad, pt []byte) (*aeadParts, error) { // Initialize a new nonce iv := make([]byte, aead.NonceSize()) - _, err = io.ReadFull(RandReader, iv) + _, err = io.ReadFull(randReader, iv) if err != nil { return nil, err } diff --git a/vendor/github.com/go-logr/logr/context_noslog.go b/vendor/github.com/go-logr/logr/context_noslog.go index f012f9a18e8..0a3d1a125e0 100644 --- a/vendor/github.com/go-logr/logr/context_noslog.go +++ b/vendor/github.com/go-logr/logr/context_noslog.go @@ -1,5 +1,4 @@ //go:build !go1.21 -// +build !go1.21 /* Copyright 2019 The logr Authors. diff --git a/vendor/github.com/go-logr/logr/context_slog.go b/vendor/github.com/go-logr/logr/context_slog.go index 065ef0b8280..c69eb01ba1b 100644 --- a/vendor/github.com/go-logr/logr/context_slog.go +++ b/vendor/github.com/go-logr/logr/context_slog.go @@ -1,5 +1,4 @@ //go:build go1.21 -// +build go1.21 /* Copyright 2019 The logr Authors. diff --git a/vendor/github.com/go-logr/logr/funcr/funcr.go b/vendor/github.com/go-logr/logr/funcr/funcr.go index b22c57d7137..7f4996e9e48 100644 --- a/vendor/github.com/go-logr/logr/funcr/funcr.go +++ b/vendor/github.com/go-logr/logr/funcr/funcr.go @@ -426,7 +426,7 @@ func (f Formatter) colon() byte { } func (f Formatter) pretty(value any) string { - return f.prettyWithFlags(value, 0, 0) + return f.prettyWithFlags(value, 0, 0, 0, nil) } const ( @@ -434,7 +434,13 @@ const ( ) // TODO: This is not fast. Most of the overhead goes here. -func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { +// value: The value to render +// flags: Bitmask of flags (see above) +// depth: The current depth of nested structs, slices, arrays, and maps +// ptrDepth: The current depth of including pointer dereferences +// ptrMap: A map of pointers already seen, to avoid infinite recursion (usually +// nil unless ptrDepth is large) +func (f Formatter) prettyWithFlags(value any, flags uint32, depth int, ptrDepth int, ptrMap map[uintptr]bool) string { if depth > f.opts.MaxLogDepth { return `""` } @@ -504,7 +510,7 @@ func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { // arbitrary keys might need escaping buf.WriteString(prettyString(k)) buf.WriteByte(f.colon()) - buf.WriteString(f.prettyWithFlags(v[i+1], 0, depth+1)) + buf.WriteString(f.prettyWithFlags(v[i+1], 0, depth+1, ptrDepth+1, ptrMap)) } if flags&flagRawStruct == 0 { buf.WriteByte('}') @@ -576,7 +582,7 @@ func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { } printComma = true // if we got here, we are rendering a field if fld.Anonymous && fld.Type.Kind() == reflect.Struct && name == "" { - buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), flags|flagRawStruct, depth+1)) + buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), flags|flagRawStruct, depth+1, ptrDepth+1, ptrMap)) continue } if name == "" { @@ -585,7 +591,7 @@ func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { // field names can't contain characters which need escaping buf.WriteString(f.quoted(name, false)) buf.WriteByte(f.colon()) - buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), 0, depth+1)) + buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), 0, depth+1, ptrDepth+1, ptrMap)) } if flags&flagRawStruct == 0 { buf.WriteByte('}') @@ -612,7 +618,7 @@ func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { buf.WriteByte(f.comma()) } e := v.Index(i) - buf.WriteString(f.prettyWithFlags(e.Interface(), 0, depth+1)) + buf.WriteString(f.prettyWithFlags(e.Interface(), 0, depth+1, ptrDepth+1, ptrMap)) } buf.WriteByte(']') return buf.String() @@ -637,7 +643,8 @@ func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { keystr = prettyString(keystr) } else { // prettyWithFlags will produce already-escaped values - keystr = f.prettyWithFlags(it.Key().Interface(), 0, depth+1) + // key depth is unrelated to overall depth + keystr = f.prettyWithFlags(it.Key().Interface(), 0, 0, ptrDepth, ptrMap) if t.Key().Kind() != reflect.String { // JSON only does string keys. Unlike Go's standard JSON, we'll // convert just about anything to a string. @@ -646,16 +653,34 @@ func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { } buf.WriteString(keystr) buf.WriteByte(f.colon()) - buf.WriteString(f.prettyWithFlags(it.Value().Interface(), 0, depth+1)) + buf.WriteString(f.prettyWithFlags(it.Value().Interface(), 0, depth+1, ptrDepth+1, ptrMap)) i++ } buf.WriteByte('}') return buf.String() - case reflect.Ptr, reflect.Interface: + case reflect.Pointer, reflect.Interface: if v.IsNil() { return "null" } - return f.prettyWithFlags(v.Elem().Interface(), 0, depth) + // Special case: recursive pointers. For normal use we do not want to + // count pointer dereferences as depth, but if we see the same pointer + // again we have a recursion and need to stop. After a large number of + // pointer dereferences we will start tracking pointers to avoid the + // perf hit of doing it in the normal path. + // + // This should not happen accidentally (e.g. json decoding should never + // do this) but we can handle it gracefully. + if ptrMap != nil && ptrMap[uintptr(v.Pointer())] { + depth = f.opts.MaxLogDepth + 1 // force a depth error + } + const maxDepthFactor = 4 // arbitrary, but we want it large enough to not false-alert + if ptrDepth > f.opts.MaxLogDepth*maxDepthFactor && ptrMap == nil { + ptrMap = map[uintptr]bool{} + } + if ptrMap != nil { + ptrMap[(uintptr)(v.Pointer())] = true + } + return f.prettyWithFlags(v.Elem().Interface(), 0, depth, ptrDepth+1, ptrMap) } return fmt.Sprintf(`""`, t.Kind().String()) } @@ -697,7 +722,7 @@ func isEmpty(v reflect.Value) bool { return v.Float() == 0 case reflect.Complex64, reflect.Complex128: return v.Complex() == 0 - case reflect.Interface, reflect.Ptr: + case reflect.Interface, reflect.Pointer: return v.IsNil() } return false diff --git a/vendor/github.com/go-logr/logr/funcr/slogsink.go b/vendor/github.com/go-logr/logr/funcr/slogsink.go index 7bd84761e2d..8b519c91e13 100644 --- a/vendor/github.com/go-logr/logr/funcr/slogsink.go +++ b/vendor/github.com/go-logr/logr/funcr/slogsink.go @@ -1,5 +1,4 @@ //go:build go1.21 -// +build go1.21 /* Copyright 2023 The logr Authors. @@ -33,7 +32,7 @@ const extraSlogSinkDepth = 3 // 2 for slog, 1 for SlogSink func (l fnlogger) Handle(_ context.Context, record slog.Record) error { kvList := make([]any, 0, 2*record.NumAttrs()) record.Attrs(func(attr slog.Attr) bool { - kvList = attrToKVs(attr, kvList) + kvList = attrToKVs(attr, kvList, l.opts.MaxLogDepth) return true }) @@ -49,7 +48,7 @@ func (l fnlogger) Handle(_ context.Context, record slog.Record) error { func (l fnlogger) WithAttrs(attrs []slog.Attr) logr.SlogSink { kvList := make([]any, 0, 2*len(attrs)) for _, attr := range attrs { - kvList = attrToKVs(attr, kvList) + kvList = attrToKVs(attr, kvList, l.opts.MaxLogDepth) } l.AddValues(kvList) return &l @@ -61,14 +60,25 @@ func (l fnlogger) WithGroup(name string) logr.SlogSink { } // attrToKVs appends a slog.Attr to a logr-style kvList. It handle slog Groups -// and other details of slog. -func attrToKVs(attr slog.Attr, kvList []any) []any { +// and other details of slog. maxDepth bounds recursion into nested groups so a +// deeply-nested slog.Group cannot exhaust the stack; it is decremented per group +// level and starts at the Formatter's MaxLogDepth (past which the formatter would +// truncate the rendering anyway). +func attrToKVs(attr slog.Attr, kvList []any, maxDepth int) []any { attrVal := attr.Value.Resolve() if attrVal.Kind() == slog.KindGroup { + if maxDepth <= 0 { + // Nesting is too deep to build without risking a stack overflow. + // Stop here; the formatter truncates below MaxLogDepth regardless. + if attr.Key != "" { + kvList = append(kvList, attr.Key, "") + } + return kvList + } groupVal := attrVal.Group() grpKVs := make([]any, 0, 2*len(groupVal)) for _, attr := range groupVal { - grpKVs = attrToKVs(attr, grpKVs) + grpKVs = attrToKVs(attr, grpKVs, maxDepth-1) } if attr.Key == "" { // slog says we have to inline these diff --git a/vendor/github.com/go-logr/logr/sloghandler.go b/vendor/github.com/go-logr/logr/sloghandler.go index 82d1ba49481..befaf5510fa 100644 --- a/vendor/github.com/go-logr/logr/sloghandler.go +++ b/vendor/github.com/go-logr/logr/sloghandler.go @@ -1,5 +1,4 @@ //go:build go1.21 -// +build go1.21 /* Copyright 2023 The logr Authors. diff --git a/vendor/github.com/go-logr/logr/slogr.go b/vendor/github.com/go-logr/logr/slogr.go index 28a83d02439..bfe80eb8d68 100644 --- a/vendor/github.com/go-logr/logr/slogr.go +++ b/vendor/github.com/go-logr/logr/slogr.go @@ -1,5 +1,4 @@ //go:build go1.21 -// +build go1.21 /* Copyright 2023 The logr Authors. diff --git a/vendor/github.com/go-logr/logr/slogsink.go b/vendor/github.com/go-logr/logr/slogsink.go index 4060fcbc2b0..ab76ea99fe6 100644 --- a/vendor/github.com/go-logr/logr/slogsink.go +++ b/vendor/github.com/go-logr/logr/slogsink.go @@ -1,5 +1,4 @@ //go:build go1.21 -// +build go1.21 /* Copyright 2023 The logr Authors. diff --git a/vendor/github.com/go-openapi/analysis/CONTRIBUTORS.md b/vendor/github.com/go-openapi/analysis/CONTRIBUTORS.md index 89eb5b0b359..f1841361133 100644 --- a/vendor/github.com/go-openapi/analysis/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/analysis/CONTRIBUTORS.md @@ -4,31 +4,32 @@ | Total Contributors | Total Contributions | | --- | --- | -| 22 | 276 | +| 23 | 298 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 136 | | +| @fredbi | 149 | | | @casualjim | 91 | | +| @amoudani | 9 | | | @keramix | 9 | | | @youyuanwu | 8 | | | @wjase | 7 | | -| @kul-amr | 3 | | -| @schafle | 3 | | | @msample | 3 | | -| @mbohlool | 2 | | +| @schafle | 3 | | +| @kul-amr | 3 | | | @zmay2030 | 2 | | -| @ujjwalsh | 1 | | -| @itengfei | 1 | | -| @nrnrk | 1 | | -| @cuishuang | 1 | | -| @tklauser | 1 | | -| @Shimizu1111 | 1 | | -| @thaJeztah | 1 | | -| @knweiss | 1 | | -| @guillemj | 1 | | -| @gregmarr | 1 | | -| @danielfbm | 1 | | +| @mbohlool | 2 | | | @Copilot | 1 | | +| @danielfbm | 1 | | +| @gregmarr | 1 | | +| @guillemj | 1 | | +| @knweiss | 1 | | +| @thaJeztah | 1 | | +| @Shimizu1111 | 1 | | +| @tklauser | 1 | | +| @cuishuang | 1 | | +| @nrnrk | 1 | | +| @itengfei | 1 | | +| @ujjwalsh | 1 | | _this file was generated by the [Contributors GitHub Action](https://github.com/github-community-projects/contributors)_ diff --git a/vendor/github.com/go-openapi/analysis/go.work b/vendor/github.com/go-openapi/analysis/go.work index c0f02a78f64..fc8fd598e56 100644 --- a/vendor/github.com/go-openapi/analysis/go.work +++ b/vendor/github.com/go-openapi/analysis/go.work @@ -1,4 +1,4 @@ -go 1.25.0 +go 1.26.0 use ( . diff --git a/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md b/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md index de0bf5c04ba..6941823e6c3 100644 --- a/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md @@ -4,11 +4,11 @@ | Total Contributors | Total Contributions | | --- | --- | -| 13 | 132 | +| 13 | 136 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 83 | | +| @fredbi | 87 | | | @casualjim | 33 | | | @magodo | 3 | | | @youyuanwu | 3 | | diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md index 6e7929c64b3..e563fac7724 100644 --- a/vendor/github.com/go-openapi/jsonpointer/README.md +++ b/vendor/github.com/go-openapi/jsonpointer/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -152,8 +152,6 @@ Maintainers can cut a new release by either: [release-badge]: https://badge.fury.io/gh/go-openapi%2Fjsonpointer.svg [release-url]: https://badge.fury.io/gh/go-openapi%2Fjsonpointer -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/jsonpointer -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/jsonpointer [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/jsonpointer [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/jsonpointer diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go index 05fc863ee60..d6ee165f631 100644 --- a/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go @@ -284,7 +284,7 @@ func (p *Pointer) set(node, data any, nameProvider NameProvider) (any, error) { // new child reference (e.g. a slice header returned by an "-" append) into its parent on the way // back up. // -// Returning the (possibly new) node at each level is what makes append work at any depth without +// Returning the (possibly new) node at each level makes append work at any depth without // requiring the caller to pass a pointer to the containing slice: the new slice header propagates // up and each parent rebinds it via the appropriate kind-specific setter. func (p *Pointer) setAt(node any, tokens []string, data any, nameProvider NameProvider) (any, error) { diff --git a/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/vendor/github.com/go-openapi/jsonreference/.golangci.yml index dc7c96053de..3f3b5af8dba 100644 --- a/vendor/github.com/go-openapi/jsonreference/.golangci.yml +++ b/vendor/github.com/go-openapi/jsonreference/.golangci.yml @@ -4,8 +4,12 @@ linters: disable: - depguard - funlen + - goconst - godox + - gomodguard + - gomodguard_v2 - exhaustruct + - exhaustruct_v5 - nlreturn - nonamedreturns - noinlineerr diff --git a/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md b/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md index d20737c946d..ce4326eef20 100644 --- a/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md @@ -4,11 +4,11 @@ | Total Contributors | Total Contributions | | --- | --- | -| 9 | 83 | +| 9 | 90 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 46 | | +| @fredbi | 53 | | | @casualjim | 25 | | | @youyuanwu | 5 | | | @olivierlemasle | 2 | | diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md index fbd16cf8924..000a1feb563 100644 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ b/vendor/github.com/go-openapi/jsonreference/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -97,8 +97,6 @@ Maintainers can cut a new release by either: [gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fjsonreference.svg [gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fjsonreference -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/jsonreference -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/jsonreference [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/jsonreference [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/jsonreference diff --git a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go index a08b47320e7..6ef640e3b6e 100644 --- a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go +++ b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go @@ -5,19 +5,12 @@ package internal import ( "net/url" - "regexp" "strings" ) const ( - defaultHTTPPort = ":80" - defaultHTTPSPort = ":443" -) - -// Regular expressions used by the normalizations. -var ( - rxPort = regexp.MustCompile(`(:\d+)/?$`) - rxDupSlashes = regexp.MustCompile(`/{2,}`) + defaultHTTPPort = "80" + defaultHTTPSPort = "443" ) // NormalizeURL will normalize the specified URL @@ -55,20 +48,66 @@ func lowercaseHost(u *url.URL) { } } +// removeDefaultPort drops :80 from an http URL and :443 from an https one. +// +// The port stays when dropping it would leave an authority url.Parse no longer accepts, so the +// shortened host is parsed before being kept. url.Parse reads "https://:a:443" as the host ":a" +// on port 443, and ":a" on its own is an invalid port, so "https://:a" no longer parses. +// +// A degenerate authority can spell a default port twice - url.Parse reads "http://:80:80" as the +// host ":80" on port 80 - so removal repeats until nothing more comes off. Each pass shortens the +// host, so the loop ends, and normalizing the result again changes nothing. func removeDefaultPort(u *url.URL) { - if len(u.Host) > 0 { - scheme := strings.ToLower(u.Scheme) - u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHTTPPort) || (scheme == "https" && val == defaultHTTPSPort) { - return "" - } - return val - }) + for { + port := u.Port() + if port == "" || port != defaultPortForScheme(strings.ToLower(u.Scheme)) { + return + } + + host := strings.TrimSuffix(u.Host, ":"+port) + if _, err := url.Parse("//" + host); err != nil { + return + } + + u.Host = host + } +} + +func defaultPortForScheme(scheme string) string { + switch scheme { + case "http": + return defaultHTTPPort + case "https": + return defaultHTTPSPort + default: + return "" } } +// removeDuplicateSlashes collapses every run of slashes in the path to a single one, however +// long the run is: "/a//b///c" becomes "/a/b/c". +// +// A path holding no "//" is left as it is, which is the common case and costs one scan and no +// allocation. func removeDuplicateSlashes(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") + const doubleSlash = "//" + + start := strings.Index(u.Path, doubleSlash) + if start < 0 { + return } + + var collapsed strings.Builder + collapsed.Grow(len(u.Path)) + collapsed.WriteString(u.Path[:start+1]) // everything up to and including the first slash of the run + + for i := start + 1; i < len(u.Path); i++ { + c := u.Path[i] + if c == '/' && u.Path[i-1] == '/' { + continue + } + collapsed.WriteByte(c) + } + + u.Path = collapsed.String() } diff --git a/vendor/github.com/go-openapi/loads/.golangci.yml b/vendor/github.com/go-openapi/loads/.golangci.yml index 272b14e545d..756b516dfd8 100644 --- a/vendor/github.com/go-openapi/loads/.golangci.yml +++ b/vendor/github.com/go-openapi/loads/.golangci.yml @@ -6,10 +6,12 @@ linters: - funlen - gochecknoglobals # on this repo, it is hard to refactor without globals/inits and no breaking change - gochecknoinits + - goconst - godox - gomodguard - gomodguard_v2 - exhaustruct + - exhaustruct_v5 - nlreturn - nonamedreturns - noinlineerr diff --git a/vendor/github.com/go-openapi/loads/CONTRIBUTORS.md b/vendor/github.com/go-openapi/loads/CONTRIBUTORS.md index b13f2b8d22d..0746f7d5646 100644 --- a/vendor/github.com/go-openapi/loads/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/loads/CONTRIBUTORS.md @@ -4,11 +4,11 @@ | Total Contributors | Total Contributions | | --- | --- | -| 14 | 139 | +| 14 | 148 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 61 | | +| @fredbi | 70 | | | @casualjim | 48 | | | @youyuanwu | 6 | | | @vburenin | 4 | | diff --git a/vendor/github.com/go-openapi/loads/README.md b/vendor/github.com/go-openapi/loads/README.md index 293f79bb6a0..8fa5b4bc749 100644 --- a/vendor/github.com/go-openapi/loads/README.md +++ b/vendor/github.com/go-openapi/loads/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -127,8 +127,6 @@ Maintainers can cut a new release by either: [release-badge]: https://badge.fury.io/gh/go-openapi%2Floads.svg [release-url]: https://badge.fury.io/gh/go-openapi%2Floads -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/loads -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/loads [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/loads [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/loads diff --git a/vendor/github.com/go-openapi/loads/spec.go b/vendor/github.com/go-openapi/loads/spec.go index e9e4b57b78b..ea64717cfda 100644 --- a/vendor/github.com/go-openapi/loads/spec.go +++ b/vendor/github.com/go-openapi/loads/spec.go @@ -5,21 +5,16 @@ package loads import ( "bytes" - "encoding/gob" "encoding/json" "fmt" "maps" "github.com/go-openapi/analysis" "github.com/go-openapi/spec" + "github.com/go-openapi/swag/jsonutils" "github.com/go-openapi/swag/yamlutils" ) -func init() { - gob.Register(map[string]any{}) - gob.Register([]any{}) -} - // Document represents a swagger spec document. type Document struct { // specAnalyzer @@ -276,14 +271,16 @@ func (d *Document) SpecFilePath() string { return d.specFilePath } +// cloneSpec deep-copies a specification through its JSON representation. +// +// It used to go through gob, which omits a field holding the zero value for its type and +// flattens a pointer to what it points at, so an optional number that was present and zero came +// back nil: "minimum": 0, "maximum": 0, "maxLength": 0, "maxItems": 0 and "maxProperties": 0 were +// dropped from the copy, at any depth and with no error. That copy is what OrigSpec returns and +// what ResetDefinitions writes back over the live definitions. func cloneSpec(src *spec.Swagger) (*spec.Swagger, error) { - var b bytes.Buffer - if err := gob.NewEncoder(&b).Encode(src); err != nil { - return nil, err - } - var dst spec.Swagger - if err := gob.NewDecoder(&b).Decode(&dst); err != nil { + if err := jsonutils.FromDynamicJSON(src, &dst); err != nil { return nil, err } diff --git a/vendor/github.com/go-openapi/spec/CONTRIBUTORS.md b/vendor/github.com/go-openapi/spec/CONTRIBUTORS.md index 5871da52982..3e1620230be 100644 --- a/vendor/github.com/go-openapi/spec/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/spec/CONTRIBUTORS.md @@ -4,12 +4,12 @@ | Total Contributors | Total Contributions | | --- | --- | -| 38 | 414 | +| 39 | 439 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | | @casualjim | 191 | | -| @fredbi | 112 | | +| @fredbi | 136 | | | @pytlesk4 | 26 | | | @kul-amr | 10 | | | @keramix | 10 | | @@ -46,5 +46,6 @@ | @sttts | 1 | | | @ChandanChainani | 1 | | | @bvwells | 1 | | +| @amoudani | 1 | | _this file was generated by the [Contributors GitHub Action](https://github.com/github-community-projects/contributors)_ diff --git a/vendor/github.com/go-openapi/spec/expander.go b/vendor/github.com/go-openapi/spec/expander.go index c9ffed593e3..2922fccb558 100644 --- a/vendor/github.com/go-openapi/spec/expander.go +++ b/vendor/github.com/go-openapi/spec/expander.go @@ -583,7 +583,7 @@ func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) pathItem.Ref = Ref{} for i := range pathItem.Parameters { - if err := expandParameterOrResponse(&(pathItem.Parameters[i]), resolver, basePath); resolver.shouldStopOnError(err) { + if err := expandParameterOrResponse(&pathItem.Parameters[i], resolver, basePath); resolver.shouldStopOnError(err) { return err } } diff --git a/vendor/github.com/go-openapi/spec/gob.go b/vendor/github.com/go-openapi/spec/gob.go new file mode 100644 index 00000000000..dad749229d7 --- /dev/null +++ b/vendor/github.com/go-openapi/spec/gob.go @@ -0,0 +1,230 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package spec + +import ( + "bytes" + "encoding/gob" +) + +// Optional numbers and gob. +// +// gob omits any struct field that holds the zero value for its type, and flattens a pointer to +// the value it points at. An optional number that is present and zero - "minimum": 0, which the +// JSON Schema meta-schema spells for every positiveInteger, or "maximum": 0 on a parameter - +// therefore travels as the zero value, is omitted, and comes back as a nil pointer. The bound is +// dropped and nothing reports it. +// +// [Schema], [Parameter], [Header] and [Items] are the types that carry those numbers, so each +// sends which of them were present-and-zero alongside the struct, and puts the zero back on the +// way in. The encoders sit on the outer types rather than on CommonValidations or SchemaProps +// because a method on an embedded type is promoted to the type embedding it: gob would then call +// it for the whole value and drop everything the embedded type does not hold. [Swagger] and +// [Operation] already carry their own encoders for the same reason. + +// zeroBounds records which optional numbers of a value were present and zero. +type zeroBounds uint16 + +const ( + zeroMaximum zeroBounds = 1 << iota + zeroMinimum + zeroMaxLength + zeroMinLength + zeroMaxItems + zeroMinItems + zeroMultipleOf + zeroMaxProperties + zeroMinProperties +) + +func floatBound(value *float64, bit zeroBounds) zeroBounds { + if value != nil && *value == 0 { + return bit + } + + return 0 +} + +func intBound(value *int64, bit zeroBounds) zeroBounds { + if value != nil && *value == 0 { + return bit + } + + return 0 +} + +func restoreFloat(value **float64, bounds, bit zeroBounds) { + if bounds&bit != 0 && *value == nil { + *value = new(float64) + } +} + +func restoreInt(value **int64, bounds, bit zeroBounds) { + if bounds&bit != 0 && *value == nil { + *value = new(int64) + } +} + +func commonBounds(v CommonValidations) zeroBounds { + return floatBound(v.Maximum, zeroMaximum) | + floatBound(v.Minimum, zeroMinimum) | + floatBound(v.MultipleOf, zeroMultipleOf) | + intBound(v.MaxLength, zeroMaxLength) | + intBound(v.MinLength, zeroMinLength) | + intBound(v.MaxItems, zeroMaxItems) | + intBound(v.MinItems, zeroMinItems) +} + +func restoreCommon(v *CommonValidations, bounds zeroBounds) { + restoreFloat(&v.Maximum, bounds, zeroMaximum) + restoreFloat(&v.Minimum, bounds, zeroMinimum) + restoreFloat(&v.MultipleOf, bounds, zeroMultipleOf) + restoreInt(&v.MaxLength, bounds, zeroMaxLength) + restoreInt(&v.MinLength, bounds, zeroMinLength) + restoreInt(&v.MaxItems, bounds, zeroMaxItems) + restoreInt(&v.MinItems, bounds, zeroMinItems) +} + +// GobEncode provides a gob encoder for Schema that keeps its zero-valued bounds. +func (s Schema) GobEncode() ([]byte, error) { + type plain Schema + + p := s.SchemaProps + bounds := floatBound(p.Maximum, zeroMaximum) | + floatBound(p.Minimum, zeroMinimum) | + floatBound(p.MultipleOf, zeroMultipleOf) | + intBound(p.MaxLength, zeroMaxLength) | + intBound(p.MinLength, zeroMinLength) | + intBound(p.MaxItems, zeroMaxItems) | + intBound(p.MinItems, zeroMinItems) | + intBound(p.MaxProperties, zeroMaxProperties) | + intBound(p.MinProperties, zeroMinProperties) + + var b bytes.Buffer + err := gob.NewEncoder(&b).Encode(struct { + Plain plain + Bounds zeroBounds + }{Plain: plain(s), Bounds: bounds}) + + return b.Bytes(), err +} + +// GobDecode provides a gob decoder for Schema that keeps its zero-valued bounds. +func (s *Schema) GobDecode(b []byte) error { + type plain Schema + + var raw struct { + Plain plain + Bounds zeroBounds + } + if err := gob.NewDecoder(bytes.NewBuffer(b)).Decode(&raw); err != nil { + return err + } + + *s = Schema(raw.Plain) + restoreFloat(&s.Maximum, raw.Bounds, zeroMaximum) + restoreFloat(&s.Minimum, raw.Bounds, zeroMinimum) + restoreFloat(&s.MultipleOf, raw.Bounds, zeroMultipleOf) + restoreInt(&s.MaxLength, raw.Bounds, zeroMaxLength) + restoreInt(&s.MinLength, raw.Bounds, zeroMinLength) + restoreInt(&s.MaxItems, raw.Bounds, zeroMaxItems) + restoreInt(&s.MinItems, raw.Bounds, zeroMinItems) + restoreInt(&s.MaxProperties, raw.Bounds, zeroMaxProperties) + restoreInt(&s.MinProperties, raw.Bounds, zeroMinProperties) + + return nil +} + +// GobEncode provides a gob encoder for Parameter that keeps its zero-valued bounds. +func (p Parameter) GobEncode() ([]byte, error) { + type plain Parameter + + var b bytes.Buffer + err := gob.NewEncoder(&b).Encode(struct { + Plain plain + Bounds zeroBounds + }{Plain: plain(p), Bounds: commonBounds(p.CommonValidations)}) + + return b.Bytes(), err +} + +// GobDecode provides a gob decoder for Parameter that keeps its zero-valued bounds. +func (p *Parameter) GobDecode(b []byte) error { + type plain Parameter + + var raw struct { + Plain plain + Bounds zeroBounds + } + if err := gob.NewDecoder(bytes.NewBuffer(b)).Decode(&raw); err != nil { + return err + } + + *p = Parameter(raw.Plain) + restoreCommon(&p.CommonValidations, raw.Bounds) + + return nil +} + +// GobEncode provides a gob encoder for Header that keeps its zero-valued bounds. +func (h Header) GobEncode() ([]byte, error) { + type plain Header + + var b bytes.Buffer + err := gob.NewEncoder(&b).Encode(struct { + Plain plain + Bounds zeroBounds + }{Plain: plain(h), Bounds: commonBounds(h.CommonValidations)}) + + return b.Bytes(), err +} + +// GobDecode provides a gob decoder for Header that keeps its zero-valued bounds. +func (h *Header) GobDecode(b []byte) error { + type plain Header + + var raw struct { + Plain plain + Bounds zeroBounds + } + if err := gob.NewDecoder(bytes.NewBuffer(b)).Decode(&raw); err != nil { + return err + } + + *h = Header(raw.Plain) + restoreCommon(&h.CommonValidations, raw.Bounds) + + return nil +} + +// GobEncode provides a gob encoder for Items that keeps its zero-valued bounds. +func (i Items) GobEncode() ([]byte, error) { + type plain Items + + var b bytes.Buffer + err := gob.NewEncoder(&b).Encode(struct { + Plain plain + Bounds zeroBounds + }{Plain: plain(i), Bounds: commonBounds(i.CommonValidations)}) + + return b.Bytes(), err +} + +// GobDecode provides a gob decoder for Items that keeps its zero-valued bounds. +func (i *Items) GobDecode(b []byte) error { + type plain Items + + var raw struct { + Plain plain + Bounds zeroBounds + } + if err := gob.NewDecoder(bytes.NewBuffer(b)).Decode(&raw); err != nil { + return err + } + + *i = Items(raw.Plain) + restoreCommon(&i.CommonValidations, raw.Bounds) + + return nil +} diff --git a/vendor/github.com/go-openapi/spec/normalizer.go b/vendor/github.com/go-openapi/spec/normalizer.go index 3ca3f73cbe1..ced7f993570 100644 --- a/vendor/github.com/go-openapi/spec/normalizer.go +++ b/vendor/github.com/go-openapi/spec/normalizer.go @@ -41,10 +41,11 @@ func normalizeURI(refPath, base string) string { if refURL.Path == "." { refURL.Path = "" } + forgetSpelling(refURL) r := MustCreateRef(refURL.String()) if r.IsCanonical() { - return refURL.String() + return r.String() } baseURL, _ := parseURL(base) @@ -252,11 +253,12 @@ func normalizeBase(in string) string { if u.Path == "." { // empty after Clean() u.Path = "" } + forgetSpelling(u) if u.Scheme != "" { if path.IsAbs(u.Path) || u.Scheme != fileScheme { // this is absolute or explicitly not a local file: we're good - return u.String() + return canonicalString(u) } } @@ -269,5 +271,41 @@ func normalizeBase(in string) string { u.Scheme = fileScheme u.Path = absPath(u.Path) // platform-dependent u.RawQuery = "" // any query component is irrelevant for a base - return u.String() + return canonicalString(u) +} + +// forgetSpelling drops the escaped spelling url.Parse recorded, so that rendering the URL +// derives it from Path and Fragment again. +// +// url.URL.String returns RawPath whenever it still decodes to Path, and the normalizer rewrites +// Path - path.Clean, then a join onto the base. A RawPath describing the path as it was written +// no longer describes the path we now hold, and rendering it can produce a URI that does not +// parse: normalizeBase("%2F") used to return "file://%2F", where the escaped form lost the +// leading slash that Path carries and what is left reads as an authority. +func forgetSpelling(u *url.URL) { + u.RawPath = "" + u.RawFragment = "" +} + +// canonicalString renders a URL the way jsonreference does. +// +// The normalizer and jsonreference each canonicalize a URI, and they used to disagree: the +// normalizer kept the spelling it was handed while a Ref lower-cases the host, drops a default +// port and re-escapes path and fragment. Everything the expander stores - cache keys, the +// parentRefs chain, a $ref written back into the document - goes through both, so the two must +// agree or one document splits into two spellings of itself. +// +// A URI that jsonreference cannot parse is returned as it stands, rather than panicking through +// MustCreateRef. Such a URI is a defect in the normalizer, and the fuzz target reports it as one. +func canonicalString(u *url.URL) string { + rendered := u.String() + + r, err := NewRef(rendered) + if err != nil { + specLogger.Printf("warning: the normalizer produced an unparseable URI %q: %v", rendered, err) + + return rendered + } + + return r.String() } diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml index 31480c7138a..ce7a6ae47c4 100644 --- a/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ b/vendor/github.com/go-openapi/strfmt/.golangci.yml @@ -10,6 +10,7 @@ linters: - gomodguard_v2 - godox - exhaustruct + - exhaustruct_v5 - nlreturn - nonamedreturns - noinlineerr diff --git a/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md b/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md index fa17ff3111c..72a176c7647 100644 --- a/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/strfmt/CONTRIBUTORS.md @@ -4,12 +4,12 @@ | Total Contributors | Total Contributions | | --- | --- | -| 41 | 243 | +| 41 | 254 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | | @casualjim | 88 | | -| @fredbi | 74 | | +| @fredbi | 85 | | | @youyuanwu | 13 | | | @jlambatl | 9 | | | @GlenDC | 5 | | diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md index 15ee0e5826d..939fba7d291 100644 --- a/vendor/github.com/go-openapi/strfmt/README.md +++ b/vendor/github.com/go-openapi/strfmt/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -213,8 +213,6 @@ Maintainers can cut a new release by either: [gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fstrfmt.svg [gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fstrfmt -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/strfmt -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/strfmt [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/strfmt [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/strfmt diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go index bcc57e6fad3..9168d053c07 100644 --- a/vendor/github.com/go-openapi/strfmt/default.go +++ b/vendor/github.com/go-openapi/strfmt/default.go @@ -119,6 +119,7 @@ func IsHostname(str string) bool { } // IDNA check + str, _ = strings.CutSuffix(str, ".") // tolerates trailing ".", whereas IDNA ValidateLabel rule does not res, err := idnaHostChecker.ToASCII(strings.ToLower(str)) if err != nil || res == "" { return false @@ -1976,7 +1977,7 @@ func isISBN(str string, version int) bool { for i = range isbnVersion13 - 1 { checksum += factor[i%2] * int32(sanitized[i]-'0') } - return (int32(sanitized[isbnVersion13-1]-'0'))-((decimalBase-(checksum%decimalBase))%decimalBase) == 0 + return int32(sanitized[isbnVersion13-1]-'0')-((decimalBase-(checksum%decimalBase))%decimalBase) == 0 default: return isISBN(str, isbnVersion10) || isISBN(str, isbnVersion13) } diff --git a/vendor/github.com/go-openapi/strfmt/format.go b/vendor/github.com/go-openapi/strfmt/format.go index 09c37542546..7ec785661a6 100644 --- a/vendor/github.com/go-openapi/strfmt/format.go +++ b/vendor/github.com/go-openapi/strfmt/format.go @@ -122,7 +122,7 @@ func (f *defaultFormats) Add(name string, strfmt Format, validator Validator) bo nme := f.normalizeName(name) tpe := reflect.TypeOf(strfmt) - if tpe.Kind() == reflect.Ptr { + if tpe.Kind() == reflect.Pointer { tpe = tpe.Elem() } @@ -176,7 +176,7 @@ func (f *defaultFormats) DelByFormat(strfmt Format) bool { defer f.Unlock() tpe := reflect.TypeOf(strfmt) - if tpe.Kind() == reflect.Ptr { + if tpe.Kind() == reflect.Pointer { tpe = tpe.Elem() } @@ -208,7 +208,7 @@ func (f *defaultFormats) ContainsFormat(strfmt Format) bool { f.Lock() defer f.Unlock() tpe := reflect.TypeOf(strfmt) - if tpe.Kind() == reflect.Ptr { + if tpe.Kind() == reflect.Pointer { tpe = tpe.Elem() } diff --git a/vendor/github.com/go-openapi/strfmt/go.work b/vendor/github.com/go-openapi/strfmt/go.work index f233e74cfd0..432c541d699 100644 --- a/vendor/github.com/go-openapi/strfmt/go.work +++ b/vendor/github.com/go-openapi/strfmt/go.work @@ -4,4 +4,4 @@ use ( ./internal/testintegration ) -go 1.25.0 +go 1.26.0 diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml index c3ba0b6cd7c..e0932d0a658 100644 --- a/vendor/github.com/go-openapi/swag/.golangci.yml +++ b/vendor/github.com/go-openapi/swag/.golangci.yml @@ -7,6 +7,7 @@ linters: - errchkjson - errorlint - exhaustruct + - exhaustruct_v5 - forcetypeassert - funlen - gochecknoglobals diff --git a/vendor/github.com/go-openapi/swag/CONTRIBUTORS.md b/vendor/github.com/go-openapi/swag/CONTRIBUTORS.md index fb341cb10e5..1ff92bc1c0f 100644 --- a/vendor/github.com/go-openapi/swag/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/swag/CONTRIBUTORS.md @@ -4,11 +4,11 @@ | Total Contributors | Total Contributions | | --- | --- | -| 24 | 263 | +| 24 | 272 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 133 | | +| @fredbi | 142 | | | @casualjim | 98 | | | @alexandear | 4 | | | @orisano | 3 | | diff --git a/vendor/github.com/go-openapi/swag/README.md b/vendor/github.com/go-openapi/swag/README.md index c6c2d21e944..f56801e4305 100644 --- a/vendor/github.com/go-openapi/swag/README.md +++ b/vendor/github.com/go-openapi/swag/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -197,8 +197,6 @@ Maintainers can cut a new release by either: [gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fswag.svg [gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fswag -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/swag -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/swag [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/swag [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/swag diff --git a/vendor/github.com/go-openapi/swag/go.work b/vendor/github.com/go-openapi/swag/go.work index f1dddc436e7..bb58106509f 100644 --- a/vendor/github.com/go-openapi/swag/go.work +++ b/vendor/github.com/go-openapi/swag/go.work @@ -18,4 +18,4 @@ use ( ./yamlutils ) -go 1.25.0 +go 1.26.0 diff --git a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go index d4b5335f6f2..01ce324aec9 100644 --- a/vendor/github.com/go-openapi/swag/yamlutils/yaml.go +++ b/vendor/github.com/go-openapi/swag/yamlutils/yaml.go @@ -248,7 +248,7 @@ func yamlScalar(node *yaml.Node) (any, error) { func yamlStringScalarC(node *yaml.Node) (string, error) { if node.Kind != yaml.ScalarNode { - return "", fmt.Errorf("expecting a string scalar but got %q: %w", node.Kind, ErrYAML) + return "", fmt.Errorf("expecting a string scalar but got node.Kind(%d): %w", node.Kind, ErrYAML) } switch node.LongTag() { case yamlStringScalar, yamlIntScalar, yamlFloatScalar: diff --git a/vendor/github.com/go-openapi/validate/.gitignore b/vendor/github.com/go-openapi/validate/.gitignore index d8f4186fe59..fbb78de2c34 100644 --- a/vendor/github.com/go-openapi/validate/.gitignore +++ b/vendor/github.com/go-openapi/validate/.gitignore @@ -3,3 +3,4 @@ .idea .env .mcp.json +.worktrees diff --git a/vendor/github.com/go-openapi/validate/.golangci.yml b/vendor/github.com/go-openapi/validate/.golangci.yml index 4d6b36e4722..c05f38e9d84 100644 --- a/vendor/github.com/go-openapi/validate/.golangci.yml +++ b/vendor/github.com/go-openapi/validate/.golangci.yml @@ -7,7 +7,10 @@ linters: - gochecknoglobals - gochecknoinits - godox + - gomodguard + - gomodguard_v2 - exhaustruct + - exhaustruct_v5 - ireturn - nlreturn - nestif diff --git a/vendor/github.com/go-openapi/validate/BENCHMARK.md b/vendor/github.com/go-openapi/validate/BENCHMARK.md deleted file mode 100644 index 0353eae5bda..00000000000 --- a/vendor/github.com/go-openapi/validate/BENCHMARK.md +++ /dev/null @@ -1,34 +0,0 @@ -# Benchmark - -Validating the Kubernetes Swagger API - -## v0.22.6: 60,000,000 allocs - -``` -goos: linux -goarch: amd64 -pkg: github.com/go-openapi/validate -cpu: AMD Ryzen 7 5800X 8-Core Processor -Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 8549863982 ns/op 7067424936 B/op 59583275 allocs/op -``` - -## After refact PR: minor but noticeable improvements: 25,000,000 allocs - -``` -go test -bench Spec -goos: linux -goarch: amd64 -pkg: github.com/go-openapi/validate -cpu: AMD Ryzen 7 5800X 8-Core Processor -Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 4064535557 ns/op 3379715592 B/op 25320330 allocs/op -``` - -## After reduce GC pressure PR: 17,000,000 allocs - -``` -goos: linux -goarch: amd64 -pkg: github.com/go-openapi/validate -cpu: AMD Ryzen 7 5800X 8-Core Processor -Benchmark_KubernetesSpec/validating_kubernetes_API-16 1 3758414145 ns/op 2593881496 B/op 17111373 allocs/op -``` diff --git a/vendor/github.com/go-openapi/validate/CONTRIBUTORS.md b/vendor/github.com/go-openapi/validate/CONTRIBUTORS.md index 0f5497c8bbf..62bd8518f4d 100644 --- a/vendor/github.com/go-openapi/validate/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/validate/CONTRIBUTORS.md @@ -4,12 +4,12 @@ | Total Contributors | Total Contributions | | --- | --- | -| 31 | 305 | +| 32 | 312 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | | @casualjim | 169 | | -| @fredbi | 68 | | +| @fredbi | 74 | | | @sttts | 11 | | | @youyuanwu | 9 | | | @keramix | 8 | | @@ -32,6 +32,7 @@ | @liggitt | 1 | | | @ilyakaznacheev | 1 | | | @hypnoglow | 1 | | +| @HNO3Miracle | 1 | | | @gautierdelorme | 1 | | | @flavioribeiro | 1 | | | @pheepi | 1 | | diff --git a/vendor/github.com/go-openapi/validate/README.md b/vendor/github.com/go-openapi/validate/README.md index b814a2ef126..aa8eea56302 100644 --- a/vendor/github.com/go-openapi/validate/README.md +++ b/vendor/github.com/go-openapi/validate/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -98,8 +98,6 @@ Maintainers can cut a new release by either: [release-badge]: https://badge.fury.io/gh/go-openapi%2Fvalidate.svg [release-url]: https://badge.fury.io/gh/go-openapi%2Fvalidate -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/validate -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/validate [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/validate [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/validate diff --git a/vendor/github.com/go-openapi/validate/collection_format.go b/vendor/github.com/go-openapi/validate/collection_format.go new file mode 100644 index 00000000000..a77ba564d9b --- /dev/null +++ b/vendor/github.com/go-openapi/validate/collection_format.go @@ -0,0 +1,131 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "fmt" + "strconv" + + "github.com/go-openapi/spec" +) + +// validateCollectionFormats warns about a collectionFormat that has no effect. +// +// collectionFormat says how to join the members of an array into one value on the wire — csv, ssv, +// tsv, pipes, or multi for a parameter repeated once per member: +// +// parameters: +// - name: tags +// in: query +// type: array +// items: { type: string } +// collectionFormat: pipes +// +// There is nothing to join when the type is not array, so a collectionFormat written on a string or +// an integer does nothing. Swagger 2.0 says the member "determines the format of the array if type +// array is used" and stops there — it never forbids writing it elsewhere, so this is a warning and +// the specification stays valid. +// +// The meta-schema already covers the rest of the collectionFormat rules, and covers them at every +// location: the value must be one of csv, ssv, tsv or pipes, widened with multi for a query or +// formData parameter, where repeating the parameter is possible. A body parameter cannot carry the +// member at all. None of that needs a rule here. +// +// Only a parameter, a header and an items carry a collectionFormat — [spec.SimpleSchema] holds it, +// and [spec.Schema] has no such member. So this walks what the operations of the document declare, +// the way [SpecValidator.validateItems] does, and never looks at a schema. A JSON schema validated +// on its own is untouched by this rule. +func (s *SpecValidator) validateCollectionFormats() *Result { + res := validatorPools.results.Borrow() + + operations := s.analyzer.Operations() + for _, method := range sortedKeys(operations) { + byPath := operations[method] + for _, path := range sortedKeys(byPath) { + op := byPath[path] + + for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) { + if param.In == swaggerBody { + // a body parameter describes itself with a schema, and the meta-schema + // forbids it a collectionFormat outright + continue + } + + at := s.parameterPath(path, method, param.In, param.Name) + in := fmt.Sprintf("parameter %q", param.Name) + checkCollectionFormat(at, param.CollectionFormat, param.Type, in, res) + checkItemsCollectionFormats(at, param.Items, in, res) + } + + for _, response := range responsesOf(op) { + at := responsePath(path, method, response.code) + for _, name := range sortedKeys(response.resp.Headers) { + header := response.resp.Headers[name] + headerAt := at.children(swaggerHeaders, name) + in := fmt.Sprintf("header %q", name) + checkCollectionFormat(headerAt, header.CollectionFormat, header.Type, in, res) + checkItemsCollectionFormats(headerAt, header.Items, in, res) + } + } + } + } + + return res +} + +// codedResponse is a response together with the code the operation files it under, "default" +// included. +type codedResponse struct { + code string + resp spec.Response +} + +// responsesOf lists the responses an operation declares, in a settled order: the default response +// first, then the status codes in ascending order. +func responsesOf(op *spec.Operation) []codedResponse { + if op == nil || op.Responses == nil { + return nil + } + + var responses []codedResponse + if op.Responses.Default != nil { + responses = append(responses, codedResponse{code: jsonDefault, resp: *op.Responses.Default}) + } + + for _, code := range sortedKeys(op.Responses.StatusCodeResponses) { + responses = append(responses, codedResponse{ + code: strconv.Itoa(code), + resp: op.Responses.StatusCodeResponses[code], + }) + } + + return responses +} + +// checkItemsCollectionFormats checks the items of a parameter or header, then the items of those +// items, as deep as the document nests them. +// +// Every level is named the same way in a message: an array of arrays that writes a pointless +// collectionFormat twice is one thing to fix, and the deeper location is reported only when the +// shallower one is sound. +func checkItemsCollectionFormats(at pathSegments, items *spec.Items, in string, res *Result) { + for items != nil { + at = at.child(jsonItems) + checkCollectionFormat(at, items.CollectionFormat, items.Type, "items of "+in, res) + items = items.Items + } +} + +// checkCollectionFormat warns when a collectionFormat is written on something that is not an array. +// +// A missing collectionFormat has nothing to answer for, and neither has a missing type: a document +// that leaves the type out is already reported by the meta-schema, and guessing what it meant here +// would only add noise. +func checkCollectionFormat(at pathSegments, collectionFormat, typ, in string, res *Result) { + if collectionFormat == "" || typ == "" || typ == arrayType { + return + } + + res.addWarningsAt(at.child(swaggerCollectionFormat), collectionFormatIgnoredMsg(collectionFormat, in, typ)) +} diff --git a/vendor/github.com/go-openapi/validate/default_validator.go b/vendor/github.com/go-openapi/validate/default_validator.go index ebcd8071374..5902cee5ca6 100644 --- a/vendor/github.com/go-openapi/validate/default_validator.go +++ b/vendor/github.com/go-openapi/validate/default_validator.go @@ -4,9 +4,6 @@ package validate import ( - "fmt" - "strings" - "github.com/go-openapi/spec" ) @@ -20,7 +17,7 @@ type defaultValidator struct { // Validate validates the default values declared in the swagger spec. func (d *defaultValidator) Validate() *Result { - errs := pools.poolOfResults.BorrowResult() // will redeem when merged + errs := validatorPools.results.Borrow() // will redeem when merged if d == nil || d.SpecValidator == nil { return errs @@ -44,28 +41,16 @@ func (d *defaultValidator) resetVisited() { } } -func isVisited(path string, visitedSchemas map[string]struct{}) bool { - _, found := visitedSchemas[path] +func isVisited(path pathSegments, visitedSchemas map[string]struct{}) bool { + _, found := visitedSchemas[path.pointer()] if found { return true } - // search for overlapping paths - var ( - parent string - suffix string - ) - const backtrackFromEnd = 2 - for i := len(path) - backtrackFromEnd; i >= 0; i-- { - r := path[i] - if r != '.' { - continue - } - - parent = path[0:i] - suffix = path[i+1:] - - if strings.HasSuffix(parent, suffix) { + // search for overlapping paths: a trailing run of tokens that already + // appears at the end of what leads to it means we are going in circles. + for i := 1; i < len(path); i++ { + if path[:i].hasSuffix(path[i:]) { return true } } @@ -74,12 +59,12 @@ func isVisited(path string, visitedSchemas map[string]struct{}) bool { } // beingVisited asserts a schema is being visited. -func (d *defaultValidator) beingVisited(path string) { - d.visitedSchemas[path] = struct{}{} +func (d *defaultValidator) beingVisited(path pathSegments) { + d.visitedSchemas[path.pointer()] = struct{}{} } // isVisited tells if a path has already been visited. -func (d *defaultValidator) isVisited(path string) bool { +func (d *defaultValidator) isVisited(path pathSegments) bool { return isVisited(path, d.visitedSchemas) } @@ -88,15 +73,18 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result { // every default value that is specified must validate against the schema for that property // headers, items, parameters, schema - res := pools.poolOfResults.BorrowResult() // will redeem when merged + res := validatorPools.results.Borrow() // will redeem when merged s := d.SpecValidator - for method, pathItem := range s.expandedAnalyzer().Operations() { - for path, op := range pathItem { + operations := s.expandedAnalyzer().Operations() + for _, method := range sortedKeys(operations) { + pathItem := operations[method] + for _, path := range sortedKeys(pathItem) { + op := pathItem[path] // parameters for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) { if param.Default != nil && param.Required { - res.AddWarnings(requiredHasDefaultMsg(param.Name, param.In)) + res.addWarningsAt(s.parameterPath(path, method, param.In, param.Name), requiredHasDefaultMsg(param.Name, param.In)) } // reset explored schemas to get depth-first recursive-proof exploration @@ -107,33 +95,34 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result { if param.Default != nil && param.Schema == nil { // check param default value is valid red := newParamValidator(¶m, s.KnownFormats, d.schemaOptions).Validate(param.Default) //#nosec + red.relocate(s.parameterPath(path, method, param.In, param.Name).child(jsonDefault)) if red.HasErrorsOrWarnings() { - res.AddErrors(defaultValueDoesNotValidateMsg(param.Name, param.In)) + res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), defaultValueDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } // Recursively follows Items and Schemas if param.Items != nil { - red := d.validateDefaultValueItemsAgainstSchema(param.Name, param.In, ¶m, param.Items) //#nosec + red := d.validateDefaultValueItemsAgainstSchema(s.parameterPath(path, method, param.In, param.Name), param.In, ¶m, param.Items) //#nosec if red.HasErrorsOrWarnings() { - res.AddErrors(defaultValueItemsDoesNotValidateMsg(param.Name, param.In)) + res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), defaultValueItemsDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } if param.Schema != nil { // Validate default value against schema - red := d.validateDefaultValueSchemaAgainstSchema(param.Name, param.In, param.Schema) + red := d.validateDefaultValueSchemaAgainstSchema(s.parameterPath(path, method, param.In, param.Name).structuralChild(jsonSchema), param.In, param.Schema) if red.HasErrorsOrWarnings() { - res.AddErrors(defaultValueDoesNotValidateMsg(param.Name, param.In)) + res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), defaultValueDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } } @@ -141,68 +130,74 @@ func (d *defaultValidator) validateDefaultValueValidAgainstSchema() *Result { if op.Responses != nil { if op.Responses.Default != nil { // Same constraint on default Response - res.Merge(d.validateDefaultInResponse(op.Responses.Default, jsonDefault, path, 0, op.ID)) + res.Merge(d.validateDefaultInResponse(op.Responses.Default, jsonDefault, path, method, 0, op.ID)) } // Same constraint on regular Responses if op.Responses.StatusCodeResponses != nil { // Safeguard - for code, r := range op.Responses.StatusCodeResponses { - res.Merge(d.validateDefaultInResponse(&r, "response", path, code, op.ID)) //#nosec + for _, code := range sortedKeys(op.Responses.StatusCodeResponses) { + r := op.Responses.StatusCodeResponses[code] + res.Merge(d.validateDefaultInResponse(&r, "response", path, method, code, op.ID)) } } } else if op.ID != "" { // Empty op.ID means there is no meaningful operation: no need to report a specific message - res.AddErrors(noValidResponseMsg(op.ID)) + res.addErrorsAt(operationPath(path, method), noValidResponseMsg(op.ID)) } } } if s.spec.Spec().Definitions != nil { // Safeguard // reset explored schemas to get depth-first recursive-proof exploration d.resetVisited() - for nm, sch := range s.spec.Spec().Definitions { - res.Merge(d.validateDefaultValueSchemaAgainstSchema("definitions."+nm, "body", &sch)) //#nosec + definitions := s.spec.Spec().Definitions + for _, nm := range sortedKeys(definitions) { + sch := definitions[nm] + res.Merge(d.validateDefaultValueSchemaAgainstSchema(newPathSegments(swaggerDefinitions, nm), "body", &sch)) } } return res } -func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, responseType, path string, responseCode int, operationID string) *Result { +func (d *defaultValidator) validateDefaultInResponse( + resp *spec.Response, responseType, path, method string, responseCode int, operationID string, +) *Result { s := d.SpecValidator - response, res := responseHelp.expandResponseRef(resp, path, s) + responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode) + response, res := responseHelp.expandResponseRef(resp, path, responsePath(path, method, responseCodeAsStr), s) if !res.IsValid() { return res } - responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode) - if response.Headers != nil { // Safeguard - for nm, h := range response.Headers { + for _, nm := range sortedKeys(response.Headers) { + h := response.Headers[nm] // reset explored schemas to get depth-first recursive-proof exploration d.resetVisited() if h.Default != nil { red := newHeaderValidator(nm, &h, s.KnownFormats, d.schemaOptions).Validate(h.Default) //#nosec + red.relocate(responseHeaderPath(path, method, responseCodeAsStr, nm).child(jsonDefault)) if red.HasErrorsOrWarnings() { - res.AddErrors(defaultValueHeaderDoesNotValidateMsg(operationID, nm, responseName)) + res.addErrorsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), defaultValueHeaderDoesNotValidateMsg(operationID, nm, responseName)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } // Headers have inline definition, like params if h.Items != nil { - red := d.validateDefaultValueItemsAgainstSchema(nm, "header", &h, h.Items) //#nosec + red := d.validateDefaultValueItemsAgainstSchema(responseHeaderPath(path, method, responseCodeAsStr, nm), "header", &h, h.Items) //#nosec if red.HasErrorsOrWarnings() { - res.AddErrors(defaultValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName)) + res.addErrorsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), defaultValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } if _, err := compileRegexp(h.Pattern); err != nil { - res.AddErrors(invalidPatternInHeaderMsg(operationID, nm, responseName, h.Pattern, err)) + res.addErrorsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), invalidPatternInHeaderMsg(operationID, nm, responseName, h.Pattern, err)) } // Headers don't have schema @@ -212,62 +207,65 @@ func (d *defaultValidator) validateDefaultInResponse(resp *spec.Response, respon // reset explored schemas to get depth-first recursive-proof exploration d.resetVisited() - red := d.validateDefaultValueSchemaAgainstSchema(responseCodeAsStr, "response", response.Schema) + red := d.validateDefaultValueSchemaAgainstSchema( + responsePath(path, method, responseCodeAsStr).structuralChild(jsonSchema), "response", response.Schema) if red.HasErrorsOrWarnings() { // Additional message to make sure the context of the error is not lost - res.AddErrors(defaultValueInDoesNotValidateMsg(operationID, responseName)) + res.addErrorsAt(responsePath(path, method, responseCodeAsStr), defaultValueInDoesNotValidateMsg(operationID, responseName)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } return res } -func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in string, schema *spec.Schema) *Result { +func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path pathSegments, in string, schema *spec.Schema) *Result { if schema == nil || d.isVisited(path) { // Avoids recursing if we are already done with that check return nil } d.beingVisited(path) - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() s := d.SpecValidator if schema.Default != nil { res.Merge( - newSchemaValidator(schema, s.spec.Spec(), path+".default", s.KnownFormats, d.schemaOptions).Validate(schema.Default), + newSchemaValidator(schema, s.spec.Spec(), path.child(jsonDefault), s.KnownFormats, d.schemaOptions).Validate(schema.Default), ) } if schema.Items != nil { if schema.Items.Schema != nil { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".items.default", in, schema.Items.Schema)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonItems), in, schema.Items.Schema)) } // Multiple schemas in items if schema.Items.Schemas != nil { // Safeguard for i, sch := range schema.Items.Schemas { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.items[%d].default", path, i), in, &sch)) //#nosec + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonItems).item(i), in, &sch)) //#nosec } } } if _, err := compileRegexp(schema.Pattern); err != nil { - res.AddErrors(invalidPatternInMsg(path, in, schema.Pattern)) + res.addErrorsAt(path, invalidPatternInMsg(path.dotted(), in, schema.Pattern)) } if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { // NOTE: we keep validating values, even though additionalItems is not supported by Swagger 2.0 (and 3.0 as well) - res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".additionalItems", in, schema.AdditionalItems.Schema)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonAdditionalItems), in, schema.AdditionalItems.Schema)) } - for propName, prop := range schema.Properties { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec + for _, propName := range sortedKeys(schema.Properties) { + prop := schema.Properties[propName] + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.structuralChild(jsonProperties).child(propName), in, &prop)) } - for propName, prop := range schema.PatternProperties { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec + for _, propName := range sortedKeys(schema.PatternProperties) { + prop := schema.PatternProperties[propName] + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.structuralChild(jsonPatternProperties).child(propName), in, &prop)) } if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(path+".additionalProperties", in, schema.AdditionalProperties.Schema)) + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonAdditionalProperties), in, schema.AdditionalProperties.Schema)) } if schema.AllOf != nil { for i, aoSch := range schema.AllOf { - res.Merge(d.validateDefaultValueSchemaAgainstSchema(fmt.Sprintf("%s.allOf[%d]", path, i), in, &aoSch)) //#nosec + res.Merge(d.validateDefaultValueSchemaAgainstSchema(path.child(jsonAllOf).item(i), in, &aoSch)) //#nosec } } return res @@ -275,8 +273,8 @@ func (d *defaultValidator) validateDefaultValueSchemaAgainstSchema(path, in stri // NOTE: Temporary duplicated code. Need to refactor with examples -func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path, in string, root any, items *spec.Items) *Result { - res := pools.poolOfResults.BorrowResult() +func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path pathSegments, in string, root any, items *spec.Items) *Result { + res := validatorPools.results.Borrow() s := d.SpecValidator if items != nil { if items.Default != nil { @@ -285,10 +283,10 @@ func (d *defaultValidator) validateDefaultValueItemsAgainstSchema(path, in strin ) } if items.Items != nil { - res.Merge(d.validateDefaultValueItemsAgainstSchema(path+"[0].default", in, root, items.Items)) + res.Merge(d.validateDefaultValueItemsAgainstSchema(path.item(0), in, root, items.Items)) } if _, err := compileRegexp(items.Pattern); err != nil { - res.AddErrors(invalidPatternInMsg(path, in, items.Pattern)) + res.addErrorsAt(path, invalidPatternInMsg(path.dotted(), in, items.Pattern)) } } return res diff --git a/vendor/github.com/go-openapi/validate/discriminator.go b/vendor/github.com/go-openapi/validate/discriminator.go new file mode 100644 index 00000000000..7a4ab4167bf --- /dev/null +++ b/vendor/github.com/go-openapi/validate/discriminator.go @@ -0,0 +1,156 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "slices" + + "github.com/go-openapi/spec" +) + +// validateDiscriminators checks the discriminator of every definition, and of every schema a +// definition holds inline. +// +// A discriminator names the property that tells subtypes apart: +// +// Pet: +// discriminator: petType +// required: [ petType ] +// properties: +// petType: { type: string } +// +// Swagger 2.0 asks two things of that property: the schema must define it, and must list it as +// required. Both matter for the same reason — an instance carries its subtype in that property, +// so a subtype cannot be resolved from an instance that has nowhere to put the value, or that is +// free to leave it out. +// +// The JSON meta-schema types discriminator as a plain string and never compares it against +// properties or required, so it can express neither check. +// +// A property contributed by an allOf member counts as defined, and one that member requires counts +// as required: [SpecValidator.declaresProperty] already reads a composed definition that way for +// the required rule, and a discriminator resolves against the instance the whole composition +// describes. +// +// The third clause of the rule — the value must name this schema or one that inherits it — +// constrains the data, not the document, so it belongs to schema validation rather than here. +func (s *SpecValidator) validateDiscriminators() *Result { + res := validatorPools.results.Borrow() + definitions := s.spec.Spec().Definitions + + for _, name := range sortedKeys(definitions) { + schema := definitions[name] + s.walkDiscriminators(newPathSegments(swaggerDefinitions, name), &schema, res) + } + + return res +} + +// walkDiscriminators checks the discriminator of a schema, then of every schema it holds inline. +// +// A schema written as a $ref is left alone: it is checked where it is defined, and following it +// here would report the same fault twice and, for a recursive definition, would not terminate. +// This mirrors [SpecValidator.walkRequired]. +func (s *SpecValidator) walkDiscriminators(at pathSegments, v *spec.Schema, res *Result) { + if v == nil || v.Ref.String() != "" { + return + } + + s.checkDiscriminator(at, v, res) + + for _, name := range sortedKeys(v.Properties) { + held := v.Properties[name] + s.walkDiscriminators(at.structuralChild(jsonProperties).child(name), &held, res) + } + + for _, pattern := range sortedKeys(v.PatternProperties) { + held := v.PatternProperties[pattern] + s.walkDiscriminators(at.structuralChild(jsonPatternProperties).child(pattern), &held, res) + } + + if v.Items != nil { + if v.Items.Schema != nil { + s.walkDiscriminators(at.child(jsonItems), v.Items.Schema, res) + } + for i := range v.Items.Schemas { + s.walkDiscriminators(at.child(jsonItems).item(i), &v.Items.Schemas[i], res) + } + } + + if v.AdditionalProperties != nil && v.AdditionalProperties.Schema != nil { + s.walkDiscriminators(at.child(jsonAdditionalProperties), v.AdditionalProperties.Schema, res) + } + + for _, composition := range []struct { + keyword string + members []spec.Schema + }{ + {jsonAllOf, v.AllOf}, + {jsonAnyOf, v.AnyOf}, + {jsonOneOf, v.OneOf}, + } { + for i := range composition.members { + s.walkDiscriminators(at.child(composition.keyword).item(i), &composition.members[i], res) + } + } + + if v.Not != nil { + s.walkDiscriminators(at.child(jsonNot), v.Not, res) + } +} + +// checkDiscriminator checks the discriminator a single schema declares. A schema without one has +// nothing to answer for. +// +// Both findings are reported against the discriminator itself, which is the entry a reader has to +// go and amend, and both are reported when they apply: a discriminator naming a property that is +// neither defined nor required is two separate slips to fix. +func (s *SpecValidator) checkDiscriminator(at pathSegments, v *spec.Schema, res *Result) { + if v.Discriminator == "" { + return + } + + of := identify(at).name + discriminatorAt := at.child(jsonDiscriminator) + + if _, declared := s.declaresProperty(v, v.Discriminator, maxCompositionHops); !declared { + res.addErrorsAt(discriminatorAt, discriminatorNotDefinedMsg(v.Discriminator, of)) + } + + if !s.requiresProperty(v, v.Discriminator, maxCompositionHops) { + res.addErrorsAt(discriminatorAt, discriminatorNotRequiredMsg(v.Discriminator, of)) + } +} + +// requiresProperty reports whether a schema, or any schema composed into it by allOf, lists the +// named property as required. +// +// It is the required-list counterpart of [SpecValidator.declaresProperty], and follows allOf the +// same way, including the local $ref an allOf member may be written as. +func (s *SpecValidator) requiresProperty(v *spec.Schema, name string, hops int) bool { + if v == nil || hops <= 0 { + return false + } + + if slices.Contains(v.Required, name) { + return true + } + + for i := range v.AllOf { + member := &v.AllOf[i] + if member.Ref.String() != "" { + resolved, err := s.resolveRef(&member.Ref) + if err != nil { + continue + } + member = resolved + } + + if s.requiresProperty(member, name, hops-1) { + return true + } + } + + return false +} diff --git a/vendor/github.com/go-openapi/validate/doc.go b/vendor/github.com/go-openapi/validate/doc.go index 5218ec85c63..f2d02d1a325 100644 --- a/vendor/github.com/go-openapi/validate/doc.go +++ b/vendor/github.com/go-openapi/validate/doc.go @@ -12,6 +12,11 @@ // Validates a spec document (from JSON or YAML) against the JSON schema for swagger, // then checks a number of extra rules that can't be expressed in JSON schema. // +// The lists below hold the extra rules only. The meta-schema already settles a great deal on its +// own, and where it does, no rule is repeated here: collectionFormat, say, must be one of csv, ssv, +// tsv or pipes, widened with multi for a query or formData parameter, and a body parameter may not +// carry one at all — all of that comes out of the meta-schema, at every location it applies to. +// // Entry points: // // - Spec() @@ -25,6 +30,9 @@ // [x] path uniqueness: each api path should be non-verbatim (account for path param names) unique per method. Validation can be laxed by disabling StrictPathParamUniqueness. // [x] each security reference should contain only unique scopes // [x] each security scope in a security definition should be unique +// [x] a discriminator must name a property the schema defines and lists as required +// [x] each security requirement must name a scheme declared in securityDefinitions +// [x] only an oauth2 security requirement may list scopes: every other scheme type must list none // [x] parameters in path must be unique // [x] each path parameter must correspond to a parameter placeholder and vice versa // [x] each referenceable definition must have references @@ -47,6 +55,8 @@ // [x] unsupported validation of examples on non-JSON media types // [x] examples in response without schema // [x] readOnly properties should not be required +// [x] an oauth2 security requirement names a scope its security scheme does not declare +// [x] collectionFormat is written on a parameter, header or items whose type is not array // // # Validating a schema // @@ -69,8 +79,11 @@ // [ ] errors and warnings are not reported with key/line number in spec // [ ] default values and examples on responses only support application/json producer type // [ ] invalid numeric constraints (such as Minimum, etc..) are not checked except for default and example values -// [ ] rules for collectionFormat are not implemented -// [ ] no validation rule for polymorphism support (discriminator) [not done here] // [ ] valid js ECMA regexp not supported by Go regexp engine are considered invalid // [ ] arbitrary large numbers are not supported: max is math.MaxFloat64 +// +// Left out by design, rather than pending: a discriminator value is not checked against the schema +// names it may take. That clause of the swagger rule constrains an instance rather than the +// document, so there is nothing in a specification for [SpecValidator] to read, and checking it +// would mean resolving polymorphic payloads, which this package does not do. package validate diff --git a/vendor/github.com/go-openapi/validate/example_validator.go b/vendor/github.com/go-openapi/validate/example_validator.go index eb6b5ee5c70..0e193d52346 100644 --- a/vendor/github.com/go-openapi/validate/example_validator.go +++ b/vendor/github.com/go-openapi/validate/example_validator.go @@ -4,8 +4,6 @@ package validate import ( - "fmt" - "github.com/go-openapi/spec" ) @@ -24,7 +22,7 @@ type exampleValidator struct { // - individual property // - responses func (ex *exampleValidator) Validate() *Result { - errs := pools.poolOfResults.BorrowResult() + errs := validatorPools.results.Borrow() if ex == nil || ex.SpecValidator == nil { return errs @@ -50,12 +48,12 @@ func (ex *exampleValidator) resetVisited() { } // beingVisited asserts a schema is being visited. -func (ex *exampleValidator) beingVisited(path string) { - ex.visitedSchemas[path] = struct{}{} +func (ex *exampleValidator) beingVisited(path pathSegments) { + ex.visitedSchemas[path.pointer()] = struct{}{} } // isVisited tells if a path has already been visited. -func (ex *exampleValidator) isVisited(path string) bool { +func (ex *exampleValidator) isVisited(path pathSegments) bool { return isVisited(path, ex.visitedSchemas) } @@ -65,11 +63,14 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result { // in: schemas, properties, object, items // not in: headers, parameters without schema - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() s := ex.SpecValidator - for method, pathItem := range s.expandedAnalyzer().Operations() { - for path, op := range pathItem { + operations := s.expandedAnalyzer().Operations() + for _, method := range sortedKeys(operations) { + pathItem := operations[method] + for _, path := range sortedKeys(pathItem) { + op := pathItem[path] // parameters for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) { @@ -84,33 +85,34 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result { if param.Example != nil && param.Schema == nil { // check param default value is valid red := newParamValidator(¶m, s.KnownFormats, ex.schemaOptions).Validate(param.Example) //#nosec + red.relocate(s.parameterPath(path, method, param.In, param.Name).child(swaggerExample)) if red.HasErrorsOrWarnings() { - res.AddWarnings(exampleValueDoesNotValidateMsg(param.Name, param.In)) + res.addWarningsAt(s.parameterPath(path, method, param.In, param.Name), exampleValueDoesNotValidateMsg(param.Name, param.In)) res.MergeAsWarnings(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } // Recursively follows Items and Schemas if param.Items != nil { - red := ex.validateExampleValueItemsAgainstSchema(param.Name, param.In, ¶m, param.Items) //#nosec + red := ex.validateExampleValueItemsAgainstSchema(s.parameterPath(path, method, param.In, param.Name), param.In, ¶m, param.Items) //#nosec if red.HasErrorsOrWarnings() { - res.AddWarnings(exampleValueItemsDoesNotValidateMsg(param.Name, param.In)) + res.addWarningsAt(s.parameterPath(path, method, param.In, param.Name), exampleValueItemsDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } if param.Schema != nil { // Validate example value against schema - red := ex.validateExampleValueSchemaAgainstSchema(param.Name, param.In, param.Schema) + red := ex.validateExampleValueSchemaAgainstSchema(s.parameterPath(path, method, param.In, param.Name).structuralChild(jsonSchema), param.In, param.Schema) if red.HasErrorsOrWarnings() { - res.AddWarnings(exampleValueDoesNotValidateMsg(param.Name, param.In)) + res.addWarningsAt(s.parameterPath(path, method, param.In, param.Name), exampleValueDoesNotValidateMsg(param.Name, param.In)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } } @@ -118,68 +120,74 @@ func (ex *exampleValidator) validateExampleValueValidAgainstSchema() *Result { if op.Responses != nil { if op.Responses.Default != nil { // Same constraint on default Response - res.Merge(ex.validateExampleInResponse(op.Responses.Default, jsonDefault, path, 0, op.ID)) + res.Merge(ex.validateExampleInResponse(op.Responses.Default, jsonDefault, path, method, 0, op.ID)) } // Same constraint on regular Responses if op.Responses.StatusCodeResponses != nil { // Safeguard - for code, r := range op.Responses.StatusCodeResponses { - res.Merge(ex.validateExampleInResponse(&r, "response", path, code, op.ID)) //#nosec + for _, code := range sortedKeys(op.Responses.StatusCodeResponses) { + r := op.Responses.StatusCodeResponses[code] + res.Merge(ex.validateExampleInResponse(&r, "response", path, method, code, op.ID)) } } } else if op.ID != "" { // Empty op.ID means there is no meaningful operation: no need to report a specific message - res.AddErrors(noValidResponseMsg(op.ID)) + res.addErrorsAt(operationPath(path, method), noValidResponseMsg(op.ID)) } } } if s.spec.Spec().Definitions != nil { // Safeguard // reset explored schemas to get depth-first recursive-proof exploration ex.resetVisited() - for nm, sch := range s.spec.Spec().Definitions { - res.Merge(ex.validateExampleValueSchemaAgainstSchema("definitions."+nm, "body", &sch)) //#nosec + definitions := s.spec.Spec().Definitions + for _, nm := range sortedKeys(definitions) { + sch := definitions[nm] + res.Merge(ex.validateExampleValueSchemaAgainstSchema(newPathSegments(swaggerDefinitions, nm), "body", &sch)) } } return res } -func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, responseType, path string, responseCode int, operationID string) *Result { +func (ex *exampleValidator) validateExampleInResponse( + resp *spec.Response, responseType, path, method string, responseCode int, operationID string, +) *Result { s := ex.SpecValidator - response, res := responseHelp.expandResponseRef(resp, path, s) + responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode) + response, res := responseHelp.expandResponseRef(resp, path, responsePath(path, method, responseCodeAsStr), s) if !res.IsValid() { // Safeguard return res } - responseName, responseCodeAsStr := responseHelp.responseMsgVariants(responseType, responseCode) - if response.Headers != nil { // Safeguard - for nm, h := range response.Headers { + for _, nm := range sortedKeys(response.Headers) { + h := response.Headers[nm] // reset explored schemas to get depth-first recursive-proof exploration ex.resetVisited() if h.Example != nil { red := newHeaderValidator(nm, &h, s.KnownFormats, ex.schemaOptions).Validate(h.Example) //#nosec + red.relocate(responseHeaderPath(path, method, responseCodeAsStr, nm).child(swaggerExample)) if red.HasErrorsOrWarnings() { - res.AddWarnings(exampleValueHeaderDoesNotValidateMsg(operationID, nm, responseName)) + res.addWarningsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), exampleValueHeaderDoesNotValidateMsg(operationID, nm, responseName)) res.MergeAsWarnings(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } // Headers have inline definition, like params if h.Items != nil { - red := ex.validateExampleValueItemsAgainstSchema(nm, "header", &h, h.Items) //#nosec + red := ex.validateExampleValueItemsAgainstSchema(responseHeaderPath(path, method, responseCodeAsStr, nm), "header", &h, h.Items) //#nosec if red.HasErrorsOrWarnings() { - res.AddWarnings(exampleValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName)) + res.addWarningsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), exampleValueHeaderItemsDoesNotValidateMsg(operationID, nm, responseName)) res.MergeAsWarnings(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } if _, err := compileRegexp(h.Pattern); err != nil { - res.AddErrors(invalidPatternInHeaderMsg(operationID, nm, responseName, h.Pattern, err)) + res.addErrorsAt(responseHeaderPath(path, method, responseCodeAsStr, nm), invalidPatternInHeaderMsg(operationID, nm, responseName, h.Pattern, err)) } // Headers don't have schema @@ -189,77 +197,84 @@ func (ex *exampleValidator) validateExampleInResponse(resp *spec.Response, respo // reset explored schemas to get depth-first recursive-proof exploration ex.resetVisited() - red := ex.validateExampleValueSchemaAgainstSchema(responseCodeAsStr, "response", response.Schema) + red := ex.validateExampleValueSchemaAgainstSchema( + responsePath(path, method, responseCodeAsStr).structuralChild(jsonSchema), "response", response.Schema) if red.HasErrorsOrWarnings() { // Additional message to make sure the context of the error is not lost - res.AddWarnings(exampleValueInDoesNotValidateMsg(operationID, responseName)) + res.addWarningsAt(responsePath(path, method, responseCodeAsStr), exampleValueInDoesNotValidateMsg(operationID, responseName)) res.Merge(red) } else if red.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(red) + redeemResult(red) } } if response.Examples != nil { if response.Schema != nil { - if example, ok := response.Examples["application/json"]; ok { + if example, ok := response.Examples[jsonMimeApplicationJSON]; ok { + exampleAt := responsePath(path, method, responseCodeAsStr). + child(swaggerExamples). + structuralChild(jsonMimeApplicationJSON) res.MergeAsWarnings( - newSchemaValidator(response.Schema, s.spec.Spec(), path+".examples", s.KnownFormats, s.schemaOptions).Validate(example), + newSchemaValidator(response.Schema, s.spec.Spec(), + exampleAt, s.KnownFormats, s.schemaOptions).Validate(example), ) } else { // Proposal for enhancement: validate other media types too - res.AddWarnings(examplesMimeNotSupportedMsg(operationID, responseName)) + res.addWarningsAt(responsePath(path, method, responseCodeAsStr).child(swaggerExamples), examplesMimeNotSupportedMsg(operationID, responseName)) } } else { - res.AddWarnings(examplesWithoutSchemaMsg(operationID, responseName)) + res.addWarningsAt(responsePath(path, method, responseCodeAsStr).child(swaggerExamples), examplesWithoutSchemaMsg(operationID, responseName)) } } return res } -func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in string, schema *spec.Schema) *Result { +func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path pathSegments, in string, schema *spec.Schema) *Result { if schema == nil || ex.isVisited(path) { // Avoids recursing if we are already done with that check return nil } ex.beingVisited(path) s := ex.SpecValidator - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() if schema.Example != nil { res.MergeAsWarnings( - newSchemaValidator(schema, s.spec.Spec(), path+".example", s.KnownFormats, ex.schemaOptions).Validate(schema.Example), + newSchemaValidator(schema, s.spec.Spec(), path.child(swaggerExample), s.KnownFormats, ex.schemaOptions).Validate(schema.Example), ) } if schema.Items != nil { if schema.Items.Schema != nil { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".items.example", in, schema.Items.Schema)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonItems), in, schema.Items.Schema)) } // Multiple schemas in items if schema.Items.Schemas != nil { // Safeguard for i, sch := range schema.Items.Schemas { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.items[%d].example", path, i), in, &sch)) //#nosec + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonItems).item(i), in, &sch)) //#nosec } } } if _, err := compileRegexp(schema.Pattern); err != nil { - res.AddErrors(invalidPatternInMsg(path, in, schema.Pattern)) + res.addErrorsAt(path, invalidPatternInMsg(path.dotted(), in, schema.Pattern)) } if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { // NOTE: we keep validating values, even though additionalItems is unsupported in Swagger 2.0 (and 3.0 as well) - res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".additionalItems", in, schema.AdditionalItems.Schema)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonAdditionalItems), in, schema.AdditionalItems.Schema)) } - for propName, prop := range schema.Properties { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec + for _, propName := range sortedKeys(schema.Properties) { + prop := schema.Properties[propName] + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.structuralChild(jsonProperties).child(propName), in, &prop)) } - for propName, prop := range schema.PatternProperties { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+"."+propName, in, &prop)) //#nosec + for _, propName := range sortedKeys(schema.PatternProperties) { + prop := schema.PatternProperties[propName] + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.structuralChild(jsonPatternProperties).child(propName), in, &prop)) } if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(path+".additionalProperties", in, schema.AdditionalProperties.Schema)) + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonAdditionalProperties), in, schema.AdditionalProperties.Schema)) } if schema.AllOf != nil { for i, aoSch := range schema.AllOf { - res.Merge(ex.validateExampleValueSchemaAgainstSchema(fmt.Sprintf("%s.allOf[%d]", path, i), in, &aoSch)) //#nosec + res.Merge(ex.validateExampleValueSchemaAgainstSchema(path.child(jsonAllOf).item(i), in, &aoSch)) //#nosec } } return res @@ -268,8 +283,8 @@ func (ex *exampleValidator) validateExampleValueSchemaAgainstSchema(path, in str // NOTE: Temporary duplicated code. Need to refactor with examples // -func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path, in string, root any, items *spec.Items) *Result { - res := pools.poolOfResults.BorrowResult() +func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path pathSegments, in string, root any, items *spec.Items) *Result { + res := validatorPools.results.Borrow() s := ex.SpecValidator if items != nil { if items.Example != nil { @@ -278,10 +293,10 @@ func (ex *exampleValidator) validateExampleValueItemsAgainstSchema(path, in stri ) } if items.Items != nil { - res.Merge(ex.validateExampleValueItemsAgainstSchema(path+"[0].example", in, root, items.Items)) + res.Merge(ex.validateExampleValueItemsAgainstSchema(path.item(0), in, root, items.Items)) } if _, err := compileRegexp(items.Pattern); err != nil { - res.AddErrors(invalidPatternInMsg(path, in, items.Pattern)) + res.addErrorsAt(path, invalidPatternInMsg(path.dotted(), in, items.Pattern)) } } diff --git a/vendor/github.com/go-openapi/validate/formats.go b/vendor/github.com/go-openapi/validate/formats.go index eab26153762..23359e35dd6 100644 --- a/vendor/github.com/go-openapi/validate/formats.go +++ b/vendor/github.com/go-openapi/validate/formats.go @@ -11,21 +11,21 @@ import ( ) type formatValidator struct { - Path string + Path pathSegments In string Format string KnownFormats strfmt.Registry Options *SchemaValidatorOptions } -func newFormatValidator(path, in, format string, formats strfmt.Registry, opts *SchemaValidatorOptions) *formatValidator { +func newFormatValidator(path pathSegments, in, format string, formats strfmt.Registry, opts *SchemaValidatorOptions) *formatValidator { if opts == nil { opts = new(SchemaValidatorOptions) } var f *formatValidator if opts.recycleValidators { - f = pools.poolOfFormatValidators.BorrowValidator() + f = validatorPools.formatValidators.Borrow() } else { f = new(formatValidator) } @@ -39,10 +39,6 @@ func newFormatValidator(path, in, format string, formats strfmt.Registry, opts * return f } -func (f *formatValidator) SetPath(path string) { - f.Path = path -} - func (f *formatValidator) Applies(source any, kind reflect.Kind) bool { if source == nil || f.KnownFormats == nil { return false @@ -71,7 +67,7 @@ func (f *formatValidator) Validate(val any) *Result { var result *Result if f.Options.recycleResult { - result = pools.poolOfResults.BorrowResult() + result = validatorPools.results.Borrow() } else { result = new(Result) } @@ -81,13 +77,17 @@ func (f *formatValidator) Validate(val any) *Result { return result } - if err := FormatOf(f.Path, f.In, f.Format, str, f.KnownFormats); err != nil { - result.AddErrors(err) + if err := FormatOf(f.Path.dotted(), f.In, f.Format, str, f.KnownFormats); err != nil { + result.addErrorsAt(f.Path, err) } return result } +func (f *formatValidator) setPath(path pathSegments) { + f.Path = path +} + func (f *formatValidator) redeem() { - pools.poolOfFormatValidators.RedeemValidator(f) + validatorPools.formatValidators.Redeem(f) } diff --git a/vendor/github.com/go-openapi/validate/helpers.go b/vendor/github.com/go-openapi/validate/helpers.go index 8a1a2312830..ea7143607c8 100644 --- a/vendor/github.com/go-openapi/validate/helpers.go +++ b/vendor/github.com/go-openapi/validate/helpers.go @@ -12,6 +12,7 @@ import ( "strings" "github.com/go-openapi/errors" + "github.com/go-openapi/jsonpointer" "github.com/go-openapi/spec" ) @@ -33,13 +34,84 @@ const ( ) const ( - jsonProperties = "properties" - jsonItems = "items" - jsonType = "type" - // jsonSchema = "schema". - jsonDefault = "default" + jsonProperties = "properties" + jsonPatternProperties = "patternProperties" + jsonItems = "items" + jsonType = "type" + jsonSchema = "schema" + jsonRequired = "required" + jsonRef = "$ref" + jsonDefault = "default" + jsonDiscriminator = "discriminator" + + jsonAllOf = "allOf" + jsonAnyOf = "anyOf" + jsonOneOf = "oneOf" + jsonNot = "not" + jsonAdditionalItems = "additionalItems" + jsonAdditionalProperties = "additionalProperties" + + swaggerPaths = "paths" + swaggerDefinitions = "definitions" + swaggerResponses = "responses" + swaggerParameters = "parameters" + swaggerHeaders = "headers" + swaggerOperationID = "operationId" + swaggerSecurity = "security" + swaggerCollectionFormat = "collectionFormat" + + // securitySchemeOAuth2 is the only security scheme type whose requirements carry scopes. + securitySchemeOAuth2 = "oauth2" + + jsonMimeApplicationJSON = "application/json" ) +// operationPath locates an operation in the spec document. +func operationPath(path, method string) pathSegments { + return newPathSegments(swaggerPaths, path, methodToken(method)) +} + +// parameterPath locates a parameter of an operation in the spec document. +func (s *SpecValidator) parameterPath(path, method, in, name string) pathSegments { + return s.paramLocations.at(path, method, in, name) +} + +// responsePath locates a response of an operation in the spec document. +func responsePath(path, method, responseCode string) pathSegments { + return operationPath(path, method).children(swaggerResponses, responseCode) +} + +// responseHeaderPath locates a header declared by a response. +func responseHeaderPath(path, method, responseCode, header string) pathSegments { + return responsePath(path, method, responseCode).children(swaggerHeaders, header) +} + +// methodToken normalizes an HTTP method into the key under which the operation +// is found in the document: the analyzer hands them over in upper case, but a +// path item spells them in lower case. +func methodToken(method string) string { + return strings.ToLower(method) +} + +// localRefPath turns a local JSON reference such as "#/definitions/Pet" into +// the location of what it points to. +// +// It yields the document root for anything that does not address a local +// fragment, a remote reference in particular. +func localRefPath(ref string) pathSegments { + rest, isLocal := strings.CutPrefix(ref, "#/") + if !isLocal { + return rootPath() + } + + tokens := strings.Split(rest, "/") + for i, token := range tokens { + tokens[i] = jsonpointer.Unescape(token) + } + + return newPathSegments(tokens...) +} + const ( stringFormatDate = "date" stringFormatDateTime = "date-time" @@ -91,24 +163,33 @@ type errorHelper struct { } func (h *errorHelper) sErr(err errors.Error, recycle bool) *Result { - // Builds a Result from standard errors.Error + return h.sErrAt(nil, err, recycle) +} + +// sErrAt builds a Result from a standard errors.Error reported at a known location. +func (h *errorHelper) sErrAt(at pathSegments, err errors.Error, recycle bool) *Result { var result *Result if recycle { - result = pools.poolOfResults.BorrowResult() + result = validatorPools.results.Borrow() } else { result = new(Result) } - result.Errors = []error{err} + result.addErrorsAt(at, err) return result } func (h *errorHelper) addPointerError(res *Result, err error, ref string, fromPath string) *Result { - // Provides more context on error messages - // reported by the jsoinpointer package by altering the passed Result + return h.addPointerErrorAt(res, nil, err, ref, fromPath) +} + +// addPointerErrorAt provides more context on error messages reported by the +// jsonpointer package, by altering the passed Result. +func (h *errorHelper) addPointerErrorAt(res *Result, at pathSegments, err error, ref string, fromPath string) *Result { if err != nil { - res.AddErrors(cannotResolveRefMsg(fromPath, ref, err)) + res.addErrorsAt(at, cannotResolveRefMsg(fromPath, ref, err)) } + return res } @@ -222,15 +303,19 @@ func (h *paramHelper) safeExpandedParamsFor(path, method, operationID string, re // remove params with invalid expansion from Slice operation.Parameters = resolvedParams - for _, ppr := range s.expandedAnalyzer().SafeParamsFor(method, path, + // the analyzer keys parameters by name and location: walk those keys in + // order, so that findings about an operation's parameters come out the + // same way on every run + safeParams := s.expandedAnalyzer().SafeParamsFor(method, path, func(_ spec.Parameter, err error) bool { // since params have already been expanded, there are few causes for error - res.AddErrors(someParametersBrokenMsg(path, method, operationID)) + res.addErrorsAt(operationPath(path, method), someParametersBrokenMsg(path, method, operationID)) // original error from analyzer - res.AddErrors(err) + res.addErrorsAt(operationPath(path, method), err) return true - }) { - params = append(params, ppr) + }) + for _, k := range sortedKeys(safeParams) { + params = append(params, safeParams[k]) } } return @@ -242,21 +327,23 @@ func (h *paramHelper) resolveParam(path, method, operationID string, param *spec res := new(Result) isRef := param.Ref.String() != "" if s.spec.SpecFilePath() == "" { - err = spec.ExpandParameterWithRoot(param, s.spec.Spec(), nil) + err = spec.ExpandParameterWithOptions(param, s.spec.Spec(), nil, s.schemaOptions.expandOptions("")) } else { - err = spec.ExpandParameter(param, s.spec.SpecFilePath()) + err = spec.ExpandParameterWithOptions(param, nil, nil, s.schemaOptions.expandOptions(s.spec.SpecFilePath())) } if err != nil { // Safeguard // NOTE: we may enter here when the whole parameter is an unresolved $ref refPath := strings.Join([]string{"\"" + path + "\"", method}, ".") - errorHelp.addPointerError(res, err, param.Ref.String(), refPath) + errorHelp.addPointerErrorAt(res, s.parameterPath(path, method, param.In, param.Name), err, param.Ref.String(), refPath) return nil, res } - res.Merge(h.checkExpandedParam(param, param.Name, param.In, operationID, isRef)) + res.Merge(h.checkExpandedParam(param, param.Name, param.In, operationID, s.parameterPath(path, method, param.In, param.Name), isRef)) return param, res } -func (h *paramHelper) checkExpandedParam(pr *spec.Parameter, path, in, operation string, isRef bool) *Result { +func (h *paramHelper) checkExpandedParam( + pr *spec.Parameter, path, in, operation string, at pathSegments, isRef bool, +) *Result { // Secure parameter structure after $ref resolution res := new(Result) simpleZero := spec.SimpleSchema{} @@ -267,17 +354,17 @@ func (h *paramHelper) checkExpandedParam(pr *spec.Parameter, path, in, operation // Most likely, a $ref with a sibling is an unwanted situation: in itself this is a warning... // but we detect it because of the following error: // schema took over Parameter for an unexplained reason - res.AddWarnings(refShouldNotHaveSiblingsMsg(path, operation)) + res.addWarningsAt(at, refShouldNotHaveSiblingsMsg(path, operation)) } - res.AddErrors(invalidParameterDefinitionMsg(path, in, operation)) + res.addErrorsAt(at, invalidParameterDefinitionMsg(path, in, operation)) case pr.In != swaggerBody && pr.Schema != nil: if isRef { - res.AddWarnings(refShouldNotHaveSiblingsMsg(path, operation)) + res.addWarningsAt(at, refShouldNotHaveSiblingsMsg(path, operation)) } - res.AddErrors(invalidParameterDefinitionAsSchemaMsg(path, in, operation)) + res.addErrorsAt(at, invalidParameterDefinitionAsSchemaMsg(path, in, operation)) case (pr.In == swaggerBody && pr.Schema == nil) || (pr.In != swaggerBody && pr.SimpleSchema == simpleZero): // Other unexpected mishaps - res.AddErrors(invalidParameterDefinitionMsg(path, in, operation)) + res.addErrorsAt(at, invalidParameterDefinitionMsg(path, in, operation)) } return res } @@ -288,20 +375,20 @@ type responseHelper struct { func (r *responseHelper) expandResponseRef( response *spec.Response, - path string, s *SpecValidator, + path string, at pathSegments, s *SpecValidator, ) (*spec.Response, *Result) { // Ensure response is expanded var err error res := new(Result) if s.spec.SpecFilePath() == "" { // there is no physical document to resolve $ref in response - err = spec.ExpandResponseWithRoot(response, s.spec.Spec(), nil) + err = spec.ExpandResponseWithOptions(response, s.spec.Spec(), nil, s.schemaOptions.expandOptions("")) } else { - err = spec.ExpandResponse(response, s.spec.SpecFilePath()) + err = spec.ExpandResponseWithOptions(response, nil, nil, s.schemaOptions.expandOptions(s.spec.SpecFilePath())) } if err != nil { // Safeguard // NOTE: we may enter here when the whole response is an unresolved $ref. - errorHelp.addPointerError(res, err, response.Ref.String(), path) + errorHelp.addPointerErrorAt(res, at, err, response.Ref.String(), path) return nil, res } diff --git a/vendor/github.com/go-openapi/validate/object_validator.go b/vendor/github.com/go-openapi/validate/object_validator.go index e651b3f70f0..cac243ece67 100644 --- a/vendor/github.com/go-openapi/validate/object_validator.go +++ b/vendor/github.com/go-openapi/validate/object_validator.go @@ -4,7 +4,6 @@ package validate import ( - "fmt" "reflect" "strings" @@ -14,7 +13,7 @@ import ( ) type objectValidator struct { - Path string + Path pathSegments In string MaxProperties *int64 MinProperties *int64 @@ -25,10 +24,9 @@ type objectValidator struct { Root any KnownFormats strfmt.Registry Options *SchemaValidatorOptions - splitPath []string } -func newObjectValidator(path, in string, +func newObjectValidator(path pathSegments, in string, maxProperties, minProperties *int64, required []string, properties spec.SchemaProperties, additionalProperties *spec.SchemaOrBool, patternProperties spec.SchemaProperties, root any, formats strfmt.Registry, opts *SchemaValidatorOptions, @@ -39,7 +37,7 @@ func newObjectValidator(path, in string, var v *objectValidator if opts.recycleValidators { - v = pools.poolOfObjectValidators.BorrowValidator() + v = validatorPools.objectValidators.Borrow() } else { v = new(objectValidator) } @@ -55,7 +53,6 @@ func newObjectValidator(path, in string, v.Root = root v.KnownFormats = formats v.Options = opts - v.splitPath = strings.Split(v.Path, ".") return v } @@ -72,21 +69,21 @@ func (o *objectValidator) Validate(data any) *Result { var ok bool val, ok = data.(map[string]any) if !ok { - return errorHelp.sErr(invalidObjectMsg(o.Path, o.In), o.Options.recycleResult) + return errorHelp.sErrAt(o.Path, invalidObjectMsg(o.Path.dotted(), o.In), o.Options.recycleResult) } } numKeys := int64(len(val)) if o.MinProperties != nil && numKeys < *o.MinProperties { - return errorHelp.sErr(errors.TooFewProperties(o.Path, o.In, *o.MinProperties), o.Options.recycleResult) + return errorHelp.sErrAt(o.Path, errors.TooFewProperties(o.Path.dotted(), o.In, *o.MinProperties), o.Options.recycleResult) } if o.MaxProperties != nil && numKeys > *o.MaxProperties { - return errorHelp.sErr(errors.TooManyProperties(o.Path, o.In, *o.MaxProperties), o.Options.recycleResult) + return errorHelp.sErrAt(o.Path, errors.TooManyProperties(o.Path.dotted(), o.In, *o.MaxProperties), o.Options.recycleResult) } var res *Result if o.Options.recycleResult { - res = pools.poolOfResults.BorrowResult() + res = validatorPools.results.Borrow() } else { res = new(Result) } @@ -106,7 +103,8 @@ func (o *objectValidator) Validate(data any) *Result { // Check patternProperties // NOTE: it looks like we have done that twice in many cases - for key, value := range val { + for _, key := range sortedKeys(val) { + value := val[key] _, regularProperty := o.Properties[key] matched, _, patterns := o.validatePatternProperty(key, value, res) // applies to regular properties as well if regularProperty || !matched { @@ -115,7 +113,7 @@ func (o *objectValidator) Validate(data any) *Result { for _, pName := range patterns { if v, ok := o.PatternProperties[pName]; ok { - r := newSchemaValidator(&v, o.Root, o.Path+"."+key, o.KnownFormats, o.Options).Validate(value) + r := newSchemaValidator(&v, o.Root, o.Path.child(key), o.KnownFormats, o.Options).Validate(value) res.mergeForField(data.(map[string]any), key, r) //nolint:forcetypeassert // data is always map[string]any at this point } } @@ -124,11 +122,6 @@ func (o *objectValidator) Validate(data any) *Result { return res } -func (o *objectValidator) SetPath(path string) { - o.Path = path - o.splitPath = strings.Split(path, ".") -} - func (o *objectValidator) Applies(source any, kind reflect.Kind) bool { // NOTE: this should also work for structs // there is a problem in the type validator where it will be unhappy about null values @@ -137,19 +130,29 @@ func (o *objectValidator) Applies(source any, kind reflect.Kind) bool { return isSchema && (kind == reflect.Map || kind == reflect.Struct) } +// The three predicates below tell what kind of content the validated object +// is, so that schema-only checks are not run against plain data. +// +// Array indices are trimmed first: an element of an example is example data +// just as much as the example itself. + func (o *objectValidator) isProperties() bool { - p := o.splitPath - return len(p) > 1 && p[len(p)-1] == jsonProperties && p[len(p)-2] != jsonProperties + p := o.Path.trimIndexes() + + return p.last() == jsonProperties && p.beforeLast() != jsonProperties } func (o *objectValidator) isDefault() bool { - p := o.splitPath - return len(p) > 1 && p[len(p)-1] == jsonDefault && p[len(p)-2] != jsonDefault + p := o.Path.trimIndexes() + + return p.last() == jsonDefault && p.beforeLast() != jsonDefault } func (o *objectValidator) isExample() bool { - p := o.splitPath - return len(p) > 1 && (p[len(p)-1] == swaggerExample || p[len(p)-1] == swaggerExamples) && p[len(p)-2] != swaggerExample + p := o.Path.trimIndexes() + last := p.last() + + return (last == swaggerExample || last == swaggerExamples) && p.beforeLast() != swaggerExample } func (o *objectValidator) checkArrayMustHaveItems(res *Result, val map[string]any) { @@ -174,7 +177,7 @@ func (o *objectValidator) checkArrayMustHaveItems(res *Result, val map[string]an return } - res.AddErrors(errors.Required(jsonItems, o.Path, item)) + res.addErrorsAt(o.Path, errors.Required(jsonItems, o.Path.dotted(), item)) } func (o *objectValidator) checkItemsMustBeTypeArray(res *Result, val map[string]any) { @@ -194,11 +197,11 @@ func (o *objectValidator) checkItemsMustBeTypeArray(res *Result, val map[string] t, typeFound := val[jsonType] if !typeFound { // there is no type - res.AddErrors(errors.Required(jsonType, o.Path, t)) + res.addErrorsAt(o.Path, errors.Required(jsonType, o.Path.dotted(), t)) } if tpe, isString := t.(string); !isString || tpe != arrayType { - res.AddErrors(errors.InvalidType(o.Path, o.In, arrayType, nil)) + res.addErrorsAt(o.Path, errors.InvalidType(o.Path.dotted(), o.In, arrayType, nil)) } } @@ -212,7 +215,7 @@ func (o *objectValidator) precheck(res *Result, val map[string]any) { } func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res *Result) { - for k := range val { + for _, k := range sortedKeys(val) { if k == "$schema" || k == "id" { // special properties "$schema" and "id" are ignored continue @@ -238,7 +241,7 @@ func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res continue } - res.AddErrors(errors.PropertyNotAllowed(o.Path, o.In, k)) + res.addErrorsAt(o.Path.child(k), errors.PropertyNotAllowed(o.Path.dotted(), o.In, k)) // BUG(fredbi): This section should move to a part dedicated to spec validation as // it will conflict with regular schemas where a property "headers" is defined. @@ -261,7 +264,8 @@ func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res continue } - for headerKey, headerBody := range headers { + for _, headerKey := range sortedKeys(headers) { + headerBody := headers[headerKey] if headerBody == nil { continue } @@ -282,7 +286,7 @@ func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res } msg := strings.Join([]string{", one may not use $ref=\":", refString, "\""}, "") - res.AddErrors(refNotAllowedInHeaderMsg(o.Path, headerKey, msg)) + res.addErrorsAt(o.Path, refNotAllowedInHeaderMsg(o.Path.dotted(), headerKey, msg)) /* case "$ref": if val[k] != nil { @@ -294,7 +298,8 @@ func (o *objectValidator) validateNoAdditionalProperties(val map[string]any, res } func (o *objectValidator) validateAdditionalProperties(val map[string]any, res *Result) { - for key, value := range val { + for _, key := range sortedKeys(val) { + value := val[key] _, regularProperty := o.Properties[key] if regularProperty { continue @@ -315,7 +320,7 @@ func (o *objectValidator) validateAdditionalProperties(val map[string]any, res * // Cases: properties which are not regular properties and have not been matched by the PatternProperties validator // AdditionalProperties as Schema - r := newSchemaValidator(o.AdditionalProperties.Schema, o.Root, o.Path+"."+key, o.KnownFormats, o.Options).Validate(value) + r := newSchemaValidator(o.AdditionalProperties.Schema, o.Root, o.Path.child(key), o.KnownFormats, o.Options).Validate(value) res.mergeForField(val, key, r) } // Valid cases: additionalProperties: true or undefined @@ -326,19 +331,14 @@ func (o *objectValidator) validatePropertiesSchema(val map[string]any, res *Resu // Property types: // - regular Property - pSchema := pools.poolOfSchemas.BorrowSchema() // recycle a spec.Schema object which lifespan extends only to the validation of properties + pSchema := validatorPools.schemas.Borrow() // recycle a spec.Schema object which lifespan extends only to the validation of properties defer func() { - pools.poolOfSchemas.RedeemSchema(pSchema) + validatorPools.schemas.Redeem(pSchema) }() - for pName := range o.Properties { + for _, pName := range sortedKeys(o.Properties) { *pSchema = o.Properties[pName] - var rName string - if o.Path == "" { - rName = pName - } else { - rName = o.Path + "." + pName - } + rName := o.Path.child(pName) // Recursively validates each property against its schema v, ok := val[pName] @@ -374,7 +374,9 @@ func (o *objectValidator) validatePropertiesSchema(val map[string]any, res *Resu continue } - res.AddErrors(errors.Required(fmt.Sprintf("%s.%s", o.Path, k), o.In, v)) + // located on the object that lacks the property: the property itself + // has no node to point at, and the object has to be amended + res.addErrorsAt(o.Path, errors.Required(o.Path.child(k).dotted(), o.In, v)) } } @@ -388,12 +390,12 @@ func (o *objectValidator) validatePatternProperty(key string, value any, result succeededOnce := false patterns := make([]string, 0, len(o.PatternProperties)) - schema := pools.poolOfSchemas.BorrowSchema() + schema := validatorPools.schemas.Borrow() defer func() { - pools.poolOfSchemas.RedeemSchema(schema) + validatorPools.schemas.Redeem(schema) }() - for k := range o.PatternProperties { + for _, k := range sortedKeys(o.PatternProperties) { re, err := compileRegexp(k) if err != nil { continue @@ -407,7 +409,7 @@ func (o *objectValidator) validatePatternProperty(key string, value any, result *schema = o.PatternProperties[k] patterns = append(patterns, k) matched = true - validator := newSchemaValidator(schema, o.Root, fmt.Sprintf("%s.%s", o.Path, key), o.KnownFormats, o.Options) + validator := newSchemaValidator(schema, o.Root, o.Path.child(key), o.KnownFormats, o.Options) res := validator.Validate(value) result.Merge(res) @@ -416,6 +418,10 @@ func (o *objectValidator) validatePatternProperty(key string, value any, result return matched, succeededOnce, patterns } +func (o *objectValidator) setPath(path pathSegments) { + o.Path = path +} + func (o *objectValidator) redeem() { - pools.poolOfObjectValidators.RedeemValidator(o) + validatorPools.objectValidators.Redeem(o) } diff --git a/vendor/github.com/go-openapi/validate/param_locations.go b/vendor/github.com/go-openapi/validate/param_locations.go new file mode 100644 index 00000000000..703d6ca17fc --- /dev/null +++ b/vendor/github.com/go-openapi/validate/param_locations.go @@ -0,0 +1,122 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "strconv" + + "github.com/go-openapi/spec" +) + +// paramLocations tells where an operation declares a parameter. +// +// Parameters are held in an array, so a name is not how a document addresses +// one: only its index is. The index is not something a validator can work out +// from an expanded parameter either, because expansion merges the parameters +// an operation declares with those its path item declares, and resolves the +// ones written as a $ref. So the unexpanded document is indexed once, and +// looked up by what a validator does know: the operation, and the name and +// location of the parameter it is reporting on. +type paramLocations map[paramKey]pathSegments + +// paramKey identifies a parameter the way the swagger specification does: +// a name is unique only within an "in". +type paramKey struct { + path string + method string + in string + name string +} + +// newParamLocations indexes the parameters declared by an unexpanded document. +func newParamLocations(sp *spec.Swagger) paramLocations { + locations := make(paramLocations) + if sp == nil || sp.Paths == nil { + return locations + } + + for path, pathItem := range sp.Paths.Paths { + at := newPathSegments(swaggerPaths, path) + + // parameters declared by the path item are shared by all its + // operations: recorded once, without a method + locations.collect(sp, paramKey{path: path}, at, pathItem.Parameters) + + for method, op := range operationsOf(&pathItem) { //#nosec + if op == nil { + continue + } + + locations.collect(sp, paramKey{path: path, method: method}, at.child(method), op.Parameters) + } + } + + return locations +} + +// at returns where an operation declares a parameter. +// +// A parameter the operation does not declare itself may come from its path +// item. When neither knows it, which happens for a parameter too broken to be +// identified, the pointer stops on the array holding it and the name is kept +// for the message alone: an index no one could work out would be a guess. +func (l paramLocations) at(path, method, in, name string) pathSegments { + if found, isDeclared := l[paramKey{path: path, method: methodToken(method), in: in, name: name}]; isDeclared { + return found + } + + if found, isDeclared := l[paramKey{path: path, in: in, name: name}]; isDeclared { + return found + } + + return operationPath(path, method).child(swaggerParameters).cosmeticChild(name) +} + +func (l paramLocations) collect(sp *spec.Swagger, key paramKey, at pathSegments, params []spec.Parameter) { + for i := range params { + name, in, ok := parameterIdentity(sp, ¶ms[i]) + if !ok { + continue + } + + key.name = name + key.in = in + l[key] = at.child(swaggerParameters).childAs(strconv.Itoa(i), name) + } +} + +// parameterIdentity names a parameter as declared, resolving the one indirection +// a document may put in the way: an entry written as a local $ref. +func parameterIdentity(sp *spec.Swagger, param *spec.Parameter) (name, in string, ok bool) { + if param.Ref.String() == "" { + return param.Name, param.In, param.Name != "" + } + + shared := localRefPath(param.Ref.String()) + const sharedParameterDepth = 2 + if len(shared) != sharedParameterDepth || shared.beforeLast() != swaggerParameters { + return "", "", false + } + + declared, isDeclared := sp.Parameters[shared.last()] + if !isDeclared { + return "", "", false + } + + return declared.Name, declared.In, declared.Name != "" +} + +// operationsOf yields the operations of a path item, keyed as the document +// spells them. +func operationsOf(pathItem *spec.PathItem) map[string]*spec.Operation { + return map[string]*spec.Operation{ + "get": pathItem.Get, + "put": pathItem.Put, + "post": pathItem.Post, + "delete": pathItem.Delete, + "options": pathItem.Options, + "head": pathItem.Head, + "patch": pathItem.Patch, + } +} diff --git a/vendor/github.com/go-openapi/validate/path.go b/vendor/github.com/go-openapi/validate/path.go new file mode 100644 index 00000000000..4b2da2535be --- /dev/null +++ b/vendor/github.com/go-openapi/validate/path.go @@ -0,0 +1,269 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "slices" + "strconv" + "strings" + + "github.com/go-openapi/jsonpointer" +) + +// pathSegments is the location of a validated value inside a document, +// held as an ordered list of unescaped JSON pointer reference tokens. +// +// Validators build a location by appending tokens as they descend into +// properties and array items, then render it only when they report an error. +// Keeping the tokens apart until then makes it possible to produce a +// valid [RFC 6901] JSON pointer: a token is escaped when it is rendered, and +// the separator can never be confused with a token that contains one. +// +// The zero value is the location of the document root. +// +// [RFC 6901]: https://datatracker.ietf.org/doc/html/rfc6901 +type pathSegments []pathToken + +// pathToken is one step of a location. +// +// A token addresses a member the way the document does, which is not always +// the way a reader recognizes it: an operation addresses its parameters by +// index, while a message is far more useful naming them. When the two differ, +// display carries the readable form and only the message uses it. +type pathToken struct { + token string + display string + + // structural marks a token a document needs to address the value, but + // that messages have never shown: a "properties" between a schema and one + // of its members, say. It is part of the pointer and absent from the + // dotted form. + structural bool + + // cosmetic is the converse: a token messages name but that the document + // does not address, such as a parameter too broken to be found by name in + // the array holding it. It is part of the dotted form and absent from the + // pointer, which then stops at the deepest node the document does contain. + cosmetic bool +} + +// readable renders a token the way a message should spell it. +func (t pathToken) readable() string { + if t.display != "" { + return t.display + } + + return t.token +} + +// newPathSegments builds a location from a list of unescaped tokens. +func newPathSegments(tokens ...string) pathSegments { + if len(tokens) == 0 { + return nil + } + + segments := make(pathSegments, len(tokens)) + for i, token := range tokens { + segments[i] = pathToken{token: token} + } + + return segments +} + +// rootPath is the location of the document root. +func rootPath() pathSegments { return nil } + +// String implements [fmt.Stringer] with the legacy dotted notation, so that a +// location interpolated into a message reads as it always has. +func (p pathSegments) String() string { return p.dotted() } + +// child returns the location of a named member of the value at p. +// +// The receiver is never modified: sibling children may be derived from the +// same parent without aliasing one another. +func (p pathSegments) child(token string) pathSegments { + return p.appendToken(pathToken{token: token}) +} + +// childAs returns the location of a member the document addresses as token, +// which messages should spell as display instead. +func (p pathSegments) childAs(token, display string) pathSegments { + return p.appendToken(pathToken{token: token, display: display}) +} + +// structuralChild returns the location of a member a document addresses but +// messages do not name. +func (p pathSegments) structuralChild(token string) pathSegments { + return p.appendToken(pathToken{token: token, structural: true}) +} + +// cosmeticChild returns a location that messages spell as a member named token, +// while the pointer stays on p. +func (p pathSegments) cosmeticChild(token string) pathSegments { + return p.appendToken(pathToken{token: token, cosmetic: true}) +} + +func (p pathSegments) appendToken(token pathToken) pathSegments { + child := make(pathSegments, len(p)+1) + copy(child, p) + child[len(p)] = p.inherit(token) + + return child +} + +// inherit passes down what a parent token says about addressability: nothing +// below a token the document does not address is addressable either, so the +// pointer has to stop at the same place. +func (p pathSegments) inherit(token pathToken) pathToken { + if len(p) > 0 && p[len(p)-1].cosmetic { + token.cosmetic = true + } + + return token +} + +// children returns the location of a chain of named members below p. +func (p pathSegments) children(tokens ...string) pathSegments { + child := make(pathSegments, len(p)+len(tokens)) + copy(child, p) + for i, token := range tokens { + child[len(p)+i] = child[:len(p)+i].inherit(pathToken{token: token}) + } + + return child +} + +// item returns the location of the index'th element of the array at p. +func (p pathSegments) item(index int) pathSegments { + return p.child(strconv.Itoa(index)) +} + +// isEmpty tells if p locates the document root. +func (p pathSegments) isEmpty() bool { return len(p) == 0 } + +// last returns the trailing meaningful token, or an empty string at the +// document root. +// +// Structural tokens are skipped: they say how a document addresses the value, +// not what the value is, and the callers here are asking the latter. +func (p pathSegments) last() string { + if token, ok := p.meaningfulAt(0); ok { + return token + } + + return "" +} + +// beforeLast returns the meaningful token before the trailing one, or an empty +// string when p holds fewer than two of them. +func (p pathSegments) beforeLast() string { + if token, ok := p.meaningfulAt(1); ok { + return token + } + + return "" +} + +// meaningfulAt returns the nth token from the end, counting only the tokens a +// message would show. +func (p pathSegments) meaningfulAt(n int) (string, bool) { + seen := 0 + for _, token := range slices.Backward(p) { + if token.structural { + continue + } + + if seen == n { + return token.token, true + } + + seen++ + } + + return "", false +} + +// trimIndexes returns p without its trailing array index tokens. +// +// It answers "what is this value inside of", disregarding how deep into an +// array it sits: the items of an example are still an example. +func (p pathSegments) trimIndexes() pathSegments { + end := len(p) + for end > 0 && isIndexToken(p[end-1].token) { + end-- + } + + return p[:end] +} + +// isIndexToken tells if a token addresses an array element rather than a member. +func isIndexToken(token string) bool { + if token == "" { + return false + } + + for _, r := range token { + if r < '0' || r > '9' { + return false + } + } + + return true +} + +// hasSuffix tells if p ends with the given sequence of tokens. +func (p pathSegments) hasSuffix(suffix pathSegments) bool { + if len(suffix) > len(p) { + return false + } + + offset := len(p) - len(suffix) + for i, token := range suffix { + if p[offset+i].token != token.token { + return false + } + } + + return true +} + +// dotted renders the location in the legacy dot-separated notation, e.g. +// "definitions.Pet.friends.0.name". +// +// Tokens are emitted verbatim: a token containing a dot is indistinguishable +// from a separator. This notation is kept because it is what surfaces as the +// name of a validation error, and API consumers of go-swagger servers see it. +// Use [pathSegments.pointer] whenever the location needs to be unambiguous. +func (p pathSegments) dotted() string { + readable := make([]string, 0, len(p)) + for _, token := range p { + if token.structural { + continue + } + + readable = append(readable, token.readable()) + } + + return strings.Join(readable, ".") +} + +// pointer renders the location as an RFC 6901 JSON pointer, e.g. +// "/definitions/Pet/friends/0/name". The document root renders as "". +func (p pathSegments) pointer() string { + if len(p) == 0 { + return "" + } + + var w strings.Builder + for _, token := range p { + if token.cosmetic { + continue + } + + w.WriteByte('/') + w.WriteString(jsonpointer.Escape(token.token)) + } + + return w.String() +} diff --git a/vendor/github.com/go-openapi/validate/pools.go b/vendor/github.com/go-openapi/validate/pools.go index c8936bd10ba..24fde6e9c2a 100644 --- a/vendor/github.com/go-openapi/validate/pools.go +++ b/vendor/github.com/go-openapi/validate/pools.go @@ -1,369 +1,87 @@ // SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers // SPDX-License-Identifier: Apache-2.0 -//go:build !validatedebug - package validate import ( - "sync" - "github.com/go-openapi/spec" + "github.com/go-openapi/swag/pools" ) -var pools allPools +// validatorPools recycles the objects allocated while validating. +// +// Validation allocates a validator per schema node and a result per check, so +// the same handful of types are built and thrown away constantly. Recycling +// them keeps validating a large specification affordable. +// +// Build with the "poolsdebug" tag to have every borrow and redeem tracked: +// misuse then panics where it happens rather than corrupting a pool, and +// [pools.AssertNoLeaks] reports what was borrowed and never given back. +var validatorPools allPools func init() { resetPools() } +// resetPools builds a fresh set of pools. +// +// Recycling an object twice leaves a pool holding it twice, and it would then +// be handed to two borrowers at once. A test that provokes such misuse has to +// start the next one from clean pools. func resetPools() { - // NOTE: for testing purpose, we might want to reset pools after calling Validate twice. - // The pool is corrupted in that case: calling Put twice inserts a duplicate in the pool - // and further calls to Get are mishandled. - - pools = allPools{ - poolOfSchemaValidators: schemaValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &SchemaValidator{} - - return s - }, - }, - }, - poolOfObjectValidators: objectValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &objectValidator{} - - return s - }, - }, - }, - poolOfSliceValidators: sliceValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &schemaSliceValidator{} - - return s - }, - }, - }, - poolOfItemsValidators: itemsValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &itemsValidator{} - - return s - }, - }, - }, - poolOfBasicCommonValidators: basicCommonValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &basicCommonValidator{} - - return s - }, - }, - }, - poolOfHeaderValidators: headerValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &HeaderValidator{} - - return s - }, - }, - }, - poolOfParamValidators: paramValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &ParamValidator{} - - return s - }, - }, - }, - poolOfBasicSliceValidators: basicSliceValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &basicSliceValidator{} - - return s - }, - }, - }, - poolOfNumberValidators: numberValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &numberValidator{} - - return s - }, - }, - }, - poolOfStringValidators: stringValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &stringValidator{} - - return s - }, - }, - }, - poolOfSchemaPropsValidators: schemaPropsValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &schemaPropsValidator{} - - return s - }, - }, - }, - poolOfFormatValidators: formatValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &formatValidator{} - - return s - }, - }, - }, - poolOfTypeValidators: typeValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &typeValidator{} - - return s - }, - }, - }, - poolOfSchemas: schemasPool{ - Pool: &sync.Pool{ - New: func() any { - s := &spec.Schema{} - - return s - }, - }, - }, - poolOfResults: resultsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &Result{} - - return s - }, - }, - }, - } -} - -type ( - allPools struct { - // memory pools for all validator objects. - // - // Each pool can be borrowed from and redeemed to. - poolOfSchemaValidators schemaValidatorsPool - poolOfObjectValidators objectValidatorsPool - poolOfSliceValidators sliceValidatorsPool - poolOfItemsValidators itemsValidatorsPool - poolOfBasicCommonValidators basicCommonValidatorsPool - poolOfHeaderValidators headerValidatorsPool - poolOfParamValidators paramValidatorsPool - poolOfBasicSliceValidators basicSliceValidatorsPool - poolOfNumberValidators numberValidatorsPool - poolOfStringValidators stringValidatorsPool - poolOfSchemaPropsValidators schemaPropsValidatorsPool - poolOfFormatValidators formatValidatorsPool - poolOfTypeValidators typeValidatorsPool - poolOfSchemas schemasPool - poolOfResults resultsPool - } - - schemaValidatorsPool struct { - *sync.Pool - } - - objectValidatorsPool struct { - *sync.Pool - } - - sliceValidatorsPool struct { - *sync.Pool - } - - itemsValidatorsPool struct { - *sync.Pool - } - - basicCommonValidatorsPool struct { - *sync.Pool - } - - headerValidatorsPool struct { - *sync.Pool - } - - paramValidatorsPool struct { - *sync.Pool - } - - basicSliceValidatorsPool struct { - *sync.Pool - } - - numberValidatorsPool struct { - *sync.Pool - } - - stringValidatorsPool struct { - *sync.Pool - } - - schemaPropsValidatorsPool struct { - *sync.Pool - } - - formatValidatorsPool struct { - *sync.Pool - } - - typeValidatorsPool struct { - *sync.Pool - } - - schemasPool struct { - *sync.Pool - } - - resultsPool struct { - *sync.Pool - } -) - -func (p schemaValidatorsPool) BorrowValidator() *SchemaValidator { - return p.Get().(*SchemaValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p schemaValidatorsPool) RedeemValidator(s *SchemaValidator) { - // NOTE: s might be nil. In that case, Put is a noop. - p.Put(s) -} - -func (p objectValidatorsPool) BorrowValidator() *objectValidator { - return p.Get().(*objectValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p objectValidatorsPool) RedeemValidator(s *objectValidator) { - p.Put(s) -} - -func (p sliceValidatorsPool) BorrowValidator() *schemaSliceValidator { - return p.Get().(*schemaSliceValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p sliceValidatorsPool) RedeemValidator(s *schemaSliceValidator) { - p.Put(s) -} - -func (p itemsValidatorsPool) BorrowValidator() *itemsValidator { - return p.Get().(*itemsValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p itemsValidatorsPool) RedeemValidator(s *itemsValidator) { - p.Put(s) -} - -func (p basicCommonValidatorsPool) BorrowValidator() *basicCommonValidator { - return p.Get().(*basicCommonValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p basicCommonValidatorsPool) RedeemValidator(s *basicCommonValidator) { - p.Put(s) -} - -func (p headerValidatorsPool) BorrowValidator() *HeaderValidator { - return p.Get().(*HeaderValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p headerValidatorsPool) RedeemValidator(s *HeaderValidator) { - p.Put(s) -} - -func (p paramValidatorsPool) BorrowValidator() *ParamValidator { - return p.Get().(*ParamValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p paramValidatorsPool) RedeemValidator(s *ParamValidator) { - p.Put(s) -} - -func (p basicSliceValidatorsPool) BorrowValidator() *basicSliceValidator { - return p.Get().(*basicSliceValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p basicSliceValidatorsPool) RedeemValidator(s *basicSliceValidator) { - p.Put(s) -} - -func (p numberValidatorsPool) BorrowValidator() *numberValidator { - return p.Get().(*numberValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p numberValidatorsPool) RedeemValidator(s *numberValidator) { - p.Put(s) -} - -func (p stringValidatorsPool) BorrowValidator() *stringValidator { - return p.Get().(*stringValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p stringValidatorsPool) RedeemValidator(s *stringValidator) { - p.Put(s) -} - -func (p schemaPropsValidatorsPool) BorrowValidator() *schemaPropsValidator { - return p.Get().(*schemaPropsValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p schemaPropsValidatorsPool) RedeemValidator(s *schemaPropsValidator) { - p.Put(s) -} - -func (p formatValidatorsPool) BorrowValidator() *formatValidator { - return p.Get().(*formatValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p formatValidatorsPool) RedeemValidator(s *formatValidator) { - p.Put(s) -} - -func (p typeValidatorsPool) BorrowValidator() *typeValidator { - return p.Get().(*typeValidator) //nolint:forcetypeassert // pool New always returns this type -} - -func (p typeValidatorsPool) RedeemValidator(s *typeValidator) { - p.Put(s) -} - -func (p schemasPool) BorrowSchema() *spec.Schema { - return p.Get().(*spec.Schema) //nolint:forcetypeassert // pool New always returns this type -} - -func (p schemasPool) RedeemSchema(s *spec.Schema) { - p.Put(s) -} - -func (p resultsPool) BorrowResult() *Result { - return p.Get().(*Result).cleared() //nolint:forcetypeassert // pool New always returns *Result -} - -func (p resultsPool) RedeemResult(s *Result) { - if s == emptyResult { + validatorPools = allPools{ + schemaValidators: pools.New[SchemaValidator](), + objectValidators: pools.New[objectValidator](), + sliceValidators: pools.New[schemaSliceValidator](), + itemsValidators: pools.New[itemsValidator](), + basicCommonValidators: pools.New[basicCommonValidator](), + headerValidators: pools.New[HeaderValidator](), + paramValidators: pools.New[ParamValidator](), + basicSliceValidators: pools.New[basicSliceValidator](), + numberValidators: pools.New[numberValidator](), + stringValidators: pools.New[stringValidator](), + schemaPropsValidators: pools.New[schemaPropsValidator](), + formatValidators: pools.New[formatValidator](), + typeValidators: pools.New[typeValidator](), + schemas: pools.New[spec.Schema](), + results: pools.New[Result](), + } +} + +// allPools is the set of pools shared by the validators of this package. +type allPools struct { + schemaValidators *pools.Pool[SchemaValidator] + objectValidators *pools.Pool[objectValidator] + sliceValidators *pools.Pool[schemaSliceValidator] + itemsValidators *pools.Pool[itemsValidator] + basicCommonValidators *pools.Pool[basicCommonValidator] + headerValidators *pools.Pool[HeaderValidator] + paramValidators *pools.Pool[ParamValidator] + basicSliceValidators *pools.Pool[basicSliceValidator] + numberValidators *pools.Pool[numberValidator] + stringValidators *pools.Pool[stringValidator] + schemaPropsValidators *pools.Pool[schemaPropsValidator] + formatValidators *pools.Pool[formatValidator] + typeValidators *pools.Pool[typeValidator] + schemas *pools.Pool[spec.Schema] + results *pools.Pool[Result] +} + +// redeemResult returns a result to the pool. +// +// emptyResult is a shared value that was never borrowed, so it is not the +// pool's to take back: handing it over would be reported as a foreign redeem, +// rightly. +// +// Results are borrowed straight from the pool rather than through a helper, +// so that the instrumented build attributes a leak to the code that borrowed it. +// +// This wrapper costs that attribution on redeem, where a double redeem still +// names the offending call site in the panic it raises. +func redeemResult(r *Result) { + if r == emptyResult { return } - p.Put(s) + + validatorPools.results.Redeem(r) } diff --git a/vendor/github.com/go-openapi/validate/pools_debug.go b/vendor/github.com/go-openapi/validate/pools_debug.go deleted file mode 100644 index d123ed4093f..00000000000 --- a/vendor/github.com/go-openapi/validate/pools_debug.go +++ /dev/null @@ -1,1015 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers -// SPDX-License-Identifier: Apache-2.0 - -//go:build validatedebug - -package validate - -import ( - "fmt" - "runtime" - "sync" - "testing" - - "github.com/go-openapi/spec" -) - -// This version of the pools is to be used for debugging and testing, with build tag "validatedebug". -// -// In this mode, the pools are tracked for allocation and redemption of borrowed objects, so we can -// verify a few behaviors of the validators. The debug pools panic when an invalid usage pattern is detected. - -var pools allPools - -func init() { - resetPools() -} - -func resetPools() { - // NOTE: for testing purpose, we might want to reset pools after calling Validate twice. - // The pool is corrupted in that case: calling Put twice inserts a duplicate in the pool - // and further calls to Get are mishandled. - - pools = allPools{ - poolOfSchemaValidators: schemaValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &SchemaValidator{} - - return s - }, - }, - debugMap: make(map[*SchemaValidator]status), - allocMap: make(map[*SchemaValidator]string), - redeemMap: make(map[*SchemaValidator]string), - }, - poolOfObjectValidators: objectValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &objectValidator{} - - return s - }, - }, - debugMap: make(map[*objectValidator]status), - allocMap: make(map[*objectValidator]string), - redeemMap: make(map[*objectValidator]string), - }, - poolOfSliceValidators: sliceValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &schemaSliceValidator{} - - return s - }, - }, - debugMap: make(map[*schemaSliceValidator]status), - allocMap: make(map[*schemaSliceValidator]string), - redeemMap: make(map[*schemaSliceValidator]string), - }, - poolOfItemsValidators: itemsValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &itemsValidator{} - - return s - }, - }, - debugMap: make(map[*itemsValidator]status), - allocMap: make(map[*itemsValidator]string), - redeemMap: make(map[*itemsValidator]string), - }, - poolOfBasicCommonValidators: basicCommonValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &basicCommonValidator{} - - return s - }, - }, - debugMap: make(map[*basicCommonValidator]status), - allocMap: make(map[*basicCommonValidator]string), - redeemMap: make(map[*basicCommonValidator]string), - }, - poolOfHeaderValidators: headerValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &HeaderValidator{} - - return s - }, - }, - debugMap: make(map[*HeaderValidator]status), - allocMap: make(map[*HeaderValidator]string), - redeemMap: make(map[*HeaderValidator]string), - }, - poolOfParamValidators: paramValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &ParamValidator{} - - return s - }, - }, - debugMap: make(map[*ParamValidator]status), - allocMap: make(map[*ParamValidator]string), - redeemMap: make(map[*ParamValidator]string), - }, - poolOfBasicSliceValidators: basicSliceValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &basicSliceValidator{} - - return s - }, - }, - debugMap: make(map[*basicSliceValidator]status), - allocMap: make(map[*basicSliceValidator]string), - redeemMap: make(map[*basicSliceValidator]string), - }, - poolOfNumberValidators: numberValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &numberValidator{} - - return s - }, - }, - debugMap: make(map[*numberValidator]status), - allocMap: make(map[*numberValidator]string), - redeemMap: make(map[*numberValidator]string), - }, - poolOfStringValidators: stringValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &stringValidator{} - - return s - }, - }, - debugMap: make(map[*stringValidator]status), - allocMap: make(map[*stringValidator]string), - redeemMap: make(map[*stringValidator]string), - }, - poolOfSchemaPropsValidators: schemaPropsValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &schemaPropsValidator{} - - return s - }, - }, - debugMap: make(map[*schemaPropsValidator]status), - allocMap: make(map[*schemaPropsValidator]string), - redeemMap: make(map[*schemaPropsValidator]string), - }, - poolOfFormatValidators: formatValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &formatValidator{} - - return s - }, - }, - debugMap: make(map[*formatValidator]status), - allocMap: make(map[*formatValidator]string), - redeemMap: make(map[*formatValidator]string), - }, - poolOfTypeValidators: typeValidatorsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &typeValidator{} - - return s - }, - }, - debugMap: make(map[*typeValidator]status), - allocMap: make(map[*typeValidator]string), - redeemMap: make(map[*typeValidator]string), - }, - poolOfSchemas: schemasPool{ - Pool: &sync.Pool{ - New: func() any { - s := &spec.Schema{} - - return s - }, - }, - debugMap: make(map[*spec.Schema]status), - allocMap: make(map[*spec.Schema]string), - redeemMap: make(map[*spec.Schema]string), - }, - poolOfResults: resultsPool{ - Pool: &sync.Pool{ - New: func() any { - s := &Result{} - - return s - }, - }, - debugMap: make(map[*Result]status), - allocMap: make(map[*Result]string), - redeemMap: make(map[*Result]string), - }, - } -} - -const ( - statusFresh status = iota + 1 - statusRecycled - statusRedeemed -) - -func (s status) String() string { - switch s { - case statusFresh: - return "fresh" - case statusRecycled: - return "recycled" - case statusRedeemed: - return "redeemed" - default: - panic(fmt.Errorf("invalid status: %d", s)) - } -} - -type ( - // Debug - status uint8 - - allPools struct { - // memory pools for all validator objects. - // - // Each pool can be borrowed from and redeemed to. - poolOfSchemaValidators schemaValidatorsPool - poolOfObjectValidators objectValidatorsPool - poolOfSliceValidators sliceValidatorsPool - poolOfItemsValidators itemsValidatorsPool - poolOfBasicCommonValidators basicCommonValidatorsPool - poolOfHeaderValidators headerValidatorsPool - poolOfParamValidators paramValidatorsPool - poolOfBasicSliceValidators basicSliceValidatorsPool - poolOfNumberValidators numberValidatorsPool - poolOfStringValidators stringValidatorsPool - poolOfSchemaPropsValidators schemaPropsValidatorsPool - poolOfFormatValidators formatValidatorsPool - poolOfTypeValidators typeValidatorsPool - poolOfSchemas schemasPool - poolOfResults resultsPool - } - - schemaValidatorsPool struct { - *sync.Pool - debugMap map[*SchemaValidator]status - allocMap map[*SchemaValidator]string - redeemMap map[*SchemaValidator]string - mx sync.Mutex - } - - objectValidatorsPool struct { - *sync.Pool - debugMap map[*objectValidator]status - allocMap map[*objectValidator]string - redeemMap map[*objectValidator]string - mx sync.Mutex - } - - sliceValidatorsPool struct { - *sync.Pool - debugMap map[*schemaSliceValidator]status - allocMap map[*schemaSliceValidator]string - redeemMap map[*schemaSliceValidator]string - mx sync.Mutex - } - - itemsValidatorsPool struct { - *sync.Pool - debugMap map[*itemsValidator]status - allocMap map[*itemsValidator]string - redeemMap map[*itemsValidator]string - mx sync.Mutex - } - - basicCommonValidatorsPool struct { - *sync.Pool - debugMap map[*basicCommonValidator]status - allocMap map[*basicCommonValidator]string - redeemMap map[*basicCommonValidator]string - mx sync.Mutex - } - - headerValidatorsPool struct { - *sync.Pool - debugMap map[*HeaderValidator]status - allocMap map[*HeaderValidator]string - redeemMap map[*HeaderValidator]string - mx sync.Mutex - } - - paramValidatorsPool struct { - *sync.Pool - debugMap map[*ParamValidator]status - allocMap map[*ParamValidator]string - redeemMap map[*ParamValidator]string - mx sync.Mutex - } - - basicSliceValidatorsPool struct { - *sync.Pool - debugMap map[*basicSliceValidator]status - allocMap map[*basicSliceValidator]string - redeemMap map[*basicSliceValidator]string - mx sync.Mutex - } - - numberValidatorsPool struct { - *sync.Pool - debugMap map[*numberValidator]status - allocMap map[*numberValidator]string - redeemMap map[*numberValidator]string - mx sync.Mutex - } - - stringValidatorsPool struct { - *sync.Pool - debugMap map[*stringValidator]status - allocMap map[*stringValidator]string - redeemMap map[*stringValidator]string - mx sync.Mutex - } - - schemaPropsValidatorsPool struct { - *sync.Pool - debugMap map[*schemaPropsValidator]status - allocMap map[*schemaPropsValidator]string - redeemMap map[*schemaPropsValidator]string - mx sync.Mutex - } - - formatValidatorsPool struct { - *sync.Pool - debugMap map[*formatValidator]status - allocMap map[*formatValidator]string - redeemMap map[*formatValidator]string - mx sync.Mutex - } - - typeValidatorsPool struct { - *sync.Pool - debugMap map[*typeValidator]status - allocMap map[*typeValidator]string - redeemMap map[*typeValidator]string - mx sync.Mutex - } - - schemasPool struct { - *sync.Pool - debugMap map[*spec.Schema]status - allocMap map[*spec.Schema]string - redeemMap map[*spec.Schema]string - mx sync.Mutex - } - - resultsPool struct { - *sync.Pool - debugMap map[*Result]status - allocMap map[*Result]string - redeemMap map[*Result]string - mx sync.Mutex - } -) - -func (p *schemaValidatorsPool) BorrowValidator() *SchemaValidator { - s := p.Get().(*SchemaValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled schema should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *schemaValidatorsPool) RedeemValidator(s *SchemaValidator) { - // NOTE: s might be nil. In that case, Put is a noop. - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed schema should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed schema should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *objectValidatorsPool) BorrowValidator() *objectValidator { - s := p.Get().(*objectValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled object should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *objectValidatorsPool) RedeemValidator(s *objectValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed object should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed object should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *sliceValidatorsPool) BorrowValidator() *schemaSliceValidator { - s := p.Get().(*schemaSliceValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled schemaSliceValidator should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *sliceValidatorsPool) RedeemValidator(s *schemaSliceValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed schemaSliceValidator should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed schemaSliceValidator should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *itemsValidatorsPool) BorrowValidator() *itemsValidator { - s := p.Get().(*itemsValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled itemsValidator should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *itemsValidatorsPool) RedeemValidator(s *itemsValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed itemsValidator should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed itemsValidator should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *basicCommonValidatorsPool) BorrowValidator() *basicCommonValidator { - s := p.Get().(*basicCommonValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled basicCommonValidator should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *basicCommonValidatorsPool) RedeemValidator(s *basicCommonValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed basicCommonValidator should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed basicCommonValidator should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *headerValidatorsPool) BorrowValidator() *HeaderValidator { - s := p.Get().(*HeaderValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled HeaderValidator should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *headerValidatorsPool) RedeemValidator(s *HeaderValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed header should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed header should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *paramValidatorsPool) BorrowValidator() *ParamValidator { - s := p.Get().(*ParamValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled param should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *paramValidatorsPool) RedeemValidator(s *ParamValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed param should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed param should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *basicSliceValidatorsPool) BorrowValidator() *basicSliceValidator { - s := p.Get().(*basicSliceValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled basicSliceValidator should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *basicSliceValidatorsPool) RedeemValidator(s *basicSliceValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed basicSliceValidator should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed basicSliceValidator should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *numberValidatorsPool) BorrowValidator() *numberValidator { - s := p.Get().(*numberValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled number should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *numberValidatorsPool) RedeemValidator(s *numberValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed number should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed number should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *stringValidatorsPool) BorrowValidator() *stringValidator { - s := p.Get().(*stringValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled string should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *stringValidatorsPool) RedeemValidator(s *stringValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed string should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed string should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *schemaPropsValidatorsPool) BorrowValidator() *schemaPropsValidator { - s := p.Get().(*schemaPropsValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled param should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *schemaPropsValidatorsPool) RedeemValidator(s *schemaPropsValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed schemaProps should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed schemaProps should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *formatValidatorsPool) BorrowValidator() *formatValidator { - s := p.Get().(*formatValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled format should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *formatValidatorsPool) RedeemValidator(s *formatValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed format should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed format should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *typeValidatorsPool) BorrowValidator() *typeValidator { - s := p.Get().(*typeValidator) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled type should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *typeValidatorsPool) RedeemValidator(s *typeValidator) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed type should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic(fmt.Errorf("redeemed type should have been allocated from a fresh or recycled pointer. Got status %s, already redeamed at: %s", x, p.redeemMap[s])) - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *schemasPool) BorrowSchema() *spec.Schema { - s := p.Get().(*spec.Schema) - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled spec.Schema should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *schemasPool) RedeemSchema(s *spec.Schema) { - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed spec.Schema should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed spec.Schema should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *resultsPool) BorrowResult() *Result { - s := p.Get().(*Result).cleared() - - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - p.debugMap[s] = statusFresh - } else { - if x != statusRedeemed { - panic("recycled result should have been redeemed") - } - p.debugMap[s] = statusRecycled - } - p.allocMap[s] = caller() - - return s -} - -func (p *resultsPool) RedeemResult(s *Result) { - if s == emptyResult { - if len(s.Errors) > 0 || len(s.Warnings) > 0 { - panic("empty result should not mutate") - } - return - } - p.mx.Lock() - defer p.mx.Unlock() - x, ok := p.debugMap[s] - if !ok { - panic("redeemed Result should have been allocated") - } - if x != statusRecycled && x != statusFresh { - panic("redeemed Result should have been allocated from a fresh or recycled pointer") - } - p.debugMap[s] = statusRedeemed - p.redeemMap[s] = caller() - p.Put(s) -} - -func (p *allPools) allIsRedeemed(t testing.TB) bool { - outcome := true - for k, v := range p.poolOfSchemaValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("schemaValidator should be redeemed. Allocated by: %s", p.poolOfSchemaValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfObjectValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("objectValidator should be redeemed. Allocated by: %s", p.poolOfObjectValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfSliceValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("sliceValidator should be redeemed. Allocated by: %s", p.poolOfSliceValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfItemsValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("itemsValidator should be redeemed. Allocated by: %s", p.poolOfItemsValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfBasicCommonValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("basicCommonValidator should be redeemed. Allocated by: %s", p.poolOfBasicCommonValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfHeaderValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("headerValidator should be redeemed. Allocated by: %s", p.poolOfHeaderValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfParamValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("paramValidator should be redeemed. Allocated by: %s", p.poolOfParamValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfBasicSliceValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("basicSliceValidator should be redeemed. Allocated by: %s", p.poolOfBasicSliceValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfNumberValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("numberValidator should be redeemed. Allocated by: %s", p.poolOfNumberValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfStringValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("stringValidator should be redeemed. Allocated by: %s", p.poolOfStringValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfSchemaPropsValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("schemaPropsValidator should be redeemed. Allocated by: %s", p.poolOfSchemaPropsValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfFormatValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("formatValidator should be redeemed. Allocated by: %s", p.poolOfFormatValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfTypeValidators.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("typeValidator should be redeemed. Allocated by: %s", p.poolOfTypeValidators.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfSchemas.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("schemas should be redeemed. Allocated by: %s", p.poolOfSchemas.allocMap[k]) - outcome = false - } - for k, v := range p.poolOfResults.debugMap { - if v == statusRedeemed { - continue - } - t.Logf("result should be redeemed. Allocated by: %s", p.poolOfResults.allocMap[k]) - outcome = false - } - - return outcome -} - -func caller() string { - pc, _, _, _ := runtime.Caller(3) //nolint:dogsled - from, line := runtime.FuncForPC(pc).FileLine(pc) - - return fmt.Sprintf("%s:%d", from, line) -} diff --git a/vendor/github.com/go-openapi/validate/ref_locations.go b/vendor/github.com/go-openapi/validate/ref_locations.go new file mode 100644 index 00000000000..1853340d228 --- /dev/null +++ b/vendor/github.com/go-openapi/validate/ref_locations.go @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "github.com/go-openapi/analysis" +) + +// refLocations tells where a $ref value is declared in a document. +// +// The analyzer indexes references the other way around, by the location each +// was found at, so the index is inverted here. Only declarations are indexed: +// a "$ref" member sitting in an example or in a default value is data, and the +// analyzer never walks into it. +type refLocations map[string]pathSegments + +// newRefLocations inverts the analyzer's reference index. +// +// A reference declared in several places keeps the smallest declaration, so +// that the answer does not depend on map iteration order. +func newRefLocations(analyzer *analysis.Spec) refLocations { + declarations := make(map[string]string) + for location, ref := range analyzer.AllRefsByLocation() { + value := ref.String() + if value == "" { + continue + } + + if known, isKnown := declarations[value]; isKnown && known <= location { + continue + } + + declarations[value] = location + } + + locations := make(refLocations, len(declarations)) + for value, location := range declarations { + locations[value] = localRefPath(location) + } + + return locations +} + +// at returns where a reference is declared, or the document root when the +// reference is not one the analyzer indexed. +func (l refLocations) at(ref string) pathSegments { + return l[ref] +} diff --git a/vendor/github.com/go-openapi/validate/ref_redirects.go b/vendor/github.com/go-openapi/validate/ref_redirects.go new file mode 100644 index 00000000000..95fe96c229f --- /dev/null +++ b/vendor/github.com/go-openapi/validate/ref_redirects.go @@ -0,0 +1,71 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "strings" + + "github.com/go-openapi/analysis" +) + +// maxRefHops bounds how many $ref a pointer may be followed through, so that a +// document referring to itself cannot spin here. +const maxRefHops = 10 + +// refRedirects maps the location of a $ref to the location it points at, for +// the local references of a document. +// +// Checks walk the expanded document, so a finding below a $ref comes out with a +// pointer that descends into a node the authored document does not contain: a +// bare "$ref" member has nothing under it. Following the reference turns such a +// pointer back into one the document addresses. +type refRedirects map[string]string + +func newRefRedirects(analyzer *analysis.Spec) refRedirects { + redirects := make(refRedirects) + for location, ref := range analyzer.AllRefsByLocation() { + target := ref.String() + if !strings.HasPrefix(target, "#/") { + // only a local reference has a location in this document + continue + } + + redirects[strings.TrimPrefix(location, "#")] = strings.TrimPrefix(target, "#") + } + + return redirects +} + +// through rewrites a pointer that descends below a $ref. +// +// A pointer that stops at the $ref itself is left alone: that node exists, and +// it is where a reader has to go to amend the reference. +func (r refRedirects) through(pointer string) string { + if len(r) == 0 { + return pointer + } + + for range maxRefHops { + prefix, rest, ok := r.crossing(pointer) + if !ok { + return pointer + } + + pointer = prefix + rest + } + + return pointer +} + +// crossing finds the longest prefix of pointer that holds a $ref, and returns +// the location that reference points at together with what is left below it. +func (r refRedirects) crossing(pointer string) (target, rest string, ok bool) { + for at := strings.LastIndex(pointer, "/"); at > 0; at = strings.LastIndex(pointer[:at], "/") { + if target, isRef := r[pointer[:at]]; isRef { + return target, pointer[at:], true + } + } + + return "", "", false +} diff --git a/vendor/github.com/go-openapi/validate/required_walk.go b/vendor/github.com/go-openapi/validate/required_walk.go new file mode 100644 index 00000000000..b3fd3cdf4a7 --- /dev/null +++ b/vendor/github.com/go-openapi/validate/required_walk.go @@ -0,0 +1,179 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/spec" +) + +// schemaIdentity is how a message refers to the schema a required entry +// belongs to. +// +// A definition is named on its own, the way it always has been. A schema the +// definition holds is named by the way down to it, relative to the definition: +// "A.inner" rather than "A", which would send a reader to the wrong place. +type schemaIdentity struct { + name string + nested bool +} + +// identify names the schema a location leads to. +func identify(at pathSegments) schemaIdentity { + const definitionDepth = 2 // "definitions", then the name of one + + return schemaIdentity{ + name: strings.TrimPrefix(at.dotted(), swaggerDefinitions+"."), + nested: len(at) > definitionDepth, + } +} + +func (i schemaIdentity) requiredButNotDefined(property string) errors.Error { + if i.nested { + return requiredButNotDefinedInSchemaMsg(property, i.name) + } + + return requiredButNotDefinedMsg(property, i.name) +} + +// maxCompositionHops bounds how far the search for a declared property follows +// allOf members and the local $ref they may be written as. +const maxCompositionHops = 20 + +// walkRequired checks the required entries of a schema, then those of every +// schema it holds inline. +// +// A definition is not the only place a document says an object must hold a +// property: so does the schema of a property, of an array item, of an +// additionalProperties. Each of those is a self-contained object definition, +// and a required entry naming something it never declares is the same slip +// wherever it sits. +// +// A schema written as a $ref is left alone: it is checked where it is defined, +// and following it here would report the same slip twice and, for a recursive +// definition, would not terminate. +// +// It reports whether the walk should carry on, which is how the caller stops on +// the first fault unless it was asked for everything. +func (s *SpecValidator) walkRequired(at pathSegments, v *spec.Schema, res *Result) bool { + if v == nil || v.Ref.String() != "" { + return true + } + + for i, pn := range v.Required { + // the offending entry of the required array, not the schema holding + // it: that is what a reader has to go and amend + red := s.validateRequiredProperties(pn, identify(at), at, at.child(jsonRequired).item(i), v) + // NOTE: capture validity before merging: Merge may redeem `red` to the + // pool (wantsRedeemOnMerge), after which reading it races with a + // concurrent BorrowResult().cleared() in another goroutine. + isValid := red.IsValid() + res.Merge(red) + if !isValid && !s.Options.ContinueOnErrors { + return false + } + } + + return s.walkInlineSchemas(at, v, res) +} + +// walkInlineSchemas descends into every schema a schema holds, without checking +// the required entries of a composition member. +// +// Inside allOf, anyOf, oneOf or not, a member is a fragment of a constraint +// rather than a complete definition: its required entries speak of the instance +// the whole composition describes, and are legitimately met by a sibling member +// or by no declaration at all. Those are honoured when data is validated, and +// saying anything about them here would be wrong. Their own members are still +// walked, because a property schema nested in one of them is a definition like +// any other. +func (s *SpecValidator) walkInlineSchemas(at pathSegments, v *spec.Schema, res *Result) bool { + for _, name := range sortedKeys(v.Properties) { + held := v.Properties[name] + if !s.walkRequired(at.structuralChild(jsonProperties).child(name), &held, res) { + return false + } + } + + for _, pattern := range sortedKeys(v.PatternProperties) { + held := v.PatternProperties[pattern] + if !s.walkRequired(at.structuralChild(jsonPatternProperties).child(pattern), &held, res) { + return false + } + } + + if v.Items != nil { + if v.Items.Schema != nil && !s.walkRequired(at.child(jsonItems), v.Items.Schema, res) { + return false + } + for i := range v.Items.Schemas { + if !s.walkRequired(at.child(jsonItems).item(i), &v.Items.Schemas[i], res) { + return false + } + } + } + + if v.AdditionalProperties != nil && v.AdditionalProperties.Schema != nil && + !s.walkRequired(at.child(jsonAdditionalProperties), v.AdditionalProperties.Schema, res) { + return false + } + + // a composition member is walked for the schemas it holds, never for its + // own required entries + for _, composition := range []struct { + keyword string + members []spec.Schema + }{ + {jsonAllOf, v.AllOf}, + {jsonAnyOf, v.AnyOf}, + {jsonOneOf, v.OneOf}, + } { + for i := range composition.members { + if !s.walkInlineSchemas(at.child(composition.keyword).item(i), &composition.members[i], res) { + return false + } + } + } + + if v.Not != nil { + return s.walkInlineSchemas(at.child(jsonNot), v.Not, res) + } + + return true +} + +// declaresProperty reports whether a schema, or any schema composed into it by +// allOf, declares the named property, and whether that declaration is readOnly. +// +// An allOf member may be written as a $ref, which is followed here: a property +// contributed by a base definition is declared just as plainly as one written +// in place. +func (s *SpecValidator) declaresProperty(v *spec.Schema, name string, hops int) (readOnly, declared bool) { + if v == nil || hops <= 0 { + return false, false + } + + if held, ok := v.Properties[name]; ok { + return held.ReadOnly, true + } + + for i := range v.AllOf { + member := &v.AllOf[i] + if member.Ref.String() != "" { + resolved, err := s.resolveRef(&member.Ref) + if err != nil { + continue + } + member = resolved + } + + if readOnly, ok := s.declaresProperty(member, name, hops-1); ok { + return readOnly, true + } + } + + return false, false +} diff --git a/vendor/github.com/go-openapi/validate/resolvable.go b/vendor/github.com/go-openapi/validate/resolvable.go new file mode 100644 index 00000000000..bbd35d36086 --- /dev/null +++ b/vendor/github.com/go-openapi/validate/resolvable.go @@ -0,0 +1,70 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "strconv" + "strings" + + "github.com/go-openapi/jsonpointer" +) + +// resolvable trims a pointer down to the deepest node the document holds. +// +// Checks walk an expanded, model-level view of a specification, which holds +// members the document itself never wrote: a parameter merged in from a path +// item, a member of a schema reached through a $ref. A pointer built along the +// way may therefore end on something a reader cannot go to. +// +// Trimming is the last word on a location, applied once every check has had its +// say: it only ever shortens, so a pointer that already addressed a node comes +// back untouched, and one that did not still says as much as it truthfully can. +// This is what makes [Located.Pointer] always resolve. +func (s *SpecValidator) resolvable(pointer string) string { + if pointer == "" || s.document == nil { + return pointer + } + + node := s.document + for at := 0; at < len(pointer); { + end := strings.IndexByte(pointer[at+1:], '/') + token := pointer[at+1:] + if end >= 0 { + token = pointer[at+1 : at+1+end] + } + + member, isHeld := memberOf(node, jsonpointer.Unescape(token)) + if !isHeld { + return pointer[:at] + } + node = member + + if end < 0 { + break + } + at += end + 1 + } + + return pointer +} + +// memberOf returns the member a reference token addresses in a decoded JSON +// node, and whether the node holds one at all. +func memberOf(node any, token string) (any, bool) { + switch held := node.(type) { + case map[string]any: + member, isHeld := held[token] + + return member, isHeld + case []any: + index, err := strconv.Atoi(token) + if err != nil || index < 0 || index >= len(held) { + return nil, false + } + + return held[index], true + default: + return nil, false + } +} diff --git a/vendor/github.com/go-openapi/validate/result.go b/vendor/github.com/go-openapi/validate/result.go index ede945503d7..5684774a5fd 100644 --- a/vendor/github.com/go-openapi/validate/result.go +++ b/vendor/github.com/go-openapi/validate/result.go @@ -14,6 +14,25 @@ import ( var emptyResult = &Result{MatchCount: 1} +// Located pairs a validation error with the location of the value that caused it. +type Located struct { + // Err is the reported error or warning. + Err error + + // Pointer locates the offending value as an RFC 6901 JSON pointer, + // relative to the validated document. + // + // It is empty when the document as a whole is the answer: either because + // the finding is about the document rather than a value in it, such as a + // duplicate operation id, or because the value in question is the root. + // An empty pointer is a valid one, addressing the whole document. + // + // A finding about something a document does not contain, a missing + // required property say, is located on the value that should contain it: + // what is absent has no node to point at. + Pointer string +} + // Result represents a validation result set, composed of // errors and warnings. // @@ -25,12 +44,17 @@ var emptyResult = &Result{MatchCount: 1} // schema validation. Results from the validation branch // with most matches get eventually selected. // -// Proposal for enhancement: keep path of key originating the error. +// Use [Result.LocatedErrors] to know where each error happened. type Result struct { Errors []error Warnings []error MatchCount int + // errorLocations[i] locates Errors[i], and likewise for warnings. Kept + // aligned by the add methods; see [Result.LocatedErrors]. + errorLocations []string + warningLocations []string + // the object data data any @@ -110,7 +134,7 @@ func (r *Result) Merge(others ...*Result) *Result { r.mergeWithoutRootSchemata(other) r.rootObjectSchemata.Append(other.rootObjectSchemata) if other.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(other) + redeemResult(other) } } return r @@ -173,11 +197,11 @@ func (r *Result) MergeAsErrors(others ...*Result) *Result { for _, other := range others { if other != nil { r.resetCaches() - r.AddErrors(other.Errors...) - r.AddErrors(other.Warnings...) + r.carryErrors(other.Errors, other.errorLocations) + r.carryErrors(other.Warnings, other.warningLocations) r.MatchCount += other.MatchCount if other.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(other) + redeemResult(other) } } } @@ -191,11 +215,11 @@ func (r *Result) MergeAsWarnings(others ...*Result) *Result { for _, other := range others { if other != nil { r.resetCaches() - r.AddWarnings(other.Errors...) - r.AddWarnings(other.Warnings...) + r.carryWarnings(other.Errors, other.errorLocations) + r.carryWarnings(other.Warnings, other.warningLocations) r.MatchCount += other.MatchCount if other.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(other) + redeemResult(other) } } } @@ -207,39 +231,79 @@ func (r *Result) MergeAsWarnings(others ...*Result) *Result { // Since the same check may be passed several times while exploring the // spec structure (via $ref, ...) reported messages are kept // unique. +// +// Errors added this way carry no location. Validators use [Result.addErrorsAt] +// so that [Result.LocatedErrors] can tell where the failure happened. func (r *Result) AddErrors(errors ...error) { - for _, e := range errors { - found := false - if e != nil { - for _, isReported := range r.Errors { - if e.Error() == isReported.Error() { - found = true - break - } - } - if !found { - r.Errors = append(r.Errors, e) - } - } - } + r.addLocatedErrors("", errors...) } // AddWarnings adds warnings to this validation result (if not already reported). func (r *Result) AddWarnings(warnings ...error) { - for _, e := range warnings { - found := false - if e != nil { - for _, isReported := range r.Warnings { - if e.Error() == isReported.Error() { - found = true - break - } - } - if !found { - r.Warnings = append(r.Warnings, e) - } + r.addLocatedWarnings("", warnings...) +} + +// isReportedError tells if the same message is already part of a collection. +func isReportedError(reported []error, e error) bool { + msg := e.Error() + for _, isReported := range reported { + if msg == isReported.Error() { + return true } } + + return false +} + +// locationAt reads a location out of a slice that may be shorter than the +// errors it describes. +func locationAt(locations []string, i int) string { + if i < len(locations) { + return locations[i] + } + + return "" +} + +// appendLocation records the location of the error that has just been appended, +// keeping the location slice aligned with the error slice it describes. +// +// Errors may reach a Result without going through the methods here (a caller +// assigning Errors directly, say), so the slice is padded rather than assumed +// to be in step. +func appendLocation(locations []string, upTo int, pointer string) []string { + for len(locations) < upTo-1 { + locations = append(locations, "") + } + + return append(locations, pointer) +} + +// LocatedErrors returns the reported errors, each paired with the JSON pointer +// of the value that caused it. +// +// The pointer is empty whenever the location is unknown, so callers should +// treat it as a hint and keep using the error message as the primary report. +func (r *Result) LocatedErrors() []Located { + return locate(r.Errors, r.errorLocations) +} + +// LocatedWarnings returns the reported warnings, each paired with the JSON +// pointer of the value that caused it. +func (r *Result) LocatedWarnings() []Located { + return locate(r.Warnings, r.warningLocations) +} + +func locate(errs []error, locations []string) []Located { + located := make([]Located, len(errs)) + for i, err := range errs { + located[i] = Located{Err: err} + if i < len(locations) { + located[i].Pointer = locations[i] + } + } + + return located } // IsValid returns true when this result is valid. @@ -298,6 +362,106 @@ func (r *Result) AsError() error { return errors.CompositeValidationError(r.Errors...) } +// Reset clears this result so it may be reused, keeping allocated capacity. +// +// It implements the hook the pool calls when a result is borrowed and when it +// is redeemed. Calling it on a result still in use loses its findings. +func (r *Result) Reset() { + _ = r.cleared() +} + +// addErrorsAt adds errors located at the given path. +func (r *Result) addErrorsAt(at pathSegments, errors ...error) { + r.addLocatedErrors(at.pointer(), errors...) +} + +// addWarningsAt adds warnings located at the given path. +func (r *Result) addWarningsAt(at pathSegments, warnings ...error) { + r.addLocatedWarnings(at.pointer(), warnings...) +} + +func (r *Result) addLocatedErrors(pointer string, errors ...error) { + for _, e := range errors { + if e == nil { + continue + } + + if isReportedError(r.Errors, e) { + continue + } + + r.Errors = append(r.Errors, e) + r.errorLocations = appendLocation(r.errorLocations, len(r.Errors), pointer) + } +} + +func (r *Result) addLocatedWarnings(pointer string, warnings ...error) { + for _, e := range warnings { + if e == nil { + continue + } + + if isReportedError(r.Warnings, e) { + continue + } + + r.Warnings = append(r.Warnings, e) + r.warningLocations = appendLocation(r.warningLocations, len(r.Warnings), pointer) + } +} + +// relocate rewrites every location this result recorded. +// +// The parameter and header validators are the ones a generated client uses at +// runtime, so they locate a finding by the name of the parameter or header it +// concerns: a name is all the caller has. When spec validation borrows them to +// check a default or an example, that name addresses nothing in the document, +// and the value's own node is the best location available for everything the +// borrowed validator found. +func (r *Result) relocate(at pathSegments) { + if r == nil { + return + } + + pointer := at.pointer() + r.errorLocations = fillLocations(r.errorLocations[:0], len(r.Errors), pointer) + r.warningLocations = fillLocations(r.warningLocations[:0], len(r.Warnings), pointer) +} + +// fillLocations records the same location for a whole run of findings. +func fillLocations(locations []string, count int, pointer string) []string { + for range count { + locations = append(locations, pointer) + } + + return locations +} + +// redirect rewrites every location this result recorded with the given mapping. +func (r *Result) redirect(through func(string) string) { + for i, pointer := range r.errorLocations { + r.errorLocations[i] = through(pointer) + } + for i, pointer := range r.warningLocations { + r.warningLocations[i] = through(pointer) + } +} + +// carryErrors adds errors from another result as errors, one by one, so that +// each keeps the location that result recorded for it. +func (r *Result) carryErrors(errs []error, locations []string) { + for i, e := range errs { + r.addLocatedErrors(locationAt(locations, i), e) + } +} + +// carryWarnings adds errors from another result as warnings, keeping locations. +func (r *Result) carryWarnings(errs []error, locations []string) { + for i, e := range errs { + r.addLocatedWarnings(locationAt(locations, i), e) + } +} + func (r *Result) resetCaches() { r.cachedFieldSchemata = nil r.cachedItemSchemata = nil @@ -324,7 +488,7 @@ func (r *Result) mergeForField(obj map[string]any, field string, other *Result) }) } if other.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(other) + redeemResult(other) } return r @@ -352,7 +516,7 @@ func (r *Result) mergeForSlice(slice reflect.Value, i int, other *Result) *Resul } if other.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(other) + redeemResult(other) } return r @@ -391,8 +555,8 @@ func (r *Result) addSliceSchemata(slice reflect.Value, i int, schema *spec.Schem // mergeWithoutRootSchemata merges other into r, ignoring the rootObject schemata. func (r *Result) mergeWithoutRootSchemata(other *Result) { r.resetCaches() - r.AddErrors(other.Errors...) - r.AddWarnings(other.Warnings...) + r.carryErrors(other.Errors, other.errorLocations) + r.carryWarnings(other.Warnings, other.warningLocations) r.MatchCount += other.MatchCount if other.fieldSchemata != nil { @@ -438,32 +602,40 @@ func (r *Result) keepRelevantErrors() *Result { // codes would require to change a lot here. So, for the moment, let's go with // placeholders. strippedErrors := []error{} - for _, e := range r.Errors { + strippedErrorLocations := []string{} + for i, e := range r.Errors { if isImportant(e) { strippedErrors = append(strippedErrors, stripImportantTag(e)) + strippedErrorLocations = append(strippedErrorLocations, locationAt(r.errorLocations, i)) } } strippedWarnings := []error{} - for _, e := range r.Warnings { + strippedWarningLocations := []string{} + for i, e := range r.Warnings { if isImportant(e) { strippedWarnings = append(strippedWarnings, stripImportantTag(e)) + strippedWarningLocations = append(strippedWarningLocations, locationAt(r.warningLocations, i)) } } var strippedResult *Result if r.wantsRedeemOnMerge { - strippedResult = pools.poolOfResults.BorrowResult() + strippedResult = validatorPools.results.Borrow() } else { strippedResult = new(Result) } strippedResult.Errors = strippedErrors + strippedResult.errorLocations = strippedErrorLocations strippedResult.Warnings = strippedWarnings + strippedResult.warningLocations = strippedWarningLocations return strippedResult } func (r *Result) cleared() *Result { // clear the Result to be reusable. Keep allocated capacity. r.Errors = r.Errors[:0] + r.errorLocations = r.errorLocations[:0] r.Warnings = r.Warnings[:0] + r.warningLocations = r.warningLocations[:0] r.MatchCount = 0 r.data = nil r.rootObjectSchemata.one = nil diff --git a/vendor/github.com/go-openapi/validate/schema.go b/vendor/github.com/go-openapi/validate/schema.go index b72a47bc331..9b49007b5c7 100644 --- a/vendor/github.com/go-openapi/validate/schema.go +++ b/vendor/github.com/go-openapi/validate/schema.go @@ -15,7 +15,17 @@ import ( // SchemaValidator validates data against a JSON schema. type SchemaValidator struct { - Path string + // Path is the location of the validated value, in the legacy dot-separated + // notation. It is what surfaces as the name of a validation error. + // + // Deprecated: a dotted path is ambiguous whenever a property name contains + // a dot. Prefer the JSON pointer rendering of the same location. + Path string + + // path is the same location, kept as JSON pointer reference tokens so that + // children may be derived from it unambiguously. + path pathSegments + in string Schema *spec.Schema validators [8]valueValidator @@ -32,7 +42,7 @@ func AgainstSchema(schema *spec.Schema, data any, formats strfmt.Registry, optio append(options, WithRecycleValidators(true), withRecycleResults(true))..., ).Validate(data) defer func() { - pools.poolOfResults.RedeemResult(res) + redeemResult(res) }() if res.HasErrors() { @@ -51,10 +61,39 @@ func NewSchemaValidator(schema *spec.Schema, rootSchema any, root string, format o(opts) } - return newSchemaValidator(schema, rootSchema, root, formats, opts) + // the caller still owns this schema, and validation expands what it walks: work on a copy, + // once, here - every validator below this one is then free to expand in place + if !opts.ownSchemata && schema != nil { + cloned, err := deepCloneSchema(*schema) + if err != nil { + panic(invalidSchemaProvidedMsg(err).Error()) + } + + if rootSchema == schema { + rootSchema = &cloned + } + + schema = &cloned + opts.ownSchemata = true + } + + return newSchemaValidator(schema, rootSchema, rootPathFromString(root), formats, opts) } -func newSchemaValidator(schema *spec.Schema, rootSchema any, root string, formats strfmt.Registry, opts *SchemaValidatorOptions) *SchemaValidator { +// rootPathFromString interprets the root path of the exported constructors. +// +// The caller hands over an opaque string, so there is no telling which of its +// dots are separators and which belong to a name: it is taken as a single +// reference token. +func rootPathFromString(root string) pathSegments { + if root == "" { + return rootPath() + } + + return newPathSegments(root) +} + +func newSchemaValidator(schema *spec.Schema, rootSchema any, root pathSegments, formats strfmt.Registry, opts *SchemaValidatorOptions) *SchemaValidator { if schema == nil { return nil } @@ -63,26 +102,27 @@ func newSchemaValidator(schema *spec.Schema, rootSchema any, root string, format rootSchema = schema } + if opts == nil { + opts = new(SchemaValidatorOptions) + } + if schema.ID != "" || schema.Ref.String() != "" || schema.Ref.IsRoot() { - err := spec.ExpandSchema(schema, rootSchema, nil) + err := spec.ExpandSchemaWithOptions(schema, rootSchema, nil, opts.expandOptions("")) if err != nil { msg := invalidSchemaProvidedMsg(err).Error() panic(msg) } } - if opts == nil { - opts = new(SchemaValidatorOptions) - } - var s *SchemaValidator if opts.recycleValidators { - s = pools.poolOfSchemaValidators.BorrowValidator() + s = validatorPools.schemaValidators.Borrow() } else { s = new(SchemaValidator) } - s.Path = root + s.path = root + s.Path = root.dotted() s.in = "body" s.Schema = schema s.Root = rootSchema @@ -104,8 +144,11 @@ func newSchemaValidator(schema *spec.Schema, rootSchema any, root string, format } // SetPath sets the path for this schema validator. +// +// Note that the sub-validators are built when the validator is created, so +// this only affects errors reported by this validator, not by its children. func (s *SchemaValidator) SetPath(path string) { - s.Path = path + s.setPath(rootPathFromString(path)) } // Applies returns true when this schema validator applies. @@ -131,7 +174,7 @@ func (s *SchemaValidator) Validate(data any) *Result { var result *Result if s.Options.recycleResult { - result = pools.poolOfResults.BorrowResult() + result = validatorPools.results.Borrow() result.data = data } else { result = &Result{data: data} @@ -169,7 +212,7 @@ func (s *SchemaValidator) Validate(data any) *Result { // to map[string]interface{}. var dd any if err := jsonutils.FromDynamicJSON(data, &dd); err != nil { - result.AddErrors(err) + result.addErrorsAt(s.path, err) result.Inc() return result @@ -185,7 +228,7 @@ func (s *SchemaValidator) Validate(data any) *Result { if s.Schema.Type.Contains(integerType) { // avoid lossy conversion in, erri := num.Int64() if erri != nil { - result.AddErrors(invalidTypeConversionMsg(s.Path, erri)) + result.addErrorsAt(s.path, invalidTypeConversionMsg(s.Path, erri)) result.Inc() return result @@ -194,7 +237,7 @@ func (s *SchemaValidator) Validate(data any) *Result { } else { nf, errf := num.Float64() if errf != nil { - result.AddErrors(invalidTypeConversionMsg(s.Path, errf)) + result.addErrorsAt(s.path, invalidTypeConversionMsg(s.Path, errf)) result.Inc() return result @@ -235,7 +278,7 @@ func (s *SchemaValidator) Validate(data any) *Result { func (s *SchemaValidator) typeValidator() valueValidator { return newTypeValidator( - s.Path, + s.path, s.in, s.Schema.Type, s.Schema.Nullable, @@ -246,7 +289,7 @@ func (s *SchemaValidator) typeValidator() valueValidator { func (s *SchemaValidator) commonValidator() valueValidator { return newBasicCommonValidator( - s.Path, + s.path, s.in, s.Schema.Default, s.Schema.Enum, @@ -256,7 +299,7 @@ func (s *SchemaValidator) commonValidator() valueValidator { func (s *SchemaValidator) sliceValidator() valueValidator { return newSliceValidator( - s.Path, + s.path, s.in, s.Schema.MaxItems, s.Schema.MinItems, @@ -271,7 +314,7 @@ func (s *SchemaValidator) sliceValidator() valueValidator { func (s *SchemaValidator) numberValidator() valueValidator { return newNumberValidator( - s.Path, + s.path, s.in, s.Schema.Default, s.Schema.MultipleOf, @@ -287,7 +330,7 @@ func (s *SchemaValidator) numberValidator() valueValidator { func (s *SchemaValidator) stringValidator() valueValidator { return newStringValidator( - s.Path, + s.path, s.in, nil, false, @@ -301,7 +344,7 @@ func (s *SchemaValidator) stringValidator() valueValidator { func (s *SchemaValidator) formatValidator() valueValidator { return newFormatValidator( - s.Path, + s.path, s.in, s.Schema.Format, s.KnownFormats, @@ -312,14 +355,14 @@ func (s *SchemaValidator) formatValidator() valueValidator { func (s *SchemaValidator) schemaPropsValidator() valueValidator { sch := s.Schema return newSchemaPropsValidator( - s.Path, s.in, sch.AllOf, sch.OneOf, sch.AnyOf, sch.Not, sch.Dependencies, s.Root, s.KnownFormats, + s.path, s.in, sch.AllOf, sch.OneOf, sch.AnyOf, sch.Not, sch.Dependencies, s.Root, s.KnownFormats, s.Options, ) } func (s *SchemaValidator) objectValidator() valueValidator { return newObjectValidator( - s.Path, + s.path, s.in, s.Schema.MaxProperties, s.Schema.MinProperties, @@ -333,8 +376,13 @@ func (s *SchemaValidator) objectValidator() valueValidator { ) } +func (s *SchemaValidator) setPath(path pathSegments) { + s.path = path + s.Path = path.dotted() +} + func (s *SchemaValidator) redeem() { - pools.poolOfSchemaValidators.RedeemValidator(s) + validatorPools.schemaValidators.Redeem(s) } func (s *SchemaValidator) redeemChildren() { diff --git a/vendor/github.com/go-openapi/validate/schema_option.go b/vendor/github.com/go-openapi/validate/schema_option.go index 3e1b882ed38..09a03eba11e 100644 --- a/vendor/github.com/go-openapi/validate/schema_option.go +++ b/vendor/github.com/go-openapi/validate/schema_option.go @@ -3,6 +3,13 @@ package validate +import ( + "encoding/json" + + "github.com/go-openapi/spec" + "github.com/go-openapi/swag/loading" +) + // SchemaValidatorOptions defines optional rules for schema validation. type SchemaValidatorOptions struct { EnableObjectArrayTypeCheck bool @@ -10,6 +17,16 @@ type SchemaValidatorOptions struct { recycleValidators bool recycleResult bool skipSchemataResult bool + pathLoaderWithOptions func(string, ...loading.Option) (json.RawMessage, error) + + // ownSchemata tells the validators that the schemata they walk are theirs to rewrite. + // + // Validation expands every schema carrying a $ref or an id, and expansion rewrites what it is + // given. The copy that makes this safe is taken once, at the entry point - the whole document + // in [SpecValidator.Validate], the single schema in [NewSchemaValidator] - because a copy per + // schema multiplies with the recursion, and because parameters, path items and responses + // expand too, not only schemata. + ownSchemata bool } // Option sets optional rules for schema validation. @@ -60,6 +77,23 @@ func WithSkipSchemataResult(enable bool) Option { } } +// WithPathLoader injects the document loader used to resolve remote and relative $ref while +// validating a schema or specification. It matches the option-aware loader signature of +// github.com/go-openapi/swag/loading (and go-openapi/loads). +// +// This lets validation resolve references through a caller-provided loader instead of the spec +// package's global default. The loader may carry any loading options — a custom HTTP client or +// timeout, authentication or custom headers, an embedded or rooted file system, and so on. +// +// One important use is confining loading of untrusted input: build the loader with loading.WithRoot +// (to confine local reads) and loading.WithHTTPClient (to restrict remote fetches), or use a +// restricted loader from go-openapi/loads. Left unset, the spec package default loader is used. +func WithPathLoader(loader func(string, ...loading.Option) (json.RawMessage, error)) Option { + return func(svo *SchemaValidatorOptions) { + svo.pathLoaderWithOptions = loader + } +} + // Options returns the current set of options. func (svo SchemaValidatorOptions) Options() []Option { return []Option{ @@ -68,5 +102,17 @@ func (svo SchemaValidatorOptions) Options() []Option { WithRecycleValidators(svo.recycleValidators), withRecycleResults(svo.recycleResult), WithSkipSchemataResult(svo.skipSchemataResult), + WithPathLoader(svo.pathLoaderWithOptions), + } +} + +// expandOptions builds the spec expand options for schema/$ref expansion during validation, +// carrying the injected loader (when set) so resolution can be confined. relativeBase is used for +// base-path-relative resolution; it is ignored by [spec.ExpandSchemaWithOptions], which derives the +// base from the root. +func (svo *SchemaValidatorOptions) expandOptions(relativeBase string) *spec.ExpandOptions { + return &spec.ExpandOptions{ + RelativeBase: relativeBase, + PathLoaderWithOptions: svo.pathLoaderWithOptions, } } diff --git a/vendor/github.com/go-openapi/validate/schema_props.go b/vendor/github.com/go-openapi/validate/schema_props.go index 2c4354d08a6..d7ecb14ce0d 100644 --- a/vendor/github.com/go-openapi/validate/schema_props.go +++ b/vendor/github.com/go-openapi/validate/schema_props.go @@ -12,7 +12,7 @@ import ( ) type schemaPropsValidator struct { - Path string + Path pathSegments In string AllOf []spec.Schema OneOf []spec.Schema @@ -28,12 +28,8 @@ type schemaPropsValidator struct { Options *SchemaValidatorOptions } -func (s *schemaPropsValidator) SetPath(path string) { - s.Path = path -} - func newSchemaPropsValidator( - path string, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root any, formats strfmt.Registry, + path pathSegments, in string, allOf, oneOf, anyOf []spec.Schema, not *spec.Schema, deps spec.Dependencies, root any, formats strfmt.Registry, opts *SchemaValidatorOptions, ) *schemaPropsValidator { if opts == nil { @@ -60,7 +56,7 @@ func newSchemaPropsValidator( var s *schemaPropsValidator if opts.recycleValidators { - s = pools.poolOfSchemaPropsValidators.BorrowValidator() + s = validatorPools.schemaPropsValidators.Borrow() } else { s = new(schemaPropsValidator) } @@ -91,7 +87,7 @@ func (s *schemaPropsValidator) Applies(source any, _ reflect.Kind) bool { func (s *schemaPropsValidator) Validate(data any) *Result { var mainResult *Result if s.Options.recycleResult { - mainResult = pools.poolOfResults.BorrowResult() + mainResult = validatorPools.results.Borrow() } else { mainResult = new(Result) } @@ -111,17 +107,17 @@ func (s *schemaPropsValidator) Validate(data any) *Result { } if len(s.anyOfValidators) > 0 { - keepResultAnyOf = pools.poolOfResults.BorrowResult() + keepResultAnyOf = validatorPools.results.Borrow() s.validateAnyOf(data, mainResult, keepResultAnyOf) } if len(s.oneOfValidators) > 0 { - keepResultOneOf = pools.poolOfResults.BorrowResult() + keepResultOneOf = validatorPools.results.Borrow() s.validateOneOf(data, mainResult, keepResultOneOf) } if len(s.allOfValidators) > 0 { - keepResultAllOf = pools.poolOfResults.BorrowResult() + keepResultAllOf = validatorPools.results.Borrow() s.validateAllOf(data, mainResult, keepResultAllOf) } @@ -154,7 +150,7 @@ func (s *schemaPropsValidator) validateAnyOf(data any, mainResult, keepResultAny if result.IsValid() { if bestFailures != nil && bestFailures.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(bestFailures) + redeemResult(bestFailures) } _ = keepResultAnyOf.cleared() @@ -166,7 +162,7 @@ func (s *schemaPropsValidator) validateAnyOf(data any, mainResult, keepResultAny // MatchCount is used to select errors from the schema with most positive checks if bestFailures == nil || result.MatchCount > bestFailures.MatchCount { if bestFailures != nil && bestFailures.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(bestFailures) + redeemResult(bestFailures) } bestFailures = result @@ -174,11 +170,11 @@ func (s *schemaPropsValidator) validateAnyOf(data any, mainResult, keepResultAny } if result.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(result) // this result is ditched + redeemResult(result) // this result is ditched } } - mainResult.AddErrors(mustValidateAtLeastOneSchemaMsg(s.Path)) + mainResult.addErrorsAt(s.Path, mustValidateAtLeastOneSchemaMsg(s.Path.dotted())) mainResult.Merge(bestFailures) } @@ -205,7 +201,7 @@ func (s *schemaPropsValidator) validateOneOf(data any, mainResult, keepResultOne if firstSuccess == nil { firstSuccess = result } else if result.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(result) // this result is ditched + redeemResult(result) // this result is ditched } continue @@ -214,29 +210,29 @@ func (s *schemaPropsValidator) validateOneOf(data any, mainResult, keepResultOne // MatchCount is used to select errors from the schema with most positive checks if validated == 0 && (bestFailures == nil || result.MatchCount > bestFailures.MatchCount) { if bestFailures != nil && bestFailures.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(bestFailures) + redeemResult(bestFailures) } bestFailures = result } else if result.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(result) // this result is ditched + redeemResult(result) // this result is ditched } } switch validated { case 0: - mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, "Found none valid")) + mainResult.addErrorsAt(s.Path, mustValidateOnlyOneSchemaMsg(s.Path.dotted(), "Found none valid")) mainResult.Merge(bestFailures) // firstSucess necessarily nil case 1: mainResult.Merge(firstSuccess) if bestFailures != nil && bestFailures.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(bestFailures) + redeemResult(bestFailures) } default: - mainResult.AddErrors(mustValidateOnlyOneSchemaMsg(s.Path, fmt.Sprintf("Found %d valid alternatives", validated))) + mainResult.addErrorsAt(s.Path, mustValidateOnlyOneSchemaMsg(s.Path.dotted(), fmt.Sprintf("Found %d valid alternatives", validated))) mainResult.Merge(bestFailures) if firstSuccess != nil && firstSuccess.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(firstSuccess) + redeemResult(firstSuccess) } } } @@ -260,10 +256,10 @@ func (s *schemaPropsValidator) validateAllOf(data any, mainResult, keepResultAll switch validated { case 0: - mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, ". None validated")) + mainResult.addErrorsAt(s.Path, mustValidateAllSchemasMsg(s.Path.dotted(), ". None validated")) case len(s.allOfValidators): default: - mainResult.AddErrors(mustValidateAllSchemasMsg(s.Path, "")) + mainResult.addErrorsAt(s.Path, mustValidateAllSchemasMsg(s.Path.dotted(), "")) } } @@ -274,16 +270,16 @@ func (s *schemaPropsValidator) validateNot(data any, mainResult *Result) { } // We keep inner IMPORTANT! errors no matter what MatchCount tells us if result.IsValid() { - mainResult.AddErrors(mustNotValidatechemaMsg(s.Path)) + mainResult.addErrorsAt(s.Path, mustNotValidatechemaMsg(s.Path.dotted())) } if result.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(result) // this result is ditched + redeemResult(result) // this result is ditched } } func (s *schemaPropsValidator) validateDependencies(data any, mainResult *Result) { val := data.(map[string]any) //nolint:forcetypeassert // caller guarantees map[string]any - for key := range val { + for _, key := range sortedKeys(val) { dep, ok := s.Dependencies[key] if !ok { continue @@ -291,7 +287,7 @@ func (s *schemaPropsValidator) validateDependencies(data any, mainResult *Result if dep.Schema != nil { mainResult.Merge( - newSchemaValidator(dep.Schema, s.Root, s.Path+"."+key, s.KnownFormats, s.Options).Validate(data), + newSchemaValidator(dep.Schema, s.Root, s.Path.child(key), s.KnownFormats, s.Options).Validate(data), ) continue } @@ -299,15 +295,19 @@ func (s *schemaPropsValidator) validateDependencies(data any, mainResult *Result if len(dep.Property) > 0 { for _, depKey := range dep.Property { if _, ok := val[depKey]; !ok { - mainResult.AddErrors(hasADependencyMsg(s.Path, depKey)) + mainResult.addErrorsAt(s.Path, hasADependencyMsg(s.Path.dotted(), depKey)) } } } } } +func (s *schemaPropsValidator) setPath(path pathSegments) { + s.Path = path +} + func (s *schemaPropsValidator) redeem() { - pools.poolOfSchemaPropsValidators.RedeemValidator(s) + validatorPools.schemaPropsValidators.Redeem(s) } func (s *schemaPropsValidator) redeemChildren() { diff --git a/vendor/github.com/go-openapi/validate/security_requirements.go b/vendor/github.com/go-openapi/validate/security_requirements.go new file mode 100644 index 00000000000..b6c10f3b223 --- /dev/null +++ b/vendor/github.com/go-openapi/validate/security_requirements.go @@ -0,0 +1,99 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "strings" + + "github.com/go-openapi/spec" +) + +// validateSecurityRequirements checks the security requirements declared by the document and by +// each of its operations against the security definitions. +// +// A requirement names a security scheme and lists the scopes an operation needs from it: +// +// security: +// - petstore_auth: [ "write:pets" ] +// - api_key: [] +// +// Three rules apply: +// +// - the name must be declared in securityDefinitions (error) +// - only an oauth2 requirement carries scopes; every other scheme type must list none (error) +// - an oauth2 requirement should only name scopes its scheme declares (warning) +// +// The JSON meta-schema types a requirement as an object of string arrays and never reads +// securityDefinitions, so it can express none of the three. +// +// An empty requirement object ({}) names no scheme and passes. So does an empty security array, +// which an operation uses to drop the requirements the document sets for every operation. +func (s *SpecValidator) validateSecurityRequirements() *Result { + res := validatorPools.results.Borrow() + definitions := s.spec.Spec().SecurityDefinitions + + res.Merge(checkSecurityRequirements( + newPathSegments(swaggerSecurity), + s.spec.Spec().Security, + definitions, + )) + + operations := s.expandedAnalyzer().Operations() + for _, method := range sortedKeys(operations) { + byPath := operations[method] + for _, path := range sortedKeys(byPath) { + op := byPath[path] + if op == nil { + continue + } + + res.Merge(checkSecurityRequirements( + operationPath(path, method).child(swaggerSecurity), + op.Security, + definitions, + )) + } + } + + return res +} + +// checkSecurityRequirements checks the list of security requirements held at the given location. +// +// Requirements are checked in the order the document lists them, and the schemes one requirement +// names in sorted order: a requirement is a map, so the document's own order is lost (see +// [sortedKeys]). +func checkSecurityRequirements(at pathSegments, requirements []map[string][]string, definitions spec.SecurityDefinitions) *Result { + res := validatorPools.results.Borrow() + + for i, requirement := range requirements { + for _, name := range sortedKeys(requirement) { + scopes := requirement[name] + schemeAt := at.item(i).child(name) + + scheme, isDeclared := definitions[name] + if !isDeclared || scheme == nil { + res.addErrorsAt(schemeAt, securitySchemeNotDeclaredMsg(name)) + + continue + } + + if scheme.Type != securitySchemeOAuth2 { + if len(scopes) > 0 { + res.addErrorsAt(schemeAt, securityScopesNotEmptyMsg(name, strings.Join(scopes, ", "), scheme.Type)) + } + + continue + } + + for _, scope := range scopes { + if _, isKnown := scheme.Scopes[scope]; !isKnown { + res.addWarningsAt(schemeAt, securityScopeNotDeclaredMsg(name, scope)) + } + } + } + } + + return res +} diff --git a/vendor/github.com/go-openapi/validate/slice_validator.go b/vendor/github.com/go-openapi/validate/slice_validator.go index 8f49d137073..0a0ee740279 100644 --- a/vendor/github.com/go-openapi/validate/slice_validator.go +++ b/vendor/github.com/go-openapi/validate/slice_validator.go @@ -4,7 +4,6 @@ package validate import ( - "fmt" "reflect" "github.com/go-openapi/spec" @@ -12,7 +11,7 @@ import ( ) type schemaSliceValidator struct { - Path string + Path pathSegments In string MaxItems *int64 MinItems *int64 @@ -24,7 +23,7 @@ type schemaSliceValidator struct { Options *SchemaValidatorOptions } -func newSliceValidator(path, in string, +func newSliceValidator(path pathSegments, in string, maxItems, minItems *int64, uniqueItems bool, additionalItems *spec.SchemaOrBool, items *spec.SchemaOrArray, root any, formats strfmt.Registry, opts *SchemaValidatorOptions, @@ -35,7 +34,7 @@ func newSliceValidator(path, in string, var v *schemaSliceValidator if opts.recycleValidators { - v = pools.poolOfSliceValidators.BorrowValidator() + v = validatorPools.sliceValidators.Borrow() } else { v = new(schemaSliceValidator) } @@ -54,10 +53,6 @@ func newSliceValidator(path, in string, return v } -func (s *schemaSliceValidator) SetPath(path string) { - s.Path = path -} - func (s *schemaSliceValidator) Applies(source any, kind reflect.Kind) bool { _, ok := source.(*spec.Schema) r := ok && kind == reflect.Slice @@ -73,7 +68,7 @@ func (s *schemaSliceValidator) Validate(data any) *Result { var result *Result if s.Options.recycleResult { - result = pools.poolOfResults.BorrowResult() + result = validatorPools.results.Borrow() } else { result = new(Result) } @@ -85,8 +80,10 @@ func (s *schemaSliceValidator) Validate(data any) *Result { if s.Items != nil && s.Items.Schema != nil { for i := range size { - validator := newSchemaValidator(s.Items.Schema, s.Root, s.Path, s.KnownFormats, s.Options) - validator.SetPath(fmt.Sprintf("%s.%d", s.Path, i)) + // the index has to reach the constructor: the sub-validators that + // report the error are built there, and setting the path afterwards + // would leave them located on the array rather than on the item. + validator := newSchemaValidator(s.Items.Schema, s.Root, s.Path.item(i), s.KnownFormats, s.Options) value := val.Index(i) result.mergeForSlice(val, i, validator.Validate(value.Interface())) } @@ -100,41 +97,45 @@ func (s *schemaSliceValidator) Validate(data any) *Result { break } - validator := newSchemaValidator(&s.Items.Schemas[i], s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options) + validator := newSchemaValidator(&s.Items.Schemas[i], s.Root, s.Path.item(i), s.KnownFormats, s.Options) result.mergeForSlice(val, i, validator.Validate(val.Index(i).Interface())) } } if s.AdditionalItems != nil && itemsSize < size { if s.Items != nil && len(s.Items.Schemas) > 0 && !s.AdditionalItems.Allows { - result.AddErrors(arrayDoesNotAllowAdditionalItemsMsg()) + result.addErrorsAt(s.Path, arrayDoesNotAllowAdditionalItemsMsg()) } if s.AdditionalItems.Schema != nil { for i := itemsSize; i < size-itemsSize+1; i++ { - validator := newSchemaValidator(s.AdditionalItems.Schema, s.Root, fmt.Sprintf("%s.%d", s.Path, i), s.KnownFormats, s.Options) + validator := newSchemaValidator(s.AdditionalItems.Schema, s.Root, s.Path.item(i), s.KnownFormats, s.Options) result.mergeForSlice(val, i, validator.Validate(val.Index(i).Interface())) } } } if s.MinItems != nil { - if err := MinItems(s.Path, s.In, int64(size), *s.MinItems); err != nil { - result.AddErrors(err) + if err := MinItems(s.Path.dotted(), s.In, int64(size), *s.MinItems); err != nil { + result.addErrorsAt(s.Path, err) } } if s.MaxItems != nil { - if err := MaxItems(s.Path, s.In, int64(size), *s.MaxItems); err != nil { - result.AddErrors(err) + if err := MaxItems(s.Path.dotted(), s.In, int64(size), *s.MaxItems); err != nil { + result.addErrorsAt(s.Path, err) } } if s.UniqueItems { - if err := UniqueItems(s.Path, s.In, val.Interface()); err != nil { - result.AddErrors(err) + if err := UniqueItems(s.Path.dotted(), s.In, val.Interface()); err != nil { + result.addErrorsAt(s.Path, err) } } result.Inc() return result } +func (s *schemaSliceValidator) setPath(path pathSegments) { + s.Path = path +} + func (s *schemaSliceValidator) redeem() { - pools.poolOfSliceValidators.RedeemValidator(s) + validatorPools.sliceValidators.Redeem(s) } diff --git a/vendor/github.com/go-openapi/validate/sorted.go b/vendor/github.com/go-openapi/validate/sorted.go new file mode 100644 index 00000000000..829a042c672 --- /dev/null +++ b/vendor/github.com/go-openapi/validate/sorted.go @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package validate + +import ( + "cmp" + "maps" + "slices" + "strings" + + "github.com/go-openapi/spec" +) + +// sortedKeys returns the keys of a map in ascending order. +// +// Findings are reported in the order the checks walk the document, and several +// of them walk a map: definitions, paths, response codes, headers, properties. +// Go randomises map iteration, so the same bytes validated twice would list +// their findings in a different order — and where a check stops on the first +// fault it meets, would name a different offender altogether. +// +// Walking keys in sorted order makes both defined: findings come out in +// definition-name (or path, or status-code) order, on every run. +func sortedKeys[K cmp.Ordered, V any](m map[K]V) []K { + return slices.Sorted(maps.Keys(m)) +} + +// sortedRefs orders references by the location they point at. +// +// The analyzer gathers references in a map, so the slice it hands back comes +// out in a different order on every run. See [sortedKeys]. +func sortedRefs(refs []spec.Ref) []spec.Ref { + slices.SortFunc(refs, func(a, b spec.Ref) int { + return strings.Compare(a.String(), b.String()) + }) + + return refs +} diff --git a/vendor/github.com/go-openapi/validate/spec.go b/vendor/github.com/go-openapi/validate/spec.go index 0849e47ea58..133752345ce 100644 --- a/vendor/github.com/go-openapi/validate/spec.go +++ b/vendor/github.com/go-openapi/validate/spec.go @@ -4,8 +4,6 @@ package validate import ( - "bytes" - "encoding/gob" "encoding/json" "fmt" "slices" @@ -25,9 +23,11 @@ import ( // // Returns an error flattening in a single standard error, all validation messages. // +// Options are forwarded to the underlying [SpecValidator]; in particular [WithPathLoader] injects a +// confined document loader for validating a specification from an untrusted source. +// // - Proposal for enhancement: $ref should not have siblings // - Proposal for enhancement: make sure documentation reflects all checks and warnings -// - Proposal for enhancement: check on discriminators // - Proposal for enhancement: explicit message on unsupported keywords (better than "forbidden property"...) // - Proposal for enhancement: full list of unresolved refs // - Proposal for enhancement: validate numeric constraints (issue#581): this should be handled like defaults and examples @@ -35,8 +35,8 @@ import ( // - Proposal for enhancement: check on required properties to support anyOf, allOf, oneOf // // NOTE: SecurityScopes are maps: no need to check uniqueness. -func Spec(doc *loads.Document, formats strfmt.Registry) error { - errs, _ /*warns*/ := NewSpecValidator(doc.Schema(), formats).Validate(doc) +func Spec(doc *loads.Document, formats strfmt.Registry, options ...Option) error { + errs, _ /*warns*/ := NewSpecValidator(doc.Schema(), formats, options...).Validate(doc) if errs.HasErrors() { return errors.CompositeValidationError(errs.Errors...) } @@ -45,24 +45,34 @@ func Spec(doc *loads.Document, formats strfmt.Registry) error { // SpecValidator validates a swagger 2.0 spec. type SpecValidator struct { - schema *spec.Schema // swagger 2.0 schema - spec *loads.Document - analyzer *analysis.Spec - expanded *loads.Document - KnownFormats strfmt.Registry - Options Opts // validation options - schemaOptions *SchemaValidatorOptions + schema *spec.Schema // swagger 2.0 schema + spec *loads.Document + analyzer *analysis.Spec + expanded *loads.Document + refLocations refLocations + refRedirects refRedirects + paramLocations paramLocations + document any // the document as decoded, to tell what it holds + KnownFormats strfmt.Registry + Options Opts // validation options + schemaOptions *SchemaValidatorOptions } // NewSpecValidator creates a new swagger spec validator instance. -func NewSpecValidator(schema *spec.Schema, formats strfmt.Registry) *SpecValidator { - // schema options that apply to all called validators +// +// Options apply to the schema validators used internally. In particular, [WithPathLoader] injects +// the document loader used to resolve $ref while validating the specification — set a confined +// loader when validating a specification from an untrusted source (see the package "Security" +// notes on [WithPathLoader]). +func NewSpecValidator(schema *spec.Schema, formats strfmt.Registry, options ...Option) *SpecValidator { + // schema options that apply to all called validators: built-in defaults first, then + // caller-supplied options (which may add a loader or override a default). schemaOptions := new(SchemaValidatorOptions) - for _, o := range []Option{ + for _, o := range append([]Option{ SwaggerSchema(true), WithRecycleValidators(true), // withRecycleResults(true), - } { + }, options...) { o(schemaOptions) } @@ -87,26 +97,53 @@ func (s *SpecValidator) Validate(data any) (*Result, *Result) { errs.AddErrors(invalidDocumentMsg()) return errs, warnings // no point in continuing } + + // Validation expands what it walks - schemata, but also parameters, path items and responses - + // and expansion rewrites what it is given. Take one copy of the whole document here and work + // on that, so the caller gets back the document it handed over. Raw() still reads the bytes as + // they were authored, so the checks below that go through them are unaffected. + // + // Cloning here rather than per schema is what keeps the cost flat: a copy taken inside + // newSchemaValidator is paid again at every level of a recursive document. + raw := sd.Raw() + sd = sd.Pristine() + s.schemaOptions.ownSchemata = true s.spec = sd s.analyzer = analysis.New(sd.Spec()) + // where each $ref sits, as authored: refs are reported against the + // unexpanded document, before expansion flattens them away + s.refLocations = newRefLocations(s.analyzer) + // where each operation declares its parameters: the document addresses + // them by index, and expansion loses that + s.paramLocations = newParamLocations(sd.Spec()) + // where each $ref leads: checks walk the expanded document, and a finding + // below a $ref has to be brought back to a node the document contains + s.refRedirects = newRefRedirects(s.analyzer) // Raw spec unmarshalling errors var obj any - if err := json.Unmarshal(sd.Raw(), &obj); err != nil { + if err := json.Unmarshal(raw, &obj); err != nil { // NOTE: under normal conditions, the *load.Document has been already unmarshalled // So this one is just a paranoid check on the behavior of the spec package panic(InvalidDocumentError) } + s.document = obj defer func() { + // bring findings reached through a $ref back onto the document, then + // hold every location to what the document actually addresses + errs.redirect(s.refRedirects.through) + errs.redirect(s.resolvable) // errs holds all errors and warnings, // warnings only warnings errs.MergeAsWarnings(warnings) - warnings.AddErrors(errs.Warnings...) + // reported as errors of the warnings-only result, but keeping the + // location each was recorded with + warnings.carryErrors(errs.Warnings, errs.warningLocations) }() // Swagger schema validator - schv := newSchemaValidator(s.schema, nil, "", s.KnownFormats, s.schemaOptions) + schv := newSchemaValidator(s.schema, nil, rootPath(), s.KnownFormats, s.schemaOptions) errs.Merge(schv.Validate(obj)) // error - // There may be a point in continuing to try and determine more accurate errors if !s.Options.ContinueOnErrors && errs.HasErrors() { @@ -123,6 +160,9 @@ func (s *SpecValidator) Validate(data any) (*Result, *Result) { errs.Merge(s.validateDuplicatePropertyNames()) // error - errs.Merge(s.validateParameters()) // error - errs.Merge(s.validateItems()) // error - + errs.Merge(s.validateSecurityRequirements()) // error and warning + errs.Merge(s.validateDiscriminators()) // error - + errs.Merge(s.validateCollectionFormats()) // warning only // Properties in required definition MUST validate their schema // Properties SHOULD NOT be declared as both required and readOnly (warning) @@ -158,24 +198,25 @@ func (s *SpecValidator) SetContinueOnErrors(c bool) { } func (s *SpecValidator) validateNonEmptyPathParamNames() *Result { - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() if s.spec.Spec().Paths == nil { - // There is no Paths object: error - res.AddErrors(noValidPathMsg()) + // There is no Paths object: the document itself lacks it, so + // there is no node below it to point at + res.addErrorsAt(rootPath(), noValidPathMsg()) return res } if s.spec.Spec().Paths.Paths == nil { // Paths may be empty: warning - res.AddWarnings(noValidPathMsg()) + res.addWarningsAt(newPathSegments(swaggerPaths), noValidPathMsg()) return res } - for k := range s.spec.Spec().Paths.Paths { + for _, k := range sortedKeys(s.spec.Spec().Paths.Paths) { if strings.Contains(k, "{}") { - res.AddErrors(emptyPathParameterMsg(k)) + res.addErrorsAt(newPathSegments(swaggerPaths, k), emptyPathParameterMsg(k)) } } @@ -192,21 +233,55 @@ func (s *SpecValidator) validateDuplicateOperationIDs() *Result { // fallback on possible incomplete picture because of previous errors analyzer = s.analyzer } - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() + + // the message says how many times an identifier is used, so the count is + // what it needs; a reader needs somewhere to go, so the first operation to + // declare the identifier is remembered along with it known := make(map[string]int) - for _, v := range analyzer.OperationIDs() { - if v != "" { - known[v]++ + declaredAt := make(map[string]pathSegments) + operations := analyzer.Operations() + for _, method := range sortedKeys(operations) { + byPath := operations[method] + for _, path := range sortedKeys(byPath) { + op := byPath[path] + id := operationIdentity(method, path, op) + known[id]++ + if _, isKnown := declaredAt[id]; !isKnown { + declaredAt[id] = operationIDPath(path, method, op) + } } } - for k, v := range known { - if v > 1 { - res.AddErrors(nonUniqueOperationIDMsg(k, v)) + + for _, k := range sortedKeys(known) { + if v := known[k]; v > 1 { + res.addErrorsAt(declaredAt[k], nonUniqueOperationIDMsg(k, v)) } } return res } +// operationIdentity names an operation the way the analyzer does: by its +// operationId, or by method and path when it declares none. +func operationIdentity(method, path string, op *spec.Operation) string { + if op == nil || op.ID == "" { + return strings.ToUpper(method) + " " + path + } + + return op.ID +} + +// operationIDPath locates the operationId of an operation, or the operation +// itself when it declares none. +func operationIDPath(path, method string, op *spec.Operation) pathSegments { + at := operationPath(path, method) + if op == nil || op.ID == "" { + return at + } + + return at.child(swaggerOperationID) +} + type dupProp struct { Name string Definition string @@ -214,8 +289,10 @@ type dupProp struct { func (s *SpecValidator) validateDuplicatePropertyNames() *Result { // definition can't declare a property that's already defined by one of its ancestors - res := pools.poolOfResults.BorrowResult() - for k, sch := range s.spec.Spec().Definitions { + res := validatorPools.results.Borrow() + definitions := s.spec.Spec().Definitions + for _, k := range sortedKeys(definitions) { + sch := definitions[k] if len(sch.AllOf) == 0 { continue } @@ -229,8 +306,15 @@ func (s *SpecValidator) validateDuplicatePropertyNames() *Result { res.Merge(rec) } if len(ancs) > 0 { - res.AddErrors(circularAncestryDefinitionMsg(k, ancs)) - return res + res.addErrorsAt(newPathSegments(swaggerDefinitions, k), circularAncestryDefinitionMsg(k, ancs)) + if !s.Options.ContinueOnErrors { + return res + } + + // the ancestry loops back on itself: searching it for duplicate + // property names would not terminate, so this definition stops here + // and the next one is examined. + continue } knowns := make(map[string]struct{}) @@ -243,7 +327,7 @@ func (s *SpecValidator) validateDuplicatePropertyNames() *Result { for _, v := range dups { pns = append(pns, v.Definition+"."+v.Name) } - res.AddErrors(duplicatePropertiesMsg(k, pns)) + res.addErrorsAt(newPathSegments(swaggerDefinitions, k), duplicatePropertiesMsg(k, pns)) } } @@ -252,7 +336,7 @@ func (s *SpecValidator) validateDuplicatePropertyNames() *Result { func (s *SpecValidator) resolveRef(ref *spec.Ref) (*spec.Schema, error) { if s.spec.SpecFilePath() != "" { - return spec.ResolveRefWithBase(s.spec.Spec(), ref, &spec.ExpandOptions{RelativeBase: s.spec.SpecFilePath()}) + return spec.ResolveRefWithBase(s.spec.Spec(), ref, s.schemaOptions.expandOptions(s.spec.SpecFilePath())) } // NOTE: it looks like with the new spec resolver, this code is now unrecheable return spec.ResolveRef(s.spec.Spec(), ref) @@ -263,7 +347,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema, schn := nm schc := &sch - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() for schc.Ref.String() != "" { // gather property names @@ -287,7 +371,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema, return dups, res } - for k := range schc.Properties { + for _, k := range sortedKeys(schc.Properties) { _, ok := knowns[k] if ok { dups = append(dups, dupProp{Name: k, Definition: schn}) @@ -300,7 +384,7 @@ func (s *SpecValidator) validateSchemaPropertyNames(nm string, sch spec.Schema, } func (s *SpecValidator) validateCircularAncestry(nm string, sch spec.Schema, knowns map[string]struct{}) ([]string, *Result) { - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() if sch.Ref.String() == "" && len(sch.AllOf) == 0 { // Safeguard. We should not be able to actually get there return nil, res @@ -351,14 +435,17 @@ func (s *SpecValidator) validateCircularAncestry(nm string, sch spec.Schema, kno //nolint:gocognit // refactor in a forthcoming PR func (s *SpecValidator) validateItems() *Result { // validate parameter, items, schema and response objects for presence of item if type is array - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() - for method, pi := range s.analyzer.Operations() { - for path, op := range pi { + operations := s.analyzer.Operations() + for _, method := range sortedKeys(operations) { + pi := operations[method] + for _, path := range sortedKeys(pi) { + op := pi[path] for _, param := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) { if param.TypeName() == arrayType && param.ItemsTypeName() == "" { - res.AddErrors(arrayInParamRequiresItemsMsg(param.Name, op.ID)) + res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), arrayInParamRequiresItemsMsg(param.Name, op.ID)) continue } if param.In != swaggerBody { @@ -366,7 +453,7 @@ func (s *SpecValidator) validateItems() *Result { items := param.Items for items.TypeName() == arrayType { if items.ItemsTypeName() == "" { - res.AddErrors(arrayInParamRequiresItemsMsg(param.Name, op.ID)) + res.addErrorsAt(s.parameterPath(path, method, param.In, param.Name), arrayInParamRequiresItemsMsg(param.Name, op.ID)) break } items = items.Items @@ -375,32 +462,22 @@ func (s *SpecValidator) validateItems() *Result { } else { // In: body if param.Schema != nil { - res.Merge(s.validateSchemaItems(*param.Schema, fmt.Sprintf("body param %q", param.Name), op.ID)) + res.Merge(s.validateSchemaItems(*param.Schema, s.parameterPath(path, method, param.In, param.Name).child(jsonSchema), + fmt.Sprintf("body param %q", param.Name), op.ID)) } } } - var responses []spec.Response - if op.Responses != nil { - if op.Responses.Default != nil { - responses = append(responses, *op.Responses.Default) - } - if op.Responses.StatusCodeResponses != nil { - for _, v := range op.Responses.StatusCodeResponses { - responses = append(responses, v) - } - } - } - - for _, resp := range responses { + for _, resp := range responsesOf(op) { + at := responsePath(path, method, resp.code) // Response headers with array - for hn, hv := range resp.Headers { - if hv.TypeName() == arrayType && hv.ItemsTypeName() == "" { - res.AddErrors(arrayInHeaderRequiresItemsMsg(hn, op.ID)) + for _, hn := range sortedKeys(resp.resp.Headers) { + if hv := resp.resp.Headers[hn]; hv.TypeName() == arrayType && hv.ItemsTypeName() == "" { + res.addErrorsAt(at.children(swaggerHeaders, hn), arrayInHeaderRequiresItemsMsg(hn, op.ID)) } } - if resp.Schema != nil { - res.Merge(s.validateSchemaItems(*resp.Schema, "response body", op.ID)) + if resp.resp.Schema != nil { + res.Merge(s.validateSchemaItems(*resp.resp.Schema, at.child(jsonSchema), "response body", op.ID)) } } } @@ -409,24 +486,24 @@ func (s *SpecValidator) validateItems() *Result { } // Verifies constraints on array type. -func (s *SpecValidator) validateSchemaItems(schema spec.Schema, prefix, opID string) *Result { - res := pools.poolOfResults.BorrowResult() +func (s *SpecValidator) validateSchemaItems(schema spec.Schema, at pathSegments, prefix, opID string) *Result { + res := validatorPools.results.Borrow() if !schema.Type.Contains(arrayType) { return res } if schema.Items == nil || schema.Items.Len() == 0 { - res.AddErrors(arrayRequiresItemsMsg(prefix, opID)) + res.addErrorsAt(at, arrayRequiresItemsMsg(prefix, opID)) return res } if schema.Items.Schema != nil { schema = *schema.Items.Schema if _, err := compileRegexp(schema.Pattern); err != nil { - res.AddErrors(invalidItemsPatternMsg(prefix, opID, schema.Pattern)) + res.addErrorsAt(at, invalidItemsPatternMsg(prefix, opID, schema.Pattern)) } - res.Merge(s.validateSchemaItems(schema, prefix, opID)) + res.Merge(s.validateSchemaItems(schema, at.child(jsonItems), prefix, opID)) } return res } @@ -434,7 +511,7 @@ func (s *SpecValidator) validateSchemaItems(schema spec.Schema, prefix, opID str func (s *SpecValidator) validatePathParamPresence(path string, fromPath, fromOperation []string) *Result { // Each defined operation path parameters must correspond to a named element in the API's path pattern. // (For example, you cannot have a path parameter named id for the following path /pets/{petId} but you must have a path parameter named petId.) - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() for _, l := range fromPath { var matched bool for _, r := range fromOperation { @@ -444,7 +521,7 @@ func (s *SpecValidator) validatePathParamPresence(path string, fromPath, fromOpe } } if !matched { - res.AddErrors(noParameterInPathMsg(l)) + res.addErrorsAt(newPathSegments(swaggerPaths, path), noParameterInPathMsg(l)) } } @@ -454,7 +531,7 @@ func (s *SpecValidator) validatePathParamPresence(path string, fromPath, fromOpe matched = true } if !matched { - res.AddErrors(pathParamNotInPathMsg(path, p)) + res.addErrorsAt(newPathSegments(swaggerPaths, path), pathParamNotInPathMsg(path, p)) } } @@ -487,9 +564,9 @@ func (s *SpecValidator) validateReferencedParameters() *Result { if len(expected) == 0 { return nil } - result := pools.poolOfResults.BorrowResult() - for k := range expected { - result.AddWarnings(unusedParamMsg(k)) + result := validatorPools.results.Borrow() + for _, k := range sortedKeys(expected) { + result.addWarningsAt(localRefPath(k), unusedParamMsg(k)) } return result } @@ -512,10 +589,12 @@ func (s *SpecValidator) validateReferencedResponses() *Result { if len(expected) == 0 { return nil } - result := pools.poolOfResults.BorrowResult() - for k := range expected { - result.AddWarnings(unusedResponseMsg(k)) + + result := validatorPools.results.Borrow() + for _, k := range sortedKeys(expected) { + result.addWarningsAt(localRefPath(k), unusedResponseMsg(k)) } + return result } @@ -539,59 +618,63 @@ func (s *SpecValidator) validateReferencedDefinitions() *Result { } result := new(Result) - for k := range expected { - result.AddWarnings(unusedDefinitionMsg(k)) + for _, k := range sortedKeys(expected) { + result.addWarningsAt(localRefPath(k), unusedDefinitionMsg(k)) } return result } func (s *SpecValidator) validateRequiredDefinitions() *Result { // Each property listed in the required array must be defined in the properties of the model - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() + + definitions := s.spec.Spec().Definitions DEFINITIONS: - for d, schema := range s.spec.Spec().Definitions { - if schema.Required != nil { // Safeguard - for _, pn := range schema.Required { - red := s.validateRequiredProperties(pn, d, &schema) //#nosec - // NOTE: capture validity before merging: Merge may redeem `red` to the - // pool (wantsRedeemOnMerge), after which reading it races with a concurrent - // BorrowResult().cleared() in another goroutine sharing the global pool. - isValid := red.IsValid() - res.Merge(red) - if !isValid && !s.Options.ContinueOnErrors { - break DEFINITIONS // there is an error, let's stop that bleeding - } - } + for _, d := range sortedKeys(definitions) { + schema := definitions[d] + red := validatorPools.results.Borrow() + keepGoing := s.walkRequired(newPathSegments(swaggerDefinitions, d), &schema, red) //#nosec + res.Merge(red) + if !keepGoing { + break DEFINITIONS // there is an error, let's stop that bleeding } } return res } -func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Schema) *Result { +// validateRequiredProperties checks one entry of a required array. +// +// schemaAt locates the schema being searched for the property, which moves as +// the search descends into additionalProperties. requiredAt locates the entry +// of the required array that started it, and stays put. +func (s *SpecValidator) validateRequiredProperties( + path string, of schemaIdentity, schemaAt, requiredAt pathSegments, v *spec.Schema, +) *Result { + in := of.name // Takes care of recursive property definitions, which may be nested in additionalProperties schemas - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() propertyMatch := false patternMatch := false additionalPropertiesMatch := false isReadOnly := false - // Regular properties - if _, ok := v.Properties[path]; ok { + // Regular properties, including those a base definition contributes + if readOnly, declared := s.declaresProperty(v, path, maxCompositionHops); declared { propertyMatch = true - isReadOnly = v.Properties[path].ReadOnly + isReadOnly = readOnly } // NOTE: patternProperties are not supported in swagger. Even though, we continue validation here // We check all defined patterns: if one regexp is invalid, croaks an error - for pp, pv := range v.PatternProperties { + for _, pp := range sortedKeys(v.PatternProperties) { re, err := compileRegexp(pp) if err != nil { - res.AddErrors(invalidPatternMsg(pp, in)) + res.addErrorsAt(schemaAt, invalidPatternMsg(pp, in)) } else if re.MatchString(path) { patternMatch = true if !propertyMatch { - isReadOnly = pv.ReadOnly + isReadOnly = v.PatternProperties[pp].ReadOnly } } } @@ -604,7 +687,7 @@ func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Sche // additionalProperties as schema are upported in swagger // recursively validates additionalProperties schema // Proposal for enhancement: anyOf, allOf, oneOf like in schemaPropsValidator - red := s.validateRequiredProperties(path, in, v.AdditionalProperties.Schema) + red := s.validateRequiredProperties(path, of, schemaAt.child(jsonAdditionalProperties), requiredAt, v.AdditionalProperties.Schema) if red.IsValid() { additionalPropertiesMatch = true if !propertyMatch && !patternMatch { @@ -617,11 +700,11 @@ func (s *SpecValidator) validateRequiredProperties(path, in string, v *spec.Sche } if !propertyMatch && !patternMatch && !additionalPropertiesMatch { - res.AddErrors(requiredButNotDefinedMsg(path, in)) + res.addErrorsAt(requiredAt, of.requiredButNotDefined(path)) } if isReadOnly { - res.AddWarnings(readOnlyAndRequiredMsg(in, path)) + res.addWarningsAt(requiredAt, readOnlyAndRequiredMsg(in, path)) } return res } @@ -637,26 +720,29 @@ func (s *SpecValidator) validateParameters() *Result { // - parameters with pattern property must specify valid patterns // - $ref in parameters must resolve // - path param must be required - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() rexGarbledPathSegment := mustCompileRegexp(`.*[{}\s]+.*`) - for method, pi := range s.expandedAnalyzer().Operations() { + operations := s.expandedAnalyzer().Operations() + for _, method := range sortedKeys(operations) { + pi := operations[method] methodPaths := make(map[string]map[string]string) - for path, op := range pi { + for _, path := range sortedKeys(pi) { + op := pi[path] if s.Options.StrictPathParamUniqueness { pathToAdd := pathHelp.stripParametersInPath(path) // Warn on garbled path afer param stripping if rexGarbledPathSegment.MatchString(pathToAdd) { - res.AddWarnings(pathStrippedParamGarbledMsg(pathToAdd)) + res.addWarningsAt(newPathSegments(swaggerPaths, path), pathStrippedParamGarbledMsg(pathToAdd)) } // Check uniqueness of stripped paths if _, found := methodPaths[method][pathToAdd]; found { // Sort names for stable, testable output if strings.Compare(path, methodPaths[method][pathToAdd]) < 0 { - res.AddErrors(pathOverlapMsg(path, methodPaths[method][pathToAdd])) + res.addErrorsAt(newPathSegments(swaggerPaths, path), pathOverlapMsg(path, methodPaths[method][pathToAdd])) } else { - res.AddErrors(pathOverlapMsg(methodPaths[method][pathToAdd], path)) + res.addErrorsAt(newPathSegments(swaggerPaths, path), pathOverlapMsg(methodPaths[method][pathToAdd], path)) } } else { if _, found := methodPaths[method]; !found { @@ -688,10 +774,10 @@ func (s *SpecValidator) validateParameters() *Result { for _, pr := range paramHelp.safeExpandedParamsFor(path, method, op.ID, res, s) { // An expanded parameter must validate the Parameter schema (an unexpanded $ref always passes high-level schema validation) - schv := newSchemaValidator(¶mSchema, s.schema, fmt.Sprintf("%s.%s.parameters.%s", path, method, pr.Name), s.KnownFormats, s.schemaOptions) + schv := newSchemaValidator(¶mSchema, s.schema, s.parameterPath(path, method, pr.In, pr.Name), s.KnownFormats, s.schemaOptions) var obj any if err := jsonutils.FromDynamicJSON(pr, &obj); err != nil { - res.AddErrors(err) + res.addErrorsAt(s.parameterPath(path, method, pr.In, pr.Name), err) return res } @@ -700,7 +786,7 @@ func (s *SpecValidator) validateParameters() *Result { // Validate pattern regexp for parameters with a Pattern property if _, err := compileRegexp(pr.Pattern); err != nil { - res.AddErrors(invalidPatternInParamMsg(op.ID, pr.Name, pr.Pattern)) + res.addErrorsAt(s.parameterPath(path, method, pr.In, pr.Name), invalidPatternInParamMsg(op.ID, pr.Name, pr.Pattern)) } // There must be at most one parameter in body: list them all @@ -713,7 +799,7 @@ func (s *SpecValidator) validateParameters() *Result { paramNames = append(paramNames, pr.Name) // Path declared in path must have the required: true property if !pr.Required { - res.AddErrors(pathParamRequiredMsg(op.ID, pr.Name)) + res.addErrorsAt(s.parameterPath(path, method, pr.In, pr.Name), pathParamRequiredMsg(op.ID, pr.Name)) } } @@ -724,31 +810,31 @@ func (s *SpecValidator) validateParameters() *Result { if pr.Type != numberType && pr.Type != integerType && (pr.Maximum != nil || pr.Minimum != nil || pr.MultipleOf != nil) { // A non-numeric parameter has validation keywords for numeric instances (number and integer) - res.AddWarnings(parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type)) + res.addWarningsAt(s.parameterPath(path, method, pr.In, pr.Name), parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type)) } if pr.Type != stringType && // A non-string parameter has validation keywords for strings (pr.MaxLength != nil || pr.MinLength != nil || pr.Pattern != "") { - res.AddWarnings(parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type)) + res.addWarningsAt(s.parameterPath(path, method, pr.In, pr.Name), parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type)) } if pr.Type != arrayType && // A non-array parameter has validation keywords for arrays (pr.MaxItems != nil || pr.MinItems != nil || pr.UniqueItems) { - res.AddWarnings(parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type)) + res.addWarningsAt(s.parameterPath(path, method, pr.In, pr.Name), parameterValidationTypeMismatchMsg(pr.Name, path, pr.Type)) } } // In:formData and In:body are mutually exclusive if hasBody && hasForm { - res.AddErrors(bothFormDataAndBodyMsg(op.ID)) + res.addErrorsAt(operationPath(path, method), bothFormDataAndBodyMsg(op.ID)) } // There must be at most one body param // Accurately report situations when more than 1 body param is declared (possibly unnamed) if len(bodyParams) > 1 { sort.Strings(bodyParams) - res.AddErrors(multipleBodyParamMsg(op.ID, bodyParams)) + res.addErrorsAt(operationPath(path, method), multipleBodyParamMsg(op.ID, bodyParams)) } // Check uniqueness of parameters in path @@ -756,7 +842,7 @@ func (s *SpecValidator) validateParameters() *Result { for i, p := range paramsInPath { for j, q := range paramsInPath { if p == q && i > j { - res.AddErrors(pathParamNotUniqueMsg(path, p, q)) + res.addErrorsAt(newPathSegments(swaggerPaths, path), pathParamNotUniqueMsg(path, p, q)) break } } @@ -766,7 +852,7 @@ func (s *SpecValidator) validateParameters() *Result { rexGarbledParam := mustCompileRegexp(`{.*[{}\s]+.*}`) for _, p := range paramsInPath { if rexGarbledParam.MatchString(p) { - res.AddWarnings(pathParamGarbledMsg(path, p)) + res.addWarningsAt(newPathSegments(swaggerPaths, path), pathParamGarbledMsg(path, p)) } } @@ -779,25 +865,63 @@ func (s *SpecValidator) validateParameters() *Result { func (s *SpecValidator) validateReferencesValid() *Result { // each reference must point to a valid object - res := pools.poolOfResults.BorrowResult() - for _, r := range s.analyzer.AllRefs() { + res := validatorPools.results.Borrow() + for _, r := range sortedRefs(s.analyzer.AllRefs()) { if !r.IsValidURI(s.spec.SpecFilePath()) { // Safeguard - spec should always yield a valid URI - res.AddErrors(invalidRefMsg(r.String())) + res.addErrorsAt(s.refLocations.at(r.String()), invalidRefMsg(r.String())) } } if !res.HasErrors() { // NOTE: with default settings, loads.Document.Expanded() // stops on first error. Anyhow, the expand option to continue // on errors fails to report errors at all. - exp, err := s.spec.Expanded() + // + // Pass the injected loader (if any) so whole-spec expansion is confined too. When no loader + // is set, this is a no-op: loads falls back to the document's own loader. + exp, err := s.spec.Expanded(s.schemaOptions.expandOptions("")) if err != nil { - res.AddErrors(unresolvedReferencesMsg(err)) + res.addErrorsAt(s.firstUnresolvableRef(), unresolvedReferencesMsg(err)) } s.expanded = exp } return res } +// firstUnresolvableRef locates the declaration of the first local $ref, in +// document order, that points at a node the document does not hold. +// +// Expansion reports the whole document in a single message, naming only the +// reference it happened to trip on, so the finding has no location of its own. +// A document usually has one broken reference; when it has several, this is the +// first one a reader would meet. +func (s *SpecValidator) firstUnresolvableRef() pathSegments { + first := rootPath() + found := false + + for _, r := range s.analyzer.AllRefs() { + value := r.String() + if !strings.HasPrefix(value, "#/") { + // a remote reference cannot be checked against the document alone + continue + } + + pointer, err := jsonpointer.New(strings.TrimPrefix(value, "#")) + if err != nil { + continue + } + if _, _, err := pointer.Get(s.document); err == nil { + continue + } + + at := s.refLocations.at(value) + if !found || at.pointer() < first.pointer() { + first, found = at, true + } + } + + return first +} + func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operation) *Result { // Check for duplicate parameters declaration in param section. // Each parameter should have a unique `name` and `type` combination @@ -805,7 +929,7 @@ func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operatio // However, there are some issues with such a factorization: // - analysis does not seem to fully expand params // - param keys may be altered by x-go-name - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() pnames := make(map[string]struct{}) if op.Parameters != nil { // Safeguard @@ -818,7 +942,7 @@ func (s *SpecValidator) checkUniqueParams(path, method string, op *spec.Operatio key := fmt.Sprintf("%s#%s", pr.In, pr.Name) if _, ok = pnames[key]; ok { - res.AddErrors(duplicateParamNameMsg(pr.In, pr.Name, op.ID)) + res.addErrorsAt(s.parameterPath(path, method, pr.In, pr.Name), duplicateParamNameMsg(pr.In, pr.Name, op.ID)) } pnames[key] = struct{}{} } @@ -836,14 +960,15 @@ func (s *SpecValidator) expandedAnalyzer() *analysis.Spec { return s.analyzer } +// deepCloneSchema returns a copy of src that shares nothing with it. +// +// The copy goes through JSON, which is the form [spec.Schema] is defined by. gob drops any field +// holding its zero value and flattens a pointer to what it points at, so a *float64 pointing at +// 0 - "minimum": 0, which the JSON Schema meta-schema spells for every positiveInteger - came +// back nil and the bound was lost. JSON is also the faster of the two on this model. func deepCloneSchema(src spec.Schema) (spec.Schema, error) { - var b bytes.Buffer - if err := gob.NewEncoder(&b).Encode(src); err != nil { - return spec.Schema{}, err - } - var dst spec.Schema - if err := gob.NewDecoder(&b).Decode(&dst); err != nil { + if err := jsonutils.FromDynamicJSON(src, &dst); err != nil { return spec.Schema{}, err } diff --git a/vendor/github.com/go-openapi/validate/spec_messages.go b/vendor/github.com/go-openapi/validate/spec_messages.go index eeb8a869518..541af4d91d5 100644 --- a/vendor/github.com/go-openapi/validate/spec_messages.go +++ b/vendor/github.com/go-openapi/validate/spec_messages.go @@ -44,6 +44,15 @@ const ( // DefaultValueInDoesNotValidateError ... DefaultValueInDoesNotValidateError = "in operation %q, default value in %s does not validate its schema" + // DiscriminatorNotDefinedError indicates a schema whose discriminator names a property the + // schema does not declare. A discriminator tells subtypes apart by the value of that property, + // so an instance has nowhere to carry the value when the property is not declared. + DiscriminatorNotDefinedError = "discriminator %q of %q is not defined as a property of that schema" + + // DiscriminatorNotRequiredError indicates a schema whose discriminator property is declared but + // left optional. An instance that omits it cannot be resolved to a subtype. + DiscriminatorNotRequiredError = "discriminator %q of %q is not in the required property list" + // DuplicateParamNameError ... DuplicateParamNameError = "duplicate parameter name %q for %q in operation %q" @@ -132,6 +141,17 @@ const ( // RequiredButNotDefinedError ... RequiredButNotDefinedError = "%q is present in required but not defined as property in definition %q" + // RequiredButNotDefinedInSchemaError is the same slip, in a schema a definition holds rather than + // in the definition itself. + RequiredButNotDefinedInSchemaError = "%q is present in required but not defined as property in schema %q" + + // SecuritySchemeNotDeclaredError indicates a security requirement naming a scheme that + // securityDefinitions does not declare. + SecuritySchemeNotDeclaredError = "security requirement %q is not declared in securityDefinitions" + + // SecurityScopesNotEmptyError indicates a security requirement listing scopes on a scheme that is + // not oauth2. Only an oauth2 requirement carries scopes; every other type must list none. + SecurityScopesNotEmptyError = "security requirement %q lists scopes (%s), but the security scheme it names is of type %q: only oauth2 requirements carry scopes" // SomeParametersBrokenError indicates that some parameters could not be resolved, which might result in partial checks to be carried on. SomeParametersBrokenError = "some parameters definitions are broken in %q.%s. Cannot carry on full checks on parameters for operation %s" @@ -168,6 +188,11 @@ const ( // RequiredHasDefaultWarning indicates that a required parameter property should not have a default. RequiredHasDefaultWarning = "%s in %s has a default value and is required as parameter" + // SecurityScopeNotDeclaredWarning flags an oauth2 security requirement asking for a scope that the + // scheme does not list in its scopes. Swagger 2.0 does not spell out that the two must agree, so + // this is reported as a warning: a specification that names an undeclared scope stays valid. + SecurityScopeNotDeclaredWarning = "security requirement %q requires scope %q, which the security scheme does not declare" + // UnusedDefinitionWarning ... UnusedDefinitionWarning = "definition %q is not used anywhere" @@ -177,6 +202,12 @@ const ( // UnusedResponseWarning ... UnusedResponseWarning = "response %q is not used anywhere" + // CollectionFormatIgnoredWarning flags a collectionFormat on a parameter, header or items whose + // type is not array. collectionFormat says how to join the members of an array into one value, so + // it does nothing anywhere else. It is a warning, not an error: Swagger 2.0 defines the member as + // applying when the type is array, and does not forbid writing it elsewhere. + CollectionFormatIgnoredWarning = "collectionFormat %q is ignored in %s: it joins the members of an array, and the type is %q" + // DubiousAbsoluteRefWarning flags a $ref pointing to an absolute local file location that escapes the // spec's base path. Absolute local references are legitimate when they stay beneath the base path // (flattening/expansion introduces such anchors for cyclical $refs), but an absolute reference that @@ -260,6 +291,10 @@ func requiredButNotDefinedMsg(path, definition string) errors.Error { return errors.New(errors.CompositeErrorCode, RequiredButNotDefinedError, path, definition) } +func requiredButNotDefinedInSchemaMsg(path, schema string) errors.Error { + return errors.New(errors.CompositeErrorCode, RequiredButNotDefinedInSchemaError, path, schema) +} + func pathParamGarbledMsg(path, param string) errors.Error { return errors.New(errors.CompositeErrorCode, PathParamGarbledWarning, path, param) } @@ -409,6 +444,31 @@ func invalidObjectMsg(path, in string) errors.Error { // func invalidResponseDefinitionAsSchemaMsg(path, method string) errors.Error { // return errors.New(errors.CompositeErrorCode, InvalidResponseDefinitionAsSchemaError, path, method) // } + +func collectionFormatIgnoredMsg(collectionFormat, in, typ string) errors.Error { + return errors.New(errors.CompositeErrorCode, CollectionFormatIgnoredWarning, collectionFormat, in, typ) +} + +func discriminatorNotDefinedMsg(discriminator, in string) errors.Error { + return errors.New(errors.CompositeErrorCode, DiscriminatorNotDefinedError, discriminator, in) +} + +func discriminatorNotRequiredMsg(discriminator, in string) errors.Error { + return errors.New(errors.CompositeErrorCode, DiscriminatorNotRequiredError, discriminator, in) +} + +func securitySchemeNotDeclaredMsg(name string) errors.Error { + return errors.New(errors.CompositeErrorCode, SecuritySchemeNotDeclaredError, name) +} + +func securityScopesNotEmptyMsg(name, scopes, schemeType string) errors.Error { + return errors.New(errors.CompositeErrorCode, SecurityScopesNotEmptyError, name, scopes, schemeType) +} + +func securityScopeNotDeclaredMsg(name, scope string) errors.Error { + return errors.New(errors.CompositeErrorCode, SecurityScopeNotDeclaredWarning, name, scope) +} + func someParametersBrokenMsg(path, method, operationID string) errors.Error { return errors.New(errors.CompositeErrorCode, SomeParametersBrokenError, path, method, operationID) } diff --git a/vendor/github.com/go-openapi/validate/spec_ref_warnings.go b/vendor/github.com/go-openapi/validate/spec_ref_warnings.go index 49c72314c94..d56cb177cc6 100644 --- a/vendor/github.com/go-openapi/validate/spec_ref_warnings.go +++ b/vendor/github.com/go-openapi/validate/spec_ref_warnings.go @@ -34,12 +34,12 @@ const minDistinctHostsToWarn = 2 // // All findings are warnings: they do not affect validity (see Result.IsValid). func (s *SpecValidator) validateDubiousRefs() *Result { - res := pools.poolOfResults.BorrowResult() + res := validatorPools.results.Borrow() baseDir, hasBase := s.localBaseDir() remoteHosts := make(map[string]struct{}) - for _, r := range s.analyzer.AllRefs() { + for _, r := range sortedRefs(s.analyzer.AllRefs()) { u := r.GetURL() if u == nil { // Safeguard: a valid spec always yields parseable refs continue @@ -48,7 +48,7 @@ func (s *SpecValidator) validateDubiousRefs() *Result { // Rule 1: absolute local reference escaping the base path. if refPath, isLocalAbs := absoluteLocalRefPath(r, u); isLocalAbs { if !hasBase || !isBeneathBase(refPath, baseDir) { - res.AddWarnings(dubiousAbsoluteRefMsg(r.String())) + res.addWarningsAt(s.refLocations.at(r.String()), dubiousAbsoluteRefMsg(r.String())) } continue } diff --git a/vendor/github.com/go-openapi/validate/type.go b/vendor/github.com/go-openapi/validate/type.go index d29574c3498..3016783f071 100644 --- a/vendor/github.com/go-openapi/validate/type.go +++ b/vendor/github.com/go-openapi/validate/type.go @@ -15,7 +15,7 @@ import ( ) type typeValidator struct { - Path string + Path pathSegments In string Type spec.StringOrArray Nullable bool @@ -23,14 +23,14 @@ type typeValidator struct { Options *SchemaValidatorOptions } -func newTypeValidator(path, in string, typ spec.StringOrArray, nullable bool, format string, opts *SchemaValidatorOptions) *typeValidator { +func newTypeValidator(path pathSegments, in string, typ spec.StringOrArray, nullable bool, format string, opts *SchemaValidatorOptions) *typeValidator { if opts == nil { opts = new(SchemaValidatorOptions) } var t *typeValidator if opts.recycleValidators { - t = pools.poolOfTypeValidators.BorrowValidator() + t = validatorPools.typeValidators.Borrow() } else { t = new(typeValidator) } @@ -45,10 +45,6 @@ func newTypeValidator(path, in string, typ spec.StringOrArray, nullable bool, fo return t } -func (t *typeValidator) SetPath(path string) { - t.Path = path -} - func (t *typeValidator) Applies(source any, _ reflect.Kind) bool { // typeValidator applies to Schema, Parameter and Header objects switch source.(type) { @@ -72,7 +68,7 @@ func (t *typeValidator) Validate(data any) *Result { if data == nil { // nil or zero value for the passed structure require Type: null if len(t.Type) > 0 && !t.Type.Contains(nullType) && !t.Nullable { // NOTE: if a property is not required it also passes this - return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), nullType), t.Options.recycleResult) + return errorHelp.sErrAt(t.Path, errors.InvalidType(t.Path.dotted(), t.In, strings.Join(t.Type, ","), nullType), t.Options.recycleResult) } return emptyResult @@ -98,7 +94,7 @@ func (t *typeValidator) Validate(data any) *Result { !isFloatInt && !isIntFloat && !isLowerInt && !isLowerFloat if formatMismatch { // NOTE: test case - return errorHelp.sErr(errors.InvalidType(t.Path, t.In, t.Format, format), t.Options.recycleResult) + return errorHelp.sErrAt(t.Path, errors.InvalidType(t.Path.dotted(), t.In, t.Format, format), t.Options.recycleResult) } if !t.Type.Contains(numberType) && !t.Type.Contains(integerType) && t.Format != "" && (kind == reflect.String || kind == reflect.Slice) { @@ -106,7 +102,7 @@ func (t *typeValidator) Validate(data any) *Result { } if !t.Type.Contains(schType) && !isFloatInt && !isIntFloat { - return errorHelp.sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), schType), t.Options.recycleResult) + return errorHelp.sErrAt(t.Path, errors.InvalidType(t.Path.dotted(), t.In, strings.Join(t.Type, ","), schType), t.Options.recycleResult) } return emptyResult @@ -201,6 +197,10 @@ func (t *typeValidator) schemaInfoForType(data any) (string, string) { return "", "" } +func (t *typeValidator) setPath(path pathSegments) { + t.Path = path +} + func (t *typeValidator) redeem() { - pools.poolOfTypeValidators.RedeemValidator(t) + validatorPools.typeValidators.Redeem(t) } diff --git a/vendor/github.com/go-openapi/validate/update-fixtures.sh b/vendor/github.com/go-openapi/validate/update-fixtures.sh deleted file mode 100644 index 8ee55ca3b24..00000000000 --- a/vendor/github.com/go-openapi/validate/update-fixtures.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers -# SPDX-License-Identifier: Apache-2.0 - -set -eu -o pipefail -dir=$(git rev-parse --show-toplevel) -scratch=$(mktemp -d -t tmp.XXXXXXXXXX) - -function finish { - rm -rf "$scratch" -} -trap finish EXIT SIGHUP SIGINT SIGTERM - -cd "$scratch" -git clone https://github.com/json-schema-org/JSON-Schema-Test-Suite Suite -cp -r Suite/tests/draft4/* "$dir/fixtures/jsonschema_suite" -cp -a Suite/remotes "$dir/fixtures/jsonschema_suite" diff --git a/vendor/github.com/go-openapi/validate/validator.go b/vendor/github.com/go-openapi/validate/validator.go index e7aebc52561..3989b21e7db 100644 --- a/vendor/github.com/go-openapi/validate/validator.go +++ b/vendor/github.com/go-openapi/validate/validator.go @@ -4,7 +4,6 @@ package validate import ( - "fmt" "reflect" "github.com/go-openapi/errors" @@ -18,7 +17,7 @@ type EntityValidator interface { } type valueValidator interface { - SetPath(path string) + setPath(path pathSegments) Applies(source any, kind reflect.Kind) bool Validate(data any) *Result } @@ -26,21 +25,21 @@ type valueValidator interface { type itemsValidator struct { items *spec.Items root any - path string + path pathSegments in string validators [6]valueValidator KnownFormats strfmt.Registry Options *SchemaValidatorOptions } -func newItemsValidator(path, in string, items *spec.Items, root any, formats strfmt.Registry, opts *SchemaValidatorOptions) *itemsValidator { +func newItemsValidator(path pathSegments, in string, items *spec.Items, root any, formats strfmt.Registry, opts *SchemaValidatorOptions) *itemsValidator { if opts == nil { opts = new(SchemaValidatorOptions) } var iv *itemsValidator if opts.recycleValidators { - iv = pools.poolOfItemsValidators.BorrowValidator() + iv = validatorPools.itemsValidators.Borrow() } else { iv = new(itemsValidator) } @@ -74,12 +73,12 @@ func (i *itemsValidator) Validate(index int, data any) *Result { kind := tpe.Kind() var result *Result if i.Options.recycleResult { - result = pools.poolOfResults.BorrowResult() + result = validatorPools.results.Borrow() } else { result = new(Result) } - path := fmt.Sprintf("%s.%d", i.path, index) + path := i.path.item(index) for idx, validator := range i.validators { if !validator.Applies(i.root, kind) { @@ -97,7 +96,7 @@ func (i *itemsValidator) Validate(index int, data any) *Result { continue } - validator.SetPath(path) + validator.setPath(path) err := validator.Validate(data) if i.Options.recycleValidators { i.validators[idx] = nil // prevents further (unsafe) usage @@ -130,7 +129,7 @@ func (i *itemsValidator) typeValidator() valueValidator { func (i *itemsValidator) commonValidator() valueValidator { return newBasicCommonValidator( - "", + nil, // located by the item index, set on each Validate call i.in, i.items.Default, i.items.Enum, @@ -140,7 +139,7 @@ func (i *itemsValidator) commonValidator() valueValidator { func (i *itemsValidator) sliceValidator() valueValidator { return newBasicSliceValidator( - "", + nil, // located by the item index, set on each Validate call i.in, i.items.Default, i.items.MaxItems, @@ -155,7 +154,7 @@ func (i *itemsValidator) sliceValidator() valueValidator { func (i *itemsValidator) numberValidator() valueValidator { return newNumberValidator( - "", + nil, // located by the item index, set on each Validate call i.in, i.items.Default, i.items.MultipleOf, @@ -171,7 +170,7 @@ func (i *itemsValidator) numberValidator() valueValidator { func (i *itemsValidator) stringValidator() valueValidator { return newStringValidator( - "", + nil, // located by the item index, set on each Validate call i.in, i.items.Default, false, // Required @@ -185,7 +184,7 @@ func (i *itemsValidator) stringValidator() valueValidator { func (i *itemsValidator) formatValidator() valueValidator { return newFormatValidator( - "", + nil, // located by the item index, set on each Validate call i.in, i.items.Format, i.KnownFormats, @@ -194,7 +193,7 @@ func (i *itemsValidator) formatValidator() valueValidator { } func (i *itemsValidator) redeem() { - pools.poolOfItemsValidators.RedeemValidator(i) + validatorPools.itemsValidators.Redeem(i) } func (i *itemsValidator) redeemChildren() { @@ -213,21 +212,21 @@ func (i *itemsValidator) redeemChildren() { } type basicCommonValidator struct { - Path string + Path pathSegments In string Default any Enum []any Options *SchemaValidatorOptions } -func newBasicCommonValidator(path, in string, def any, enum []any, opts *SchemaValidatorOptions) *basicCommonValidator { +func newBasicCommonValidator(path pathSegments, in string, def any, enum []any, opts *SchemaValidatorOptions) *basicCommonValidator { if opts == nil { opts = new(SchemaValidatorOptions) } var b *basicCommonValidator if opts.recycleValidators { - b = pools.poolOfBasicCommonValidators.BorrowValidator() + b = validatorPools.basicCommonValidators.Borrow() } else { b = new(basicCommonValidator) } @@ -241,10 +240,6 @@ func newBasicCommonValidator(path, in string, def any, enum []any, opts *SchemaV return b } -func (b *basicCommonValidator) SetPath(path string) { - b.Path = path -} - func (b *basicCommonValidator) Applies(source any, _ reflect.Kind) bool { switch source.(type) { case *spec.Parameter, *spec.Schema, *spec.Header: @@ -279,11 +274,15 @@ func (b *basicCommonValidator) Validate(data any) (res *Result) { } } - return errorHelp.sErr(errors.EnumFail(b.Path, b.In, data, b.Enum), b.Options.recycleResult) + return errorHelp.sErrAt(b.Path, errors.EnumFail(b.Path.dotted(), b.In, data, b.Enum), b.Options.recycleResult) +} + +func (b *basicCommonValidator) setPath(path pathSegments) { + b.Path = path } func (b *basicCommonValidator) redeem() { - pools.poolOfBasicCommonValidators.RedeemValidator(b) + validatorPools.basicCommonValidators.Redeem(b) } // A HeaderValidator has very limited subset of validations to apply. @@ -312,7 +311,7 @@ func newHeaderValidator(name string, header *spec.Header, formats strfmt.Registr var p *HeaderValidator if opts.recycleValidators { - p = pools.poolOfHeaderValidators.BorrowValidator() + p = validatorPools.headerValidators.Borrow() } else { p = new(HeaderValidator) } @@ -323,7 +322,7 @@ func newHeaderValidator(name string, header *spec.Header, formats strfmt.Registr p.Options = opts p.validators = [6]valueValidator{ newTypeValidator( - name, + newPathSegments(name), "header", spec.StringOrArray([]string{header.Type}), header.Nullable, @@ -355,7 +354,7 @@ func (p *HeaderValidator) Validate(data any) *Result { var result *Result if p.Options.recycleResult { - result = pools.poolOfResults.BorrowResult() + result = validatorPools.results.Borrow() } else { result = new(Result) } @@ -397,7 +396,7 @@ func (p *HeaderValidator) Validate(data any) *Result { func (p *HeaderValidator) commonValidator() valueValidator { return newBasicCommonValidator( - p.name, + newPathSegments(p.name), "response", p.header.Default, p.header.Enum, @@ -407,7 +406,7 @@ func (p *HeaderValidator) commonValidator() valueValidator { func (p *HeaderValidator) sliceValidator() valueValidator { return newBasicSliceValidator( - p.name, + newPathSegments(p.name), "response", p.header.Default, p.header.MaxItems, @@ -422,7 +421,7 @@ func (p *HeaderValidator) sliceValidator() valueValidator { func (p *HeaderValidator) numberValidator() valueValidator { return newNumberValidator( - p.name, + newPathSegments(p.name), "response", p.header.Default, p.header.MultipleOf, @@ -438,7 +437,7 @@ func (p *HeaderValidator) numberValidator() valueValidator { func (p *HeaderValidator) stringValidator() valueValidator { return newStringValidator( - p.name, + newPathSegments(p.name), "response", p.header.Default, true, @@ -452,7 +451,7 @@ func (p *HeaderValidator) stringValidator() valueValidator { func (p *HeaderValidator) formatValidator() valueValidator { return newFormatValidator( - p.name, + newPathSegments(p.name), "response", p.header.Format, p.KnownFormats, @@ -461,7 +460,7 @@ func (p *HeaderValidator) formatValidator() valueValidator { } func (p *HeaderValidator) redeem() { - pools.poolOfHeaderValidators.RedeemValidator(p) + validatorPools.headerValidators.Redeem(p) } func (p *HeaderValidator) redeemChildren() { @@ -504,7 +503,7 @@ func newParamValidator(param *spec.Parameter, formats strfmt.Registry, opts *Sch var p *ParamValidator if opts.recycleValidators { - p = pools.poolOfParamValidators.BorrowValidator() + p = validatorPools.paramValidators.Borrow() } else { p = new(ParamValidator) } @@ -514,7 +513,7 @@ func newParamValidator(param *spec.Parameter, formats strfmt.Registry, opts *Sch p.Options = opts p.validators = [6]valueValidator{ newTypeValidator( - param.Name, + newPathSegments(param.Name), param.In, spec.StringOrArray([]string{param.Type}), param.Nullable, @@ -539,7 +538,7 @@ func (p *ParamValidator) Validate(data any) *Result { var result *Result if p.Options.recycleResult { - result = pools.poolOfResults.BorrowResult() + result = validatorPools.results.Borrow() } else { result = new(Result) } @@ -589,7 +588,7 @@ func (p *ParamValidator) Validate(data any) *Result { func (p *ParamValidator) commonValidator() valueValidator { return newBasicCommonValidator( - p.param.Name, + newPathSegments(p.param.Name), p.param.In, p.param.Default, p.param.Enum, @@ -599,7 +598,7 @@ func (p *ParamValidator) commonValidator() valueValidator { func (p *ParamValidator) sliceValidator() valueValidator { return newBasicSliceValidator( - p.param.Name, + newPathSegments(p.param.Name), p.param.In, p.param.Default, p.param.MaxItems, @@ -614,7 +613,7 @@ func (p *ParamValidator) sliceValidator() valueValidator { func (p *ParamValidator) numberValidator() valueValidator { return newNumberValidator( - p.param.Name, + newPathSegments(p.param.Name), p.param.In, p.param.Default, p.param.MultipleOf, @@ -630,7 +629,7 @@ func (p *ParamValidator) numberValidator() valueValidator { func (p *ParamValidator) stringValidator() valueValidator { return newStringValidator( - p.param.Name, + newPathSegments(p.param.Name), p.param.In, p.param.Default, p.param.Required, @@ -644,7 +643,7 @@ func (p *ParamValidator) stringValidator() valueValidator { func (p *ParamValidator) formatValidator() valueValidator { return newFormatValidator( - p.param.Name, + newPathSegments(p.param.Name), p.param.In, p.param.Format, p.KnownFormats, @@ -653,7 +652,7 @@ func (p *ParamValidator) formatValidator() valueValidator { } func (p *ParamValidator) redeem() { - pools.poolOfParamValidators.RedeemValidator(p) + validatorPools.paramValidators.Redeem(p) } func (p *ParamValidator) redeemChildren() { @@ -672,7 +671,7 @@ func (p *ParamValidator) redeemChildren() { } type basicSliceValidator struct { - Path string + Path pathSegments In string Default any MaxItems *int64 @@ -685,7 +684,7 @@ type basicSliceValidator struct { } func newBasicSliceValidator( - path, in string, + path pathSegments, in string, def any, maxItems, minItems *int64, uniqueItems bool, items *spec.Items, source any, formats strfmt.Registry, opts *SchemaValidatorOptions, @@ -696,7 +695,7 @@ func newBasicSliceValidator( var s *basicSliceValidator if opts.recycleValidators { - s = pools.poolOfBasicSliceValidators.BorrowValidator() + s = validatorPools.basicSliceValidators.Borrow() } else { s = new(basicSliceValidator) } @@ -715,10 +714,6 @@ func newBasicSliceValidator( return s } -func (s *basicSliceValidator) SetPath(path string) { - s.Path = path -} - func (s *basicSliceValidator) Applies(source any, kind reflect.Kind) bool { switch source.(type) { case *spec.Parameter, *spec.Items, *spec.Header: @@ -738,20 +733,20 @@ func (s *basicSliceValidator) Validate(data any) *Result { size := int64(val.Len()) if s.MinItems != nil { - if err := MinItems(s.Path, s.In, size, *s.MinItems); err != nil { - return errorHelp.sErr(err, s.Options.recycleResult) + if err := MinItems(s.Path.dotted(), s.In, size, *s.MinItems); err != nil { + return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult) } } if s.MaxItems != nil { - if err := MaxItems(s.Path, s.In, size, *s.MaxItems); err != nil { - return errorHelp.sErr(err, s.Options.recycleResult) + if err := MaxItems(s.Path.dotted(), s.In, size, *s.MaxItems); err != nil { + return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult) } } if s.UniqueItems { - if err := UniqueItems(s.Path, s.In, data); err != nil { - return errorHelp.sErr(err, s.Options.recycleResult) + if err := UniqueItems(s.Path.dotted(), s.In, data); err != nil { + return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult) } } @@ -767,7 +762,7 @@ func (s *basicSliceValidator) Validate(data any) *Result { return err } if err.wantsRedeemOnMerge { - pools.poolOfResults.RedeemResult(err) + redeemResult(err) } } } @@ -775,12 +770,16 @@ func (s *basicSliceValidator) Validate(data any) *Result { return nil } +func (s *basicSliceValidator) setPath(path pathSegments) { + s.Path = path +} + func (s *basicSliceValidator) redeem() { - pools.poolOfBasicSliceValidators.RedeemValidator(s) + validatorPools.basicSliceValidators.Redeem(s) } type numberValidator struct { - Path string + Path pathSegments In string Default any MultipleOf *float64 @@ -795,7 +794,7 @@ type numberValidator struct { } func newNumberValidator( - path, in string, def any, + path pathSegments, in string, def any, multipleOf, maximum *float64, exclusiveMaximum bool, minimum *float64, exclusiveMinimum bool, typ, format string, opts *SchemaValidatorOptions, @@ -806,7 +805,7 @@ func newNumberValidator( var n *numberValidator if opts.recycleValidators { - n = pools.poolOfNumberValidators.BorrowValidator() + n = validatorPools.numberValidators.Borrow() } else { n = new(numberValidator) } @@ -826,10 +825,6 @@ func newNumberValidator( return n } -func (n *numberValidator) SetPath(path string) { - n.Path = path -} - func (n *numberValidator) Applies(source any, kind reflect.Kind) bool { switch source.(type) { case *spec.Parameter, *spec.Schema, *spec.Items, *spec.Header: @@ -871,7 +866,7 @@ func (n *numberValidator) Validate(val any) *Result { var res, resMultiple, resMinimum, resMaximum *Result if n.Options.recycleResult { - res = pools.poolOfResults.BorrowResult() + res = validatorPools.results.Borrow() } else { res = new(Result) } @@ -881,58 +876,58 @@ func (n *numberValidator) Validate(val any) *Result { data := valueHelp.asFloat64(val) // Is the provided value within the range of the specified numeric type and format? - res.AddErrors(IsValueValidAgainstRange(val, n.Type, n.Format, "Checked", n.Path)) + res.addErrorsAt(n.Path, IsValueValidAgainstRange(val, n.Type, n.Format, "Checked", n.Path.dotted())) if n.MultipleOf != nil { - resMultiple = pools.poolOfResults.BorrowResult() + resMultiple = validatorPools.results.Borrow() // Is the constraint specifier within the range of the specific numeric type and format? - resMultiple.AddErrors(IsValueValidAgainstRange(*n.MultipleOf, n.Type, n.Format, "MultipleOf", n.Path)) + resMultiple.addErrorsAt(n.Path, IsValueValidAgainstRange(*n.MultipleOf, n.Type, n.Format, "MultipleOf", n.Path.dotted())) if resMultiple.IsValid() { // Constraint validated with compatible types - if err := MultipleOfNativeType(n.Path, n.In, val, *n.MultipleOf); err != nil { - resMultiple.Merge(errorHelp.sErr(err, n.Options.recycleResult)) + if err := MultipleOfNativeType(n.Path.dotted(), n.In, val, *n.MultipleOf); err != nil { + resMultiple.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult)) } } else { // Constraint nevertheless validated, converted as general number - if err := MultipleOf(n.Path, n.In, data, *n.MultipleOf); err != nil { - resMultiple.Merge(errorHelp.sErr(err, n.Options.recycleResult)) + if err := MultipleOf(n.Path.dotted(), n.In, data, *n.MultipleOf); err != nil { + resMultiple.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult)) } } } if n.Maximum != nil { - resMaximum = pools.poolOfResults.BorrowResult() + resMaximum = validatorPools.results.Borrow() // Is the constraint specifier within the range of the specific numeric type and format? - resMaximum.AddErrors(IsValueValidAgainstRange(*n.Maximum, n.Type, n.Format, "Maximum boundary", n.Path)) + resMaximum.addErrorsAt(n.Path, IsValueValidAgainstRange(*n.Maximum, n.Type, n.Format, "Maximum boundary", n.Path.dotted())) if resMaximum.IsValid() { // Constraint validated with compatible types - if err := MaximumNativeType(n.Path, n.In, val, *n.Maximum, n.ExclusiveMaximum); err != nil { - resMaximum.Merge(errorHelp.sErr(err, n.Options.recycleResult)) + if err := MaximumNativeType(n.Path.dotted(), n.In, val, *n.Maximum, n.ExclusiveMaximum); err != nil { + resMaximum.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult)) } } else { // Constraint nevertheless validated, converted as general number - if err := Maximum(n.Path, n.In, data, *n.Maximum, n.ExclusiveMaximum); err != nil { - resMaximum.Merge(errorHelp.sErr(err, n.Options.recycleResult)) + if err := Maximum(n.Path.dotted(), n.In, data, *n.Maximum, n.ExclusiveMaximum); err != nil { + resMaximum.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult)) } } } if n.Minimum != nil { - resMinimum = pools.poolOfResults.BorrowResult() + resMinimum = validatorPools.results.Borrow() // Is the constraint specifier within the range of the specific numeric type and format? - resMinimum.AddErrors(IsValueValidAgainstRange(*n.Minimum, n.Type, n.Format, "Minimum boundary", n.Path)) + resMinimum.addErrorsAt(n.Path, IsValueValidAgainstRange(*n.Minimum, n.Type, n.Format, "Minimum boundary", n.Path.dotted())) if resMinimum.IsValid() { // Constraint validated with compatible types - if err := MinimumNativeType(n.Path, n.In, val, *n.Minimum, n.ExclusiveMinimum); err != nil { - resMinimum.Merge(errorHelp.sErr(err, n.Options.recycleResult)) + if err := MinimumNativeType(n.Path.dotted(), n.In, val, *n.Minimum, n.ExclusiveMinimum); err != nil { + resMinimum.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult)) } } else { // Constraint nevertheless validated, converted as general number - if err := Minimum(n.Path, n.In, data, *n.Minimum, n.ExclusiveMinimum); err != nil { - resMinimum.Merge(errorHelp.sErr(err, n.Options.recycleResult)) + if err := Minimum(n.Path.dotted(), n.In, data, *n.Minimum, n.ExclusiveMinimum); err != nil { + resMinimum.Merge(errorHelp.sErrAt(n.Path, err, n.Options.recycleResult)) } } } @@ -942,12 +937,16 @@ func (n *numberValidator) Validate(val any) *Result { return res } +func (n *numberValidator) setPath(path pathSegments) { + n.Path = path +} + func (n *numberValidator) redeem() { - pools.poolOfNumberValidators.RedeemValidator(n) + validatorPools.numberValidators.Redeem(n) } type stringValidator struct { - Path string + Path pathSegments In string Default any Required bool @@ -959,7 +958,7 @@ type stringValidator struct { } func newStringValidator( - path, in string, + path pathSegments, in string, def any, required, allowEmpty bool, maxLength, minLength *int64, pattern string, opts *SchemaValidatorOptions, ) *stringValidator { @@ -969,7 +968,7 @@ func newStringValidator( var s *stringValidator if opts.recycleValidators { - s = pools.poolOfStringValidators.BorrowValidator() + s = validatorPools.stringValidators.Borrow() } else { s = new(stringValidator) } @@ -987,10 +986,6 @@ func newStringValidator( return s } -func (s *stringValidator) SetPath(path string) { - s.Path = path -} - func (s *stringValidator) Applies(source any, kind reflect.Kind) bool { switch source.(type) { case *spec.Parameter, *spec.Schema, *spec.Items, *spec.Header: @@ -1009,35 +1004,39 @@ func (s *stringValidator) Validate(val any) *Result { data, ok := val.(string) if !ok { - return errorHelp.sErr(errors.InvalidType(s.Path, s.In, stringType, val), s.Options.recycleResult) + return errorHelp.sErrAt(s.Path, errors.InvalidType(s.Path.dotted(), s.In, stringType, val), s.Options.recycleResult) } if s.Required && !s.AllowEmptyValue && (s.Default == nil || s.Default == "") { - if err := RequiredString(s.Path, s.In, data); err != nil { - return errorHelp.sErr(err, s.Options.recycleResult) + if err := RequiredString(s.Path.dotted(), s.In, data); err != nil { + return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult) } } if s.MaxLength != nil { - if err := MaxLength(s.Path, s.In, data, *s.MaxLength); err != nil { - return errorHelp.sErr(err, s.Options.recycleResult) + if err := MaxLength(s.Path.dotted(), s.In, data, *s.MaxLength); err != nil { + return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult) } } if s.MinLength != nil { - if err := MinLength(s.Path, s.In, data, *s.MinLength); err != nil { - return errorHelp.sErr(err, s.Options.recycleResult) + if err := MinLength(s.Path.dotted(), s.In, data, *s.MinLength); err != nil { + return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult) } } if s.Pattern != "" { - if err := Pattern(s.Path, s.In, data, s.Pattern); err != nil { - return errorHelp.sErr(err, s.Options.recycleResult) + if err := Pattern(s.Path.dotted(), s.In, data, s.Pattern); err != nil { + return errorHelp.sErrAt(s.Path, err, s.Options.recycleResult) } } return nil } +func (s *stringValidator) setPath(path pathSegments) { + s.Path = path +} + func (s *stringValidator) redeem() { - pools.poolOfStringValidators.RedeemValidator(s) + validatorPools.stringValidators.Redeem(s) } diff --git a/vendor/github.com/google/go-tpm/tpm2/structures.go b/vendor/github.com/google/go-tpm/tpm2/structures.go index b173ed29b11..8991159ffd4 100644 --- a/vendor/github.com/google/go-tpm/tpm2/structures.go +++ b/vendor/github.com/google/go-tpm/tpm2/structures.go @@ -3328,4 +3328,6 @@ type TPMSContext struct { ContextBlob TPM2BContextData } -type tpm2bCreationData = TPM2B[TPMSCreationData, *TPMSCreationData] +// TPM2BCreationData represents a TPM2B_CREATION_DATA +// See definition in Part 2: Structures, section 15.2. +type TPM2BCreationData = TPM2B[TPMSCreationData, *TPMSCreationData] diff --git a/vendor/github.com/google/go-tpm/tpm2/tpm2.go b/vendor/github.com/google/go-tpm/tpm2/tpm2.go index 0dbebafde3b..8762b4b46de 100644 --- a/vendor/github.com/google/go-tpm/tpm2/tpm2.go +++ b/vendor/github.com/google/go-tpm/tpm2/tpm2.go @@ -229,7 +229,7 @@ type CreateResponse struct { // the public portion of the created object OutPublic TPM2BPublic // contains a TPMS_CREATION_DATA - CreationData tpm2bCreationData + CreationData TPM2BCreationData // digest of creationData using nameAlg of outPublic CreationHash TPM2BDigest // ticket used by TPM2_CertifyCreation() to validate that the @@ -1632,7 +1632,7 @@ type CreatePrimaryResponse struct { // the public portion of the created object OutPublic TPM2BPublic // contains a TPMS_CREATION_DATA - CreationData tpm2bCreationData + CreationData TPM2BCreationData // digest of creationData using nameAlg of outPublic CreationHash TPM2BDigest // ticket used by TPM2_CertifyCreation() to validate that the diff --git a/vendor/github.com/google/jsonschema-go/jsonschema/infer.go b/vendor/github.com/google/jsonschema-go/jsonschema/infer.go index 9c195f579f0..1b3d975df0b 100644 --- a/vendor/github.com/google/jsonschema-go/jsonschema/infer.go +++ b/vendor/github.com/google/jsonschema-go/jsonschema/infer.go @@ -7,6 +7,7 @@ package jsonschema import ( + "encoding" "fmt" "log/slog" "maps" @@ -199,14 +200,12 @@ func forType(t reflect.Type, seen map[reflect.Type]bool, ignore bool, schemas ma // Unrestricted case reflect.Map: - if t.Key().Kind() != reflect.String { + if t.Key().Kind() != reflect.String && !t.Key().Implements(reflect.TypeFor[encoding.TextMarshaler]()) { if ignore { return nil, nil // ignore } return nil, fmt.Errorf("unsupported map key type %v", t.Key().Kind()) } - if t.Key().Kind() != reflect.String { - } s.Type = "object" s.AdditionalProperties, err = forType(t.Elem(), seen, ignore, schemas) if err != nil { diff --git a/vendor/github.com/google/jsonschema-go/jsonschema/validate.go b/vendor/github.com/google/jsonschema-go/jsonschema/validate.go index bbef5906c9c..03fe4093641 100644 --- a/vendor/github.com/google/jsonschema-go/jsonschema/validate.go +++ b/vendor/github.com/google/jsonschema-go/jsonschema/validate.go @@ -262,14 +262,15 @@ func (st *state) validate(instance reflect.Value, schema *Schema, callerAnns *an } if schema.AnyOf != nil { // We must visit them all, to collect annotations. - ok := false + var errs []error for _, ss := range schema.AnyOf { - if valid(ss, &anns) { - ok = true + if err := st.validate(instance, ss, &anns); err != nil { + errs = append(errs, err) } } - if !ok { - return fmt.Errorf("anyOf: did not validate against any of %v", schema.AnyOf) + if len(errs) == len(schema.AnyOf) { + return fmt.Errorf("anyOf: did not validate against any of %v:\n%v", + schema.AnyOf, errors.Join(errs...)) } } if schema.OneOf != nil { diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/block.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/block.go index edfa1d54beb..9ef997e43df 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/block.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/block.go @@ -2,7 +2,6 @@ package godeltaprof import ( "io" - "runtime" "sort" "sync" @@ -27,7 +26,7 @@ import ( type BlockProfiler struct { impl pprof.DeltaMutexProfiler mutex sync.Mutex - runtimeProfile func([]runtime.BlockProfileRecord) (int, bool) + runtimeProfile func() []pprof.BlockProfileRecord scaleProfile pprof.MutexProfileScaler options pprof.ProfileBuilderOptions gz gz @@ -43,7 +42,7 @@ type BlockProfiler struct { // err := mp.Profile(someWriter) func NewMutexProfiler() *BlockProfiler { return &BlockProfiler{ - runtimeProfile: runtime.MutexProfile, + runtimeProfile: pprof.MutexProfile, scaleProfile: pprof.ScalerMutexProfile, impl: pprof.DeltaMutexProfiler{}, options: pprof.ProfileBuilderOptions{ @@ -55,7 +54,7 @@ func NewMutexProfiler() *BlockProfiler { func NewMutexProfilerWithOptions(options ProfileOptions) *BlockProfiler { return &BlockProfiler{ - runtimeProfile: runtime.MutexProfile, + runtimeProfile: pprof.MutexProfile, scaleProfile: pprof.ScalerMutexProfile, impl: pprof.DeltaMutexProfiler{}, options: pprof.ProfileBuilderOptions{ @@ -75,7 +74,7 @@ func NewMutexProfilerWithOptions(options ProfileOptions) *BlockProfiler { // err := bp.Profile(someWriter) func NewBlockProfiler() *BlockProfiler { return &BlockProfiler{ - runtimeProfile: runtime.BlockProfile, + runtimeProfile: pprof.BlockProfile, scaleProfile: pprof.ScalerBlockProfile, impl: pprof.DeltaMutexProfiler{}, options: pprof.ProfileBuilderOptions{ @@ -87,7 +86,7 @@ func NewBlockProfiler() *BlockProfiler { func NewBlockProfilerWithOptions(options ProfileOptions) *BlockProfiler { return &BlockProfiler{ - runtimeProfile: runtime.BlockProfile, + runtimeProfile: pprof.BlockProfile, scaleProfile: pprof.ScalerBlockProfile, impl: pprof.DeltaMutexProfiler{}, options: pprof.ProfileBuilderOptions{ @@ -101,18 +100,7 @@ func (d *BlockProfiler) Profile(w io.Writer) error { d.mutex.Lock() defer d.mutex.Unlock() - var p []runtime.BlockProfileRecord - var ok bool - n, _ := d.runtimeProfile(nil) - for { - p = make([]runtime.BlockProfileRecord, n+50) - n, ok = d.runtimeProfile(p) - if ok { - p = p[:n] - - break - } - } + p := d.runtimeProfile() sort.Slice(p, func(i, j int) bool { return p[i].Cycles > p[j].Cycles }) diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/heap.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/heap.go index 07f2fce16da..7375fc8cb89 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/heap.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/heap.go @@ -57,28 +57,7 @@ func (d *HeapProfiler) Profile(w io.Writer) error { d.mutex.Lock() defer d.mutex.Unlock() - // Find out how many records there are (MemProfile(nil, true)), - // allocate that many records, and get the data. - // There's a race—more records might be added between - // the two calls—so allocate a few extra records for safety - // and also try again if we're very unlucky. - // The loop should only execute one iteration in the common case. - var p []runtime.MemProfileRecord - var ok bool - n, _ := runtime.MemProfile(nil, true) - for { - // Allocate room for a slightly bigger profile, - // in case a few more entries have been added - // since the call to MemProfile. - p = make([]runtime.MemProfileRecord, n+50) - n, ok = runtime.MemProfile(p, true) - if ok { - p = p[0:n] - - break - } - // Profile grew; try again. - } + p := pprof.MemProfile(true) rate := int64(runtime.MemProfileRate) zw := d.gz.get(w) diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/http/pprof/pprof_go21.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/http/pprof/pprof_go21.go deleted file mode 100644 index dff3250e4d7..00000000000 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/http/pprof/pprof_go21.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build !go1.22 - -package pprof - -func routePrefix() string { - return "" -} diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/http/pprof/pprof_go22.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/http/pprof/pprof_go22.go index 069ec98eecd..fd71c66918d 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/http/pprof/pprof_go22.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/http/pprof/pprof_go22.go @@ -1,5 +1,3 @@ -//go:build go1.22 - package pprof func routePrefix() string { diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_heap.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_heap.go index 0bba813a18b..5b27b704022 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_heap.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_heap.go @@ -23,36 +23,30 @@ type DeltaHeapProfiler struct { // WriteHeapProto writes the current heap profile in protobuf format to w. // //nolint:gocognit -func (d *DeltaHeapProfiler) WriteHeapProto(b ProfileBuilder, p []runtime.MemProfileRecord, rate int64) error { +func (d *DeltaHeapProfiler) WriteHeapProto(b ProfileBuilder, p []MemProfileRecord, rate int64) error { values := []int64{0, 0, 0, 0} var locs []uint64 // deduplicate: accumulate allocObjects and inuseObjects in entry.acc for equal stacks for i := range p { r := &p[i] - if r.AllocBytes == 0 && r.AllocObjects == 0 && r.FreeObjects == 0 && r.FreeBytes == 0 { + if memRecordIsFresh(r) { // it is a fresh bucket and it will be published after next 1-2 gc cycles continue } - var blockSize int64 - if r.AllocObjects > 0 { - blockSize = r.AllocBytes / r.AllocObjects - } - entry := d.m.Lookup(r.Stack(), uintptr(blockSize)) + blockSize := memRecordBlockSize(r) + entry := d.m.Lookup(memRecordStack(r), uintptr(blockSize)) entry.acc.allocObjects += r.AllocObjects entry.acc.inuseObjects += r.InUseObjects() } // do the delta using the accumulated values and previous values for i := range p { r := &p[i] - if r.AllocBytes == 0 && r.AllocObjects == 0 && r.FreeObjects == 0 && r.FreeBytes == 0 { + if memRecordIsFresh(r) { // it is a fresh bucket and it will be published after next 1-2 gc cycles continue } - var blockSize int64 - if r.AllocObjects > 0 { - blockSize = r.AllocBytes / r.AllocObjects - } - entry := d.m.Lookup(r.Stack(), uintptr(blockSize)) + blockSize := memRecordBlockSize(r) + entry := d.m.Lookup(memRecordStack(r), uintptr(blockSize)) if entry.acc == (heapAccValue{}) { continue } @@ -80,8 +74,8 @@ func (d *DeltaHeapProfiler) WriteHeapProto(b ProfileBuilder, p []runtime.MemProf } hideRuntime := true - for tries := 0; tries < 2; tries++ { - stk := r.Stack() + for range 2 { + stk := memRecordStack(r) // For heap profiles, all stack // addresses are return PCs, which is // what appendLocsForStack expects. diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_mutex.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_mutex.go index cf91722f2a5..306a4a44b4b 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_mutex.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/delta_mutex.go @@ -1,9 +1,5 @@ package pprof -import ( - "runtime" -) - type mutexPrevValue struct { count int64 inanosec int64 @@ -24,7 +20,7 @@ type DeltaMutexProfiler struct { // and the number of cycles for block, contention profiles. // Possible 'scaler' functions are scaleBlockProfile and scaleMutexProfile. func (d *DeltaMutexProfiler) PrintCountCycleProfile(b ProfileBuilder, scaler MutexProfileScaler, - records []runtime.BlockProfileRecord) error { + records []BlockProfileRecord) error { cpuGHz := float64(runtime_cyclesPerSecond()) / 1e9 values := []int64{0, 0} @@ -32,7 +28,7 @@ func (d *DeltaMutexProfiler) PrintCountCycleProfile(b ProfileBuilder, scaler Mut // deduplicate: accumulate count and cycles in entry.acc for equal stacks for i := range records { r := &records[i] - entry := d.m.Lookup(r.Stack(), 0) + entry := d.m.Lookup(blockRecordStack(r), 0) entry.acc.count += r.Count // accumulate unscaled entry.acc.cycles += r.Cycles } @@ -40,7 +36,7 @@ func (d *DeltaMutexProfiler) PrintCountCycleProfile(b ProfileBuilder, scaler Mut // do the delta using the accumulated values and previous values for i := range records { r := &records[i] - stk := r.Stack() + stk := blockRecordStack(r) entry := d.m.Lookup(stk, 0) accCount := entry.acc.count accCycles := entry.acc.cycles diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/elf.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/elf.go index 9840030e8b5..afad15a551a 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/elf.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/elf.go @@ -70,7 +70,7 @@ func elfBuildID(file string) (string, error) { shnum = int(byteOrder.Uint16(buf[60:])) } - for i := 0; i < shnum; i++ { + for i := range shnum { if _, err := f.ReadAt(buf[:shentsize], shoff+int64(i)*shentsize); err != nil { return "", err } diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/mutex_scale_go19.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/mutex_scale_go19.go deleted file mode 100644 index 349a9dad0ad..00000000000 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/mutex_scale_go19.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build go1.16 && !go1.20 -// +build go1.16,!go1.20 - -package pprof - -import "runtime" - -type MutexProfileScaler struct { - f func(cnt int64, ns float64) (int64, float64) -} - -func ScaleMutexProfile(scaler MutexProfileScaler, cnt int64, ns float64) (int64, float64) { - return scaler.f(cnt, ns) -} - -var ScalerMutexProfile = MutexProfileScaler{func(cnt int64, ns float64) (int64, float64) { - period := runtime.SetMutexProfileFraction(-1) - return cnt * int64(period), ns * float64(period) -}} - -var ScalerBlockProfile = MutexProfileScaler{func(cnt int64, ns float64) (int64, float64) { - // Do nothing. - // The current way of block profile sampling makes it - // hard to compute the unsampled number. The legacy block - // profile parse doesn't attempt to scale or unsample. - return cnt, ns -}} diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/mutex_scale_go20.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/mutex_scale_go20.go index 5741ba1ce8a..f52c801e8b8 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/mutex_scale_go20.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/mutex_scale_go20.go @@ -1,6 +1,3 @@ -//go:build go1.20 -// +build go1.20 - package pprof type MutexProfileScaler struct { diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/proto.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/proto.go index 8fdea5a93bc..ca20d45a28b 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/proto.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/proto.go @@ -17,9 +17,8 @@ import ( ) type ProfileBuilderOptions struct { - // for go1.21+ if true - use runtime_FrameSymbolName - produces frames with generic types, for example [go.shape.int] - // for go1.21+ if false - use runtime.Frame->Function - produces frames with generic types omitted [...] - // pre 1.21 - always use runtime.Frame->Function - produces frames with generic types omitted [...] + // if true - use runtime_FrameSymbolName - produces frames with generic types, for example [go.shape.int] + // if false - use runtime.Frame->Function - produces frames with generic types omitted [...] GenericsFrames bool LazyMapping bool mem []memMap diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/runtime_profile_go123.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/runtime_profile_go123.go new file mode 100644 index 00000000000..8f59420aa45 --- /dev/null +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/runtime_profile_go123.go @@ -0,0 +1,77 @@ +//go:build !go1.27 +// +build !go1.27 + +package pprof + +import _ "unsafe" + +// MemProfileRecord mirrors internal/profilerecord.MemProfileRecord layout +// for Go 1.23 through 1.26. The runtime writes into these via //go:linkname +// to pprof_memProfileInternal, so the field layout MUST match the runtime's +// definition exactly. +type MemProfileRecord struct { + AllocBytes, FreeBytes int64 + AllocObjects, FreeObjects int64 + Stack []uintptr +} + +func (r *MemProfileRecord) InUseObjects() int64 { return r.AllocObjects - r.FreeObjects } + +type BlockProfileRecord struct { + Count int64 + Cycles int64 + Stack []uintptr +} + +func memRecordStack(r *MemProfileRecord) []uintptr { return r.Stack } +func blockRecordStack(r *BlockProfileRecord) []uintptr { return r.Stack } + +func memRecordIsFresh(r *MemProfileRecord) bool { + return r.AllocBytes == 0 && r.AllocObjects == 0 && r.FreeObjects == 0 && r.FreeBytes == 0 +} + +func memRecordBlockSize(r *MemProfileRecord) int64 { + if r.AllocObjects > 0 { + return r.AllocBytes / r.AllocObjects + } + + return 0 +} + +//go:linkname pprof_memProfileInternal runtime.pprof_memProfileInternal +func pprof_memProfileInternal(p []MemProfileRecord, inuseZero bool) (n int, ok bool) + +//go:linkname pprof_blockProfileInternal runtime.pprof_blockProfileInternal +func pprof_blockProfileInternal(p []BlockProfileRecord) (n int, ok bool) + +//go:linkname pprof_mutexProfileInternal runtime.pprof_mutexProfileInternal +func pprof_mutexProfileInternal(p []BlockProfileRecord) (n int, ok bool) + +func MemProfile(inuseZero bool) []MemProfileRecord { + var p []MemProfileRecord + n, _ := pprof_memProfileInternal(nil, inuseZero) + for { + p = make([]MemProfileRecord, n+50) + var ok bool + n, ok = pprof_memProfileInternal(p, inuseZero) + if ok { + return p[:n] + } + } +} + +func BlockProfile() []BlockProfileRecord { return fetchBlockLike(pprof_blockProfileInternal) } +func MutexProfile() []BlockProfileRecord { return fetchBlockLike(pprof_mutexProfileInternal) } + +func fetchBlockLike(f func([]BlockProfileRecord) (int, bool)) []BlockProfileRecord { + var p []BlockProfileRecord + n, _ := f(nil) + for { + p = make([]BlockProfileRecord, n+50) + var ok bool + n, ok = f(p) + if ok { + return p[:n] + } + } +} diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/runtime_profile_go127.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/runtime_profile_go127.go new file mode 100644 index 00000000000..30b583d1133 --- /dev/null +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/runtime_profile_go127.go @@ -0,0 +1,72 @@ +//go:build go1.27 +// +build go1.27 + +package pprof + +import _ "unsafe" + +// MemProfileRecord mirrors internal/profilerecord.MemProfileRecord layout +// for Go 1.27+. The runtime CL "remove redundant fields from memory profile +// records" replaced AllocBytes/FreeBytes with a single ObjectSize. +// The runtime writes into these via //go:linkname to pprof_memProfileInternal, +// so the field layout MUST match the runtime's definition exactly. +type MemProfileRecord struct { + ObjectSize int64 + AllocObjects, FreeObjects int64 + Stack []uintptr +} + +func (r *MemProfileRecord) InUseObjects() int64 { return r.AllocObjects - r.FreeObjects } + +type BlockProfileRecord struct { + Count int64 + Cycles int64 + Stack []uintptr +} + +func memRecordStack(r *MemProfileRecord) []uintptr { return r.Stack } +func blockRecordStack(r *BlockProfileRecord) []uintptr { return r.Stack } + +func memRecordIsFresh(r *MemProfileRecord) bool { + return r.AllocObjects == 0 && r.FreeObjects == 0 +} + +func memRecordBlockSize(r *MemProfileRecord) int64 { return r.ObjectSize } + +//go:linkname pprof_memProfileInternal runtime.pprof_memProfileInternal +func pprof_memProfileInternal(p []MemProfileRecord, inuseZero bool) (n int, ok bool) + +//go:linkname pprof_blockProfileInternal runtime.pprof_blockProfileInternal +func pprof_blockProfileInternal(p []BlockProfileRecord) (n int, ok bool) + +//go:linkname pprof_mutexProfileInternal runtime.pprof_mutexProfileInternal +func pprof_mutexProfileInternal(p []BlockProfileRecord) (n int, ok bool) + +func MemProfile(inuseZero bool) []MemProfileRecord { + var p []MemProfileRecord + n, _ := pprof_memProfileInternal(nil, inuseZero) + for { + p = make([]MemProfileRecord, n+50) + var ok bool + n, ok = pprof_memProfileInternal(p, inuseZero) + if ok { + return p[:n] + } + } +} + +func BlockProfile() []BlockProfileRecord { return fetchBlockLike(pprof_blockProfileInternal) } +func MutexProfile() []BlockProfileRecord { return fetchBlockLike(pprof_mutexProfileInternal) } + +func fetchBlockLike(f func([]BlockProfileRecord) (int, bool)) []BlockProfileRecord { + var p []BlockProfileRecord + n, _ := f(nil) + for { + p = make([]BlockProfileRecord, n+50) + var ok bool + n, ok = f(p) + if ok { + return p[:n] + } + } +} diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go20.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go20.go deleted file mode 100644 index 7a32846722d..00000000000 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go20.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build go1.16 && !go1.21 -// +build go1.16,!go1.21 - -package pprof - -import ( - "runtime" - _ "unsafe" -) - -// runtime_FrameStartLine is defined in runtime/symtab.go. -func runtime_FrameStartLine(f *runtime.Frame) int { - return 0 -} - -// runtime_FrameSymbolName is defined in runtime/symtab.go. -func runtime_FrameSymbolName(f *runtime.Frame) string { - return f.Function -} - -//go:linkname runtime_expandFinalInlineFrame runtime/pprof.runtime_expandFinalInlineFrame -func runtime_expandFinalInlineFrame(stk []uintptr) []uintptr - -//go:linkname runtime_cyclesPerSecond runtime/pprof.runtime_cyclesPerSecond -func runtime_cyclesPerSecond() int64 diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go22.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go22.go deleted file mode 100644 index 02c726faa33..00000000000 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go22.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build go1.21 && !go1.23 -// +build go1.21,!go1.23 - -package pprof - -import ( - "runtime" - _ "unsafe" -) - -// runtime_FrameStartLine is defined in runtime/symtab.go. -// -//go:noescape -//go:linkname runtime_FrameStartLine runtime/pprof.runtime_FrameStartLine -func runtime_FrameStartLine(f *runtime.Frame) int - -// runtime_FrameSymbolName is defined in runtime/symtab.go. -// -//go:noescape -//go:linkname runtime_FrameSymbolName runtime/pprof.runtime_FrameSymbolName -func runtime_FrameSymbolName(f *runtime.Frame) string - -//go:linkname runtime_expandFinalInlineFrame runtime/pprof.runtime_expandFinalInlineFrame -func runtime_expandFinalInlineFrame(stk []uintptr) []uintptr - -//go:linkname runtime_cyclesPerSecond runtime/pprof.runtime_cyclesPerSecond -func runtime_cyclesPerSecond() int64 diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go23.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go23.go index d587cad75c6..3f8984c8832 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go23.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/internal/pprof/stub_go23.go @@ -1,6 +1,3 @@ -//go:build go1.23 -// +build go1.23 - package pprof import ( diff --git a/vendor/github.com/grafana/pyroscope-go/godeltaprof/proto.go b/vendor/github.com/grafana/pyroscope-go/godeltaprof/proto.go index b499124142a..21e44810a20 100644 --- a/vendor/github.com/grafana/pyroscope-go/godeltaprof/proto.go +++ b/vendor/github.com/grafana/pyroscope-go/godeltaprof/proto.go @@ -1,9 +1,8 @@ package godeltaprof type ProfileOptions struct { - // for go1.21+ if true - use runtime_FrameSymbolName - produces frames with generic types, for example [go.shape.int] - // for go1.21+ if false - use runtime.Frame->Function - produces frames with generic types omitted [...] - // pre 1.21 - always use runtime.Frame->Function - produces frames with generic types omitted [...] + // if true - use runtime_FrameSymbolName - produces frames with generic types, for example [go.shape.int] + // if false - use runtime.Frame->Function - produces frames with generic types omitted [...] GenericsFrames bool LazyMappings bool } diff --git a/vendor/github.com/hashicorp/consul/api/agent.go b/vendor/github.com/hashicorp/consul/api/agent.go index 355b2f467b0..fd23dee0ef4 100644 --- a/vendor/github.com/hashicorp/consul/api/agent.go +++ b/vendor/github.com/hashicorp/consul/api/agent.go @@ -159,6 +159,7 @@ type AgentService struct { Proxy *AgentServiceConnectProxyConfig `json:",omitempty"` Connect *AgentServiceConnect `json:",omitempty"` PeerName string `json:",omitempty"` + AI *AgentServiceAI `json:",omitempty" bexpr:"-"` // NOTE: If we ever set the ContentHash outside of singular service lookup then we may need // to include the Namespace in the hash. When we do, then we are in for lots of fun with tests. // For now though, ignoring it works well enough. @@ -211,6 +212,84 @@ type AgentServiceConnectProxyConfig struct { AccessLogs *AccessLogsConfig `json:",omitempty"` } +// AgentServiceAI is the public twin of the internal structs.ServiceAI: the +// inline AI role block on a service registration/lookup. It carries a Role +// discriminator and exactly one role-specific sub-block. Field names mirror the +// internal type so mapstructure-based conversion maps them automatically. +type AgentServiceAI struct { + Role string `json:",omitempty"` + InferenceModel *AgentAIInferenceModel `json:",omitempty"` + MCPServer *AgentAIMCPServer `json:",omitempty"` + Agent *AgentAIAgent `json:",omitempty"` +} + +// AgentAIInferenceModel is the role-specific config for the inference-model role. +type AgentAIInferenceModel struct { + Protocol string `json:",omitempty"` + Path string `json:",omitempty"` + Defaults *AgentAIModelDefaults `json:",omitempty"` +} + +// AgentAIModelDefaults carries optional request defaults for an inference model. +type AgentAIModelDefaults struct { + MaxTokens int `json:",omitempty"` + Temperature float64 `json:",omitempty"` +} + +// AgentAIMCPServer is the role-specific config for the mcp-server role. +type AgentAIMCPServer struct { + Transport string `json:",omitempty"` + Path string `json:",omitempty"` + ProtocolVersion string `json:",omitempty"` +} + +// AgentAIAgent is the role-specific config for the ai-agent role. +type AgentAIAgent struct { + Inference *AgentAIAgentInference `json:",omitempty"` + MCP *AgentAIAgentMCP `json:",omitempty"` + RateLimits *AgentAIAgentRateLimits `json:",omitempty"` + Interceptor *AgentAIAgentInterceptor `json:",omitempty"` +} + +// AgentAIAgentInference describes the inference specialization for an agent. +type AgentAIAgentInference struct { + Specialization []string `json:",omitempty"` + Vendor string `json:",omitempty"` +} + +// AgentAIAgentMCP is the MCP egress configuration for an agent. +type AgentAIAgentMCP struct { + Port int `json:",omitempty"` + HITL *AgentAIAgentMCPHITL `json:",omitempty"` +} + +// AgentAIAgentMCPHITL is the human-in-the-loop approval configuration for MCP +// tool calls. +type AgentAIAgentMCPHITL struct { + Port int `json:",omitempty"` + ApprovalTimeout string `json:",omitempty"` +} + +// AgentAIAgentRateLimits are per-agent tool-call rate limits. +type AgentAIAgentRateLimits struct { + ToolCallsPerMinute int `json:",omitempty"` + ToolCallsPerHour int `json:",omitempty"` +} + +// AgentAIAgentInterceptor configures the co-located governance interceptor the +// sidecar reaches over plaintext loopback. +type AgentAIAgentInterceptor struct { + Port int `json:",omitempty"` +} + +// AgentAISecret is a reference to a secret stored in an external provider. It +// never holds the literal secret value. +type AgentAISecret struct { + Provider string `json:",omitempty"` + Path string `json:",omitempty"` + Field string `json:",omitempty"` +} + const ( // MemberTagKeyACLMode is the key used to indicate what ACL mode the agent is // operating in. The values of this key will be one of the MemberACLMode constants @@ -365,6 +444,7 @@ type AgentServiceRegistration struct { Checks AgentServiceChecks Proxy *AgentServiceConnectProxyConfig `json:",omitempty"` Connect *AgentServiceConnect `json:",omitempty"` + AI *AgentServiceAI `json:",omitempty" bexpr:"-"` Namespace string `json:",omitempty" bexpr:"-" hash:"ignore"` Partition string `json:",omitempty" bexpr:"-" hash:"ignore"` Locality *Locality `json:",omitempty" bexpr:"-" hash:"ignore"` diff --git a/vendor/github.com/hashicorp/consul/api/config_entry.go b/vendor/github.com/hashicorp/consul/api/config_entry.go index 84155086295..de45fe23c65 100644 --- a/vendor/github.com/hashicorp/consul/api/config_entry.go +++ b/vendor/github.com/hashicorp/consul/api/config_entry.go @@ -329,6 +329,12 @@ type UpstreamLimits struct { // to the upstream cluster at a point in time. This is mostly applicable to HTTP/2 // clusters since all HTTP/1.1 requests are limited by MaxConnections. MaxConcurrentRequests *int `alias:"max_concurrent_requests"` + + // PassiveHealthCheck configuration determines how upstream proxy instances will + // be monitored for removal from the load balancing pool. When set on an API + // gateway's Defaults it applies to all routed services; a per-service value + // overrides it. + PassiveHealthCheck *PassiveHealthCheck `json:",omitempty" alias:"passive_health_check"` } // RateLimits is rate limiting configuration that is applied to diff --git a/vendor/github.com/hashicorp/consul/api/config_entry_gateways.go b/vendor/github.com/hashicorp/consul/api/config_entry_gateways.go index 457e4b33b01..9c204f55370 100644 --- a/vendor/github.com/hashicorp/consul/api/config_entry_gateways.go +++ b/vendor/github.com/hashicorp/consul/api/config_entry_gateways.go @@ -228,6 +228,24 @@ func (g *TerminatingGatewayConfigEntry) GetMeta() map[string]string { return g.M func (g *TerminatingGatewayConfigEntry) GetCreateIndex() uint64 { return g.CreateIndex } func (g *TerminatingGatewayConfigEntry) GetModifyIndex() uint64 { return g.ModifyIndex } +// APIGatewayListenerProtocol is the protocol that an APIGateway listener uses. +type APIGatewayListenerProtocol = string + +const ( + // APIGatewayListenerProtocolHTTP configures an HTTP/1.1 listener. + APIGatewayListenerProtocolHTTP APIGatewayListenerProtocol = "http" + // APIGatewayListenerProtocolHTTP2 configures an HTTP/2 listener. The + // downstream connection manager uses the HTTP/2 codec and advertises h2 + // via ALPN; the upstream cluster also negotiates HTTP/2 end-to-end. + APIGatewayListenerProtocolHTTP2 APIGatewayListenerProtocol = "http2" + // APIGatewayListenerProtocolGRPC configures a gRPC listener. It is + // identical to http2 at the transport level; Consul routes gRPC traffic + // using standard HTTP/2 path-based matching (/package.Service/Method). + APIGatewayListenerProtocolGRPC APIGatewayListenerProtocol = "grpc" + // APIGatewayListenerProtocolTCP configures a plain TCP listener. + APIGatewayListenerProtocolTCP APIGatewayListenerProtocol = "tcp" +) + // APIGatewayConfigEntry manages the configuration for an API gateway // with the given name. type APIGatewayConfigEntry struct { @@ -308,8 +326,10 @@ type APIGatewayListener struct { Hostname string // Port is the port at which this listener should bind. Port int - // Protocol is the protocol that a listener should use, it must - // either be "http" or "tcp" + // Protocol is the protocol that a listener should use. Valid values are + // APIGatewayListenerProtocolHTTP ("http"), APIGatewayListenerProtocolHTTP2 + // ("http2"), APIGatewayListenerProtocolGRPC ("grpc"), and + // APIGatewayListenerProtocolTCP ("tcp"). Protocol string // TLS is the TLS settings for the listener. TLS APIGatewayTLSConfiguration @@ -323,7 +343,7 @@ type APIGatewayListener struct { MaxRequestHeadersKB *uint32 `json:",omitempty"` } -// APIGatewayTLSConfiguration specifies the configuration of a listener’s +// APIGatewayTLSConfiguration specifies the configuration of a listener's // TLS settings. type APIGatewayTLSConfiguration struct { // Certificates is a set of references to certificates diff --git a/vendor/github.com/hashicorp/consul/api/config_entry_routes.go b/vendor/github.com/hashicorp/consul/api/config_entry_routes.go index 7f6f142f2cd..cc6d5363f22 100644 --- a/vendor/github.com/hashicorp/consul/api/config_entry_routes.go +++ b/vendor/github.com/hashicorp/consul/api/config_entry_routes.go @@ -159,9 +159,10 @@ const ( // HTTPHeaderMatch specifies how a match should be done // on a request's headers. type HTTPHeaderMatch struct { - Match HTTPHeaderMatchType - Name string - Value string + Match HTTPHeaderMatchType + Name string + Value string + Invert bool `json:",omitempty"` } // HTTPPathMatchType specifies how path matching criteria diff --git a/vendor/github.com/hashicorp/consul/api/operator_feature_gate.go b/vendor/github.com/hashicorp/consul/api/operator_feature_gate.go new file mode 100644 index 00000000000..62601a65493 --- /dev/null +++ b/vendor/github.com/hashicorp/consul/api/operator_feature_gate.go @@ -0,0 +1,104 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package api + +import ( + "net/url" + "strconv" +) + +type FeatureGate struct { + Name string + Stage string + MinVersion string + DefaultEnabled bool + BeforeMinimumVersion string + Description string + Owner string + DesiredEnabled bool + EffectiveEnabled bool + Eligible bool + Source string + Reason string + PolicyIndex uint64 + StatusIndex uint64 +} + +type FeatureGateSetRequest struct { + Enabled bool +} + +type FeatureGateSetResponse struct { + Applied bool + Feature FeatureGate +} + +func (op *Operator) FeatureGateList(q *QueryOptions) ([]FeatureGate, *QueryMeta, error) { + r := op.c.newRequest("GET", "/v1/operator/features") + r.setQueryOptions(q) + rtt, resp, err := op.c.doRequest(r) + if err != nil { + return nil, nil, err + } + defer closeResponseBody(resp) + if err := requireOK(resp); err != nil { + return nil, nil, err + } + + meta := &QueryMeta{} + parseQueryMeta(resp, meta) + meta.RequestTime = rtt + var out []FeatureGate + if err := decodeBody(resp, &out); err != nil { + return nil, nil, err + } + return out, meta, nil +} + +func (op *Operator) FeatureGateGet(name string, q *QueryOptions) (*FeatureGate, *QueryMeta, error) { + r := op.c.newRequest("GET", "/v1/operator/feature/"+url.PathEscape(name)) + r.setQueryOptions(q) + rtt, resp, err := op.c.doRequest(r) + if err != nil { + return nil, nil, err + } + defer closeResponseBody(resp) + if err := requireOK(resp); err != nil { + return nil, nil, err + } + + meta := &QueryMeta{} + parseQueryMeta(resp, meta) + meta.RequestTime = rtt + var out FeatureGate + if err := decodeBody(resp, &out); err != nil { + return nil, nil, err + } + return &out, meta, nil +} + +// FeatureGateSet records explicit operator intent. expectedPolicyIndex zero +// means no caller-supplied CAS; the server still uses internal CAS fencing. +func (op *Operator) FeatureGateSet(name string, enabled bool, expectedPolicyIndex uint64, q *WriteOptions) (*FeatureGateSetResponse, error) { + r := op.c.newRequest("PUT", "/v1/operator/feature/"+url.PathEscape(name)) + r.setWriteOptions(q) + if expectedPolicyIndex != 0 { + r.params.Set("cas", strconv.FormatUint(expectedPolicyIndex, 10)) + } + r.obj = FeatureGateSetRequest{Enabled: enabled} + _, resp, err := op.c.doRequest(r) + if err != nil { + return nil, err + } + defer closeResponseBody(resp) + if err := requireOK(resp); err != nil { + return nil, err + } + + var out FeatureGateSetResponse + if err := decodeBody(resp, &out); err != nil { + return nil, err + } + return &out, nil +} diff --git a/vendor/github.com/knadh/koanf/maps/maps.go b/vendor/github.com/knadh/koanf/maps/maps.go index bdb9d62b80f..48bf0403e3d 100644 --- a/vendor/github.com/knadh/koanf/maps/maps.go +++ b/vendor/github.com/knadh/koanf/maps/maps.go @@ -1,21 +1,22 @@ // Package maps provides reusable functions for manipulating nested -// map[string]interface{} maps are common unmarshal products from +// map[string]any maps are common unmarshal products from // various serializers such as json, yaml etc. package maps import ( "fmt" "reflect" + "sort" "strings" "github.com/mitchellh/copystructure" ) -// Flatten takes a map[string]interface{} and traverses it and flattens +// Flatten takes a map[string]any and traverses it and flattens // nested children into keys delimited by delim. // // It's important to note that all nested maps should be -// map[string]interface{} and not map[interface{}]interface{}. +// map[string]any and not map[any]any. // Use IntfaceKeysToStrings() to convert if necessary. // // eg: `{ "parent": { "child": 123 }}` becomes `{ "parent.child": 123 }` @@ -23,9 +24,9 @@ import ( // a slice of key parts, for eg: { "parent.child": ["parent", "child"] }. This // parts list is used to remember the key path's original structure to // unflatten later. -func Flatten(m map[string]interface{}, keys []string, delim string) (map[string]interface{}, map[string][]string) { +func Flatten(m map[string]any, keys []string, delim string) (map[string]any, map[string][]string) { var ( - out = make(map[string]interface{}) + out = make(map[string]any) keyMap = make(map[string][]string) ) @@ -33,7 +34,7 @@ func Flatten(m map[string]interface{}, keys []string, delim string) (map[string] return out, keyMap } -func flatten(m map[string]interface{}, keys []string, delim string, out map[string]interface{}, keyMap map[string][]string) { +func flatten(m map[string]any, keys []string, delim string, out map[string]any, keyMap map[string][]string) { for key, val := range m { // Copy the incoming key paths into a fresh list // and append the current key in the iteration. @@ -42,7 +43,7 @@ func flatten(m map[string]interface{}, keys []string, delim string, out map[stri kp = append(kp, key) switch cur := val.(type) { - case map[string]interface{}: + case map[string]any: // Empty map. if len(cur) == 0 { newKey := strings.Join(kp, delim) @@ -65,14 +66,22 @@ func flatten(m map[string]interface{}, keys []string, delim string, out map[stri // and returns a nested map where the keys are split into hierarchies by the given // delimiter. For instance, `parent.child.key: 1` to `{parent: {child: {key: 1}}}` // +// Keys are sorted by length to make merge-order deterministic so that nested keys +// don't end up overwriting their parent keys. eg: `parent.child` -> `parent`. +// // It's important to note that all nested maps should be -// map[string]interface{} and not map[interface{}]interface{}. +// map[string]any and not map[any]any. // Use IntfaceKeysToStrings() to convert if necessary. -func Unflatten(m map[string]interface{}, delim string) map[string]interface{} { - out := make(map[string]interface{}) +func Unflatten(m map[string]any, delim string) map[string]any { + out := make(map[string]any) + + ks := make([]string, 0, len(m)) + for k := range m { + ks = append(ks, k) + } + sort.Strings(ks) - // Iterate through the flat conf map. - for k, v := range m { + for _, k := range ks { var ( keys []string next = out @@ -87,19 +96,17 @@ func Unflatten(m map[string]interface{}, delim string) map[string]interface{} { // Iterate through key parts, for eg:, parent.child.key // will be ["parent", "child", "key"] for _, k := range keys[:len(keys)-1] { - sub, ok := next[k] + // Create the key if it doesn't exist. + sub, ok := next[k].(map[string]any) if !ok { - // If the key does not exist in the map, create it. - sub = make(map[string]interface{}) + sub = make(map[string]any) next[k] = sub } - if n, ok := sub.(map[string]interface{}); ok { - next = n - } + next = sub } // Assign the value. - next[keys[len(keys)-1]] = v + next[keys[len(keys)-1]] = m[k] } return out } @@ -109,9 +116,9 @@ func Unflatten(m map[string]interface{}, delim string) map[string]interface{} { // map b will retain references to map a. // // It's important to note that all nested maps should be -// map[string]interface{} and not map[interface{}]interface{}. +// map[string]any and not map[any]any. // Use IntfaceKeysToStrings() to convert if necessary. -func Merge(a, b map[string]interface{}) { +func Merge(a, b map[string]any) { for key, val := range a { // Does the key exist in the target map? // If no, add it and move on. @@ -122,15 +129,15 @@ func Merge(a, b map[string]interface{}) { } // If the incoming val is not a map, do a direct merge. - if _, ok := val.(map[string]interface{}); !ok { + if _, ok := val.(map[string]any); !ok { b[key] = val continue } // The source key and target keys are both maps. Merge them. switch v := bVal.(type) { - case map[string]interface{}: - Merge(val.(map[string]interface{}), v) + case map[string]any: + Merge(val.(map[string]any), v) default: b[key] = val } @@ -143,13 +150,13 @@ func Merge(a, b map[string]interface{}) { // If an equal key in either of the maps has a different value type, it will return the first error. // // It's important to note that all nested maps should be -// map[string]interface{} and not map[interface{}]interface{}. +// map[string]any and not map[any]any. // Use IntfaceKeysToStrings() to convert if necessary. -func MergeStrict(a, b map[string]interface{}) error { +func MergeStrict(a, b map[string]any) error { return mergeStrict(a, b, "") } -func mergeStrict(a, b map[string]interface{}, fullKey string) error { +func mergeStrict(a, b map[string]any, fullKey string) error { for key, val := range a { // Does the key exist in the target map? // If no, add it and move on. @@ -165,23 +172,25 @@ func mergeStrict(a, b map[string]interface{}, fullKey string) error { } // If the incoming val is not a map, do a direct merge between the same types. - if _, ok := val.(map[string]interface{}); !ok { + if _, ok := val.(map[string]any); !ok { if reflect.TypeOf(b[key]) == reflect.TypeOf(val) { b[key] = val } else { - return fmt.Errorf("incorrect types at key %v, type %T != %T", fullKey, b[key], val) + return fmt.Errorf("incorrect types at key %v, type %T != %T", newFullKey, b[key], val) } continue } // The source key and target keys are both maps. Merge them. switch v := bVal.(type) { - case map[string]interface{}: - if err := mergeStrict(val.(map[string]interface{}), v, newFullKey); err != nil { + case map[string]any: + if err := mergeStrict(val.(map[string]any), v, newFullKey); err != nil { return err } default: - b[key] = val + // The incoming value is a map but the target value is not, + // which is a type mismatch. + return fmt.Errorf("incorrect types at key %v, type %T != %T", newFullKey, b[key], val) } } return nil @@ -192,9 +201,9 @@ func mergeStrict(a, b map[string]interface{}, fullKey string) error { // Any empty, nested map on the path, is recursively deleted. // // It's important to note that all nested maps should be -// map[string]interface{} and not map[interface{}]interface{}. +// map[string]any and not map[any]any. // Use IntfaceKeysToStrings() to convert if necessary. -func Delete(mp map[string]interface{}, path []string) { +func Delete(mp map[string]any, path []string) { next, ok := mp[path[0]] if ok { if len(path) == 1 { @@ -202,7 +211,7 @@ func Delete(mp map[string]interface{}, path []string) { return } switch nval := next.(type) { - case map[string]interface{}: + case map[string]any: Delete(nval, path[1:]) // Delete map if it has no keys. if len(nval) == 0 { @@ -216,22 +225,22 @@ func Delete(mp map[string]interface{}, path []string) { // the key map slice, for eg:, parent.child.key -> [parent child key]. // // It's important to note that all nested maps should be -// map[string]interface{} and not map[interface{}]interface{}. +// map[string]any and not map[any]any. // Use IntfaceKeysToStrings() to convert if necessary. -func Search(mp map[string]interface{}, path []string) interface{} { +func Search(mp map[string]any, path []string) any { next, ok := mp[path[0]] if ok { if len(path) == 1 { return next } switch m := next.(type) { - case map[string]interface{}: + case map[string]any: return Search(m, path[1:]) default: return nil } // // It's important to note that all nested maps should be - // map[string]interface{} and not map[interface{}]interface{}. + // map[string]any and not map[any]any. // Use IntfaceKeysToStrings() to convert if necessary. } return nil @@ -240,43 +249,43 @@ func Search(mp map[string]interface{}, path []string) interface{} { // Copy returns a deep copy of a conf map. // // It's important to note that all nested maps should be -// map[string]interface{} and not map[interface{}]interface{}. +// map[string]any and not map[any]any. // Use IntfaceKeysToStrings() to convert if necessary. -func Copy(mp map[string]interface{}) map[string]interface{} { +func Copy(mp map[string]any) map[string]any { out, _ := copystructure.Copy(&mp) - if res, ok := out.(*map[string]interface{}); ok { + if res, ok := out.(*map[string]any); ok { return *res } - return map[string]interface{}{} + return map[string]any{} } -// IntfaceKeysToStrings recursively converts map[interface{}]interface{} to -// map[string]interface{}. Some parses such as YAML unmarshal return this. -func IntfaceKeysToStrings(mp map[string]interface{}) { +// IntfaceKeysToStrings recursively converts map[any]any to +// map[string]any. Some parses such as YAML unmarshal return this. +func IntfaceKeysToStrings(mp map[string]any) { for key, val := range mp { switch cur := val.(type) { - case map[interface{}]interface{}: - x := make(map[string]interface{}) + case map[any]any: + x := make(map[string]any) for k, v := range cur { x[fmt.Sprintf("%v", k)] = v } mp[key] = x IntfaceKeysToStrings(x) - case []interface{}: + case []any: for i, v := range cur { switch sub := v.(type) { - case map[interface{}]interface{}: - x := make(map[string]interface{}) + case map[any]any: + x := make(map[string]any) for k, v := range sub { x[fmt.Sprintf("%v", k)] = v } cur[i] = x IntfaceKeysToStrings(x) - case map[string]interface{}: + case map[string]any: IntfaceKeysToStrings(sub) } } - case map[string]interface{}: + case map[string]any: IntfaceKeysToStrings(cur) } } @@ -285,17 +294,17 @@ func IntfaceKeysToStrings(mp map[string]interface{}) { // StringSliceToLookupMap takes a slice of strings and returns a lookup map // with the slice values as keys with true values. func StringSliceToLookupMap(s []string) map[string]bool { - mp := make(map[string]bool, len(s)) - for _, v := range s { - mp[v] = true - } - return mp + return sliceToLookupMap(s) } // Int64SliceToLookupMap takes a slice of int64s and returns a lookup map // with the slice values as keys with true values. func Int64SliceToLookupMap(s []int64) map[int64]bool { - mp := make(map[int64]bool, len(s)) + return sliceToLookupMap(s) +} + +func sliceToLookupMap[T string | int64](s []T) map[T]bool { + mp := make(map[T]bool, len(s)) for _, v := range s { mp[v] = true } diff --git a/vendor/github.com/knadh/koanf/providers/confmap/confmap.go b/vendor/github.com/knadh/koanf/providers/confmap/confmap.go index a3438933d41..13cfcdd3114 100644 --- a/vendor/github.com/knadh/koanf/providers/confmap/confmap.go +++ b/vendor/github.com/knadh/koanf/providers/confmap/confmap.go @@ -1,5 +1,5 @@ // Package confmap implements a koanf.Provider that takes nested -// and flat map[string]interface{} config maps and provides them +// and flat map[string]any config maps and provides them // to koanf. package confmap @@ -9,15 +9,15 @@ import ( "github.com/knadh/koanf/maps" ) -// Confmap implements a raw map[string]interface{} provider. +// Confmap implements a raw map[string]any provider. type Confmap struct { - mp map[string]interface{} + mp map[string]any } // Provider returns a confmap Provider that takes a flat or nested -// map[string]interface{}. If a delim is provided, it indicates that the +// map[string]any. If a delim is provided, it indicates that the // keys are flat and the map needs to be unflattened by delim. -func Provider(mp map[string]interface{}, delim string) *Confmap { +func Provider(mp map[string]any, delim string) *Confmap { cp := maps.Copy(mp) maps.IntfaceKeysToStrings(cp) if delim != "" { @@ -31,7 +31,7 @@ func (e *Confmap) ReadBytes() ([]byte, error) { return nil, errors.New("confmap provider does not support this method") } -// Read returns the loaded map[string]interface{}. -func (e *Confmap) Read() (map[string]interface{}, error) { +// Read returns the loaded map[string]any. +func (e *Confmap) Read() (map[string]any, error) { return e.mp, nil } diff --git a/vendor/github.com/knadh/koanf/v2/getters.go b/vendor/github.com/knadh/koanf/v2/getters.go index 6a50ac37c2e..9f0f6a8c847 100644 --- a/vendor/github.com/knadh/koanf/v2/getters.go +++ b/vendor/github.com/knadh/koanf/v2/getters.go @@ -589,7 +589,7 @@ func (ko *Koanf) Bools(path string) []bool { } return out case []bool: - return out + return v } return nil } diff --git a/vendor/github.com/knadh/koanf/v2/go.work b/vendor/github.com/knadh/koanf/v2/go.work index e5aa5dee7d5..d44bddc5aca 100644 --- a/vendor/github.com/knadh/koanf/v2/go.work +++ b/vendor/github.com/knadh/koanf/v2/go.work @@ -4,7 +4,6 @@ toolchain go1.24.5 use ( . - ./examples ./maps ./parsers/dotenv ./parsers/hcl @@ -26,12 +25,10 @@ use ( ./providers/etcd ./providers/file ./providers/fs - ./providers/nats ./providers/parameterstore ./providers/posflag ./providers/rawbytes ./providers/s3 ./providers/structs - ./providers/vault ./tests ) diff --git a/vendor/github.com/knadh/koanf/v2/go.work.sum b/vendor/github.com/knadh/koanf/v2/go.work.sum index f770a0f26ad..368f7bc6cfa 100644 --- a/vendor/github.com/knadh/koanf/v2/go.work.sum +++ b/vendor/github.com/knadh/koanf/v2/go.work.sum @@ -1,5 +1,7 @@ cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4= +cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= @@ -84,6 +86,8 @@ cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdi cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= +cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= +cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= cloud.google.com/go/contactcenterinsights v1.10.0 h1:YR2aPedGVQPpFBZXJnPkqRj8M//8veIZZH5ZvICoXnI= cloud.google.com/go/contactcenterinsights v1.10.0/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= @@ -365,6 +369,14 @@ cloud.google.com/go/websecurityscanner v1.6.1/go.mod h1:Njgaw3rttgRHXzwCB8kgCYqv cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= cloud.google.com/go/workflows v1.11.1 h1:2akeQ/PgtRhrNuD/n1WvJd5zb7YyuDZrlOanBj2ihPg= cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g= +codeberg.org/go-fonts/liberation v0.5.0 h1:SsKoMO1v1OZmzkG2DY+7ZkCL9U+rrWI09niOLfQ5Bo0= +codeberg.org/go-fonts/liberation v0.5.0/go.mod h1:zS/2e1354/mJ4pGzIIaEtm/59VFCFnYC7YV6YdGl5GU= +codeberg.org/go-latex/latex v0.1.0 h1:hoGO86rIbWVyjtlDLzCqZPjNykpWQ9YuTZqAzPcfL3c= +codeberg.org/go-latex/latex v0.1.0/go.mod h1:LA0q/AyWIYrqVd+A9Upkgsb+IqPcmSTKc9Dny04MHMw= +codeberg.org/go-pdf/fpdf v0.10.0 h1:u+w669foDDx5Ds43mpiiayp40Ov6sZalgcPMDBcZRd4= +codeberg.org/go-pdf/fpdf v0.10.0/go.mod h1:Y0DGRAdZ0OmnZPvjbMp/1bYxmIPxm0ws4tfoPOc4LjU= +git.sr.ht/~sbinet/gg v0.6.0 h1:RIzgkizAk+9r7uPzf/VfbJHBMKUr0F5hRFxTUGMnt38= +git.sr.ht/~sbinet/gg v0.6.0/go.mod h1:uucygbfC9wVPQIfrmwM2et0imr8L7KQWywX0xpFMm94= github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.0/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= @@ -373,14 +385,20 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 h1:3c8yed4lgqTt+oTQ+JNMDo+F4xprBf+O/il4ZC0nRLw= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 h1:sBEjpZlNHzK1voKq9695PJSX2o5NEXl7/OL3coiIY0c= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0/go.mod h1:P4WPRUkOhJC13W//jWpyfJNDAIpvRbAUIYLX/4jtlE0= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig/v3 v3.2.1 h1:n6EPaDyLSvCEa3frruQvAiHuNp2dhBlMSmkEr+HuzGc= github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Sereal/Sereal/Go/sereal v0.0.0-20231009093132-b9187f1a92c6 h1:5kUcJJAKWWI82Xnp/CaU0eu5hLlHkmm9acjowSkwCd0= github.com/Sereal/Sereal/Go/sereal v0.0.0-20231009093132-b9187f1a92c6/go.mod h1:JwrycNnC8+sZPDyzM3MQ86LvaGzSpfxg885KOOwFRW4= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw= +github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= @@ -396,6 +414,8 @@ github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= +github.com/campoy/embedmd v1.0.0 h1:V4kI2qTJJLf4J29RzI/MAt2c3Bl4dQSYPuflzwFH2hY= +github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= @@ -410,6 +430,8 @@ github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 h1:boJj011Hh+874zpIySeApCX4GeOjPl9qhRF3QuIZq+Q= github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w= +github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= @@ -427,30 +449,44 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M= github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= +github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= +github.com/envoyproxy/go-control-plane v0.14.0/go.mod h1:NcS5X47pLl/hfqxU70yPwL9ZMkUlwlKxtAohpi2wBEU= github.com/envoyproxy/go-control-plane/envoy v1.32.4 h1:jb83lalDRZSpPWW2Z7Mck/8kXZ5CQAFYVjQcdVIr83A= github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw= +github.com/envoyproxy/go-control-plane/envoy v1.36.0 h1:yg/JjO5E7ubRyKX3m07GF3reDNEnfOboJ0QySbH736g= +github.com/envoyproxy/go-control-plane/envoy v1.36.0/go.mod h1:ty89S1YCCVruQAm9OtKeEkQLTb+Lkz0k8v9W0Oxsv98= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= +github.com/envoyproxy/protoc-gen-validate v1.3.0 h1:TvGH1wof4H33rezVKWSpqKz5NXWg5VPuZ0uONDT6eb4= +github.com/envoyproxy/protoc-gen-validate v1.3.0/go.mod h1:HvYl7zwPa5mffgyeTUHA9zHIH36nmrm7oCbo4YKoSWA= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= +github.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs= +github.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ= github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/goccmack/gocc v0.0.0-20230228185258-2292f9e40198 h1:FSii2UQeSLngl3jFoR4tUKZLprO7qUlh/TKKticc0BM= +github.com/goccmack/gocc v0.0.0-20230228185258-2292f9e40198/go.mod h1:DTh/Y2+NbnOVVoypCCQrovMPDKUGp4yZpSbWg5D0XIM= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc= github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.5 h1:DrW6hGnjIhtvhOIiAKT6Psh/Kd/ldepEa81DKeiRJ5I= +github.com/golang/glog v1.2.5/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= @@ -463,6 +499,7 @@ github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9 github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba h1:qJEJcuLzH5KDR0gKc0zcktin6KSAwL7+jWKBYceddTc= github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba/go.mod h1:EFYHy8/1y2KfgTAsx7Luu7NGhoxtuVHnNo8jE7FikKc= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= @@ -510,6 +547,7 @@ github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBF github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/lyft/protoc-gen-star/v2 v2.0.4-0.20230330145011-496ad1ac90a4 h1:sIXJOMrYnQZJu7OB7ANSF4MYri2fTEGIsRLz6LwI4xE= github.com/lyft/protoc-gen-star/v2 v2.0.4-0.20230330145011-496ad1ac90a4/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= @@ -551,13 +589,18 @@ github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/rogpeppe/fastuuid v1.2.0 h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/ryanuber/columnize v2.1.2+incompatible h1:C89EOx/XBWwIXl8wm8OPJBd7kPF25UfsK2X7Ph/zCAk= @@ -569,12 +612,16 @@ github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= +github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= @@ -586,8 +633,12 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/detectors/gcp v1.34.0 h1:JRxssobiPg23otYU5SbWtQC//snGVIM3Tx6QRzlQBao= go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= +go.opentelemetry.io/contrib/detectors/gcp v1.39.0 h1:kWRNZMsfBHZ+uHjiH4y7Etn2FK26LAGkNFw7RHv1DhE= +go.opentelemetry.io/contrib/detectors/gcp v1.39.0/go.mod h1:t/OGqzHBa5v6RHZwrDBJ2OirWc+4q/w2fTbLZwAKjTk= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.opentelemetry.io/proto/otlp v1.7.1 h1:gTOMpGDb0WTBOP8JaO72iL3auEZhVmAQg4ipjOVAtj4= +go.opentelemetry.io/proto/otlp v1.7.1/go.mod h1:b2rVh6rfI/s2pHWNlB7ILJcRALpcNDzKhACevjI+ZnE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= @@ -605,8 +656,11 @@ golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZv golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc= golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= +golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ= +golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= @@ -619,10 +673,14 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= +golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc= +golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -641,13 +699,15 @@ golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= -golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= +golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -661,7 +721,9 @@ golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -678,16 +740,22 @@ golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8/go.mod h1:Pi4ztBfryZoJEkyFTI5/Ocsu2jXyDr6iSdgJiYE/uwE= +golang.org/x/telemetry v0.0.0-20251111182119-bc8e575c7b54/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ= +golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc h1:bH6xUXay0AIFMElXG2rQ4uiE+7ncwtiOdPfYK1NK2XA= golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ= +golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa/go.mod h1:kHjTxDEnAu6/Nl9lDkzjWpR+bmKfxeiRuSDlsMb70gE= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= @@ -701,6 +769,7 @@ golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= +golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= @@ -709,9 +778,9 @@ golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= -golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -724,14 +793,20 @@ golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58 golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= +golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/plot v0.15.2 h1:Tlfh/jBk2tqjLZ4/P8ZIwGrLEWQSPDLRm/SNWKNXiGI= +gonum.org/v1/plot v0.15.2/go.mod h1:DX+x+DWso3LTha+AdkJEv5Txvi+Tql3KAGkehP0/Ubg= google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -749,6 +824,7 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= google.golang.org/genproto/googleapis/rpc v0.0.0-20250409194420-de1ac958c67a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251124214823-79d6a2a48846/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -757,10 +833,14 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/grpc/examples v0.0.0-20250407062114-b368379ef8f6 h1:ExN12ndbJ608cboPYflpTny6mXSzPrDLh0iTaVrRrds= +google.golang.org/grpc/examples v0.0.0-20250407062114-b368379ef8f6/go.mod h1:6ytKWczdvnpnO+m+JiG9NjEDzR1FJfsnmJdG7B8QVZ8= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/vmihailenco/msgpack.v2 v2.9.2 h1:gjPqo9orRVlSAH/065qw3MsFCDpH7fa1KpiizXyllY4= @@ -770,5 +850,7 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/vendor/github.com/knadh/koanf/v2/koanf.go b/vendor/github.com/knadh/koanf/v2/koanf.go index 5c7abe6d573..fb57a50e3af 100644 --- a/vendor/github.com/knadh/koanf/v2/koanf.go +++ b/vendor/github.com/knadh/koanf/v2/koanf.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding" "fmt" + "math" "reflect" "sort" "strconv" @@ -483,17 +484,53 @@ func toInt64(v any) (int64, error) { return int64(i), nil case int64: return i, nil + case uint8: + return int64(i), nil + case uint16: + return int64(i), nil + case uint32: + return int64(i), nil + case uint: + return uintToInt64(uint64(i)) + case uint64: + return uintToInt64(i) } // Force it to a string and try to convert. - f, err := strconv.ParseFloat(fmt.Sprintf("%v", v), 64) + s := fmt.Sprintf("%v", v) + + // Try parsing as int64 first, and on failure, attempt float64 parsing. + // Parsing directly as float64, when the number is beyond its upper limit (2^53) + // causes unnecessary precision loss when the value is actually an int. + if i, err := strconv.ParseInt(s, 10, 64); err == nil { + return i, nil + } + + f, err := strconv.ParseFloat(s, 64) if err != nil { return 0, err } + // int64(f) is undefined for numbers that are out of range and returns different + // results on different architectures. float64 cannot exactly represent MaxInt64, + // so check against the ACTUAL upper limit of 2^63. + // If neither match, return an error instead of the undefined result. + if math.IsNaN(f) || f < math.MinInt64 || f >= 1<<63 { + return 0, fmt.Errorf("value %v overflows int64", v) + } + return int64(f), nil } +// uintToInt64 converts an unsigned integer to int64 and throw an error on overflow. +func uintToInt64(v uint64) (int64, error) { + if v > math.MaxInt64 { + return 0, fmt.Errorf("value %d overflows int64", v) + } + + return int64(v), nil +} + // toInt64 takes a `v any` value and if it is a float type, // converts and returns a `float64`. If it's any other type, forces it to a // string and attempts to get a float out using `strconv.ParseFloat`. diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go index b24a2fadc9c..569113eac5a 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_others.go +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -1,5 +1,5 @@ -//go:build (appengine || js || nacl || tinygo || wasm || wasip1 || wasip2) && !windows -// +build appengine js nacl tinygo wasm wasip1 wasip2 +//go:build (appengine || js || nacl || tinygo || wasm || wasip1 || wasip2 || haiku) && !windows +// +build appengine js nacl tinygo wasm wasip1 wasip2 haiku // +build !windows package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go b/vendor/github.com/mattn/go-isatty/isatty_tiocgwinsz.go similarity index 62% rename from vendor/github.com/mattn/go-isatty/isatty_tcgets.go rename to vendor/github.com/mattn/go-isatty/isatty_tiocgwinsz.go index 0337d8cf6de..6aecf8704cf 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go +++ b/vendor/github.com/mattn/go-isatty/isatty_tiocgwinsz.go @@ -8,8 +8,12 @@ package isatty import "golang.org/x/sys/unix" // IsTerminal return true if the file descriptor is terminal. +// TIOCGWINSZ is used instead of TCGETS because TCGETS shares its ioctl +// number with SNDCTL_TMR_TIMEBASE of the OSS sound API, so it may succeed +// (and even change the device mode) on non-tty devices. musl's isatty does +// the same. func IsTerminal(fd uintptr) bool { - _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) + _, err := unix.IoctlGetWinsize(int(fd), unix.TIOCGWINSZ) return err == nil } diff --git a/vendor/github.com/mattn/go-runewidth/SECURITY.md b/vendor/github.com/mattn/go-runewidth/SECURITY.md new file mode 100644 index 00000000000..a6898ee7015 --- /dev/null +++ b/vendor/github.com/mattn/go-runewidth/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policy + +## Supported Versions + +The following versions of go-runewidth are currently supported with +security updates. + +| Version | Supported | +| -------- | ------------------ | +| 0.0.23 | :white_check_mark: | +| < 0.0.23 | :x: | + +## Reporting a Vulnerability + +If you discover a security vulnerability in go-runewidth, please report it +privately via GitHub's "Report a vulnerability" feature on the Security tab +of the repository (https://github.com/mattn/go-runewidth/security), or by +emailing the maintainer at mattn.jp@gmail.com. + +Please include a description of the issue, reproduction steps, and the +affected version. You can expect an initial response within one week. If +the vulnerability is accepted, a fix will be prepared and a new release +will be published; you will be credited in the release notes unless you +request otherwise. If the report is declined, you will receive an +explanation of the reasoning. diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go index f6c0058222b..c2e09465563 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth.go @@ -2,7 +2,10 @@ package runewidth import ( "os" + "sort" "strings" + "sync" + "sync/atomic" "unicode/utf8" "github.com/clipperhouse/uax29/v2/graphemes" @@ -17,6 +20,14 @@ var ( // StrictEmojiNeutral should be set false if handle broken fonts StrictEmojiNeutral bool = true + // ZeroWidthJoiner is flag to set to use UTR#51 ZWJ. + // + // Deprecated: ZWJ sequences are always handled through Unicode + // grapheme cluster segmentation now, so this flag has no effect. + // It is kept only for compatibility with code written against + // v0.0.9 and earlier. + ZeroWidthJoiner bool + // DefaultCondition is a condition in current locale DefaultCondition = &Condition{ EastAsianWidth: false, @@ -25,14 +36,87 @@ var ( ) var ( - zerowidth table // combining + nonprint merged for faster zero-width lookup - widewidth table // ambiguous + doublewidth merged for EA path + zerowidth table // combining + nonprint merged for faster zero-width lookup + widewidth table // ambiguous + doublewidth merged for EA path + eastAsianWidth widthTable + tablesOnce sync.Once + + // strictWidthLUT is mostly built lazily on the first width lookup so + // that importing the package costs neither the build time nor the 2 MB + // of resident memory; see issue #104. Only the entries below + // strictWidthLUTLimit are valid: init fills the first 0x300 entries of + // both planes, and the lazy build fills the rest — never rewriting the + // low region, so readers of it cannot race with the build. The limit + // is loaded with acquire semantics, which makes the non-atomic reads + // of the high region safe once it reports 0x110000. Keeping the whole + // check down to one compare-and-branch matters: RuneWidth is only a + // dozen instructions long. + strictWidthLUT [2][0x110000]byte + strictWidthLUTLimit atomic.Int32 + strictWidthLUTOnce sync.Once + + // joinerBits is the joiner table as a bitmap over + // [joinerBase, 0x10000), the range where the per-rune test has to be + // cheap for the fast paths in StringWidth and Wrap to pay off. It is + // 7.6 KB and init fills it in a few microseconds. Runes above it stay + // on the interval search: they are rare in the text these fast paths + // are for, and the emoji that are common there leave the fast path at + // their first joiner anyway. + joinerBits [(0x10000 - joinerBase) / 8]byte ) +// joinerBase is the lowest rune in the joiner table. CR is the only rune +// below it that can form a multi-rune cluster, by pairing with LF. +const joinerBase = 0x300 + func init() { + initStrictWidthLUTLow() + fillJoinerBits() + strictWidthLUTLimit.Store(0x300) + handleEnv() +} + +// initStrictWidthLUTLow paints the first 0x300 entries of strictWidthLUT +// from the static interval tables. The result must stay identical to +// runeWidthNoLUT for runes below 0x300, which TestStrictWidthLUT verifies. +func initStrictWidthLUTLow() { + for i := 0; i < 0x300; i++ { + r := rune(i) + w := byte(1) + if r < 0x20 || (r >= 0x7F && r <= 0x9F) || r == 0xAD { // nonprint + w = 0 + } + strictWidthLUT[0][i] = w + } + + ea := strictWidthLUT[1][:0x300] + fillBytes(ea, 1) + paint := func(t table, w byte) { + for _, iv := range t { + if iv.first >= 0x300 { + break + } + last := iv.last + if last > 0x2FF { + last = 0x2FF + } + fillBytes(ea[iv.first:last+1], w) + } + } + paint(ambiguous, 2) + paint(doublewidth, 2) + // zero-width wins over wide on overlap, so paint it last. + paint(combining, 0) + paint(nonprint, 0) +} + +// initTables builds the merged lookup tables. It runs lazily through +// tablesOnce so that merely importing the package stays cheap; see issue +// #104. +func initTables() { zerowidth = mergeIntervals(combining, nonprint) widewidth = mergeIntervals(ambiguous, doublewidth) - handleEnv() + eastAsianWidth = makeWidthTable(zerowidth, widewidth) } func mergeIntervals(t1, t2 table) table { @@ -77,7 +161,6 @@ func handleEnv() { if DefaultCondition.EastAsianWidth != EastAsianWidth { DefaultCondition.EastAsianWidth = EastAsianWidth if len(DefaultCondition.combinedLut) > 0 { - DefaultCondition.combinedLut = DefaultCondition.combinedLut[:0] CreateLUT() } } @@ -90,6 +173,14 @@ type interval struct { type table []interval +type widthInterval struct { + first rune + last rune + width byte +} + +type widthTable []widthInterval + func inTable(r rune, t table) bool { if r < t[0].first { return false @@ -116,6 +207,154 @@ func inTable(r rune, t table) bool { return false } +func makeWidthTable(zero, two table) widthTable { + wt := make(widthTable, 0, len(zero)+len(two)) + zi := 0 + for _, iv := range two { + start := iv.first + for zi < len(zero) && zero[zi].last < start { + zi++ + } + for i := zi; i < len(zero) && zero[i].first <= iv.last; i++ { + if start < zero[i].first { + wt = append(wt, widthInterval{start, zero[i].first - 1, 2}) + } + if start <= zero[i].last { + start = zero[i].last + 1 + } + if start > iv.last { + break + } + } + if start <= iv.last { + wt = append(wt, widthInterval{start, iv.last, 2}) + } + } + for _, iv := range zero { + wt = append(wt, widthInterval{iv.first, iv.last, 0}) + } + sort.Slice(wt, func(i, j int) bool { + return wt[i].first < wt[j].first + }) + return wt +} + +func inWidthTable(r rune, t widthTable) (int, bool) { + if r < t[0].first { + return 0, false + } + if r > t[len(t)-1].last { + return 0, false + } + + bot := 0 + top := len(t) - 1 + for top >= bot { + mid := (bot + top) >> 1 + + switch { + case t[mid].last < r: + bot = mid + 1 + case t[mid].first > r: + top = mid - 1 + default: + return int(t[mid].width), true + } + } + + return 0, false +} + +func runeWidthNoLUT(r rune, eastAsian, strictEmojiNeutral bool) int { + tablesOnce.Do(initTables) + if !eastAsian { + if r < 0x20 { + return 0 + } + if (r >= 0x7F && r <= 0x9F) || r == 0xAD { // nonprint + return 0 + } + if r < 0x300 { + return 1 + } + switch { + case inTable(r, zerowidth): + return 0 + case inTable(r, doublewidth): + return 2 + default: + return 1 + } + } + + if r < 0x300 { + return int(strictWidthLUT[1][r]) + } + if w, ok := inWidthTable(r, eastAsianWidth); ok { + return w + } + if !strictEmojiNeutral && inTable(r, emoji) { + return 2 + } + return 1 +} + +// fillBytes sets every byte of b to v. It doubles the copied region on each +// iteration so large slices are filled at memcpy speed instead of one byte +// per loop iteration. +func fillBytes(b []byte, v byte) { + if len(b) == 0 { + return + } + b[0] = v + for i := 1; i < len(b); i *= 2 { + copy(b[i:], b[:i]) + } +} + +// buildStrictWidthLUT builds the strict-width lookup table above 0x300 +// exactly once. It paints whole intervals instead of computing every rune +// through the binary searches in runeWidthNoLUT. It must not write below +// 0x300: that region was filled by init and may be read concurrently. The +// result must stay identical to runeWidthNoLUT(r, eastAsian, true), which +// TestStrictWidthLUT verifies. +func buildStrictWidthLUT() { + strictWidthLUTOnce.Do(func() { + tablesOnce.Do(initTables) + + // paintHigh fills lut with w over each interval, clipped to 0x300+. + paintHigh := func(lut []byte, first, last rune, w byte) { + if first < 0x300 { + if last < 0x300 { + return + } + first = 0x300 + } + fillBytes(lut[first:last+1], w) + } + + // EastAsianWidth=false, StrictEmojiNeutral=true + lut := strictWidthLUT[0][:] + fillBytes(lut[0x300:], 1) + for _, iv := range doublewidth { + paintHigh(lut, iv.first, iv.last, 2) + } + // zerowidth is checked before doublewidth, so it wins on overlap. + for _, iv := range zerowidth { + paintHigh(lut, iv.first, iv.last, 0) + } + + // EastAsianWidth=true, StrictEmojiNeutral=true + lut = strictWidthLUT[1][:] + fillBytes(lut[0x300:], 1) + for _, iv := range eastAsianWidth { + paintHigh(lut, iv.first, iv.last, iv.width) + } + + strictWidthLUTLimit.Store(0x110000) + }) +} + var private = table{ {0x00E000, 0x00F8FF}, {0x0F0000, 0x0FFFFD}, {0x100000, 0x10FFFD}, } @@ -129,9 +368,20 @@ var nonprint = table{ // Condition have flag EastAsianWidth whether the current locale is CJK or not. type Condition struct { - combinedLut []byte + combinedLut []byte + // The flags combinedLut was built from, so that CreateLUT can tell a + // table that is still current from one that has to be rebuilt. + lutEastAsianWidth bool + lutStrictEmojiNeutral bool + EastAsianWidth bool StrictEmojiNeutral bool + + // Deprecated: ZWJ sequences are always handled through Unicode + // grapheme cluster segmentation now, so this flag has no effect. + // It is kept only for compatibility with code written against + // v0.0.9 and earlier. + ZeroWidthJoiner bool } // NewCondition return new instance of Condition which is current locale. @@ -139,48 +389,47 @@ func NewCondition() *Condition { return &Condition{ EastAsianWidth: EastAsianWidth, StrictEmojiNeutral: StrictEmojiNeutral, + ZeroWidthJoiner: ZeroWidthJoiner, } } // RuneWidth returns the number of cells in r. // See http://www.unicode.org/reports/tr11/ func (c *Condition) RuneWidth(r rune) int { + // This one compare doubles as the range check and the lazy-LUT check: + // out-of-range runes and runes above the built portion of + // strictWidthLUT both take the slow path. Once the LUT is fully built + // the limit is 0x110000 and only invalid runes go slow. + if uint32(r) >= uint32(strictWidthLUTLimit.Load()) { + return c.runeWidthSlow(r) + } + if len(c.combinedLut) > 0 { + return int(c.combinedLut[r>>1]>>(uint(r&1)*4)) & 3 + } + if c.StrictEmojiNeutral { + if c.EastAsianWidth { + return int(strictWidthLUT[1][r]) + } + return int(strictWidthLUT[0][r]) + } + return runeWidthNoLUT(r, c.EastAsianWidth, c.StrictEmojiNeutral) +} + +func (c *Condition) runeWidthSlow(r rune) int { if r < 0 || r > 0x10FFFF { return 0 } + buildStrictWidthLUT() if len(c.combinedLut) > 0 { return int(c.combinedLut[r>>1]>>(uint(r&1)*4)) & 3 } - // optimized version, verified by TestRuneWidthChecksums() - if !c.EastAsianWidth { - switch { - case r < 0x20: - return 0 - case (r >= 0x7F && r <= 0x9F) || r == 0xAD: // nonprint - return 0 - case r < 0x300: - return 1 - case inTable(r, zerowidth): - return 0 - case inTable(r, doublewidth): - return 2 - default: - return 1 - } - } else { - switch { - case inTable(r, zerowidth): - return 0 - case inTable(r, narrow): - return 1 - case inTable(r, widewidth): - return 2 - case !c.StrictEmojiNeutral && inTable(r, emoji): - return 2 - default: - return 1 + if c.StrictEmojiNeutral { + if c.EastAsianWidth { + return int(strictWidthLUT[1][r]) } + return int(strictWidthLUT[0][r]) } + return runeWidthNoLUT(r, c.EastAsianWidth, c.StrictEmojiNeutral) } // CreateLUT will create an in-memory lookup table of 557056 bytes for faster operation. @@ -190,6 +439,11 @@ func (c *Condition) CreateLUT() { const max = 0x110000 lut := c.combinedLut if len(c.combinedLut) != 0 { + if c.lutEastAsianWidth == c.EastAsianWidth && c.lutStrictEmojiNeutral == c.StrictEmojiNeutral { + // The table still matches the flags, so rebuilding it + // would produce the same bytes. + return + } // Remove so we don't use it. c.combinedLut = nil } else { @@ -202,10 +456,88 @@ func (c *Condition) CreateLUT() { lut[i] = uint8(x0) | uint8(x1)<<4 } c.combinedLut = lut + c.lutEastAsianWidth = c.EastAsianWidth + c.lutStrictEmojiNeutral = c.StrictEmojiNeutral +} + +// isASCII reports whether s has no byte above 0x7F, in which case every +// grapheme cluster in s is a single byte apart from CRLF. +func isASCII(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] >= 0x80 { + return false + } + } + return true +} + +// fillJoinerBits paints joinerBits from the joiner table. +func fillJoinerBits() { + for _, iv := range joiner { + if iv.first >= 0x10000 { + break // the table is sorted, the rest is astral + } + lo, hi := int(iv.first)-joinerBase, int(iv.last)-joinerBase + if hi >= len(joinerBits)*8 { + hi = len(joinerBits)*8 - 1 + } + for lo <= hi { + if lo&7 == 0 && lo+7 <= hi { + joinerBits[lo>>3] = 0xFF + lo += 8 + continue + } + joinerBits[lo>>3] |= 1 << uint(lo&7) + lo++ + } + } + // A byte that is not valid UTF-8 decodes to U+FFFD, and the segmenter + // can gather a run of such bytes into one cluster, which a rune loop + // has no way to see. Marking U+FFFD keeps those strings on the + // segmenter, and the only string it holds back needlessly is one that + // really contains U+FFFD. + i := int(utf8.RuneError) - joinerBase + joinerBits[i>>3] |= 1 << uint(i&7) +} + +// isJoiner reports whether r can join with a neighbour into a multi-rune +// grapheme cluster. A string of runes for which it reports false has one +// rune per cluster, so measuring it needs no grapheme segmentation. +func isJoiner(r rune) bool { + if r < joinerBase { + return r == '\r' + } + if r < 0x10000 { + i := r - joinerBase + return joinerBits[i>>3]&(1<<(uint(i)&7)) != 0 + } + return inTable(r, joiner) +} + +// graphemeWidth returns the width of a single grapheme cluster: the sum of +// the widths of its runes, capped at 2 cells. The cap keeps multi-rune +// sequences that render as a single glyph (ZWJ emoji, flags, Hangul jamo) +// from being counted wider than the two cells terminals give them. +func (c *Condition) graphemeWidth(cluster string) int { + width := 0 + for _, r := range cluster { + width += c.RuneWidth(r) + } + if width > 2 { + width = 2 + } + return width } // StringWidth return width as you can see func (c *Condition) StringWidth(s string) (width int) { + if len(s) == 1 { + b := s[0] + if b < 0x20 || b == 0x7F { + return 0 + } + return 1 + } if len(s) > 0 && len(s) <= utf8.UTFMax { r, size := utf8.DecodeRuneInString(s) if size == len(s) { @@ -213,36 +545,45 @@ func (c *Condition) StringWidth(s string) (width int) { } } // ASCII fast path: no grapheme clustering needed for pure ASCII - if isAllASCII(s) { - for i := 0; i < len(s); i++ { - b := s[i] - if b >= 0x20 && b != 0x7F { - width++ - } + for i := 0; i < len(s); i++ { + b := s[i] + if b >= 0x80 { + goto graphemes } + if b >= 0x20 && b != 0x7F { + width++ + } + } + return + +graphemes: + // Runes first: until one of them can join a cluster, each cluster is a + // single rune and segmenting the string would only find that out the + // expensive way. + if w, ok := c.runeWidthSum(s); ok { + width = w return } + width = 0 g := graphemes.FromString(s) for g.Next() { - var chWidth int - for _, r := range g.Value() { - chWidth = c.RuneWidth(r) - if chWidth > 0 { - break // Our best guess at this point is to use the width of the first non-zero-width rune. - } - } - width += chWidth + width += c.graphemeWidth(g.Value()) } return } -func isAllASCII(s string) bool { - for i := 0; i < len(s); i++ { - if s[i] >= 0x80 { - return false +// runeWidthSum adds up the widths of the runes in s, and reports false +// without a total once it meets a rune that can join a cluster, which is +// where per-rune widths stop being the whole story. +func (c *Condition) runeWidthSum(s string) (int, bool) { + width := 0 + for _, r := range s { + if isJoiner(r) { + return 0, false } + width += c.RuneWidth(r) } - return true + return width, true } // Truncate return string truncated with w cells @@ -251,17 +592,14 @@ func (c *Condition) Truncate(s string, w int, tail string) string { return s } w -= c.StringWidth(tail) + if pos, ok := c.truncateRunes(s, w); ok { + return s[:pos] + tail + } var width int pos := len(s) g := graphemes.FromString(s) for g.Next() { - var chWidth int - for _, r := range g.Value() { - chWidth = c.RuneWidth(r) - if chWidth > 0 { - break // See StringWidth() for details. - } - } + chWidth := c.graphemeWidth(g.Value()) if width+chWidth > w { pos = g.Start() break @@ -271,24 +609,51 @@ func (c *Condition) Truncate(s string, w int, tail string) string { return s[:pos] + tail } +// truncateRunes is the loop in Truncate with every rune taken for a whole +// cluster, which holds until a rune can join one. It reports false there +// and leaves the string to the segmenter. +func (c *Condition) truncateRunes(s string, w int) (int, bool) { + width := 0 + for i, r := range s { + if isJoiner(r) { + return 0, false + } + cw := c.RuneWidth(r) + if width+cw > w { + return i, true + } + width += cw + } + return len(s), true +} + +// endsCluster reports whether the byte at i, which follows a rune that +// cannot join a cluster, also starts one. Cutting there is only safe when +// the rune that follows does not reach back. +func endsCluster(s string, i int) bool { + if i >= len(s) { + return true + } + r, _ := utf8.DecodeRuneInString(s[i:]) + return !isJoiner(r) +} + // TruncateLeft cuts w cells from the beginning of the `s`. func (c *Condition) TruncateLeft(s string, w int, prefix string) string { if c.StringWidth(s) <= w { return prefix } + if pos, pad, ok := c.truncateLeftRunes(s, w); ok { + return prefix + strings.Repeat(" ", pad) + s[pos:] + } + var width int pos := len(s) g := graphemes.FromString(s) for g.Next() { - var chWidth int - for _, r := range g.Value() { - chWidth = c.RuneWidth(r) - if chWidth > 0 { - break // See StringWidth() for details. - } - } + chWidth := c.graphemeWidth(g.Value()) if width+chWidth > w { if width < w { @@ -307,25 +672,164 @@ func (c *Condition) TruncateLeft(s string, w int, prefix string) string { return prefix + s[pos:] } -// Wrap return string wrapped with w cells -func (c *Condition) Wrap(s string, w int) string { +// truncateLeftRunes is the loop in TruncateLeft with every rune taken for a +// whole cluster, returning the cut and the padding that replaces the cell +// the cut lands inside. It reports false at the first rune that can join a +// cluster. +func (c *Condition) truncateLeftRunes(s string, w int) (pos, pad int, ok bool) { + width := 0 + for i, r := range s { + if isJoiner(r) { + return 0, 0, false + } + cw := c.RuneWidth(r) + if width+cw > w { + if width >= w { + return i, 0, true + } + end := i + utf8.RuneLen(r) + if !endsCluster(s, end) { + return 0, 0, false + } + return end, width + cw - w, true + } + width += cw + } + return len(s), 0, true +} + +// TruncatePrefix cuts the beginning of `s` so the result fits in w cells, with prefix prepended +func (c *Condition) TruncatePrefix(s string, w int, prefix string) string { + if c.StringWidth(prefix) >= w { + return prefix + } + + sw := c.StringWidth(s) + if sw <= w { + return s + } + w -= c.StringWidth(prefix) + if pos, ok := c.truncatePrefixRunes(s, sw, w); ok { + return prefix + s[pos:] + } + var width int + var pos int + g := graphemes.FromString(s) + for g.Next() { + chWidth := c.graphemeWidth(g.Value()) + if sw-(width+chWidth) <= w { + pos = g.End() + break + } + width += chWidth + } + + return prefix + s[pos:] +} + +// truncatePrefixRunes is the loop in TruncatePrefix with every rune taken +// for a whole cluster, reporting false at the first rune that can join one. +func (c *Condition) truncatePrefixRunes(s string, sw, w int) (int, bool) { + width := 0 + for i, r := range s { + if isJoiner(r) { + return 0, false + } + cw := c.RuneWidth(r) + if sw-(width+cw) <= w { + end := i + utf8.RuneLen(r) + if !endsCluster(s, end) { + return 0, false + } + return end, true + } + width += cw + } + return 0, true +} + +// wrapRunes wraps s treating every rune as its own grapheme cluster, and +// reports false without a result once it meets a rune that can join one. +func (c *Condition) wrapRunes(s string, w int) (string, bool) { width := 0 var out strings.Builder - out.Grow(len(s) + len(s)/w + 1) + out.Grow(len(s) + len(s)/max(w, 1) + 1) for _, r := range s { + if isJoiner(r) { + return "", false + } cw := c.RuneWidth(r) if r == '\n' { out.WriteRune(r) width = 0 continue - } else if width+cw > w { + } + if width+cw > w { out.WriteByte('\n') width = 0 - out.WriteRune(r) + } + out.WriteRune(r) + width += cw + } + return out.String(), true +} + +// Wrap return string wrapped with w cells +func (c *Condition) Wrap(s string, w int) string { + // ASCII fast path: no grapheme clustering needed for pure ASCII + if isASCII(s) { + width := 0 + var out strings.Builder + // max keeps the capacity hint from dividing by zero when w is 0; + // a non-positive width breaks before every cluster, as it always + // has. + out.Grow(len(s) + len(s)/max(w, 1) + 1) + for i := 0; i < len(s); i++ { + b := s[i] + if b == '\n' { + out.WriteByte(b) + width = 0 + continue + } + // Same rule as the StringWidth fast path: no ASCII byte is + // wide or ambiguous, so the flags in c cannot change this. + cw := 0 + if b >= 0x20 && b != 0x7F { + cw = 1 + } + if width+cw > w { + out.WriteByte('\n') + width = 0 + } + out.WriteByte(b) width += cw + } + return out.String() + } + // Runes first, as in StringWidth. Reaching a rune that can join a + // cluster throws the wrapped text away and starts over on the + // segmenter, which is the uncommon case. + if out, ok := c.wrapRunes(s, w); ok { + return out + } + width := 0 + var out strings.Builder + out.Grow(len(s) + len(s)/max(w, 1) + 1) + g := graphemes.FromString(s) + for g.Next() { + cluster := g.Value() + // LF and CRLF are each a single cluster + if strings.HasSuffix(cluster, "\n") { + out.WriteString(cluster) + width = 0 continue } - out.WriteRune(r) + cw := c.graphemeWidth(cluster) + if width+cw > w { + out.WriteByte('\n') + width = 0 + } + out.WriteString(cluster) width += cw } return out.String() @@ -336,11 +840,7 @@ func (c *Condition) FillLeft(s string, w int) string { width := c.StringWidth(s) count := w - width if count > 0 { - b := make([]byte, count) - for i := range b { - b[i] = ' ' - } - return string(b) + s + return strings.Repeat(" ", count) + s } return s } @@ -350,11 +850,7 @@ func (c *Condition) FillRight(s string, w int) string { width := c.StringWidth(s) count := w - width if count > 0 { - b := make([]byte, count) - for i := range b { - b[i] = ' ' - } - return s + string(b) + return s + strings.Repeat(" ", count) } return s } @@ -395,6 +891,11 @@ func TruncateLeft(s string, w int, prefix string) string { return DefaultCondition.TruncateLeft(s, w, prefix) } +// TruncatePrefix cuts the beginning of `s` so the result fits in w cells, with prefix prepended +func TruncatePrefix(s string, w int, prefix string) string { + return DefaultCondition.TruncatePrefix(s, w, prefix) +} + // Wrap return string wrapped with w cells func Wrap(s string, w int) string { return DefaultCondition.Wrap(s, w) @@ -412,9 +913,8 @@ func FillRight(s string, w int) string { // CreateLUT will create an in-memory lookup table of 557055 bytes for faster operation. // This should not be called concurrently with other operations. +// If flags in DefaultCondition are changed, CreateLUT should be called again; +// a call that finds the table already current is a no-op. func CreateLUT() { - if len(DefaultCondition.combinedLut) > 0 { - return - } DefaultCondition.CreateLUT() } diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go index 5a31d738ecc..16673af3a1c 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go @@ -5,35 +5,50 @@ package runewidth import ( "os" - "regexp" "strings" ) -var reLoc = regexp.MustCompile(`^[a-z][a-z][a-z]?(?:_[A-Z][A-Z])?\.(.+)`) +func mblen(charset string) int { + switch charset { + case "utf-8", "utf8": + return 6 + case "jis": + return 8 + case "eucjp": + return 3 + case "euckr", "euccn", "sjis", "cp932", "cp51932", "cp936", "cp949", "cp950", "big5", "gbk", "gb2312": + return 2 + } + return 1 +} -var mblenTable = map[string]int{ - "utf-8": 6, - "utf8": 6, - "jis": 8, - "eucjp": 3, - "euckr": 2, - "euccn": 2, - "sjis": 2, - "cp932": 2, - "cp51932": 2, - "cp936": 2, - "cp949": 2, - "cp950": 2, - "big5": 2, - "gbk": 2, - "gb2312": 2, +// localeCharset extracts the charset part of a locale name of the form +// "ll.CHARSET" or "ll_CC.CHARSET" (two- or three-letter language code, +// optional uppercase country code). It returns "" if locale does not have +// that shape. +func localeCharset(locale string) string { + n := 0 + for n < len(locale) && locale[n] >= 'a' && locale[n] <= 'z' { + n++ + } + if n < 2 || n > 3 { + return "" + } + rest := locale[n:] + if len(rest) >= 3 && rest[0] == '_' && + rest[1] >= 'A' && rest[1] <= 'Z' && rest[2] >= 'A' && rest[2] <= 'Z' { + rest = rest[3:] + } + if len(rest) >= 2 && rest[0] == '.' { + return rest[1:] + } + return "" } func isEastAsian(locale string) bool { charset := strings.ToLower(locale) - r := reLoc.FindStringSubmatch(locale) - if len(r) == 2 { - charset = strings.ToLower(r[1]) + if cs := localeCharset(locale); cs != "" { + charset = strings.ToLower(cs) } if strings.HasSuffix(charset, "@cjk_narrow") { @@ -46,10 +61,7 @@ func isEastAsian(locale string) bool { break } } - max := 1 - if m, ok := mblenTable[charset]; ok { - max = m - } + max := mblen(charset) if max > 1 && (charset[0] != 'u' || strings.HasPrefix(locale, "ja") || strings.HasPrefix(locale, "ko") || diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_table.go b/vendor/github.com/mattn/go-runewidth/runewidth_table.go index cdd003e646c..be9618dd369 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_table.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_table.go @@ -3,23 +3,127 @@ package runewidth var combining = table{ - {0x0300, 0x036F}, {0x0483, 0x0489}, {0x07EB, 0x07F3}, - {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0CF3, 0x0CF3}, - {0x0D00, 0x0D01}, {0x135D, 0x135F}, {0x180B, 0x180D}, - {0x180F, 0x180F}, {0x1A7F, 0x1A7F}, {0x1AB0, 0x1ADD}, - {0x1AE0, 0x1AEB}, {0x1B6B, 0x1B73}, {0x1DC0, 0x1DFF}, - {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2DE0, 0x2DFF}, - {0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D}, - {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA8E0, 0xA8F1}, - {0xFE00, 0xFE0F}, {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, - {0x10376, 0x1037A}, {0x10EAB, 0x10EAC}, {0x10F46, 0x10F50}, - {0x10F82, 0x10F85}, {0x11300, 0x11301}, {0x1133B, 0x1133C}, - {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x16AF0, 0x16AF4}, - {0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46}, {0x1D165, 0x1D169}, - {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, - {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, {0x1E000, 0x1E006}, - {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, - {0x1E026, 0x1E02A}, {0x1E08F, 0x1E08F}, {0x1E8D0, 0x1E8D6}, + {0x0300, 0x036F}, {0x0483, 0x0489}, {0x0591, 0x05BD}, + {0x05BF, 0x05BF}, {0x05C1, 0x05C2}, {0x05C4, 0x05C5}, + {0x05C7, 0x05C7}, {0x0610, 0x061A}, {0x064B, 0x065F}, + {0x0670, 0x0670}, {0x06D6, 0x06DC}, {0x06DF, 0x06E4}, + {0x06E7, 0x06E8}, {0x06EA, 0x06ED}, {0x0711, 0x0711}, + {0x0730, 0x074A}, {0x07A6, 0x07B0}, {0x07EB, 0x07F3}, + {0x07FD, 0x07FD}, {0x0816, 0x0819}, {0x081B, 0x0823}, + {0x0825, 0x0827}, {0x0829, 0x082D}, {0x0859, 0x085B}, + {0x0897, 0x089F}, {0x08CA, 0x08E1}, {0x08E3, 0x0902}, + {0x093A, 0x093A}, {0x093C, 0x093C}, {0x0941, 0x0948}, + {0x094D, 0x094D}, {0x0951, 0x0957}, {0x0962, 0x0963}, + {0x0981, 0x0981}, {0x09BC, 0x09BC}, {0x09C1, 0x09C4}, + {0x09CD, 0x09CD}, {0x09E2, 0x09E3}, {0x09FE, 0x09FE}, + {0x0A01, 0x0A02}, {0x0A3C, 0x0A3C}, {0x0A41, 0x0A42}, + {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, + {0x0A70, 0x0A71}, {0x0A75, 0x0A75}, {0x0A81, 0x0A82}, + {0x0ABC, 0x0ABC}, {0x0AC1, 0x0AC5}, {0x0AC7, 0x0AC8}, + {0x0ACD, 0x0ACD}, {0x0AE2, 0x0AE3}, {0x0AFA, 0x0AFF}, + {0x0B01, 0x0B01}, {0x0B3C, 0x0B3C}, {0x0B3F, 0x0B3F}, + {0x0B41, 0x0B44}, {0x0B4D, 0x0B4D}, {0x0B55, 0x0B56}, + {0x0B62, 0x0B63}, {0x0B82, 0x0B82}, {0x0BC0, 0x0BC0}, + {0x0BCD, 0x0BCD}, {0x0C00, 0x0C00}, {0x0C04, 0x0C04}, + {0x0C3C, 0x0C3C}, {0x0C3E, 0x0C40}, {0x0C46, 0x0C48}, + {0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, {0x0C62, 0x0C63}, + {0x0C81, 0x0C81}, {0x0CBC, 0x0CBC}, {0x0CBF, 0x0CBF}, + {0x0CC6, 0x0CC6}, {0x0CCC, 0x0CCD}, {0x0CE2, 0x0CE3}, + {0x0CF3, 0x0CF3}, {0x0D00, 0x0D01}, {0x0D3B, 0x0D3C}, + {0x0D41, 0x0D44}, {0x0D4D, 0x0D4D}, {0x0D62, 0x0D63}, + {0x0D81, 0x0D81}, {0x0DCA, 0x0DCA}, {0x0DD2, 0x0DD4}, + {0x0DD6, 0x0DD6}, {0x0E31, 0x0E31}, {0x0E34, 0x0E3A}, + {0x0E47, 0x0E4E}, {0x0EB1, 0x0EB1}, {0x0EB4, 0x0EBC}, + {0x0EC8, 0x0ECE}, {0x0F18, 0x0F19}, {0x0F35, 0x0F35}, + {0x0F37, 0x0F37}, {0x0F39, 0x0F39}, {0x0F71, 0x0F7E}, + {0x0F80, 0x0F84}, {0x0F86, 0x0F87}, {0x0F8D, 0x0F97}, + {0x0F99, 0x0FBC}, {0x0FC6, 0x0FC6}, {0x102D, 0x1030}, + {0x1032, 0x1037}, {0x1039, 0x103A}, {0x103D, 0x103E}, + {0x1058, 0x1059}, {0x105E, 0x1060}, {0x1071, 0x1074}, + {0x1082, 0x1082}, {0x1085, 0x1086}, {0x108D, 0x108D}, + {0x109D, 0x109D}, {0x135D, 0x135F}, {0x1712, 0x1714}, + {0x1732, 0x1733}, {0x1752, 0x1753}, {0x1772, 0x1773}, + {0x17B4, 0x17B5}, {0x17B7, 0x17BD}, {0x17C6, 0x17C6}, + {0x17C9, 0x17D3}, {0x17DD, 0x17DD}, {0x180B, 0x180D}, + {0x180F, 0x180F}, {0x1885, 0x1886}, {0x18A9, 0x18A9}, + {0x1920, 0x1922}, {0x1927, 0x1928}, {0x1932, 0x1932}, + {0x1939, 0x193B}, {0x1A17, 0x1A18}, {0x1A1B, 0x1A1B}, + {0x1A56, 0x1A56}, {0x1A58, 0x1A5E}, {0x1A60, 0x1A60}, + {0x1A62, 0x1A62}, {0x1A65, 0x1A6C}, {0x1A73, 0x1A7C}, + {0x1A7F, 0x1A7F}, {0x1AB0, 0x1ADD}, {0x1AE0, 0x1AEB}, + {0x1B00, 0x1B03}, {0x1B34, 0x1B34}, {0x1B36, 0x1B3A}, + {0x1B3C, 0x1B3C}, {0x1B42, 0x1B42}, {0x1B6B, 0x1B73}, + {0x1B80, 0x1B81}, {0x1BA2, 0x1BA5}, {0x1BA8, 0x1BA9}, + {0x1BAB, 0x1BAD}, {0x1BE6, 0x1BE6}, {0x1BE8, 0x1BE9}, + {0x1BED, 0x1BED}, {0x1BEF, 0x1BF1}, {0x1C2C, 0x1C33}, + {0x1C36, 0x1C37}, {0x1CD0, 0x1CD2}, {0x1CD4, 0x1CE0}, + {0x1CE2, 0x1CE8}, {0x1CED, 0x1CED}, {0x1CF4, 0x1CF4}, + {0x1CF8, 0x1CF9}, {0x1DC0, 0x1DFF}, {0x20D0, 0x20F0}, + {0x2CEF, 0x2CF1}, {0x2D7F, 0x2D7F}, {0x2DE0, 0x2DFF}, + {0x302A, 0x302D}, {0x3099, 0x309A}, {0xA66F, 0xA672}, + {0xA674, 0xA67D}, {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, + {0xA802, 0xA802}, {0xA806, 0xA806}, {0xA80B, 0xA80B}, + {0xA825, 0xA826}, {0xA82C, 0xA82C}, {0xA8C4, 0xA8C5}, + {0xA8E0, 0xA8F1}, {0xA8FF, 0xA8FF}, {0xA926, 0xA92D}, + {0xA947, 0xA951}, {0xA980, 0xA982}, {0xA9B3, 0xA9B3}, + {0xA9B6, 0xA9B9}, {0xA9BC, 0xA9BD}, {0xA9E5, 0xA9E5}, + {0xAA29, 0xAA2E}, {0xAA31, 0xAA32}, {0xAA35, 0xAA36}, + {0xAA43, 0xAA43}, {0xAA4C, 0xAA4C}, {0xAA7C, 0xAA7C}, + {0xAAB0, 0xAAB0}, {0xAAB2, 0xAAB4}, {0xAAB7, 0xAAB8}, + {0xAABE, 0xAABF}, {0xAAC1, 0xAAC1}, {0xAAEC, 0xAAED}, + {0xAAF6, 0xAAF6}, {0xABE5, 0xABE5}, {0xABE8, 0xABE8}, + {0xABED, 0xABED}, {0xFB1E, 0xFB1E}, {0xFE00, 0xFE0F}, + {0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, {0x102E0, 0x102E0}, + {0x10376, 0x1037A}, {0x10A01, 0x10A03}, {0x10A05, 0x10A06}, + {0x10A0C, 0x10A0F}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A3F}, + {0x10AE5, 0x10AE6}, {0x10D24, 0x10D27}, {0x10D69, 0x10D6D}, + {0x10EAB, 0x10EAC}, {0x10EFA, 0x10EFF}, {0x10F46, 0x10F50}, + {0x10F82, 0x10F85}, {0x11001, 0x11001}, {0x11038, 0x11046}, + {0x11070, 0x11070}, {0x11073, 0x11074}, {0x1107F, 0x11081}, + {0x110B3, 0x110B6}, {0x110B9, 0x110BA}, {0x110C2, 0x110C2}, + {0x11100, 0x11102}, {0x11127, 0x1112B}, {0x1112D, 0x11134}, + {0x11173, 0x11173}, {0x11180, 0x11181}, {0x111B6, 0x111BE}, + {0x111C9, 0x111CC}, {0x111CF, 0x111CF}, {0x1122F, 0x11231}, + {0x11234, 0x11234}, {0x11236, 0x11237}, {0x1123E, 0x1123E}, + {0x11241, 0x11241}, {0x112DF, 0x112DF}, {0x112E3, 0x112EA}, + {0x11300, 0x11301}, {0x1133B, 0x1133C}, {0x11340, 0x11340}, + {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x113BB, 0x113C0}, + {0x113CE, 0x113CE}, {0x113D0, 0x113D0}, {0x113D2, 0x113D2}, + {0x113E1, 0x113E2}, {0x11438, 0x1143F}, {0x11442, 0x11444}, + {0x11446, 0x11446}, {0x1145E, 0x1145E}, {0x114B3, 0x114B8}, + {0x114BA, 0x114BA}, {0x114BF, 0x114C0}, {0x114C2, 0x114C3}, + {0x115B2, 0x115B5}, {0x115BC, 0x115BD}, {0x115BF, 0x115C0}, + {0x115DC, 0x115DD}, {0x11633, 0x1163A}, {0x1163D, 0x1163D}, + {0x1163F, 0x11640}, {0x116AB, 0x116AB}, {0x116AD, 0x116AD}, + {0x116B0, 0x116B5}, {0x116B7, 0x116B7}, {0x1171D, 0x1171D}, + {0x1171F, 0x1171F}, {0x11722, 0x11725}, {0x11727, 0x1172B}, + {0x1182F, 0x11837}, {0x11839, 0x1183A}, {0x1193B, 0x1193C}, + {0x1193E, 0x1193E}, {0x11943, 0x11943}, {0x119D4, 0x119D7}, + {0x119DA, 0x119DB}, {0x119E0, 0x119E0}, {0x11A01, 0x11A0A}, + {0x11A33, 0x11A38}, {0x11A3B, 0x11A3E}, {0x11A47, 0x11A47}, + {0x11A51, 0x11A56}, {0x11A59, 0x11A5B}, {0x11A8A, 0x11A96}, + {0x11A98, 0x11A99}, {0x11B60, 0x11B60}, {0x11B62, 0x11B64}, + {0x11B66, 0x11B66}, {0x11C30, 0x11C36}, {0x11C38, 0x11C3D}, + {0x11C3F, 0x11C3F}, {0x11C92, 0x11CA7}, {0x11CAA, 0x11CB0}, + {0x11CB2, 0x11CB3}, {0x11CB5, 0x11CB6}, {0x11D31, 0x11D36}, + {0x11D3A, 0x11D3A}, {0x11D3C, 0x11D3D}, {0x11D3F, 0x11D45}, + {0x11D47, 0x11D47}, {0x11D90, 0x11D91}, {0x11D95, 0x11D95}, + {0x11D97, 0x11D97}, {0x11EF3, 0x11EF4}, {0x11F00, 0x11F01}, + {0x11F36, 0x11F3A}, {0x11F40, 0x11F40}, {0x11F42, 0x11F42}, + {0x11F5A, 0x11F5A}, {0x13440, 0x13440}, {0x13447, 0x13455}, + {0x1611E, 0x16129}, {0x1612D, 0x1612F}, {0x16AF0, 0x16AF4}, + {0x16B30, 0x16B36}, {0x16F4F, 0x16F4F}, {0x16F8F, 0x16F92}, + {0x16FE4, 0x16FE4}, {0x1BC9D, 0x1BC9E}, {0x1CF00, 0x1CF2D}, + {0x1CF30, 0x1CF46}, {0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, + {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD}, + {0x1D242, 0x1D244}, {0x1DA00, 0x1DA36}, {0x1DA3B, 0x1DA6C}, + {0x1DA75, 0x1DA75}, {0x1DA84, 0x1DA84}, {0x1DA9B, 0x1DA9F}, + {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, {0x1E008, 0x1E018}, + {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, + {0x1E08F, 0x1E08F}, {0x1E130, 0x1E136}, {0x1E2AE, 0x1E2AE}, + {0x1E2EC, 0x1E2EF}, {0x1E4EC, 0x1E4EF}, {0x1E5EE, 0x1E5EF}, + {0x1E6E3, 0x1E6E3}, {0x1E6E6, 0x1E6E6}, {0x1E6EE, 0x1E6EF}, + {0x1E6F5, 0x1E6F5}, {0x1E8D0, 0x1E8D6}, {0x1E944, 0x1E94A}, {0xE0100, 0xE01EF}, } @@ -486,3 +590,120 @@ var emoji = table{ {0x1F947, 0x1F9FF}, {0x1FA58, 0x1FA5F}, {0x1FA6E, 0x1FAFF}, {0x1FC00, 0x1FFFD}, } + +var joiner = table{ + {0x0300, 0x036F}, {0x0483, 0x0489}, {0x0591, 0x05BD}, + {0x05BF, 0x05BF}, {0x05C1, 0x05C2}, {0x05C4, 0x05C5}, + {0x05C7, 0x05C7}, {0x0600, 0x0605}, {0x0610, 0x061A}, + {0x064B, 0x065F}, {0x0670, 0x0670}, {0x06D6, 0x06DD}, + {0x06DF, 0x06E4}, {0x06E7, 0x06E8}, {0x06EA, 0x06ED}, + {0x070F, 0x070F}, {0x0711, 0x0711}, {0x0730, 0x074A}, + {0x07A6, 0x07B0}, {0x07EB, 0x07F3}, {0x07FD, 0x07FD}, + {0x0816, 0x0819}, {0x081B, 0x0823}, {0x0825, 0x0827}, + {0x0829, 0x082D}, {0x0859, 0x085B}, {0x0890, 0x0891}, + {0x0897, 0x089F}, {0x08CA, 0x0903}, {0x093A, 0x093C}, + {0x093E, 0x094F}, {0x0951, 0x0957}, {0x0962, 0x0963}, + {0x0981, 0x0983}, {0x09BC, 0x09BC}, {0x09BE, 0x09C4}, + {0x09C7, 0x09C8}, {0x09CB, 0x09CD}, {0x09D7, 0x09D7}, + {0x09E2, 0x09E3}, {0x09FE, 0x09FE}, {0x0A01, 0x0A03}, + {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, {0x0A47, 0x0A48}, + {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, {0x0A70, 0x0A71}, + {0x0A75, 0x0A75}, {0x0A81, 0x0A83}, {0x0ABC, 0x0ABC}, + {0x0ABE, 0x0AC5}, {0x0AC7, 0x0AC9}, {0x0ACB, 0x0ACD}, + {0x0AE2, 0x0AE3}, {0x0AFA, 0x0AFF}, {0x0B01, 0x0B03}, + {0x0B3C, 0x0B3C}, {0x0B3E, 0x0B44}, {0x0B47, 0x0B48}, + {0x0B4B, 0x0B4D}, {0x0B55, 0x0B57}, {0x0B62, 0x0B63}, + {0x0B82, 0x0B82}, {0x0BBE, 0x0BC2}, {0x0BC6, 0x0BC8}, + {0x0BCA, 0x0BCD}, {0x0BD7, 0x0BD7}, {0x0C00, 0x0C04}, + {0x0C3C, 0x0C3C}, {0x0C3E, 0x0C44}, {0x0C46, 0x0C48}, + {0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, {0x0C62, 0x0C63}, + {0x0C81, 0x0C83}, {0x0CBC, 0x0CBC}, {0x0CBE, 0x0CC4}, + {0x0CC6, 0x0CC8}, {0x0CCA, 0x0CCD}, {0x0CD5, 0x0CD6}, + {0x0CE2, 0x0CE3}, {0x0CF3, 0x0CF3}, {0x0D00, 0x0D03}, + {0x0D3B, 0x0D3C}, {0x0D3E, 0x0D44}, {0x0D46, 0x0D48}, + {0x0D4A, 0x0D4E}, {0x0D57, 0x0D57}, {0x0D62, 0x0D63}, + {0x0D81, 0x0D83}, {0x0DCA, 0x0DCA}, {0x0DCF, 0x0DD4}, + {0x0DD6, 0x0DD6}, {0x0DD8, 0x0DDF}, {0x0DF2, 0x0DF3}, + {0x0E31, 0x0E31}, {0x0E33, 0x0E3A}, {0x0E47, 0x0E4E}, + {0x0EB1, 0x0EB1}, {0x0EB3, 0x0EBC}, {0x0EC8, 0x0ECE}, + {0x0F18, 0x0F19}, {0x0F35, 0x0F35}, {0x0F37, 0x0F37}, + {0x0F39, 0x0F39}, {0x0F3E, 0x0F3F}, {0x0F71, 0x0F84}, + {0x0F86, 0x0F87}, {0x0F8D, 0x0F97}, {0x0F99, 0x0FBC}, + {0x0FC6, 0x0FC6}, {0x102D, 0x1037}, {0x1039, 0x103E}, + {0x1056, 0x1059}, {0x105E, 0x1060}, {0x1071, 0x1074}, + {0x1082, 0x1082}, {0x1084, 0x1086}, {0x108D, 0x108D}, + {0x109D, 0x109D}, {0x1100, 0x11FF}, {0x135D, 0x135F}, + {0x1712, 0x1715}, {0x1732, 0x1734}, {0x1752, 0x1753}, + {0x1772, 0x1773}, {0x17B4, 0x17D3}, {0x17DD, 0x17DD}, + {0x180B, 0x180D}, {0x180F, 0x180F}, {0x1885, 0x1886}, + {0x18A9, 0x18A9}, {0x1920, 0x192B}, {0x1930, 0x193B}, + {0x1A17, 0x1A1B}, {0x1A55, 0x1A5E}, {0x1A60, 0x1A60}, + {0x1A62, 0x1A62}, {0x1A65, 0x1A7C}, {0x1A7F, 0x1A7F}, + {0x1AB0, 0x1ADD}, {0x1AE0, 0x1AEB}, {0x1B00, 0x1B04}, + {0x1B34, 0x1B44}, {0x1B6B, 0x1B73}, {0x1B80, 0x1B82}, + {0x1BA1, 0x1BAD}, {0x1BE6, 0x1BF3}, {0x1C24, 0x1C37}, + {0x1CD0, 0x1CD2}, {0x1CD4, 0x1CE8}, {0x1CED, 0x1CED}, + {0x1CF4, 0x1CF4}, {0x1CF7, 0x1CF9}, {0x1DC0, 0x1DFF}, + {0x200C, 0x200D}, {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, + {0x2D7F, 0x2D7F}, {0x2DE0, 0x2DFF}, {0x302A, 0x302F}, + {0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D}, + {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA802, 0xA802}, + {0xA806, 0xA806}, {0xA80B, 0xA80B}, {0xA823, 0xA827}, + {0xA82C, 0xA82C}, {0xA880, 0xA881}, {0xA8B4, 0xA8C5}, + {0xA8E0, 0xA8F1}, {0xA8FF, 0xA8FF}, {0xA926, 0xA92D}, + {0xA947, 0xA953}, {0xA960, 0xA97C}, {0xA980, 0xA983}, + {0xA9B3, 0xA9C0}, {0xA9E5, 0xA9E5}, {0xAA29, 0xAA36}, + {0xAA43, 0xAA43}, {0xAA4C, 0xAA4D}, {0xAA7C, 0xAA7C}, + {0xAAB0, 0xAAB0}, {0xAAB2, 0xAAB4}, {0xAAB7, 0xAAB8}, + {0xAABE, 0xAABF}, {0xAAC1, 0xAAC1}, {0xAAEB, 0xAAEF}, + {0xAAF5, 0xAAF6}, {0xABE3, 0xABEA}, {0xABEC, 0xABED}, + {0xAC00, 0xD7A3}, {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, + {0xFB1E, 0xFB1E}, {0xFE00, 0xFE0F}, {0xFE20, 0xFE2F}, + {0xFF9E, 0xFF9F}, {0x101FD, 0x101FD}, {0x102E0, 0x102E0}, + {0x10376, 0x1037A}, {0x10A01, 0x10A03}, {0x10A05, 0x10A06}, + {0x10A0C, 0x10A0F}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A3F}, + {0x10AE5, 0x10AE6}, {0x10D24, 0x10D27}, {0x10D69, 0x10D6D}, + {0x10EAB, 0x10EAC}, {0x10EFA, 0x10EFF}, {0x10F46, 0x10F50}, + {0x10F82, 0x10F85}, {0x11000, 0x11002}, {0x11038, 0x11046}, + {0x11070, 0x11070}, {0x11073, 0x11074}, {0x1107F, 0x11082}, + {0x110B0, 0x110BA}, {0x110BD, 0x110BD}, {0x110C2, 0x110C2}, + {0x110CD, 0x110CD}, {0x11100, 0x11102}, {0x11127, 0x11134}, + {0x11145, 0x11146}, {0x11173, 0x11173}, {0x11180, 0x11182}, + {0x111B3, 0x111C0}, {0x111C2, 0x111C3}, {0x111C9, 0x111CC}, + {0x111CE, 0x111CF}, {0x1122C, 0x11237}, {0x1123E, 0x1123E}, + {0x11241, 0x11241}, {0x112DF, 0x112EA}, {0x11300, 0x11303}, + {0x1133B, 0x1133C}, {0x1133E, 0x11344}, {0x11347, 0x11348}, + {0x1134B, 0x1134D}, {0x11357, 0x11357}, {0x11362, 0x11363}, + {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x113B8, 0x113C0}, + {0x113C2, 0x113C2}, {0x113C5, 0x113C5}, {0x113C7, 0x113CA}, + {0x113CC, 0x113D2}, {0x113E1, 0x113E2}, {0x11435, 0x11446}, + {0x1145E, 0x1145E}, {0x114B0, 0x114C3}, {0x115AF, 0x115B5}, + {0x115B8, 0x115C0}, {0x115DC, 0x115DD}, {0x11630, 0x11640}, + {0x116AB, 0x116B7}, {0x1171D, 0x1171F}, {0x11722, 0x1172B}, + {0x1182C, 0x1183A}, {0x11930, 0x11935}, {0x11937, 0x11938}, + {0x1193B, 0x11943}, {0x119D1, 0x119D7}, {0x119DA, 0x119E0}, + {0x119E4, 0x119E4}, {0x11A01, 0x11A0A}, {0x11A33, 0x11A3E}, + {0x11A47, 0x11A47}, {0x11A51, 0x11A5B}, {0x11A84, 0x11A99}, + {0x11B60, 0x11B67}, {0x11C2F, 0x11C36}, {0x11C38, 0x11C3F}, + {0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, {0x11D31, 0x11D36}, + {0x11D3A, 0x11D3A}, {0x11D3C, 0x11D3D}, {0x11D3F, 0x11D47}, + {0x11D8A, 0x11D8E}, {0x11D90, 0x11D91}, {0x11D93, 0x11D97}, + {0x11EF3, 0x11EF6}, {0x11F00, 0x11F03}, {0x11F34, 0x11F3A}, + {0x11F3E, 0x11F42}, {0x11F5A, 0x11F5A}, {0x13440, 0x13440}, + {0x13447, 0x13455}, {0x1611E, 0x1612F}, {0x16AF0, 0x16AF4}, + {0x16B30, 0x16B36}, {0x16D63, 0x16D63}, {0x16D67, 0x16D6A}, + {0x16F4F, 0x16F4F}, {0x16F51, 0x16F87}, {0x16F8F, 0x16F92}, + {0x16FE4, 0x16FE4}, {0x16FF0, 0x16FF1}, {0x1BC9D, 0x1BC9E}, + {0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46}, {0x1D165, 0x1D169}, + {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, + {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, {0x1DA00, 0x1DA36}, + {0x1DA3B, 0x1DA6C}, {0x1DA75, 0x1DA75}, {0x1DA84, 0x1DA84}, + {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, + {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, + {0x1E026, 0x1E02A}, {0x1E08F, 0x1E08F}, {0x1E130, 0x1E136}, + {0x1E2AE, 0x1E2AE}, {0x1E2EC, 0x1E2EF}, {0x1E4EC, 0x1E4EF}, + {0x1E5EE, 0x1E5EF}, {0x1E6E3, 0x1E6E3}, {0x1E6E6, 0x1E6E6}, + {0x1E6EE, 0x1E6EF}, {0x1E6F5, 0x1E6F5}, {0x1E8D0, 0x1E8D6}, + {0x1E944, 0x1E94A}, {0x1F1E6, 0x1F1FF}, {0x1F3FB, 0x1F3FF}, + {0xE0020, 0xE007F}, {0xE0100, 0xE01EF}, +} diff --git a/vendor/github.com/miekg/dns/README.md b/vendor/github.com/miekg/dns/README.md index 8dc2472360b..7e09e1d1b38 100644 --- a/vendor/github.com/miekg/dns/README.md +++ b/vendor/github.com/miekg/dns/README.md @@ -3,15 +3,10 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/miekg/dns)](https://goreportcard.com/report/miekg/dns) [![](https://godoc.org/github.com/miekg/dns?status.svg)](https://godoc.org/github.com/miekg/dns) -DNS version 2 is now available at , check it out if you want to -help shape the next 15 years of the Go DNS package. +DNS version 2 is now available at . This version should be 2x faster across +the board. Further optimizations welcome. -The version here will see no new features and less and less development, and my time (if any) will be fully -devoted towards v2. - -**December 2025**: v2 should be (already) a good replacement, the coming months would be a good time to -migrate, see [this file describing the -differences](https://codeberg.org/miekg/dns/src/branch/main/README-diff-with-v1.md), to help you get started. +The version here will only see specific fixes and nothing else. At some point this repo will be archived. # Alternative (more granular) approach to a DNS library diff --git a/vendor/github.com/miekg/dns/dnssec.go b/vendor/github.com/miekg/dns/dnssec.go index ffdafcebda9..ef04f490cac 100644 --- a/vendor/github.com/miekg/dns/dnssec.go +++ b/vendor/github.com/miekg/dns/dnssec.go @@ -12,7 +12,6 @@ import ( _ "crypto/sha256" // need its init function _ "crypto/sha512" // need its init function "encoding/asn1" - "encoding/binary" "encoding/hex" "math/big" "sort" @@ -134,38 +133,27 @@ func (k *DNSKEY) KeyTag() uint16 { return 0 } var keytag int - switch k.Algorithm { - case RSAMD5: - // This algorithm has been deprecated, but keep this key-tag calculation. - // Look at the bottom two bytes of the modules, which the last item in the pubkey. - // See https://www.rfc-editor.org/errata/eid193 . - modulus, _ := fromBase64([]byte(k.PublicKey)) - if len(modulus) > 1 { - x := binary.BigEndian.Uint16(modulus[len(modulus)-3:]) - keytag = int(x) - } - default: - keywire := new(dnskeyWireFmt) - keywire.Flags = k.Flags - keywire.Protocol = k.Protocol - keywire.Algorithm = k.Algorithm - keywire.PublicKey = k.PublicKey - wire := make([]byte, DefaultMsgSize) - n, err := packKeyWire(keywire, wire) - if err != nil { - return 0 - } - wire = wire[:n] - for i, v := range wire { - if i&1 != 0 { - keytag += int(v) // must be larger than uint32 - } else { - keytag += int(v) << 8 - } + keywire := new(dnskeyWireFmt) + keywire.Flags = k.Flags + keywire.Protocol = k.Protocol + keywire.Algorithm = k.Algorithm + keywire.PublicKey = k.PublicKey + wire := make([]byte, DefaultMsgSize) + n, err := packKeyWire(keywire, wire) + if err != nil { + return 0 + } + wire = wire[:n] + for i, v := range wire { + if i&1 != 0 { + keytag += int(v) // must be larger than uint32 + } else { + keytag += int(v) << 8 } - keytag += keytag >> 16 & 0xFFFF - keytag &= 0xFFFF } + keytag += keytag >> 16 & 0xFFFF + keytag &= 0xFFFF + return uint16(keytag) } diff --git a/vendor/github.com/miekg/dns/tools.go b/vendor/github.com/miekg/dns/tools.go deleted file mode 100644 index ccf8f6bfc73..00000000000 --- a/vendor/github.com/miekg/dns/tools.go +++ /dev/null @@ -1,10 +0,0 @@ -//go:build tools -// +build tools - -// We include our tool dependencies for `go generate` here to ensure they're -// properly tracked by the go tool. See the Go Wiki for the rationale behind this: -// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module. - -package dns - -import _ "golang.org/x/tools/go/packages" diff --git a/vendor/github.com/miekg/dns/version.go b/vendor/github.com/miekg/dns/version.go index 33cb83e5ac8..78cfcc39ea8 100644 --- a/vendor/github.com/miekg/dns/version.go +++ b/vendor/github.com/miekg/dns/version.go @@ -3,7 +3,7 @@ package dns import "fmt" // Version is current version of this library. -var Version = v{1, 1, 72} +var Version = v{1, 1, 73} // v holds the version of this library. type v struct { diff --git a/vendor/github.com/miekg/dns/zmsg.go b/vendor/github.com/miekg/dns/zmsg.go index 8143ddc1b98..b2b49b15378 100644 --- a/vendor/github.com/miekg/dns/zmsg.go +++ b/vendor/github.com/miekg/dns/zmsg.go @@ -2369,7 +2369,7 @@ func (rr *RESINFO) unpack(msg []byte, off int) (off1 int, err error) { rr.Txt, off, err = unpackStringTxt(msg, off) if err != nil { - return off, err + return off, fmt.Errorf("RESINFO.Txt: %w", err) } return off, nil } diff --git a/vendor/github.com/olekukonko/ll/comb.hcl b/vendor/github.com/olekukonko/ll/comb.hcl index 791ed93bba7..20763e802ac 100644 --- a/vendor/github.com/olekukonko/ll/comb.hcl +++ b/vendor/github.com/olekukonko/ll/comb.hcl @@ -1,7 +1,12 @@ recursive = true output_file = "all.txt" extensions = [".go"] -exclude_dirs = ["_examples", "_lab", "_tmp", "pkg", "lab","bin","dist","assets","oppor"] -exclude_files = [""] +exclude_dirs { +items = ["_examples", "_lab", "_tmp", "pkg", "lab","bin"] +} +exclude_files { + items = ["before.txt","after.txt"] +} use_gitignore = true -detailed = true \ No newline at end of file +detailed = true +go_mode = "all" \ No newline at end of file diff --git a/vendor/github.com/olekukonko/ll/conditional.go b/vendor/github.com/olekukonko/ll/conditional.go index 7aa4434f381..581079bdda8 100644 --- a/vendor/github.com/olekukonko/ll/conditional.go +++ b/vendor/github.com/olekukonko/ll/conditional.go @@ -1,5 +1,16 @@ package ll +import ( + "sync" +) + +// conditionalPool pools Conditional instances to reduce allocations. +var conditionalPool = sync.Pool{ + New: func() any { + return &Conditional{} + }, +} + // Conditional enables conditional logging based on a boolean condition. // It wraps a logger with a condition that determines whether logging operations are executed, // optimizing performance by skipping expensive operations (e.g., field computation, message formatting) @@ -9,6 +20,21 @@ type Conditional struct { condition bool // Whether logging is allowed (true to log, false to skip) } +// getConditional retrieves a Conditional from the pool or creates a new one. +func getConditional(logger *Logger, condition bool) *Conditional { + c := conditionalPool.Get().(*Conditional) + c.logger = logger + c.condition = condition + return c +} + +// putConditional returns a Conditional to the pool for reuse. +func putConditional(c *Conditional) { + c.logger = nil + c.condition = false + conditionalPool.Put(c) +} + // If creates a conditional logger that logs only if the condition is true. // It returns a Conditional struct that wraps the logger, enabling conditional logging methods. // This method is typically called on a Logger instance to start a conditional chain. @@ -19,7 +45,7 @@ type Conditional struct { // logger.If(true).Info("Logged") // Output: [app] INFO: Logged // logger.If(false).Info("Ignored") // No output func (l *Logger) If(condition bool) *Conditional { - return &Conditional{logger: l, condition: condition} + return getConditional(l, condition) } // IfAny creates a conditional logger that logs only if at least one condition is true. @@ -40,7 +66,12 @@ func (cl *Conditional) IfAny(conditions ...bool) *Conditional { break } } - return &Conditional{logger: cl.logger, condition: result} + // Reuse current instance if condition unchanged + if cl.condition == result { + return cl + } + cl.condition = result + return cl } // IfErr creates a conditional logger that logs only if the error is non-nil. @@ -107,10 +138,16 @@ func (cl *Conditional) IfErr(err error) *Conditional { func (cl *Conditional) IfErrAny(errs ...error) *Conditional { for _, err := range errs { if err != nil { - return &Conditional{logger: cl.logger, condition: cl.condition && true} + // Reuse if condition already true + if cl.condition { + return cl + } + cl.condition = true + return cl } } - return &Conditional{logger: cl.logger, condition: false} + cl.condition = false + return cl } // IfErrOne creates a conditional logger that logs only if ALL errors are non-nil. @@ -123,10 +160,14 @@ func (cl *Conditional) IfErrAny(errs ...error) *Conditional { func (cl *Conditional) IfErrOne(errs ...error) *Conditional { for _, err := range errs { if err == nil { - return &Conditional{logger: cl.logger, condition: false} + cl.condition = false + return cl } } - return &Conditional{logger: cl.logger, condition: cl.condition && len(errs) > 0} + if len(errs) > 0 { + cl.condition = cl.condition && true + } + return cl } // IfOne creates a conditional logger that logs only if all conditions are true. @@ -147,7 +188,12 @@ func (cl *Conditional) IfOne(conditions ...bool) *Conditional { break } } - return &Conditional{logger: cl.logger, condition: result} + // Reuse current instance if condition unchanged + if cl.condition == result { + return cl + } + cl.condition = result + return cl } // Debug logs a message at Debug level with variadic arguments if the condition is true. @@ -263,9 +309,10 @@ func (cl *Conditional) Fatalf(format string, args ...any) { // logger.If(true).Field(map[string]interface{}{"user": "alice"}).Info("Logged") // Output: [app] INFO: Logged [user=alice] // logger.If(false).Field(map[string]interface{}{"user": "alice"}).Info("Ignored") // No output func (cl *Conditional) Field(fields map[string]interface{}) *FieldBuilder { - // Skip field processing if condition is false + // Skip field processing if condition is false - return FieldBuilder with nil logger + // so that all subsequent logging methods become no-ops if !cl.condition { - return &FieldBuilder{logger: cl.logger, fields: nil} + return &FieldBuilder{logger: nil, fields: nil} } // Delegate to logger's Field method return cl.logger.Field(fields) @@ -280,9 +327,10 @@ func (cl *Conditional) Field(fields map[string]interface{}) *FieldBuilder { // logger.If(true).Fields("user", "alice").Info("Logged") // Output: [app] INFO: Logged [user=alice] // logger.If(false).Fields("user", "alice").Info("Ignored") // No output, no field processing func (cl *Conditional) Fields(pairs ...any) *FieldBuilder { - // Skip field processing if condition is false + // Skip field processing if condition is false - return FieldBuilder with nil logger + // so that all subsequent logging methods become no-ops if !cl.condition { - return &FieldBuilder{logger: cl.logger, fields: nil} + return &FieldBuilder{logger: nil, fields: nil} } // Delegate to logger's Fields method return cl.logger.Fields(pairs...) diff --git a/vendor/github.com/olekukonko/ll/field.go b/vendor/github.com/olekukonko/ll/field.go index ed18b529aaf..2de5b7ff399 100644 --- a/vendor/github.com/olekukonko/ll/field.go +++ b/vendor/github.com/olekukonko/ll/field.go @@ -1,15 +1,24 @@ -// field.go package ll import ( "fmt" "os" "strings" + "sync" "github.com/olekukonko/cat" "github.com/olekukonko/ll/lx" ) +// fieldBuilderPool pools FieldBuilder instances to reduce allocations. +var fieldBuilderPool = sync.Pool{ + New: func() any { + return &FieldBuilder{ + fields: make(lx.Fields, 0, 8), // Pre-allocate common size + } + }, +} + // FieldBuilder enables fluent addition of fields before logging. // It acts as a builder pattern to attach key-value pairs (fields) to log entries, // supporting structured logging with metadata. The builder allows chaining to add fields @@ -19,6 +28,30 @@ type FieldBuilder struct { fields lx.Fields // Fields to include in the log entry as ordered key-value pairs } +// getFieldBuilder retrieves a FieldBuilder from the pool or creates a new one. +func getFieldBuilder(logger *Logger, capacity int) *FieldBuilder { + fb := fieldBuilderPool.Get().(*FieldBuilder) + fb.logger = logger + // Ensure minimum capacity to reduce small allocations + const minFieldCapacity = 4 + if capacity < minFieldCapacity { + capacity = minFieldCapacity + } + if cap(fb.fields) < capacity { + fb.fields = make(lx.Fields, 0, capacity) + } else { + fb.fields = fb.fields[:0] // Reset but keep capacity + } + return fb +} + +// putFieldBuilder returns a FieldBuilder to the pool for reuse. +func putFieldBuilder(fb *FieldBuilder) { + fb.logger = nil + fb.fields = fb.fields[:0] + fieldBuilderPool.Put(fb) +} + // Logger creates a new logger with the builder's fields embedded in its context. // It clones the parent logger and copies the builder's fields into the new logger's context, // enabling persistent field inclusion in subsequent logs. This method supports fluent chaining @@ -29,200 +62,185 @@ type FieldBuilder struct { // newLogger := logger.Fields("user", "alice").Logger() // newLogger.Info("Action") // Output: [app] INFO: Action [user=alice] func (fb *FieldBuilder) Logger() *Logger { + // If logger is nil (e.g., from a false Conditional), return nil + if fb.logger == nil { + return nil + } // Clone the parent logger to preserve its configuration newLogger := fb.logger.Clone() - // Copy builder's fields into the new logger's context - newLogger.context = make(lx.Fields, len(fb.fields)) - copy(newLogger.context, fb.fields) + // Copy builder's fields into the new logger's context (optimized) + if len(fb.fields) > 0 { + newLogger.context = append(lx.Fields(nil), fb.fields...) + } return newLogger } // Info logs a message at Info level with the builder's fields. -// It concatenates the arguments with spaces and delegates to the logger's log method, -// returning early if fields are nil. This method is used for informational messages. +// It concatenates the arguments with spaces and delegates to the logger's log method. +// This method is used for informational messages. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Info("Action", "started") // Output: [app] INFO: Action started [user=alice] func (fb *FieldBuilder) Info(args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Log at Info level with the builder's fields, no stack trace fb.logger.log(lx.LevelInfo, lx.ClassText, cat.Space(args...), fb.fields, false) + putFieldBuilder(fb) } // Infof logs a message at Info level with the builder's fields. // It formats the message using the provided format string and arguments, then delegates -// to the logger's internal log method. If fields are nil, it returns early to avoid logging. -// This method is part of the fluent API, typically called after adding fields. +// to the logger's internal log method. This method is part of the fluent API. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Infof("Action %s", "started") // Output: [app] INFO: Action started [user=alice] func (fb *FieldBuilder) Infof(format string, args ...any) { - // Skip logging if fields are nil to prevent invalid log entries - if fb.fields == nil { + if fb.logger == nil { return } - // Format the message using the provided arguments msg := fmt.Sprintf(format, args...) - // Log at Info level with the builder's fields, no stack trace fb.logger.log(lx.LevelInfo, lx.ClassText, msg, fb.fields, false) + putFieldBuilder(fb) } // Debug logs a message at Debug level with the builder's fields. -// It concatenates the arguments with spaces and delegates to the logger's log method, -// returning early if fields are nil. This method is used for debugging information. +// It concatenates the arguments with spaces and delegates to the logger's log method. +// This method is used for debugging information. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Debug("Debugging", "mode") // Output: [app] DEBUG: Debugging mode [user=alice] func (fb *FieldBuilder) Debug(args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Log at Debug level with the builder's fields, no stack trace fb.logger.log(lx.LevelDebug, lx.ClassText, cat.Space(args...), fb.fields, false) + putFieldBuilder(fb) } // Debugf logs a message at Debug level with the builder's fields. -// It formats the message and delegates to the logger's log method, returning early if -// fields are nil. This method is used for debugging information that may be disabled in -// production environments. +// It formats the message and delegates to the logger's log method. +// This method is used for debugging information that may be disabled in production. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Debugf("Debug %s", "mode") // Output: [app] DEBUG: Debug mode [user=alice] func (fb *FieldBuilder) Debugf(format string, args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Format the message msg := fmt.Sprintf(format, args...) - // Log at Debug level with the builder's fields, no stack trace fb.logger.log(lx.LevelDebug, lx.ClassText, msg, fb.fields, false) + putFieldBuilder(fb) } // Warn logs a message at Warn level with the builder's fields. -// It concatenates the arguments with spaces and delegates to the logger's log method, -// returning early if fields are nil. This method is used for warning conditions. +// It concatenates the arguments with spaces and delegates to the logger's log method. +// This method is used for warning conditions. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Warn("Warning", "issued") // Output: [app] WARN: Warning issued [user=alice] func (fb *FieldBuilder) Warn(args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Log at Warn level with the builder's fields, no stack trace fb.logger.log(lx.LevelWarn, lx.ClassText, cat.Space(args...), fb.fields, false) + putFieldBuilder(fb) } // Warnf logs a message at Warn level with the builder's fields. -// It formats the message and delegates to the logger's log method, returning early if -// fields are nil. This method is used for warning conditions that do not halt execution. +// It formats the message and delegates to the logger's log method. +// This method is used for warning conditions that do not halt execution. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Warnf("Warning %s", "issued") // Output: [app] WARN: Warning issued [user=alice] func (fb *FieldBuilder) Warnf(format string, args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Format the message msg := fmt.Sprintf(format, args...) - // Log at Warn level with the builder's fields, no stack trace fb.logger.log(lx.LevelWarn, lx.ClassText, msg, fb.fields, false) + putFieldBuilder(fb) } // Error logs a message at Error level with the builder's fields. -// It concatenates the arguments with spaces and delegates to the logger's log method, -// returning early if fields are nil. This method is used for error conditions. +// It concatenates the arguments with spaces and delegates to the logger's log method. +// This method is used for error conditions. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Error("Error", "occurred") // Output: [app] ERROR: Error occurred [user=alice] func (fb *FieldBuilder) Error(args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Log at Error level with the builder's fields, no stack trace fb.logger.log(lx.LevelError, lx.ClassText, cat.Space(args...), fb.fields, false) + putFieldBuilder(fb) } // Errorf logs a message at Error level with the builder's fields. -// It formats the message and delegates to the logger's log method, returning early if -// fields are nil. This method is used for error conditions that may require attention. +// It formats the message and delegates to the logger's log method. +// This method is used for error conditions that may require attention. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Errorf("Error %s", "occurred") // Output: [app] ERROR: Error occurred [user=alice] func (fb *FieldBuilder) Errorf(format string, args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Format the message msg := fmt.Sprintf(format, args...) - // Log at Error level with the builder's fields, no stack trace fb.logger.log(lx.LevelError, lx.ClassText, msg, fb.fields, false) + putFieldBuilder(fb) } // Stack logs a message at Error level with a stack trace and the builder's fields. -// It concatenates the arguments with spaces and delegates to the logger's log method, -// returning early if fields are nil. This method is useful for debugging critical errors. +// It concatenates the arguments with spaces and delegates to the logger's log method. +// This method is useful for debugging critical errors. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Stack("Critical", "error") // Output: [app] ERROR: Critical error [user=alice stack=...] func (fb *FieldBuilder) Stack(args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Log at Error level with the builder's fields and a stack trace fb.logger.log(lx.LevelError, lx.ClassText, cat.Space(args...), fb.fields, true) + putFieldBuilder(fb) } // Stackf logs a message at Error level with a stack trace and the builder's fields. -// It formats the message and delegates to the logger's log method, returning early if -// fields are nil. This method is useful for debugging critical errors. +// It formats the message and delegates to the logger's log method. +// This method is useful for debugging critical errors. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Stackf("Critical %s", "error") // Output: [app] ERROR: Critical error [user=alice stack=...] func (fb *FieldBuilder) Stackf(format string, args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Format the message msg := fmt.Sprintf(format, args...) - // Log at Error level with the builder's fields and a stack trace fb.logger.log(lx.LevelError, lx.ClassText, msg, fb.fields, true) + putFieldBuilder(fb) } // Fatal logs a message at Error level with a stack trace and the builder's fields, then exits. // It constructs the message from variadic arguments, logs it with a stack trace, and terminates -// the program with exit code 1. Returns early if fields are nil. This method is used for -// unrecoverable errors. +// the program with exit code 1. This method is used for unrecoverable errors. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Fatal("Fatal", "error") // Output: [app] ERROR: Fatal error [user=alice stack=...], then exits func (fb *FieldBuilder) Fatal(args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Build the message by concatenating arguments with spaces var builder strings.Builder for i, arg := range args { if i > 0 { @@ -230,45 +248,37 @@ func (fb *FieldBuilder) Fatal(args ...any) { } builder.WriteString(fmt.Sprint(arg)) } - // Log at Error level with the builder's fields and a stack trace fb.logger.log(lx.LevelFatal, lx.ClassText, builder.String(), fb.fields, fb.logger.fatalStack) - - // Exit the program with status code 1 if fb.logger.fatalExits { os.Exit(1) } + putFieldBuilder(fb) } // Fatalf logs a formatted message at Error level with a stack trace and the builder's fields, -// then exits. It delegates to Fatal and returns early if fields are nil. This method is used -// for unrecoverable errors. +// then exits. It delegates to Fatal. This method is used for unrecoverable errors. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Fatalf("Fatal %s", "error") // Output: [app] ERROR: Fatal error [user=alice stack=...], then exits func (fb *FieldBuilder) Fatalf(format string, args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Format the message and pass to Fatal fb.Fatal(fmt.Sprintf(format, args...)) } // Panic logs a message at Error level with a stack trace and the builder's fields, then panics. // It constructs the message from variadic arguments, logs it with a stack trace, and triggers -// a panic with the message. Returns early if fields are nil. This method is used for critical -// errors that require immediate program termination with a panic. +// a panic with the message. This method is used for critical errors. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Panic("Panic", "error") // Output: [app] ERROR: Panic error [user=alice stack=...], then panics func (fb *FieldBuilder) Panic(args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Build the message by concatenating arguments with spaces var builder strings.Builder for i, arg := range args { if i > 0 { @@ -277,48 +287,36 @@ func (fb *FieldBuilder) Panic(args ...any) { builder.WriteString(fmt.Sprint(arg)) } msg := builder.String() - // Log at Error level with the builder's fields and a stack trace fb.logger.log(lx.LevelError, lx.ClassText, msg, fb.fields, true) - // Trigger a panic with the formatted message panic(msg) } // Panicf logs a formatted message at Error level with a stack trace and the builder's fields, -// then panics. It delegates to Panic and returns early if fields are nil. This method is used -// for critical errors that require immediate program termination with a panic. +// then panics. It delegates to Panic. This method is used for critical errors. // Example: // // logger := New("app").Enable() // logger.Fields("user", "alice").Panicf("Panic %s", "error") // Output: [app] ERROR: Panic error [user=alice stack=...], then panics func (fb *FieldBuilder) Panicf(format string, args ...any) { - // Skip logging if fields are nil - if fb.fields == nil { + if fb.logger == nil { return } - // Format the message and pass to Panic fb.Panic(fmt.Sprintf(format, args...)) } // Err adds one or more errors to the FieldBuilder as a field and logs them. // It stores non-nil errors in the "error" field: a single error if only one is non-nil, -// or a slice of errors if multiple are non-nil. It logs the concatenated string representations -// of non-nil errors (e.g., "failed 1; failed 2") at the Error level. Returns the FieldBuilder -// for chaining, allowing further field additions or logging. Thread-safe via the logger's mutex. +// or a slice of errors if multiple are non-nil. Returns the FieldBuilder for chaining. // Example: // // logger := New("app").Enable() // err1 := errors.New("failed 1") // err2 := errors.New("failed 2") // logger.Fields("k", "v").Err(err1, err2).Info("Error occurred") -// // Output: [app] ERROR: failed 1; failed 2 -// // [app] INFO: Error occurred [error=[failed 1 failed 2] k=v] func (fb *FieldBuilder) Err(errs ...error) *FieldBuilder { - // Initialize fields slice if nil - if fb.fields == nil { - fb.fields = make(lx.Fields, 0, 4) + if fb.logger == nil { + return fb } - - // Collect non-nil errors and build log message var nonNilErrors []error var builder strings.Builder count := 0 @@ -332,52 +330,36 @@ func (fb *FieldBuilder) Err(errs ...error) *FieldBuilder { count++ } } - - // Set error field and log if there are non-nil errors if count > 0 { if count == 1 { - // Store single error directly fb.fields = append(fb.fields, lx.Field{Key: "error", Value: nonNilErrors[0]}) } else { - // Store slice of errors fb.fields = append(fb.fields, lx.Field{Key: "error", Value: nonNilErrors}) } - // Log concatenated error messages at Error level fb.logger.log(lx.LevelError, lx.ClassText, builder.String(), nil, false) } - - // Return FieldBuilder for chaining return fb } // Merge adds additional key-value pairs to the FieldBuilder. -// It processes variadic arguments as key-value pairs, expecting string keys. Non-string keys -// or uneven pairs generate an "error" field with a descriptive message. Returns the FieldBuilder -// for chaining to allow further field additions or logging. +// It processes variadic arguments as key-value pairs, expecting string keys. +// Returns the FieldBuilder for chaining. // Example: // // logger := New("app").Enable() // logger.Fields("k1", "v1").Merge("k2", "v2").Info("Action") // Output: [app] INFO: Action [k1=v1 k2=v2] func (fb *FieldBuilder) Merge(pairs ...any) *FieldBuilder { - // Initialize fields slice if nil - if fb.fields == nil { - fb.fields = make(lx.Fields, 0, len(pairs)/2) - } - - // Process pairs as key-value, advancing by 2 + // Merge can work even with nil logger since it just manipulates fields for i := 0; i < len(pairs)-1; i += 2 { - // Ensure the key is a string if key, ok := pairs[i].(string); ok { fb.fields = append(fb.fields, lx.Field{Key: key, Value: pairs[i+1]}) } else { - // Log an error field for non-string keys fb.fields = append(fb.fields, lx.Field{ Key: "error", Value: fmt.Errorf("non-string key in Merge: %v", pairs[i]), }) } } - // Check for uneven pairs (missing value) if len(pairs)%2 != 0 { fb.fields = append(fb.fields, lx.Field{ Key: "error", diff --git a/vendor/github.com/olekukonko/ll/global.go b/vendor/github.com/olekukonko/ll/global.go index edc41fbcb94..dc7c2f43377 100644 --- a/vendor/github.com/olekukonko/ll/global.go +++ b/vendor/github.com/olekukonko/ll/global.go @@ -30,9 +30,9 @@ func Handler(handler lx.Handler) *Logger { // the specified level are ignored. Returns the default logger for method chaining. // Example: // -// ll.Level(lx.LevelWarn) -// ll.Info("Ignored") // No output -// ll.Warn("Logged") // Output: [] WARN: Logged +// ll.Level(lx.LevelInfo) +// ll.Warn("Ignored") // Inactive output +// ll.Info("Logged") // Output: [] INFO: Logged func Level(level lx.LevelType) *Logger { return defaultLogger.Level(level) } @@ -65,7 +65,7 @@ func NamespaceEnable(path string) *Logger { // Example: // // ll.NamespaceDisable("app/db") -// ll.Clone().Namespace("db").Info("Query") // No output +// ll.Clone().Namespace("db").Info("Query") // Inactive output func NamespaceDisable(path string) *Logger { return defaultLogger.NamespaceDisable(path) } @@ -369,7 +369,7 @@ func StackSize(size int) *Logger { // } // return nil // })) -// ll.Info("Ignored") // No output +// ll.Info("Ignored") // Inactive output // mw.Remove() // ll.Info("Logged") // Output: [] INFO: Logged func Use(fn lx.Handler) *Middleware { @@ -393,7 +393,7 @@ func Remove(m *Middleware) { // // ll.Use(someMiddleware) // ll.Clear() -// ll.Info("No middleware") // Output: [] INFO: No middleware +// ll.Info("Inactive middleware") // Output: [] INFO: Inactive middleware func Clear() *Logger { return defaultLogger.Clear() } @@ -545,7 +545,7 @@ func Err(errs ...error) { // Example: // // ll.Shutdown() -// ll.Info("Ignored") // No output +// ll.Info("Ignored") // Inactive output // ll.Start() // ll.Info("Logged") // Output: [] INFO: Logged func Start() { @@ -558,7 +558,7 @@ func Start() { // Example: // // ll.Shutdown() -// ll.Info("Ignored") // No output +// ll.Info("Ignored") // Inactive output func Shutdown() { atomic.StoreInt32(&systemActive, 0) } @@ -580,7 +580,7 @@ func Active() bool { // Example: // // ll.Disable() -// ll.Info("Ignored") // No output +// ll.Info("Ignored") // Inactive output // ll.Enable() // ll.Info("Logged") // Output: [] INFO: Logged func Enable() *Logger { @@ -593,7 +593,7 @@ func Enable() *Logger { // Example: // // ll.Disable() -// ll.Info("Ignored") // No output +// ll.Info("Ignored") // Inactive output func Disable() *Logger { return defaultLogger.Disable() } diff --git a/vendor/github.com/olekukonko/ll/lh/buffered.go b/vendor/github.com/olekukonko/ll/lh/buffered.go index 9c388b0458f..1799191da52 100644 --- a/vendor/github.com/olekukonko/ll/lh/buffered.go +++ b/vendor/github.com/olekukonko/ll/lh/buffered.go @@ -15,6 +15,7 @@ import ( type Buffering struct { BatchSize int // Flush when this many entries are buffered (default: 100) FlushInterval time.Duration // Maximum time between flushes (default: 10s) + FlushTimeout time.Duration // FlushTimeout specifies the duration to wait for a flush attempt to complete before timing out. MaxBuffer int // Maximum buffer size before applying backpressure (default: 1000) OnOverflow func(int) // Called when buffer reaches MaxBuffer (default: logs warning) ErrorOutput io.Writer // Destination for internal errors like flush failures (default: os.Stderr) @@ -24,10 +25,6 @@ type Buffering struct { type BufferingOpt func(*Buffering) // WithBatchSize sets the batch size for flushing. -// It specifies the number of log entries to buffer before flushing to the underlying handler. -// Example: -// -// handler := NewBuffered(textHandler, WithBatchSize(50)) // Flush every 50 entries func WithBatchSize(size int) BufferingOpt { return func(c *Buffering) { c.BatchSize = size @@ -35,21 +32,20 @@ func WithBatchSize(size int) BufferingOpt { } // WithFlushInterval sets the maximum time between flushes. -// It defines the interval at which buffered entries are flushed, even if the batch size is not reached. -// Example: -// -// handler := NewBuffered(textHandler, WithFlushInterval(5*time.Second)) // Flush every 5 seconds func WithFlushInterval(d time.Duration) BufferingOpt { return func(c *Buffering) { c.FlushInterval = d } } +// WithFlushTimeout sets the maximum time to wait for a flush to complete. +func WithFlushTimeout(d time.Duration) BufferingOpt { + return func(c *Buffering) { + c.FlushTimeout = d + } +} + // WithMaxBuffer sets the maximum buffer size before backpressure. -// It limits the number of entries that can be queued in the channel, triggering overflow handling if exceeded. -// Example: -// -// handler := NewBuffered(textHandler, WithMaxBuffer(500)) // Allow up to 500 buffered entries func WithMaxBuffer(size int) BufferingOpt { return func(c *Buffering) { c.MaxBuffer = size @@ -57,10 +53,6 @@ func WithMaxBuffer(size int) BufferingOpt { } // WithOverflowHandler sets the overflow callback. -// It specifies a function to call when the buffer reaches MaxBuffer, typically for logging or metrics. -// Example: -// -// handler := NewBuffered(textHandler, WithOverflowHandler(func(n int) { fmt.Printf("Overflow: %d entries\n", n) })) func WithOverflowHandler(fn func(int)) BufferingOpt { return func(c *Buffering) { c.OnOverflow = fn @@ -68,29 +60,33 @@ func WithOverflowHandler(fn func(int)) BufferingOpt { } // WithErrorOutput sets the destination for internal errors (e.g., downstream handler failures). -// Defaults to os.Stderr if not set. -// Example: -// -// // Redirect internal errors to a file or discard them -// handler := NewBuffered(textHandler, WithErrorOutput(os.Stdout)) func WithErrorOutput(w io.Writer) BufferingOpt { return func(c *Buffering) { c.ErrorOutput = w } } +// batchHandler is an optional interface that handlers may implement to receive +// an entire flush batch in a single call instead of one entry at a time. +// When implemented, flushBatch calls HandleBatch once per batch, allowing +// the handler (and test mocks) to track flush operations rather than +// individual per-entry Handle calls. +type batchHandler interface { + HandleBatch(entries []*lx.Entry) error +} + // Buffered wraps any Handler to provide buffering capabilities. // It buffers log entries in a channel and flushes them based on batch size, time interval, or explicit flush. // The generic type H ensures compatibility with any lx.Handler implementation. // Thread-safe via channels and sync primitives. type Buffered[H lx.Handler] struct { - handler H // Underlying handler to process log entries - config *Buffering // Configuration for batching and flushing - entries chan *lx.Entry // Channel for buffering log entries - flushSignal chan struct{} // Channel to trigger explicit flushes - shutdown chan struct{} // Channel to signal worker shutdown - shutdownOnce sync.Once // Ensures Close is called only once - wg sync.WaitGroup // Waits for worker goroutine to finish + handler H + config *Buffering + entries chan *lx.Entry + flushSignal chan struct{} + shutdown chan struct{} + shutdownOnce sync.Once + wg sync.WaitGroup } // NewBuffered creates a new buffered handler that wraps another handler. @@ -101,80 +97,96 @@ type Buffered[H lx.Handler] struct { // textHandler := lh.NewTextHandler(os.Stdout) // buffered := NewBuffered(textHandler, WithBatchSize(50)) func NewBuffered[H lx.Handler](handler H, opts ...BufferingOpt) *Buffered[H] { - // Initialize default configuration config := &Buffering{ - BatchSize: 100, // Default: flush every 100 entries - FlushInterval: 10 * time.Second, // Default: flush every 10 seconds - MaxBuffer: 1000, // Default: max 1000 entries in buffer - ErrorOutput: os.Stderr, // Default: report errors to stderr - OnOverflow: func(count int) { // Default: log overflow to io.Discard (silent by default for overflow) + BatchSize: 100, + FlushInterval: 10 * time.Second, + MaxBuffer: 1000, + ErrorOutput: os.Stderr, + OnOverflow: func(count int) { fmt.Fprintf(io.Discard, "log buffer overflow: %d entries\n", count) }, } - // Apply provided options for _, opt := range opts { opt(config) } - // Ensure sane configuration values if config.BatchSize < 1 { - config.BatchSize = 1 // Minimum batch size is 1 + config.BatchSize = 1 } + // Ensure the channel always holds at least BatchSize entries so a single + // batch can always be enqueued without blocking. if config.MaxBuffer < config.BatchSize { - config.MaxBuffer = config.BatchSize * 10 // Ensure buffer is at least 10x batch size + config.MaxBuffer = config.BatchSize * 10 } if config.FlushInterval <= 0 { - config.FlushInterval = 10 * time.Second // Minimum flush interval is 10s + config.FlushInterval = 10 * time.Second + } + if config.FlushTimeout <= 0 { + config.FlushTimeout = 100 * time.Millisecond } if config.ErrorOutput == nil { config.ErrorOutput = os.Stderr } - // Initialize Buffered handler b := &Buffered[H]{ - handler: handler, // Set underlying handler - config: config, // Set configuration - entries: make(chan *lx.Entry, config.MaxBuffer), // Create buffered channel - flushSignal: make(chan struct{}, 1), // Create single-slot flush signal channel - shutdown: make(chan struct{}), // Create shutdown signal channel + handler: handler, + config: config, + entries: make(chan *lx.Entry, config.MaxBuffer), + flushSignal: make(chan struct{}, 1), + shutdown: make(chan struct{}), } - // Start worker goroutine b.wg.Add(1) go b.worker() - // Set finalizer for cleanup during garbage collection runtime.SetFinalizer(b, (*Buffered[H]).Final) return b } +// cloneEntry creates a deep copy of an entry for safe asynchronous processing. +// The original entry belongs to the logger's pool and is reused immediately after Handle() returns. +func (b *Buffered[H]) cloneEntry(e *lx.Entry) *lx.Entry { + entryCopy := &lx.Entry{ + Timestamp: e.Timestamp, + Level: e.Level, + Message: e.Message, + Namespace: e.Namespace, + Style: e.Style, + Class: e.Class, + Error: e.Error, + Id: e.Id, + } + + if len(e.Fields) > 0 { + entryCopy.Fields = make(lx.Fields, len(e.Fields)) + copy(entryCopy.Fields, e.Fields) + } + + if len(e.Stack) > 0 { + entryCopy.Stack = make([]byte, len(e.Stack)) + copy(entryCopy.Stack, e.Stack) + } + + return entryCopy +} + // Handle implements the lx.Handler interface. -// It buffers log entries in the entries channel or triggers a flush on overflow. -// Returns an error if the buffer is full and flush cannot be triggered. -// Thread-safe via non-blocking channel operations. -// Example: -// -// buffered.Handle(&lx.Entry{Message: "test"}) // Buffers entry or triggers flush func (b *Buffered[H]) Handle(e *lx.Entry) error { + entryCopy := b.cloneEntry(e) + select { - case b.entries <- e: // Buffer entry if channel has space + case b.entries <- entryCopy: return nil - default: // Handle buffer overflow + default: if b.config.OnOverflow != nil { - b.config.OnOverflow(len(b.entries)) // Call overflow handler - } - select { - case b.flushSignal <- struct{}{}: // Trigger flush if possible - return fmt.Errorf("log buffer overflow, triggering flush") - default: // Flush already in progress - return fmt.Errorf("log buffer overflow and flush already in progress") + b.config.OnOverflow(len(b.entries)) } + return fmt.Errorf("log buffer overflow") } } // Flush triggers an immediate flush of buffered entries. -// It sends a signal to the worker to process all buffered entries. // If a flush is already pending, it waits briefly and may exit without flushing. // Thread-safe via non-blocking channel operations. // Example: @@ -182,9 +194,8 @@ func (b *Buffered[H]) Handle(e *lx.Entry) error { // buffered.Flush() // Flushes all buffered entries func (b *Buffered[H]) Flush() { select { - case b.flushSignal <- struct{}{}: // Signal worker to flush - case <-time.After(100 * time.Millisecond): // Timeout if flush is pending - // Flush already pending + case b.flushSignal <- struct{}{}: + case <-time.After(b.config.FlushTimeout): } } @@ -199,11 +210,10 @@ func (b *Buffered[H]) Flush() { func (b *Buffered[H]) Close() error { var closeErr error b.shutdownOnce.Do(func() { - close(b.shutdown) // Signal worker to shut down - b.wg.Wait() // Wait for worker to finish - runtime.SetFinalizer(b, nil) // Remove finalizer + close(b.shutdown) + b.wg.Wait() + runtime.SetFinalizer(b, nil) - // Check if underlying handler has a Close method and call it if closer, ok := any(b.handler).(interface{ Close() error }); ok { closeErr = closer.Close() } @@ -212,71 +222,71 @@ func (b *Buffered[H]) Close() error { } // Final ensures remaining entries are flushed during garbage collection. -// It calls Close to flush entries and stop the worker. -// Used as a runtime finalizer to prevent log loss. -// Example (internal usage): -// -// runtime.SetFinalizer(buffered, (*Buffered[H]).Final) func (b *Buffered[H]) Final() { b.Close() } // Config returns the current configuration of the Buffered handler. -// It provides access to BatchSize, FlushInterval, MaxBuffer, and OnOverflow settings. -// Example: -// -// config := buffered.Config() // Access configuration func (b *Buffered[H]) Config() *Buffering { return b.config } // worker processes entries and handles flushing. -// It runs in a goroutine, buffering entries, flushing on batch size, timer, or explicit signal, -// and shutting down cleanly when signaled. -// Thread-safe via channel operations and WaitGroup. func (b *Buffered[H]) worker() { - defer b.wg.Done() // Signal completion when worker exits - batch := make([]*lx.Entry, 0, b.config.BatchSize) // Buffer for batching entries - ticker := time.NewTicker(b.config.FlushInterval) // Timer for periodic flushes - defer ticker.Stop() // Clean up ticker + defer b.wg.Done() + batch := make([]*lx.Entry, 0, b.config.BatchSize) + ticker := time.NewTicker(b.config.FlushInterval) + defer ticker.Stop() + for { select { - case entry := <-b.entries: // Receive new entry + case entry := <-b.entries: batch = append(batch, entry) - // Flush if batch size is reached if len(batch) >= b.config.BatchSize { b.flushBatch(batch) batch = batch[:0] + ticker.Reset(b.config.FlushInterval) } - case <-ticker.C: // Periodic flush + case <-ticker.C: if len(batch) > 0 { b.flushBatch(batch) batch = batch[:0] } - case <-b.flushSignal: // Explicit flush + case <-b.flushSignal: if len(batch) > 0 { b.flushBatch(batch) batch = batch[:0] } - b.drainRemaining() // Drain all entries from the channel - case <-b.shutdown: // Shutdown signal + b.drainRemaining() + ticker.Reset(b.config.FlushInterval) + case <-b.shutdown: + // Merge whatever is already in batch with anything remaining in + // the channel, then flush everything in a single call so that + // callCount increments exactly once regardless of how many + // entries the worker happened to have pre-loaded into batch. + batch = b.collectRemaining(batch) if len(batch) > 0 { b.flushBatch(batch) } - b.drainRemaining() // Flush remaining entries return } } } // flushBatch processes a batch of entries through the wrapped handler. -// It writes each entry to the underlying handler, logging any errors to the configured ErrorOutput. -// Example (internal usage): -// -// b.flushBatch([]*lx.Entry{entry1, entry2}) +// If the handler implements the batchHandler interface, the entire batch is +// delivered in a single HandleBatch call (one "flush event"). Otherwise each +// entry is forwarded individually via Handle. func (b *Buffered[H]) flushBatch(batch []*lx.Entry) { + if bh, ok := any(b.handler).(batchHandler); ok { + if err := bh.HandleBatch(batch); err != nil { + if b.config.ErrorOutput != nil { + fmt.Fprintf(b.config.ErrorOutput, "log flush error: %v\n", err) + } + } + return + } for _, entry := range batch { - // Process each entry through the handler if err := b.handler.Handle(entry); err != nil { if b.config.ErrorOutput != nil { fmt.Fprintf(b.config.ErrorOutput, "log flush error: %v\n", err) @@ -285,22 +295,36 @@ func (b *Buffered[H]) flushBatch(batch []*lx.Entry) { } } +// collectRemaining drains the entries channel into the provided slice and +// returns the extended slice without flushing, so the caller can flush +// everything atomically in a single batch. +func (b *Buffered[H]) collectRemaining(batch []*lx.Entry) []*lx.Entry { + for { + select { + case entry := <-b.entries: + batch = append(batch, entry) + default: + return batch + } + } +} + // drainRemaining processes any remaining entries in the channel. -// It flushes all entries from the entries channel to the underlying handler, -// logging any errors to the configured ErrorOutput. Used during flush or shutdown. -// Example (internal usage): -// -// b.drainRemaining() // Flushes all pending entries +// Collects entries into a batch and flushes them together for efficiency. func (b *Buffered[H]) drainRemaining() { + batch := make([]*lx.Entry, 0, b.config.BatchSize) for { select { - case entry := <-b.entries: // Process next entry - if err := b.handler.Handle(entry); err != nil { - if b.config.ErrorOutput != nil { - fmt.Fprintf(b.config.ErrorOutput, "log drain error: %v\n", err) - } + case entry := <-b.entries: + batch = append(batch, entry) + if len(batch) >= b.config.BatchSize { + b.flushBatch(batch) + batch = batch[:0] + } + default: + if len(batch) > 0 { + b.flushBatch(batch) } - default: // Exit when channel is empty return } } diff --git a/vendor/github.com/olekukonko/ll/lh/colorized.go b/vendor/github.com/olekukonko/ll/lh/colorized.go index 05285002fbe..81736817f0b 100644 --- a/vendor/github.com/olekukonko/ll/lh/colorized.go +++ b/vendor/github.com/olekukonko/ll/lh/colorized.go @@ -3,9 +3,9 @@ package lh import ( "bytes" "fmt" + "hash/fnv" "io" "os" - "runtime" "strconv" "strings" "sync" @@ -41,7 +41,6 @@ type Palette struct { Error string // Color for Error level messages Fatal string // Color for Fatal level messages Title string // Color for dump titles (BEGIN/END separators) - // Field type colors Key string // Color for field keys Number string // Color for numbers @@ -50,7 +49,6 @@ type Palette struct { Time string // Color for timestamps/durations Nil string // Color for nil values Default string // Default color for unknown types - // JSON and Inspect specific colors JSONKey string // Color for JSON keys JSONString string // Color for JSON string values @@ -80,7 +78,6 @@ var darkPalette = Palette{ Warn: "\033[33m", Error: "\033[31m", Fatal: "\033[1;31m", - // Field type colors - made brighter for dark backgrounds Key: "\033[38;5;117m", // Brighter blue Number: "\033[38;5;141m", // Brighter purple @@ -89,7 +86,6 @@ var darkPalette = Palette{ Time: "\033[38;5;110m", // Brighter cyan-blue Nil: "\033[38;5;243m", // Slightly brighter gray Default: "\033[38;5;250m", // Brighter gray - // JSON and Inspect colors JSONKey: "\033[38;5;117m", JSONString: "\033[38;5;223m", @@ -104,30 +100,28 @@ var darkPalette = Palette{ // lightPalette defines colors optimized for light terminal backgrounds. var lightPalette = Palette{ - Header: "\033[1;31m", - Goroutine: "\033[34m", - Func: "\033[30m", - Path: "\033[90m", - FileLine: "\033[94m", - Reset: "\033[0m", - Title: "\033[38;5;245m", - Pos: "\033[38;5;117m", - Hex: "\033[38;5;156m", - Ascii: "\033[38;5;224m", - Debug: "\033[36m", - Info: "\033[32m", - Warn: "\033[33m", - Error: "\033[31m", - Fatal: "\033[1;31m", - - Key: "\033[34m", - Number: "\033[35m", - String: "\033[38;5;94m", - Bool: "\033[32m", - Time: "\033[38;5;24m", - Nil: "\033[38;5;240m", - Default: "\033[30m", - + Header: "\033[1;31m", + Goroutine: "\033[34m", + Func: "\033[30m", + Path: "\033[90m", + FileLine: "\033[94m", + Reset: "\033[0m", + Title: "\033[38;5;245m", + Pos: "\033[38;5;117m", + Hex: "\033[38;5;156m", + Ascii: "\033[38;5;224m", + Debug: "\033[36m", + Info: "\033[32m", + Warn: "\033[33m", + Error: "\033[31m", + Fatal: "\033[1;31m", + Key: "\033[34m", + Number: "\033[35m", + String: "\033[38;5;94m", + Bool: "\033[32m", + Time: "\033[38;5;24m", + Nil: "\033[38;5;240m", + Default: "\033[30m", JSONKey: "\033[1;34m", JSONString: "\033[1;33m", JSONNumber: "\033[1;35m", @@ -141,30 +135,28 @@ var lightPalette = Palette{ // brightPalette defines vibrant, high-contrast colors var brightPalette = Palette{ - Header: "\033[1;91m", - Goroutine: "\033[1;96m", - Func: "\033[1;97m", - Path: "\033[38;5;250m", - FileLine: "\033[38;5;117m", - Reset: "\033[0m", - Title: "\033[1;37m", - Pos: "\033[1;33m", - Hex: "\033[1;32m", - Ascii: "\033[1;35m", - Debug: "\033[1;36m", - Info: "\033[1;32m", - Warn: "\033[1;33m", - Error: "\033[1;31m", - Fatal: "\033[1;91m", - - Key: "\033[1;34m", - Number: "\033[1;35m", - String: "\033[1;33m", - Bool: "\033[1;32m", - Time: "\033[1;36m", - Nil: "\033[1;37m", - Default: "\033[1;37m", - + Header: "\033[1;91m", + Goroutine: "\033[1;96m", + Func: "\033[1;97m", + Path: "\033[38;5;250m", + FileLine: "\033[38;5;117m", + Reset: "\033[0m", + Title: "\033[1;37m", + Pos: "\033[1;33m", + Hex: "\033[1;32m", + Ascii: "\033[1;35m", + Debug: "\033[1;36m", + Info: "\033[1;32m", + Warn: "\033[1;33m", + Error: "\033[1;31m", + Fatal: "\033[1;91m", + Key: "\033[1;34m", + Number: "\033[1;35m", + String: "\033[1;33m", + Bool: "\033[1;32m", + Time: "\033[1;36m", + Nil: "\033[1;37m", + Default: "\033[1;37m", JSONKey: "\033[1;34m", JSONString: "\033[1;33m", JSONNumber: "\033[1;35m", @@ -178,30 +170,28 @@ var brightPalette = Palette{ // pastelPalette defines soft, pastel colors var pastelPalette = Palette{ - Header: "\033[38;5;211m", - Goroutine: "\033[38;5;153m", - Func: "\033[38;5;255m", - Path: "\033[38;5;248m", - FileLine: "\033[38;5;111m", - Reset: "\033[0m", - Title: "\033[38;5;248m", - Pos: "\033[38;5;153m", - Hex: "\033[38;5;158m", - Ascii: "\033[38;5;218m", - Debug: "\033[38;5;122m", - Info: "\033[38;5;120m", - Warn: "\033[38;5;221m", - Error: "\033[38;5;211m", - Fatal: "\033[38;5;204m", - - Key: "\033[38;5;153m", - Number: "\033[38;5;183m", - String: "\033[38;5;223m", - Bool: "\033[38;5;120m", - Time: "\033[38;5;117m", - Nil: "\033[38;5;247m", - Default: "\033[38;5;250m", - + Header: "\033[38;5;211m", + Goroutine: "\033[38;5;153m", + Func: "\033[38;5;255m", + Path: "\033[38;5;248m", + FileLine: "\033[38;5;111m", + Reset: "\033[0m", + Title: "\033[38;5;248m", + Pos: "\033[38;5;153m", + Hex: "\033[38;5;158m", + Ascii: "\033[38;5;218m", + Debug: "\033[38;5;122m", + Info: "\033[38;5;120m", + Warn: "\033[38;5;221m", + Error: "\033[38;5;211m", + Fatal: "\033[38;5;204m", + Key: "\033[38;5;153m", + Number: "\033[38;5;183m", + String: "\033[38;5;223m", + Bool: "\033[38;5;120m", + Time: "\033[38;5;117m", + Nil: "\033[38;5;247m", + Default: "\033[38;5;250m", JSONKey: "\033[38;5;153m", JSONString: "\033[38;5;223m", JSONNumber: "\033[38;5;183m", @@ -215,30 +205,28 @@ var pastelPalette = Palette{ // vibrantPalette defines highly saturated, eye-catching colors var vibrantPalette = Palette{ - Header: "\033[38;5;196m", - Goroutine: "\033[38;5;51m", - Func: "\033[38;5;15m", - Path: "\033[38;5;244m", - FileLine: "\033[38;5;75m", - Reset: "\033[0m", - Title: "\033[38;5;244m", - Pos: "\033[38;5;51m", - Hex: "\033[38;5;46m", - Ascii: "\033[38;5;201m", - Debug: "\033[38;5;51m", - Info: "\033[38;5;46m", - Warn: "\033[38;5;226m", - Error: "\033[38;5;196m", - Fatal: "\033[1;38;5;196m", - - Key: "\033[38;5;33m", - Number: "\033[38;5;129m", - String: "\033[38;5;214m", - Bool: "\033[38;5;46m", - Time: "\033[38;5;75m", - Nil: "\033[38;5;242m", - Default: "\033[38;5;15m", - + Header: "\033[38;5;196m", + Goroutine: "\033[38;5;51m", + Func: "\033[38;5;15m", + Path: "\033[38;5;244m", + FileLine: "\033[38;5;75m", + Reset: "\033[0m", + Title: "\033[38;5;244m", + Pos: "\033[38;5;51m", + Hex: "\033[38;5;46m", + Ascii: "\033[38;5;201m", + Debug: "\033[38;5;51m", + Info: "\033[38;5;46m", + Warn: "\033[38;5;226m", + Error: "\033[38;5;196m", + Fatal: "\033[1;38;5;196m", + Key: "\033[38;5;33m", + Number: "\033[38;5;129m", + String: "\033[38;5;214m", + Bool: "\033[38;5;46m", + Time: "\033[38;5;75m", + Nil: "\033[38;5;242m", + Default: "\033[38;5;15m", JSONKey: "\033[38;5;33m", JSONString: "\033[38;5;214m", JSONNumber: "\033[38;5;129m", @@ -349,11 +337,9 @@ func NewColorizedHandler(w io.Writer, opts ...ColorOption) *ColorizedHandler { intensity: IntensityNormal, colorFields: true, // Default: enable field coloring } - for _, opt := range opts { opt(c) } - c.palette = c.detectPalette() return c } @@ -368,11 +354,10 @@ func (h *ColorizedHandler) Output(w io.Writer) { func (h *ColorizedHandler) Handle(e *lx.Entry) error { h.mu.Lock() defer h.mu.Unlock() - switch e.Class { case lx.ClassDump: return h.handleDumpOutput(e) - case lx.ClassJSON: + case lx.ClassJSON, lx.ClassOutput: return h.handleJSONOutput(e) case lx.ClassInspect: return h.handleInspectOutput(e) @@ -397,25 +382,20 @@ func (h *ColorizedHandler) handleRegularOutput(e *lx.Entry) error { buf := colorBufPool.Get().(*bytes.Buffer) buf.Reset() defer colorBufPool.Put(buf) - if h.showTime { buf.WriteString(e.Timestamp.Format(h.timeFormat)) buf.WriteString(lx.Space) } - h.formatNamespace(buf, e) h.formatLevel(buf, e) buf.WriteString(e.Message) h.formatFields(buf, e) - if len(e.Stack) > 0 { h.formatStack(buf, e.Stack) } - if e.Level != lx.LevelNone { buf.WriteString(lx.Newline) } - _, err := h.writer.Write(buf.Bytes()) return err } @@ -425,20 +405,16 @@ func (h *ColorizedHandler) handleJSONOutput(e *lx.Entry) error { buf := colorBufPool.Get().(*bytes.Buffer) buf.Reset() defer colorBufPool.Put(buf) - if h.showTime { buf.WriteString(e.Timestamp.Format(h.timeFormat)) buf.WriteString(lx.Newline) } - if e.Namespace != "" { h.formatNamespace(buf, e) h.formatLevel(buf, e) } - h.colorizeJSON(buf, e.Message) buf.WriteString(lx.Newline) - _, err := h.writer.Write(buf.Bytes()) return err } @@ -448,17 +424,14 @@ func (h *ColorizedHandler) handleInspectOutput(e *lx.Entry) error { buf := colorBufPool.Get().(*bytes.Buffer) buf.Reset() defer colorBufPool.Put(buf) - if h.showTime { buf.WriteString(e.Timestamp.Format(h.timeFormat)) buf.WriteString(lx.Space) } - h.formatNamespace(buf, e) h.formatLevel(buf, e) h.colorizeInspect(buf, e.Message) buf.WriteString(lx.Newline) - _, err := h.writer.Write(buf.Bytes()) return err } @@ -467,16 +440,13 @@ func (h *ColorizedHandler) handleInspectOutput(e *lx.Entry) error { func (h *ColorizedHandler) colorizeJSON(b *bytes.Buffer, jsonStr string) { inString := false escapeNext := false - for i := 0; i < len(jsonStr); i++ { ch := jsonStr[i] - if escapeNext { b.WriteByte(ch) escapeNext = false continue } - switch ch { case '\\': escapeNext = true @@ -484,7 +454,6 @@ func (h *ColorizedHandler) colorizeJSON(b *bytes.Buffer, jsonStr string) { b.WriteString(h.palette.JSONString) } b.WriteByte(ch) - case '"': if inString { // End of string @@ -498,7 +467,6 @@ func (h *ColorizedHandler) colorizeJSON(b *bytes.Buffer, jsonStr string) { b.WriteString(h.palette.JSONString) b.WriteByte(ch) } - case ':': if !inString { b.WriteString(h.palette.JSONBrace) @@ -507,7 +475,6 @@ func (h *ColorizedHandler) colorizeJSON(b *bytes.Buffer, jsonStr string) { } else { b.WriteByte(ch) } - case '{', '}', '[', ']', ',': if !inString { b.WriteString(h.palette.JSONBrace) @@ -516,12 +483,10 @@ func (h *ColorizedHandler) colorizeJSON(b *bytes.Buffer, jsonStr string) { } else { b.WriteByte(ch) } - default: if !inString { // Check for numbers, booleans, null remaining := jsonStr[i:] - // Check for null if len(remaining) >= 4 && strings.HasPrefix(remaining, "null") { b.WriteString(h.palette.JSONNull) @@ -570,38 +535,31 @@ func (h *ColorizedHandler) colorizeJSON(b *bytes.Buffer, jsonStr string) { // colorizeInspect applies syntax highlighting to inspect output func (h *ColorizedHandler) colorizeInspect(b *bytes.Buffer, inspectStr string) { lines := strings.Split(inspectStr, "\n") - for lineIdx, line := range lines { if lineIdx > 0 { b.WriteString("\n") } - trimmed := strings.TrimSpace(line) if trimmed == "" { b.WriteString(line) continue } - // For inspect output, we'll do simple line-based coloring // This preserves the original formatting inString := false escapeNext := false - for i := 0; i < len(line); i++ { ch := line[i] - if escapeNext { b.WriteByte(ch) escapeNext = false continue } - if ch == '\\' { escapeNext = true b.WriteByte(ch) continue } - if ch == '"' { inString = !inString if inString { @@ -620,7 +578,6 @@ func (h *ColorizedHandler) colorizeInspect(b *bytes.Buffer, inspectStr string) { } continue } - if inString { // Inside a string key or value b.WriteByte(ch) @@ -637,7 +594,6 @@ func (h *ColorizedHandler) colorizeInspect(b *bytes.Buffer, inspectStr string) { } else { // Check for numbers, booleans, null outside strings remaining := line[i:] - if len(remaining) >= 4 && strings.HasPrefix(remaining, "null") { b.WriteString(h.palette.JSONNull) b.WriteString("null") @@ -681,7 +637,6 @@ func (h *ColorizedHandler) formatNamespace(b *bytes.Buffer, e *lx.Entry) { if e.Namespace == "" { return } - b.WriteString(lx.LeftBracket) switch e.Style { case lx.NestedPath: @@ -711,9 +666,7 @@ func (h *ColorizedHandler) formatLevel(b *bytes.Buffer, e *lx.Entry) { lx.LevelError: h.palette.Error, lx.LevelFatal: h.palette.Fatal, }[e.Level] - b.WriteString(color) - //b.WriteString(rightPad(e.Level.Name(e.Class), 8)) b.WriteString(e.Level.Name(e.Class)) b.WriteString(h.palette.Reset) // b.WriteString(lx.Space) @@ -726,32 +679,27 @@ func (h *ColorizedHandler) formatFields(b *bytes.Buffer, e *lx.Entry) { if len(e.Fields) == 0 { return } - b.WriteString(lx.Space) b.WriteString(lx.LeftBracket) - for i, pair := range e.Fields { if i > 0 { b.WriteString(lx.Space) } - if h.colorFields { // Color the key b.WriteString(h.palette.Key) b.WriteString(pair.Key) b.WriteString(h.palette.Reset) b.WriteString("=") - // Format value with type-based coloring h.formatFieldValue(b, pair.Value) } else { // No field coloring - just write plain text b.WriteString(pair.Key) b.WriteString("=") - fmt.Fprint(b, pair.Value) + writeFieldValue(b, pair.Value) } } - b.WriteString(lx.RightBracket) } @@ -759,68 +707,53 @@ func (h *ColorizedHandler) formatFields(b *bytes.Buffer, e *lx.Entry) { func (h *ColorizedHandler) formatFieldValue(b *bytes.Buffer, value interface{}) { // If field coloring is disabled, just write the value if !h.colorFields { - fmt.Fprint(b, value) + writeFieldValue(b, value) return } - switch v := value.(type) { case time.Time: b.WriteString(h.palette.Time) b.WriteString(v.Format("2006-01-02 15:04:05")) b.WriteString(h.palette.Reset) - case time.Duration: b.WriteString(h.palette.Time) h.formatDuration(b, v) b.WriteString(h.palette.Reset) - case error: b.WriteString(h.palette.Error) b.WriteString(`"`) b.WriteString(v.Error()) b.WriteString(`"`) b.WriteString(h.palette.Reset) - case int, int8, int16, int32, int64: b.WriteString(h.palette.Number) - fmt.Fprint(b, v) + writeFieldValue(b, v) b.WriteString(h.palette.Reset) - case uint, uint8, uint16, uint32, uint64: b.WriteString(h.palette.Number) - fmt.Fprint(b, v) + writeFieldValue(b, v) b.WriteString(h.palette.Reset) - case float32, float64: b.WriteString(h.palette.Number) - switch f := v.(type) { - case float32: - fmt.Fprintf(b, "%.6g", f) - case float64: - fmt.Fprintf(b, "%.6g", f) - } + writeFieldValue(b, v) b.WriteString(h.palette.Reset) - case string: b.WriteString(h.palette.String) b.WriteString(`"`) b.WriteString(v) b.WriteString(`"`) b.WriteString(h.palette.Reset) - case bool: b.WriteString(h.palette.Bool) - fmt.Fprint(b, v) + writeFieldValue(b, v) b.WriteString(h.palette.Reset) - case nil: b.WriteString(h.palette.Nil) b.WriteString("nil") b.WriteString(h.palette.Reset) - default: b.WriteString(h.palette.Default) - fmt.Fprint(b, v) + writeFieldValue(b, v) b.WriteString(h.palette.Reset) } } @@ -853,7 +786,6 @@ func (h *ColorizedHandler) formatStack(b *bytes.Buffer, stack []byte) { b.WriteString("[stack]") b.WriteString(h.palette.Reset) b.WriteString("\n") - lines := strings.Split(string(stack), "\n") if len(lines) == 0 { return @@ -864,11 +796,9 @@ func (h *ColorizedHandler) formatStack(b *bytes.Buffer, stack []byte) { b.WriteString(lines[0]) b.WriteString(h.palette.Reset) b.WriteString("\n") - for i := 1; i < len(lines)-1; i += 2 { funcLine := strings.TrimSpace(lines[i]) pathLine := strings.TrimSpace(lines[i+1]) - if funcLine != "" { b.WriteString(" │ ") b.WriteString(h.palette.Func) @@ -881,15 +811,12 @@ func (h *ColorizedHandler) formatStack(b *bytes.Buffer, stack []byte) { lastSlash := strings.LastIndex(pathLine, "/") goIndex := strings.Index(pathLine, ".go:") - if lastSlash >= 0 && goIndex > lastSlash { prefix := pathLine[:lastSlash+1] suffix := pathLine[lastSlash+1:] - b.WriteString(h.palette.Path) b.WriteString(prefix) b.WriteString(h.palette.Reset) - b.WriteString(h.palette.Path) b.WriteString(suffix) b.WriteString(h.palette.Reset) @@ -898,11 +825,9 @@ func (h *ColorizedHandler) formatStack(b *bytes.Buffer, stack []byte) { b.WriteString(pathLine) b.WriteString(h.palette.Reset) } - b.WriteString("\n") } } - if len(lines)%2 == 0 && strings.TrimSpace(lines[len(lines)-1]) != "" { b.WriteString(" │ ") b.WriteString(h.palette.Func) @@ -919,17 +844,14 @@ func (h *ColorizedHandler) handleDumpOutput(e *lx.Entry) error { buf := colorBufPool.Get().(*bytes.Buffer) buf.Reset() defer colorBufPool.Put(buf) - if h.showTime { buf.WriteString(e.Timestamp.Format(h.timeFormat)) buf.WriteString(lx.Newline) } - buf.WriteString(h.palette.Title) buf.WriteString("---- BEGIN DUMP ----") buf.WriteString(h.palette.Reset) buf.WriteString("\n") - lines := strings.Split(e.Message, "\n") length := len(lines) for i, line := range lines { @@ -939,13 +861,11 @@ func (h *ColorizedHandler) handleDumpOutput(e *lx.Entry) error { buf.WriteString(h.palette.Pos) buf.WriteString(parts[0]) buf.WriteString(h.palette.Reset) - hexAscii := strings.SplitN(parts[1], "'", 2) buf.WriteString(h.palette.Hex) buf.WriteString("hex:") buf.WriteString(hexAscii[0]) buf.WriteString(h.palette.Reset) - if len(hexAscii) > 1 { buf.WriteString(h.palette.Ascii) buf.WriteString("'") @@ -960,62 +880,64 @@ func (h *ColorizedHandler) handleDumpOutput(e *lx.Entry) error { } else { buf.WriteString(line) } - if i < length-1 { buf.WriteString("\n") } } - buf.WriteString(h.palette.Title) buf.WriteString("---- END DUMP ----") buf.WriteString(h.palette.Reset) - buf.WriteString("\n\n") - + buf.WriteString("\n") _, err := h.writer.Write(buf.Bytes()) return err } -// detectPalette selects a color palette based on terminal environment variables. -func (h *ColorizedHandler) detectPalette() Palette { - // If colors are explicitly disabled, return noColorPalette - if h.noColor { - return noColorPalette - } +// paletteCache stores the detected palette and environment hash to avoid repeated checks. +var paletteCache struct { + once sync.Once + mu sync.RWMutex + hash uint64 + palette Palette +} - // Check NO_COLOR environment variable (standard: https://no-color.org/) +// computeEnvHash generates a hash of relevant environment variables to detect changes. +func computeEnvHash() uint64 { + h := fnv.New64a() + h.Write([]byte(os.Getenv("NO_COLOR"))) + h.Write([]byte(os.Getenv("TERM"))) + h.Write([]byte(os.Getenv("COLORFGBG"))) + h.Write([]byte(os.Getenv("AppleInterfaceStyle"))) + h.Write([]byte(os.Getenv("APPEARANCE"))) + h.Write([]byte(os.Getenv("TERM_BACKGROUND"))) + return h.Sum64() +} + +// computePaletteFromEnv computes the palette based on current environment variables. +// This contains the original logic from detectPalette, extracted for caching. +func (h *ColorizedHandler) computePaletteFromEnv() Palette { if os.Getenv("NO_COLOR") != "" { return noColorPalette } term := os.Getenv("TERM") - if term == "dumb" || term == "" { - if runtime.GOOS == "windows" && !h.isWindowsTerminalAnsiSupported() { - return noColorPalette - } + if term == "dumb" { + return noColorPalette } - // First, try to detect background color - isDarkBackground := true // Default to dark + // Windows is handled via build tag, just check terminal capability + if h.isWindowsTerminal() { + return h.applyIntensity(darkPalette) + } - // Check for common dark/light environment variables - if style, ok := os.LookupEnv("AppleInterfaceStyle"); ok && strings.EqualFold(style, "dark") { - isDarkBackground = true - } else if style, ok := os.LookupEnv("APPEARANCE"); ok && strings.EqualFold(style, "light") { + // Unix/macOS background detection + isDarkBackground := true + if style, ok := os.LookupEnv("APPEARANCE"); ok && strings.EqualFold(style, "light") { isDarkBackground = false - } else if bg := os.Getenv("TERM_BACKGROUND"); bg != "" { - isDarkBackground = strings.ToLower(bg) != "light" } else if fgBg := os.Getenv("COLORFGBG"); fgBg != "" { - // COLORFGBG format: "foreground;background" or "foreground;background;unused" parts := strings.Split(fgBg, ";") if len(parts) >= 2 { - bg := parts[len(parts)-1] - bgInt, err := strconv.Atoi(bg) - if err == nil { - // According to XTerm documentation: - // 0-7: dark colors, 15: white, 8-14: bright colors - // Typically, 0=black (dark), 7=light gray (light), 15=white (light) - isDarkBackground = (bgInt >= 0 && bgInt <= 6) || (bgInt >= 8 && bgInt <= 14) - } + bgInt, _ := strconv.Atoi(parts[len(parts)-1]) + isDarkBackground = (bgInt >= 0 && bgInt <= 6) || (bgInt >= 8 && bgInt <= 14) } } @@ -1025,6 +947,41 @@ func (h *ColorizedHandler) detectPalette() Palette { return h.applyIntensity(lightPalette) } +// detectPalette selects a color palette based on terminal environment variables. +// It uses caching with environment hash to avoid repeated checks. +func (h *ColorizedHandler) detectPalette() Palette { + // If colors are explicitly disabled, return noColorPalette + if h.noColor { + return noColorPalette + } + + // Fast path: Check cache + currentHash := computeEnvHash() + + paletteCache.mu.RLock() + if paletteCache.hash == currentHash && paletteCache.palette != (Palette{}) { + p := paletteCache.palette + paletteCache.mu.RUnlock() + return p + } + paletteCache.mu.RUnlock() + + // Slow path: Compute + paletteCache.mu.Lock() + defer paletteCache.mu.Unlock() + + // Double-check after acquiring write lock + if paletteCache.hash == currentHash && paletteCache.palette != (Palette{}) { + return paletteCache.palette + } + + // Compute new palette + p := h.computePaletteFromEnv() + paletteCache.hash = currentHash + paletteCache.palette = p + return p +} + // applyIntensity applies the intensity setting to a base palette func (h *ColorizedHandler) applyIntensity(basePalette Palette) Palette { switch h.intensity { @@ -1040,24 +997,3 @@ func (h *ColorizedHandler) applyIntensity(basePalette Palette) Palette { return basePalette } } - -// isWindowsTerminalAnsiSupported checks if the Windows terminal supports ANSI colors -func (h *ColorizedHandler) isWindowsTerminalAnsiSupported() bool { - if runtime.GOOS != "windows" { - return true - } - - if os.Getenv("WT_SESSION") != "" { - return true - } - - if os.Getenv("ConEmuANSI") == "ON" { - return true - } - - if os.Getenv("ANSICON") != "" { - return true - } - - return false -} diff --git a/vendor/github.com/olekukonko/ll/lh/colorized_unix.go b/vendor/github.com/olekukonko/ll/lh/colorized_unix.go new file mode 100644 index 00000000000..b01e1f542c2 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/colorized_unix.go @@ -0,0 +1,10 @@ +//go:build !windows + +package lh + +// No-op for Unix systems - ANSI is native. +func enableWindowsANSI() {} + +func (h *ColorizedHandler) isWindowsTerminal() bool { + return false +} diff --git a/vendor/github.com/olekukonko/ll/lh/colorized_windows.go b/vendor/github.com/olekukonko/ll/lh/colorized_windows.go new file mode 100644 index 00000000000..e4edafd53cf --- /dev/null +++ b/vendor/github.com/olekukonko/ll/lh/colorized_windows.go @@ -0,0 +1,47 @@ +//go:build windows + +package lh + +import ( + "os" + "syscall" + "unsafe" +) + +func init() { + enableWindowsANSI() +} + +// enableWindowsANSI enables virtual terminal processing on Windows 10+. +func enableWindowsANSI() { + kernel32 := syscall.NewLazyDLL("kernel32.dll") + setConsoleMode := kernel32.NewProc("SetConsoleMode") + getConsoleMode := kernel32.NewProc("GetConsoleMode") + + const enableVirtualTerminalProcessing = 0x0004 + handles := []syscall.Handle{syscall.Stdout, syscall.Stderr} + + for _, handle := range handles { + var mode uint32 + if r, _, _ := getConsoleMode.Call(uintptr(handle), uintptr(unsafe.Pointer(&mode))); r != 0 { + if mode&enableVirtualTerminalProcessing == 0 { + newMode := mode | enableVirtualTerminalProcessing + setConsoleMode.Call(uintptr(handle), uintptr(newMode)) + } + } + } +} + +// isWindowsTerminal checks Windows-specific terminal indicators. +func (h *ColorizedHandler) isWindowsTerminal() bool { + if os.Getenv("WT_SESSION") != "" { + return true + } + if os.Getenv("ConEmuANSI") == "ON" { + return true + } + if os.Getenv("ANSICON") != "" { + return true + } + return false +} diff --git a/vendor/github.com/olekukonko/ll/lh/dedup.go b/vendor/github.com/olekukonko/ll/lh/dedup.go index 41808560ea5..523e15fca14 100644 --- a/vendor/github.com/olekukonko/ll/lh/dedup.go +++ b/vendor/github.com/olekukonko/ll/lh/dedup.go @@ -1,47 +1,59 @@ package lh import ( + "bytes" + "fmt" + "sort" "sync" "time" + "github.com/cespare/xxhash/v2" "github.com/olekukonko/ll/lx" ) +// shardCount determines the number of shards for the dedup handler. +// Must be a power of 2 for efficient modulo via bitwise AND. +const shardCount = 32 + // Dedup is a log handler that suppresses duplicate entries within a TTL window. -// It wraps another handler (H) and filters out repeated log entries that match +// It wraps another handler and filters out repeated log entries that match // within the deduplication period. -type Dedup[H lx.Handler] struct { - next H - +type Dedup struct { + next lx.Handler ttl time.Duration cleanupEvery time.Duration - keyFn func(*lx.Entry) uint64 + keyFn lx.Deduper maxKeys int - - // shards reduce lock contention by partitioning the key space - shards [32]dedupShard - - done chan struct{} - wg sync.WaitGroup - once sync.Once + shards [shardCount]dedupShard // value array; take &shards[i] when locking + done chan struct{} + wg sync.WaitGroup + once sync.Once } type dedupShard struct { mu sync.Mutex - seen map[uint64]int64 + seen map[uint64]int64 // key -> expiry unix-nano timestamp } // DedupOpt configures a Dedup handler. -type DedupOpt[H lx.Handler] func(*Dedup[H]) +type DedupOpt func(*Dedup) // WithDedupKeyFunc customizes how deduplication keys are generated. -func WithDedupKeyFunc[H lx.Handler](fn func(*lx.Entry) uint64) DedupOpt[H] { - return func(d *Dedup[H]) { d.keyFn = fn } +func WithDedupKeyFunc(fn func(*lx.Entry) uint64) DedupOpt { + return func(d *Dedup) { + d.keyFn = dedupKeyFunc(fn) + } +} + +type dedupKeyFunc func(*lx.Entry) uint64 + +func (f dedupKeyFunc) Calculate(e *lx.Entry) uint64 { + return f(e) } // WithDedupCleanupInterval sets how often expired deduplication keys are purged. -func WithDedupCleanupInterval[H lx.Handler](every time.Duration) DedupOpt[H] { - return func(d *Dedup[H]) { +func WithDedupCleanupInterval(every time.Duration) DedupOpt { + return func(d *Dedup) { if every > 0 { d.cleanupEvery = every } @@ -49,65 +61,78 @@ func WithDedupCleanupInterval[H lx.Handler](every time.Duration) DedupOpt[H] { } // WithDedupMaxKeys sets a soft limit on tracked deduplication keys. -func WithDedupMaxKeys[H lx.Handler](max int) DedupOpt[H] { - return func(d *Dedup[H]) { +func WithDedupMaxKeys(max int) DedupOpt { + return func(d *Dedup) { if max > 0 { d.maxKeys = max } } } +// WithDedupIgnore specifies fields to ignore in the default key function. +func WithDedupIgnore(fields ...string) DedupOpt { + return func(d *Dedup) { + if dd, ok := d.keyFn.(*defaultDedup); ok { + if dd.ignoreFields == nil { + dd.ignoreFields = make(map[string]struct{}, len(fields)) + } + for _, f := range fields { + dd.ignoreFields[f] = struct{}{} + } + } + } +} + // NewDedup creates a deduplicating handler wrapper. -func NewDedup[H lx.Handler](next H, ttl time.Duration, opts ...DedupOpt[H]) *Dedup[H] { +func NewDedup(next lx.Handler, ttl time.Duration, opts ...DedupOpt) *Dedup { if ttl <= 0 { ttl = 2 * time.Second } - - d := &Dedup[H]{ + d := &Dedup{ next: next, ttl: ttl, cleanupEvery: time.Minute, - keyFn: defaultDedupKey, + keyFn: NewDefaultDedup(), done: make(chan struct{}), } - - // Initialize shards + // Pre-allocate each shard's map to avoid growth allocations at startup. for i := 0; i < len(d.shards); i++ { d.shards[i].seen = make(map[uint64]int64, 64) } - for _, opt := range opts { opt(d) } - d.wg.Add(1) go d.cleanupLoop() - return d } // Handle processes a log entry, suppressing duplicates within the TTL window. -func (d *Dedup[H]) Handle(e *lx.Entry) error { +func (d *Dedup) Handle(e *lx.Entry) error { + // Guard against nil keyFn — pass through if not configured. + if d.keyFn == nil { + return d.next.Handle(e) + } + now := time.Now().UnixNano() - key := d.keyFn(e) + key := d.keyFn.Calculate(e) - // Select shard based on key hash - shardIdx := key % uint64(len(d.shards)) - shard := &d.shards[shardIdx] + // Bitwise AND is safe because shardCount is a power of 2. + shard := &d.shards[key&(shardCount-1)] shard.mu.Lock() exp, ok := shard.seen[key] if ok && now < exp { shard.mu.Unlock() - return nil + return nil // duplicate within TTL — suppress } - // Basic guard against unbounded growth per shard - // Using strict limits per shard avoids global atomic counters - limitPerShard := d.maxKeys / len(d.shards) - if d.maxKeys > 0 && len(shard.seen) >= limitPerShard { - // Opportunistic cleanup of current shard - d.cleanupShard(shard, now) + // Opportunistic per-shard cleanup when the shard is getting full. + if d.maxKeys > 0 { + limitPerShard := d.maxKeys / shardCount + if limitPerShard > 0 && len(shard.seen) >= limitPerShard { + d.cleanupShardLocked(shard, now) + } } shard.seen[key] = now + d.ttl.Nanoseconds() @@ -116,14 +141,19 @@ func (d *Dedup[H]) Handle(e *lx.Entry) error { return d.next.Handle(e) } +// getShardIndex returns the shard index for a given key. +// Uses bitwise AND since shardCount is a power of 2. +func (d *Dedup) getShardIndex(key uint64) int { + return int(key & (shardCount - 1)) +} + // Close stops the cleanup goroutine and closes the underlying handler. -func (d *Dedup[H]) Close() error { +func (d *Dedup) Close() error { var err error d.once.Do(func() { close(d.done) d.wg.Wait() - - if c, ok := any(d.next).(interface{ Close() error }); ok { + if c, ok := d.next.(interface{ Close() error }); ok { err = c.Close() } }) @@ -131,21 +161,19 @@ func (d *Dedup[H]) Close() error { } // cleanupLoop runs periodically to purge expired deduplication keys. -func (d *Dedup[H]) cleanupLoop() { +func (d *Dedup) cleanupLoop() { defer d.wg.Done() - - t := time.NewTicker(d.cleanupEvery) - defer t.Stop() - + ticker := time.NewTicker(d.cleanupEvery) + defer ticker.Stop() for { select { - case <-t.C: + case <-ticker.C: now := time.Now().UnixNano() - // Cleanup all shards sequentially to avoid massive CPU spike for i := 0; i < len(d.shards); i++ { - d.shards[i].mu.Lock() - d.cleanupShard(&d.shards[i], now) - d.shards[i].mu.Unlock() + shard := &d.shards[i] + shard.mu.Lock() + d.cleanupShardLocked(shard, now) + shard.mu.Unlock() } case <-d.done: return @@ -153,11 +181,68 @@ func (d *Dedup[H]) cleanupLoop() { } } -// cleanupShard removes expired keys from a specific shard. -func (d *Dedup[H]) cleanupShard(shard *dedupShard, now int64) { +// cleanupShardLocked removes expired keys from a shard (caller must hold lock). +func (d *Dedup) cleanupShardLocked(shard *dedupShard, now int64) { for k, exp := range shard.seen { if now > exp { delete(shard.seen, k) } } } + +// defaultDedup implements the default deduplication key calculation. +type defaultDedup struct { + ignoreFields map[string]struct{} +} + +// NewDefaultDedup creates a new default deduplication key generator. +func NewDefaultDedup() lx.Deduper { + return &defaultDedup{ignoreFields: make(map[string]struct{})} +} + +// Calculate generates a deduplication key from level, message, namespace, and +// fields. Fields are sorted before hashing so that identical entries always +// produce the same key regardless of Go map iteration order. +func (d *defaultDedup) Calculate(e *lx.Entry) uint64 { + h := xxhash.New() + zero := []byte{0} + + h.Write([]byte(e.Level.String())) + h.Write(zero) + h.Write([]byte(e.Message)) + h.Write(zero) + h.Write([]byte(e.Namespace)) + h.Write(zero) + + if len(e.Fields) > 0 { + m := e.Fields.Map() + keys := make([]string, 0, len(m)) + for k := range m { + if _, excluded := d.ignoreFields[k]; !excluded { + keys = append(keys, k) + } + } + // Sort keys to guarantee a deterministic hash across calls. + // Without this, Go's random map iteration order means two identical + // entries can hash to different values and bypass deduplication. + sort.Strings(keys) + + buf := dedupBufPool.Get().(*bytes.Buffer) + buf.Reset() + defer dedupBufPool.Put(buf) + + for _, k := range keys { + buf.WriteString(k) + buf.WriteByte('=') + fmt.Fprint(buf, m[k]) + buf.WriteByte(0) + } + h.Write(buf.Bytes()) + } + + return h.Sum64() +} + +var dedupBufPool = sync.Pool{ + New: func() any { return new(bytes.Buffer) }, +} diff --git a/vendor/github.com/olekukonko/ll/lh/json.go b/vendor/github.com/olekukonko/ll/lh/json.go index 6bed34615b7..4fab0203f63 100644 --- a/vendor/github.com/olekukonko/ll/lh/json.go +++ b/vendor/github.com/olekukonko/ll/lh/json.go @@ -2,7 +2,6 @@ package lh import ( "bytes" - "encoding/json" "fmt" "io" "os" @@ -10,6 +9,7 @@ import ( "sync" "time" + "github.com/goccy/go-json" "github.com/olekukonko/ll/lx" ) @@ -19,16 +19,31 @@ var jsonBufPool = sync.Pool{ }, } +// fieldsMapPool pools map[string]interface{} to reduce allocations +var fieldsMapPool = sync.Pool{ + New: func() any { + return make(map[string]interface{}, 8) + }, +} + +// jsonOutputPool pools JsonOutput structs to reduce allocations +var jsonOutputPool = sync.Pool{ + New: func() any { + return &JsonOutput{ + Fields: make(map[string]interface{}, 8), + } + }, +} + // JSONHandler is a handler that outputs log entries as JSON objects. // It formats log entries with timestamp, level, message, namespace, fields, and optional // stack traces or dump segments, writing the result to the provided writer. // Thread-safe with a mutex to protect concurrent writes. type JSONHandler struct { - writer io.Writer // Destination for JSON output - timeFmt string // Format for timestamp (default: RFC3339Nano) - pretty bool // Enable pretty printing with indentation if true - //fieldMap map[string]string // Optional mapping for field names (not used in provided code) - mu sync.Mutex // Protects concurrent access to writer + writer io.Writer // Destination for JSON output + timeFmt string // Format for timestamp (default: RFC3339Nano) + pretty bool // Enable pretty printing with indentation if true + mu sync.Mutex // Protects concurrent access to writer } // JsonOutput represents the JSON structure for a log entry. @@ -83,7 +98,6 @@ func NewJSONHandler(w io.Writer, opts ...func(*JSONHandler)) *JSONHandler { func (h *JSONHandler) Handle(e *lx.Entry) error { h.mu.Lock() defer h.mu.Unlock() - // Handle dump entries separately if e.Class == lx.ClassDump { return h.handleDump(e) @@ -107,36 +121,52 @@ func (h *JSONHandler) Output(w io.Writer) { // // h.handleRegular(&lx.Entry{Message: "test", Level: lx.LevelInfo}) // Writes JSON object func (h *JSONHandler) handleRegular(e *lx.Entry) error { + // Get fieldsMap from pool to avoid allocation + fieldsMap := fieldsMapPool.Get().(map[string]interface{}) + // Clear any existing keys from previous use + for k := range fieldsMap { + delete(fieldsMap, k) + } // Convert ordered fields to map for JSON output - fieldsMap := make(map[string]interface{}, len(e.Fields)) for _, pair := range e.Fields { fieldsMap[pair.Key] = pair.Value } - // Create JSON output structure - entry := JsonOutput{ - Time: e.Timestamp.Format(h.timeFmt), // Format timestamp - Level: e.Level.String(), // Convert level to string - Class: e.Class.String(), // Convert class to string - Msg: e.Message, // Set message - Namespace: e.Namespace, // Set namespace - Dump: nil, // No dump for regular entries - Fields: fieldsMap, // Copy fields as map - Stack: e.Stack, // Include stack trace if present - } + // Get JsonOutput from pool + entry := jsonOutputPool.Get().(*JsonOutput) + entry.Time = e.Timestamp.Format(h.timeFmt) + entry.Level = e.Level.String() + entry.Class = e.Class.String() + entry.Msg = e.Message + entry.Namespace = e.Namespace + entry.Dump = nil + entry.Fields = fieldsMap + entry.Stack = e.Stack // Acquire buffer from pool to avoid allocation and reduce syscalls buf := jsonBufPool.Get().(*bytes.Buffer) buf.Reset() - defer jsonBufPool.Put(buf) + defer func() { + // Return all pooled objects + jsonBufPool.Put(buf) + // Reset and return fieldsMap to pool + for k := range entry.Fields { + delete(entry.Fields, k) + } + fieldsMapPool.Put(entry.Fields) + // Reset and return JsonOutput to pool + entry.Fields = nil + entry.Stack = nil + entry.Dump = nil + jsonOutputPool.Put(entry) + }() - // Create JSON encoder writing to buffer + // Create JSON encoder writing to buffer (uses go-json for 2-5x speedup) enc := json.NewEncoder(buf) if h.pretty { // Enable indentation for pretty printing enc.SetIndent("", " ") } - // Encode JSON to buffer err := enc.Encode(entry) if err != nil { @@ -144,7 +174,6 @@ func (h *JSONHandler) handleRegular(e *lx.Entry) error { fmt.Fprintf(os.Stderr, "JSON encode error: %v\n", err) return err } - // Write buffer to underlying writer in one go _, err = h.writer.Write(buf.Bytes()) return err @@ -160,7 +189,6 @@ func (h *JSONHandler) handleRegular(e *lx.Entry) error { func (h *JSONHandler) handleDump(e *lx.Entry) error { var segments []dumpSegment lines := strings.Split(e.Message, "\n") - // Parse each line of the dump message for _, line := range lines { if !strings.HasPrefix(line, "pos") { @@ -173,11 +201,9 @@ func (h *JSONHandler) handleDump(e *lx.Entry) error { // Parse position var offset int fmt.Sscanf(parts[0], "pos %d", &offset) - // Parse hex and ASCII hexAscii := strings.SplitN(parts[1], "'", 2) hexStr := strings.Fields(strings.TrimSpace(hexAscii[0])) - // Create dump segment segments = append(segments, dumpSegment{ Offset: offset, // Set byte offset @@ -186,39 +212,51 @@ func (h *JSONHandler) handleDump(e *lx.Entry) error { }) } - // Convert ordered fields to map for JSON output - fieldsMap := make(map[string]interface{}, len(e.Fields)) + // Get fieldsMap from pool + fieldsMap := fieldsMapPool.Get().(map[string]interface{}) + for k := range fieldsMap { + delete(fieldsMap, k) + } for _, pair := range e.Fields { fieldsMap[pair.Key] = pair.Value } + // Get JsonOutput from pool + entry := jsonOutputPool.Get().(*JsonOutput) + entry.Time = e.Timestamp.Format(h.timeFmt) + entry.Level = e.Level.String() + entry.Class = e.Class.String() + entry.Msg = "dumping segments" + entry.Namespace = e.Namespace + entry.Dump = segments + entry.Fields = fieldsMap + entry.Stack = e.Stack + // Acquire buffer from pool buf := jsonBufPool.Get().(*bytes.Buffer) buf.Reset() - defer jsonBufPool.Put(buf) + defer func() { + jsonBufPool.Put(buf) + for k := range entry.Fields { + delete(entry.Fields, k) + } + fieldsMapPool.Put(entry.Fields) + entry.Fields = nil + entry.Stack = nil + entry.Dump = nil + jsonOutputPool.Put(entry) + }() // Encode JSON output with dump segments to buffer enc := json.NewEncoder(buf) if h.pretty { enc.SetIndent("", " ") } - - err := enc.Encode(JsonOutput{ - Time: e.Timestamp.Format(h.timeFmt), // Format timestamp - Level: e.Level.String(), // Convert level to string - Class: e.Class.String(), // Convert class to string - Msg: "dumping segments", // Fixed message for dumps - Namespace: e.Namespace, // Set namespace - Dump: segments, // Include parsed segments - Fields: fieldsMap, // Copy fields as map - Stack: e.Stack, // Include stack trace if present - }) - + err := enc.Encode(entry) if err != nil { fmt.Fprintf(os.Stderr, "JSON dump encode error: %v\n", err) return err } - // Write buffer to underlying writer _, err = h.writer.Write(buf.Bytes()) return err diff --git a/vendor/github.com/olekukonko/ll/lh/lh.go b/vendor/github.com/olekukonko/ll/lh/lh.go index 5166c3b51e7..a118b6a8ae2 100644 --- a/vendor/github.com/olekukonko/ll/lh/lh.go +++ b/vendor/github.com/olekukonko/ll/lh/lh.go @@ -1,14 +1,9 @@ package lh import ( - "bytes" "fmt" - "sort" + "strconv" "strings" - "sync" - - "github.com/cespare/xxhash/v2" - "github.com/olekukonko/ll/lx" ) // rightPad pads a string with spaces on the right to reach the specified length. @@ -25,43 +20,56 @@ func rightPad(str string, length int) string { return sb.String() } -var dedupBufPool = sync.Pool{ - New: func() any { return new(bytes.Buffer) }, +// stringWriter is the interface for types that can write strings and bytes. +// Both *strings.Builder and *bytes.Buffer implement this. +type stringWriter interface { + WriteString(s string) (int, error) + Write(p []byte) (n int, err error) } -// defaultDedupKey generates a deduplication key from log level and message. -// Uses FNV-1a hash for speed and good distribution. Override with WithDedupKeyFunc -// to include additional fields like namespace, caller, or structured fields. -func defaultDedupKey(e *lx.Entry) uint64 { - h := xxhash.New() - - _, _ = h.Write([]byte(e.Level.String())) - _, _ = h.Write([]byte{0}) - _, _ = h.Write([]byte(e.Message)) - _, _ = h.Write([]byte{0}) - _, _ = h.Write([]byte(e.Namespace)) - _, _ = h.Write([]byte{0}) - - if len(e.Fields) > 0 { - m := e.Fields.Map() - keys := make([]string, 0, len(m)) - for k := range m { - keys = append(keys, k) +// writeFieldValue writes a field value to the builder using type switches +// to avoid reflection and allocations associated with fmt.Fprint. +func writeFieldValue(b stringWriter, v interface{}) { + switch val := v.(type) { + case string: + b.WriteString(val) + case int: + b.WriteString(strconv.Itoa(val)) + case int8: + b.WriteString(strconv.FormatInt(int64(val), 10)) + case int16: + b.WriteString(strconv.FormatInt(int64(val), 10)) + case int32: + b.WriteString(strconv.FormatInt(int64(val), 10)) + case int64: + b.WriteString(strconv.FormatInt(val, 10)) + case uint: + b.WriteString(strconv.FormatUint(uint64(val), 10)) + case uint8: + b.WriteString(strconv.FormatUint(uint64(val), 10)) + case uint16: + b.WriteString(strconv.FormatUint(uint64(val), 10)) + case uint32: + b.WriteString(strconv.FormatUint(uint64(val), 10)) + case uint64: + b.WriteString(strconv.FormatUint(val, 10)) + case float32: + b.WriteString(strconv.FormatFloat(float64(val), 'g', -1, 32)) + case float64: + b.WriteString(strconv.FormatFloat(val, 'g', -1, 64)) + case bool: + if val { + b.WriteString("true") + } else { + b.WriteString("false") } - sort.Strings(keys) - - buf := dedupBufPool.Get().(*bytes.Buffer) - buf.Reset() - defer dedupBufPool.Put(buf) - - for _, k := range keys { - fmt.Fprint(buf, k) - buf.WriteByte('=') - fmt.Fprint(buf, m[k]) - buf.WriteByte(0) - } - _, _ = h.Write(buf.Bytes()) + case nil: + b.WriteString("nil") + case error: + b.WriteString(val.Error()) + case fmt.Stringer: + b.WriteString(val.String()) + default: + fmt.Fprint(b, val) } - - return h.Sum64() } diff --git a/vendor/github.com/olekukonko/ll/lh/pipe.go b/vendor/github.com/olekukonko/ll/lh/pipe.go index 4594c6b7d89..78057134e11 100644 --- a/vendor/github.com/olekukonko/ll/lh/pipe.go +++ b/vendor/github.com/olekukonko/ll/lh/pipe.go @@ -37,7 +37,7 @@ func Pipe(h lx.Handler, wraps ...lx.Wrap) lx.Handler { } // PipeDedup returns a wrapper that applies deduplication to the handler. -func PipeDedup(ttl time.Duration, opts ...DedupOpt[lx.Handler]) lx.Wrap { +func PipeDedup(ttl time.Duration, opts ...DedupOpt) lx.Wrap { return func(next lx.Handler) lx.Handler { return NewDedup(next, ttl, opts...) } diff --git a/vendor/github.com/olekukonko/ll/lh/rotate.go b/vendor/github.com/olekukonko/ll/lh/rotate.go index 68cff5cee43..37fcf27dd79 100644 --- a/vendor/github.com/olekukonko/ll/lh/rotate.go +++ b/vendor/github.com/olekukonko/ll/lh/rotate.go @@ -3,10 +3,36 @@ package lh import ( "io" "sync" + "sync/atomic" "github.com/olekukonko/ll/lx" ) +// trackingWriter wraps an io.WriteCloser to keep an in-memory count of bytes written. +// This prevents the rotator from having to query the filesystem (via os.Stat) +// on every single log entry, which would cause severe performance bottlenecks. +type trackingWriter struct { + io.WriteCloser + written int64 // Atomic: use atomic.LoadInt64/AddInt64 +} + +// Write intercepts the write operation, counts the bytes, and passes them to the underlying writer. +func (t *trackingWriter) Write(p []byte) (n int, err error) { + n, err = t.WriteCloser.Write(p) + if n > 0 { + atomic.AddInt64(&t.written, int64(n)) + } + return +} + +// writtenBytes returns the current byte count atomically. +func (t *trackingWriter) writtenBytes() int64 { + if t == nil { + return 0 + } + return atomic.LoadInt64(&t.written) +} + // RotateSource defines the callbacks needed to implement log rotation. // It abstracts the destination lifecycle: opening, sizing, and rotating. // @@ -23,21 +49,23 @@ import ( // return 0, nil // File doesn't exist yet // }, // Rotate: func() error { -// // Rename current log before creating new one +// // Close and rename the current log before creating a new one. // return os.Rename("app.log", "app.log."+time.Now().Format("20060102-150405")) // }, // } type RotateSource struct { // Open returns a fresh destination for log output. - // Called on initialization and after rotation. + // Called on initialization and after each rotation. Open func() (io.WriteCloser, error) // Size returns the current size in bytes of the active destination. // Return an error if size cannot be determined (rotation will be skipped). Size func() (int64, error) - // Rotate performs cleanup/rotation actions before opening a new destination. - // For files: rename or move the current log. Optional for other destinations. + // Rotate performs all cleanup/rotation actions before a new destination is + // opened, including closing or renaming the previous writer when required. + // Rotating will NOT close the old writer itself; that is the responsibility + // of this callback. May be nil if no pre-open actions are needed. Rotate func() error } @@ -60,7 +88,7 @@ type Rotating[H interface { maxSize int64 src RotateSource - out io.WriteCloser + out *trackingWriter // Uses the tracking wrapper to count bytes in memory handler H } @@ -83,6 +111,11 @@ func NewRotating[H interface { lx.Handler lx.Outputter }](handler H, maxSizeBytes int64, src RotateSource) (*Rotating[H], error) { + // Validate that Open callback is provided + if src.Open == nil { + return nil, io.ErrClosedPipe + } + r := &Rotating[H]{ maxSize: maxSizeBytes, src: src, @@ -130,29 +163,42 @@ func (r *Rotating[H]) Close() error { return nil } +// Written returns the total bytes written to the current output destination. +// Useful for metrics and monitoring. +func (r *Rotating[H]) Written() int64 { + r.mu.Lock() + out := r.out + r.mu.Unlock() + return out.writtenBytes() +} + // rotateIfNeededLocked checks current size and rotates if maxSize exceeded. // Called with mu already held. +// +// The old trackingWriter is simply dereferenced (not closed) because ownership +// of the underlying io.WriteCloser belongs to the src.Rotate callback. That +// callback is responsible for closing, renaming, or otherwise finishing with +// the old destination before src.Open is called to provide a fresh one. This +// design avoids double-closes on shared writers (e.g. test mocks, pipes) and +// correctly models real file-rotation where the OS rename is done before the +// old fd is released. func (r *Rotating[H]) rotateIfNeededLocked() error { - if r.maxSize <= 0 || r.src.Size == nil || r.src.Open == nil { + if r.maxSize <= 0 || r.src.Open == nil { return nil } - size, err := r.src.Size() - if err != nil { - // Size unknown - skip rotation - return nil - } - if size < r.maxSize { + // PERFORMANCE OPTIMIZATION: + // Instead of calling r.src.Size() (which executes a slow os.Stat filesystem call), + // we simply check our fast, in-memory integer counter. + if r.out != nil && r.out.writtenBytes() < r.maxSize { return nil } - // Close current output - if r.out != nil { - _ = r.out.Close() - r.out = nil - } + // Drop the reference to the old trackingWriter without closing the underlying + // WriteCloser. Closing/renaming is the responsibility of src.Rotate (see doc above). + r.out = nil - // Run rotation hook (rename/move/commit) + // Run rotation hook (rename/move/compress/close old file, etc.) if r.src.Rotate != nil { if err := r.src.Rotate(); err != nil { return err @@ -170,7 +216,20 @@ func (r *Rotating[H]) reopenLocked() error { if err != nil { return err } - r.out = out - r.handler.Output(out) + + // We only ask the filesystem for the true file size ONCE when we first open the file. + // This is necessary to know the starting size if we are appending to an existing log file. + var initialSize int64 + if r.src.Size != nil { + initialSize, _ = r.src.Size() + } + + // Wrap the returned io.WriteCloser so we can track all future bytes written in memory. + r.out = &trackingWriter{ + WriteCloser: out, + written: initialSize, + } + + r.handler.Output(r.out) return nil } diff --git a/vendor/github.com/olekukonko/ll/lh/text.go b/vendor/github.com/olekukonko/ll/lh/text.go index 2bd59ff70e8..2aaff3af17d 100644 --- a/vendor/github.com/olekukonko/ll/lh/text.go +++ b/vendor/github.com/olekukonko/ll/lh/text.go @@ -2,7 +2,6 @@ package lh import ( "bytes" - "fmt" "io" "strings" "sync" @@ -171,7 +170,7 @@ func (h *TextHandler) handleRegularOutput(e *lx.Entry) error { } buf.WriteString(pair.Key) buf.WriteString("=") - fmt.Fprint(buf, pair.Value) + writeFieldValue(buf, pair.Value) } buf.WriteString(lx.RightBracket) } diff --git a/vendor/github.com/olekukonko/ll/ll.go b/vendor/github.com/olekukonko/ll/ll.go index 4dfafdd9460..99ba5e1ad86 100644 --- a/vendor/github.com/olekukonko/ll/ll.go +++ b/vendor/github.com/olekukonko/ll/ll.go @@ -19,12 +19,35 @@ import ( "github.com/olekukonko/ll/lx" ) +// stackBufPool pools buffers for stack trace capture to reduce allocations. +var ( + stackBufPool = sync.Pool{ + New: func() any { return make([]byte, 4096) }, + } + + entryPool = sync.Pool{ + New: func() any { + return &lx.Entry{ + Fields: make(lx.Fields, 0, 4), + Stack: nil, + } + }, + } + + fieldsSlicePool = sync.Pool{ + New: func() any { + s := make(lx.Fields, 0, 8) + return &s + }, + } +) + // Logger manages logging configuration and behavior, encapsulating state such as enablement, // log level, namespaces, context fields, output style, handler, middleware, and formatting. // It is thread-safe, using a read-write mutex to protect concurrent access to its fields. type Logger struct { mu sync.RWMutex // Guards concurrent access to fields - enabled bool // Determines if logging is enabled + enabled atomic.Int32 // Determines if logging is enabled suspend atomic.Bool // uses suspend path for most actions eg. skipping namespace checks level lx.LevelType // Minimum log level (e.g., Debug, Info, Warn, Error) atomicLevel int32 // Shadow copy of level for lock-free checks @@ -54,7 +77,7 @@ type Logger struct { // logger.Info("Starting application") // Output: [app] INFO: Starting application func New(namespace string, opts ...Option) *Logger { logger := &Logger{ - enabled: lx.DefaultEnabled, // Defaults to disabled (false) + //enabled: 0, // Defaults to disabled (false) level: lx.LevelDebug, // Default minimum log level atomicLevel: int32(lx.LevelDebug), // Initialize atomic level namespaces: defaultStore, // Shared namespace store @@ -66,12 +89,11 @@ func New(namespace string, opts ...Option) *Logger { stackBufferSize: 4096, // Default stack trace buffer size separator: lx.Slash, // Default namespace separator ("/") } - + logger.enabled.Store(lx.Active) // Apply provided configuration options for _, opt := range opts { opt(logger) } - return logger } @@ -117,11 +139,9 @@ func (l *Logger) Apply(opts ...Option) *Logger { func (l *Logger) AddContext(pairs ...any) *Logger { l.mu.Lock() defer l.mu.Unlock() - if l.context == nil { l.context = make(lx.Fields, 0, len(pairs)/2) } - for i := 0; i < len(pairs)-1; i += 2 { if key, ok := pairs[i].(string); ok { l.context = append(l.context, lx.Field{Key: key, Value: pairs[i+1]}) @@ -143,7 +163,6 @@ func (l *Logger) Benchmark(start time.Time) time.Duration { "duration_ms", duration.Milliseconds(), "duration", duration.String(), ).Infof("benchmark completed") - return duration } @@ -163,7 +182,7 @@ func (l *Logger) CanLog(level lx.LevelType) bool { // // logger := New("app").Enable().Use(someMiddleware) // logger.Clear() -// logger.Info("No middleware") // Output: [app] INFO: No middleware +// logger.Info("Inactive middleware") // Output: [app] INFO: Inactive middleware func (l *Logger) Clear() *Logger { l.mu.Lock() defer l.mu.Unlock() @@ -182,21 +201,20 @@ func (l *Logger) Clear() *Logger { func (l *Logger) Clone() *Logger { l.mu.RLock() defer l.mu.RUnlock() - return &Logger{ - enabled: l.enabled, // Copy enablement state - level: l.level, // Copy log level - atomicLevel: l.atomicLevel, // Copy atomic level - namespaces: l.namespaces, // Share namespace store - currentPath: l.currentPath, // Copy namespace path - context: make(lx.Fields, 0, 10), // Fresh context map - style: l.style, // Copy namespace style - handler: l.handler, // Copy output handler - middleware: l.middleware, // Copy middleware chain - prefix: l.prefix, // Copy message prefix - indent: l.indent, // Copy indentation level - stackBufferSize: l.stackBufferSize, // Copy stack trace buffer size - separator: l.separator, // Default separator ("/") + enabled: l.enabled, // Copy enablement state + level: l.level, // Copy log level + atomicLevel: l.atomicLevel, // Copy atomic level + namespaces: l.namespaces, // Share namespace store + currentPath: l.currentPath, // Copy namespace path + context: nil, // Fresh context map (nil saves allocation, handled by AddContext) + style: l.style, // Copy namespace style + handler: l.handler, // Copy output handler + middleware: l.middleware, // Copy middleware chain + prefix: l.prefix, // Copy message prefix + indent: l.indent, // Copy indentation level + stackBufferSize: l.stackBufferSize, // Copy stack trace buffer size + separator: l.separator, // Default separator ("/") suspend: l.suspend, } } @@ -212,7 +230,6 @@ func (l *Logger) Clone() *Logger { func (l *Logger) Context(fields map[string]interface{}) *Logger { l.mu.Lock() defer l.mu.Unlock() - // Create a new logger with inherited configuration newLogger := &Logger{ enabled: l.enabled, @@ -232,15 +249,12 @@ func (l *Logger) Context(fields map[string]interface{}) *Logger { fatalExits: l.fatalExits, fatalStack: l.fatalStack, } - // Copy parent's context fields (in order) newLogger.context = append(newLogger.context, l.context...) - // Add new fields from map for k, v := range fields { newLogger.context = append(newLogger.context, lx.Field{Key: k, Value: v}) } - return newLogger } @@ -251,16 +265,13 @@ func (l *Logger) Context(fields map[string]interface{}) *Logger { // logger := New("app").Enable().Level(lx.LevelDebug) // logger.Debug("Debugging") // Output: [app] DEBUG: Debugging func (l *Logger) Debug(args ...any) { - // check if suspended if l.suspend.Load() { return } - // Skip logging if Debug level is not enabled if !l.shouldLog(lx.LevelDebug) { return } - l.log(lx.LevelDebug, lx.ClassText, cat.Space(args...), nil, false) } @@ -274,7 +285,6 @@ func (l *Logger) Debugf(format string, args ...any) { if l.suspend.Load() { return } - l.Debug(fmt.Sprintf(format, args...)) } @@ -283,11 +293,9 @@ func (l *Logger) Debugf(format string, args ...any) { // Example: // // logger := New("app").Enable().Disable() -// logger.Info("Ignored") // No output +// logger.Info("Ignored") // Inactive output func (l *Logger) Disable() *Logger { - l.mu.Lock() - defer l.mu.Unlock() - l.enabled = false + l.enabled.Store(lx.Inactive) return l } @@ -298,13 +306,16 @@ func (l *Logger) Disable() *Logger { // type Data struct { X int; Y string } // logger.Dump(Data{42, "test"}) // Outputs hex/ASCII dump func (l *Logger) Dump(values ...interface{}) { + if l.suspend.Load() { + return + } + // Iterate over each value to dump for _, value := range values { // Log value description and type l.Infof("Dumping %v (%T)", value, value) var by []byte var err error - // Convert value to byte slice based on type switch v := value.(type) { case []byte: @@ -336,13 +347,11 @@ func (l *Logger) Dump(values ...interface{}) { // Fallback to JSON marshaling for complex types by, err = json.Marshal(v) } - // Log error if conversion fails if err != nil { l.Errorf("Dump error: %v", err) continue } - // Generate hex/ASCII dump n := len(by) rowcount := 0 @@ -359,7 +368,6 @@ func (l *Logger) Dump(values ...interface{}) { } // Write position and hex prefix s.WriteString(fmt.Sprintf("pos %02d hex: ", i)) - // Write hex values for j := 0; j < rowcount; j++ { s.WriteString(fmt.Sprintf("%02x ", by[i+j])) @@ -380,15 +388,22 @@ func (l *Logger) Dump(values ...interface{}) { // Each value is logged on its own line with [file:line] and a blank line after the header. // Ideal for inspecting outgoing/incoming REST payloads. func (l *Logger) Output(values ...interface{}) { + if l.suspend.Load() { + return + } + l.output(2, values...) } // mark logs the caller's file and line number along with an optional custom name label for tracing execution flow. func (l *Logger) output(skip int, values ...interface{}) { - if !l.shouldLog(lx.LevelInfo) { + if l.suspend.Load() { return } + if !l.shouldLog(lx.LevelInfo) { + return + } _, file, line, ok := runtime.Caller(skip) if !ok { return @@ -397,9 +412,7 @@ func (l *Logger) output(skip int, values ...interface{}) { if idx := strings.LastIndex(file, "/"); idx >= 0 { shortFile = file[idx+1:] } - header := fmt.Sprintf("[%s:%d] JSON:\n", shortFile, line) - for _, v := range values { // Always pretty-print with indent b, err := json.MarshalIndent(v, " ", " ") @@ -409,26 +422,29 @@ func (l *Logger) output(skip int, values ...interface{}) { "error": err.Error(), }, " ", " ") } - l.log(lx.LevelInfo, lx.ClassJSON, header+string(b), nil, false) + l.log(lx.LevelInfo, lx.ClassOutput, header+string(b), nil, false) } } // Inspect logs one or more values in a **developer-friendly, deeply introspective format** at Info level. -// It includes the caller file and line number, and reveals **all fields** — including: +// It includes the caller file and line number, and reveals **all fields** â including: // -// - Private (unexported) fields → prefixed with `(field)` +// - Private (unexported) fields â prefixed with `(field)` // - Embedded structs (inlined) -// - Pointers and nil values → shown as `*(field)` or `nil` +// - Pointers and nil values â shown as `*(field)` or `nil` // - Full struct nesting and type information // // This method uses `NewInspector` under the hood, which performs **full reflection-based traversal**. -// It is **not** meant for production logging or REST APIs — use `Output` for that. +// It is **not** meant for production logging or REST APIs â use `Output` for that. // // Ideal for: // - Debugging complex internal state // - Inspecting structs with private fields // - Understanding struct embedding and pointer behavior func (l *Logger) Inspect(values ...interface{}) { + if l.suspend.Load() { + return + } o := NewInspector(l) o.Log(2, values...) } @@ -440,9 +456,7 @@ func (l *Logger) Inspect(values ...interface{}) { // logger := New("app").Enable() // logger.Info("Started") // Output: [app] INFO: Started func (l *Logger) Enable() *Logger { - l.mu.Lock() - defer l.mu.Unlock() - l.enabled = true + l.enabled.Store(lx.Active) return l } @@ -454,12 +468,10 @@ func (l *Logger) Enable() *Logger { // logger.Info("Logging is enabled") // Output: [app] INFO: Logging is enabled // } func (l *Logger) Enabled() bool { - l.mu.RLock() - defer l.mu.RUnlock() - return l.enabled + return l.enabled.Load() == lx.Active } -// Err adds one or more errors to the logger’s context and logs them at Error level. +// Err adds one or more errors to the loggerâ s context and logs them at Error level. // Non-nil errors are stored in the "error" context field (single error or slice) and // logged as a concatenated string (e.g., "failed 1; failed 2"). It is thread-safe and // returns the logger for chaining. @@ -472,19 +484,20 @@ func (l *Logger) Enabled() bool { // // Output: [app] ERROR: failed 1; failed 2 // // [app] INFO: Error occurred [error=[failed 1 failed 2]] func (l *Logger) Err(errs ...error) { + if l.suspend.Load() { + return + } + // Skip logging if Error level is not enabled if !l.shouldLog(lx.LevelError) { return } - l.mu.Lock() defer l.mu.Unlock() - // Initialize context slice if nil if l.context == nil { l.context = make(lx.Fields, 0, 4) } - // Collect non-nil errors and build log message var nonNilErrors []error var builder strings.Builder @@ -499,7 +512,6 @@ func (l *Logger) Err(errs ...error) { count++ } } - if count > 0 { if count == 1 { // Store single error directly @@ -520,11 +532,9 @@ func (l *Logger) Err(errs ...error) { // logger := New("app").Enable() // logger.Error("Error occurred") // Output: [app] ERROR: Error occurred func (l *Logger) Error(args ...any) { - // check if suspended if l.suspend.Load() { return } - // Skip logging if Error level is not enabled if !l.shouldLog(lx.LevelError) { return @@ -542,7 +552,6 @@ func (l *Logger) Errorf(format string, args ...any) { if l.suspend.Load() { return } - l.Error(fmt.Errorf(format, args...)) } @@ -553,16 +562,12 @@ func (l *Logger) Errorf(format string, args ...any) { // logger := New("app").Enable() // logger.Fatal("Fatal error") // Output: [app] ERROR: Fatal error [stack=...], then exits func (l *Logger) Fatal(args ...any) { - // check if suspended if l.suspend.Load() { return } - - // Exit immediately if Error level is not enabled if !l.shouldLog(lx.LevelError) { os.Exit(1) } - l.log(lx.LevelFatal, lx.ClassText, cat.Space(args...), nil, l.fatalStack) if l.fatalExits { os.Exit(1) @@ -576,28 +581,46 @@ func (l *Logger) Fatal(args ...any) { // logger := New("app").Enable() // logger.Fatalf("Fatal %s", "error") // Output: [app] ERROR: Fatal error [stack=...], then exits func (l *Logger) Fatalf(format string, args ...any) { - // check if suspended if l.suspend.Load() { return } - l.Fatal(fmt.Sprintf(format, args...)) } +// FieldOne logs a message at Error level with a stack trace and exits the program with +// exit code 1. It is thread-safe. +func (l *Logger) FieldOne(key string, value any) *FieldBuilder { + fb := fieldBuilderPool.Get().(*FieldBuilder) + fb.logger = l + fb.fields = fb.fields[:1] + fb.fields[0] = lx.Field{Key: key, Value: value} + return fb +} + +// FieldSet avoids variadic allocation overhead by accepting a slice of strongly typed fields. +// Ideally, lx.Field is struct{Key string, Value any} +func (l *Logger) FieldSet(fields []lx.Field) *FieldBuilder { + fb := getFieldBuilder(l, len(fields)) + if l.suspend.Load() { + return fb + } + fb.fields = append(fb.fields, fields...) + return fb +} + // Field starts a fluent chain for adding fields from a map, creating a FieldBuilder -// for type-safe field addition. It is thread-safe via the FieldBuilder’s logger. +// for type-safe field addition. It is thread-safe via the FieldBuilderâ s logger. // Example: // // logger := New("app").Enable() // logger.Field(map[string]interface{}{"user": "alice"}).Info("Action") // Output: [app] INFO: Action [user=alice] +// +// Field starts a fluent chain for adding fields from a map func (l *Logger) Field(fields map[string]interface{}) *FieldBuilder { - fb := &FieldBuilder{logger: l, fields: make(lx.Fields, 0, len(fields))} - + fb := getFieldBuilder(l, len(fields)) if l.suspend.Load() { return fb } - - // Copy fields from input map to FieldBuilder (preserving map iteration order) for k, v := range fields { fb.fields = append(fb.fields, lx.Field{Key: k, Value: v}) } @@ -611,12 +634,10 @@ func (l *Logger) Field(fields map[string]interface{}) *FieldBuilder { // // logger.Fields("user", "alice").Info("Action") // Output: [app] INFO: Action [user=alice] func (l *Logger) Fields(pairs ...any) *FieldBuilder { - fb := &FieldBuilder{logger: l, fields: make(lx.Fields, 0, len(pairs)/2)} - + fb := getFieldBuilder(l, len(pairs)/2) if l.suspend.Load() { return fb } - // Process key-value pairs for i := 0; i < len(pairs)-1; i += 2 { if key, ok := pairs[i].(string); ok { @@ -753,11 +774,9 @@ func (l *Logger) Info(args ...any) { if l.suspend.Load() { return } - if !l.shouldLog(lx.LevelInfo) { return } - l.log(lx.LevelInfo, lx.ClassText, cat.Space(args...), nil, false) } @@ -770,7 +789,6 @@ func (l *Logger) Infof(format string, args ...any) { if l.suspend.Load() { return } - l.Info(fmt.Sprintf(format, args...)) } @@ -812,7 +830,7 @@ func (l *Logger) Labels(names ...string) *Logger { // Example: // // logger := New("app").Enable().Level(lx.LevelWarn) -// logger.Info("Ignored") // No output +// logger.Info("Ignored") // Inactive output // logger.Warn("Logged") // Output: [app] WARN: Logged func (l *Logger) Level(level lx.LevelType) *Logger { l.mu.Lock() @@ -853,41 +871,43 @@ func (l *Logger) Line(lines ...int) *Logger { // // logger.Mark() // *MARK*: [file.go:123] func (l *Logger) Mark(name ...string) { + if l.suspend.Load() { + return + } l.mark(2, name...) } // mark logs the caller's file and line number along with an optional custom name label for tracing execution flow. func (l *Logger) mark(skip int, names ...string) { + if l.suspend.Load() { + return + } // Skip logging if Info level is not enabled if !l.shouldLog(lx.LevelInfo) { return } - // Get caller information (file, line) _, file, line, ok := runtime.Caller(skip) if !ok { l.log(lx.LevelError, lx.ClassText, "Mark: Unable to parse runtime caller", nil, false) return } - // Extract just the filename (without full path) shortFile := file if idx := strings.LastIndex(file, "/"); idx >= 0 { shortFile = file[idx+1:] } - name := strings.Join(names, l.separator) if name == "" { name = "MARK" } - // Format as [filename:line] out := fmt.Sprintf("[*%s*]: [%s:%d]\n", name, shortFile, line) l.log(lx.LevelInfo, lx.ClassRaw, out, nil, false) } // Namespace creates a child logger with a sub-namespace appended to the current path, -// inheriting the parent’s configuration but with an independent context. It is thread-safe +// inheriting the parentâ s configuration but with an independent context. It is thread-safe // using a read lock. // Example: // @@ -898,16 +918,13 @@ func (l *Logger) Namespace(name string) *Logger { if l.suspend.Load() { return l } - l.mu.RLock() defer l.mu.RUnlock() - // Construct full namespace path fullPath := name if l.currentPath != "" { fullPath = l.currentPath + l.separator + name } - // Create child logger with inherited configuration return &Logger{ enabled: l.enabled, @@ -915,7 +932,7 @@ func (l *Logger) Namespace(name string) *Logger { atomicLevel: l.atomicLevel, namespaces: l.namespaces, currentPath: fullPath, - context: make(lx.Fields, 0, 10), + context: nil, // Fresh context map (nil saves allocation) style: l.style, handler: l.handler, middleware: l.middleware, @@ -928,24 +945,23 @@ func (l *Logger) Namespace(name string) *Logger { } // NamespaceDisable disables logging for a namespace and its children, invalidating the -// namespace cache. It is thread-safe via lx.Namespace’s sync.Map and returns the logger +// namespace cache. It is thread-safe via lx.Namespaceâ s sync.Map and returns the logger // for chaining. // Example: // // logger := New("parent").Enable().NamespaceDisable("parent/child") -// logger.Namespace("child").Info("Ignored") // No output +// logger.Namespace("child").Info("Ignored") // Inactive output func (l *Logger) NamespaceDisable(relativePath string) *Logger { l.mu.RLock() fullPath := l.joinPath(l.currentPath, relativePath) l.mu.RUnlock() - // Disable namespace in shared store l.namespaces.Set(fullPath, false) return l } // NamespaceEnable enables logging for a namespace and its children, invalidating the -// namespace cache. It is thread-safe via lx.Namespace’s sync.Map and returns the logger +// namespace cache. It is thread-safe via lx.Namespaceâ s sync.Map and returns the logger // for chaining. // Example: // @@ -955,7 +971,6 @@ func (l *Logger) NamespaceEnable(relativePath string) *Logger { l.mu.RLock() fullPath := l.joinPath(l.currentPath, relativePath) l.mu.RUnlock() - // Enable namespace in shared store l.namespaces.Set(fullPath, true) return l @@ -968,20 +983,15 @@ func (l *Logger) NamespaceEnable(relativePath string) *Logger { // logger := New("parent").Enable().NamespaceDisable("parent/child") // enabled := logger.NamespaceEnabled("parent/child") // false func (l *Logger) NamespaceEnabled(relativePath string) bool { - l.mu.RLock() fullPath := l.joinPath(l.currentPath, relativePath) separator := l.separator if separator == "" { separator = lx.Slash } - instanceEnabled := l.enabled - l.mu.RUnlock() - // Handle root path case if fullPath == "" && relativePath == "" { - return instanceEnabled + return l.enabled.Load() == lx.Active } - if fullPath != "" { // Check namespace rules isEnabledByNSRule, isDisabledByNSRule := l.namespaces.Enabled(fullPath, separator) @@ -993,7 +1003,7 @@ func (l *Logger) NamespaceEnabled(relativePath string) bool { } } // Fall back to logger's enabled state - return instanceEnabled + return l.enabled.Load() == lx.Active } // Panic logs a message at Error level with a stack trace and triggers a panic. It is @@ -1005,16 +1015,13 @@ func (l *Logger) NamespaceEnabled(relativePath string) bool { func (l *Logger) Panic(args ...any) { // Build message by concatenating arguments with spaces msg := cat.Space(args...) - if l.suspend.Load() { panic(msg) } - // Panic immediately if Error level is not enabled if !l.shouldLog(lx.LevelError) { panic(msg) } - l.log(lx.LevelFatal, lx.ClassText, msg, nil, true) panic(msg) } @@ -1052,7 +1059,6 @@ func (l *Logger) Print(args ...any) { if l.suspend.Load() { return } - // Skip logging if Info level is not enabled if !l.shouldLog(lx.LevelInfo) { return @@ -1070,7 +1076,6 @@ func (l *Logger) Println(args ...any) { if l.suspend.Load() { return } - // Skip logging if Info level is not enabled if !l.shouldLog(lx.LevelInfo) { return @@ -1087,12 +1092,11 @@ func (l *Logger) Printf(format string, args ...any) { if l.suspend.Load() { return } - l.Print(fmt.Sprintf(format, args...)) } // Remove removes middleware by the reference returned from Use, delegating to the -// Middleware’s Remove method for thread-safe removal. +// Middlewareâ s Remove method for thread-safe removal. // Example: // // logger := New("app").Enable() @@ -1135,7 +1139,7 @@ func (l *Logger) Separator(separator string) *Logger { // // logger := New("app").Enable() // logger.Suspend() -// logger.Info("Ignored") // No output +// logger.Info("Ignored") // Inactive output func (l *Logger) Suspend() *Logger { l.suspend.Store(true) return l @@ -1160,17 +1164,8 @@ func (l *Logger) Suspended() bool { // logger := New("app").Enable() // logger.Stack("Critical error") // Output: [app] ERROR: Critical error [stack=...] func (l *Logger) Stack(args ...any) { - if l.suspend.Load() { - return - } - - // Skip logging if Debug level is not enabled - if !l.shouldLog(lx.LevelDebug) { - return - } - for _, arg := range args { - l.log(lx.LevelError, lx.ClassText, cat.Concat(arg), nil, true) + l.log(lx.LevelError, lx.ClassStack, cat.Concat(arg), nil, true) } } @@ -1181,10 +1176,6 @@ func (l *Logger) Stack(args ...any) { // logger := New("app").Enable() // logger.Stackf("Critical %s", "error") // Output: [app] ERROR: Critical error [stack=...] func (l *Logger) Stackf(format string, args ...any) { - if l.suspend.Load() { - return - } - l.Stack(fmt.Sprintf(format, args...)) } @@ -1204,12 +1195,12 @@ func (l *Logger) StackSize(size int) *Logger { } // Style sets the namespace formatting style (FlatPath or NestedPath). FlatPath uses -// [parent/child], while NestedPath uses [parent]→[child]. It is thread-safe using a write +// [parent/child], while NestedPath uses [parent]â [child]. It is thread-safe using a write // lock and returns the logger for chaining. // Example: // // logger := New("parent/child").Enable().Style(lx.NestedPath) -// logger.Info("Log") // Output: [parent]→[child]: INFO: Log +// logger.Info("Log") // Output: [parent]â [child]: INFO: Log func (l *Logger) Style(style lx.StyleType) *Logger { l.mu.Lock() defer l.mu.Unlock() @@ -1228,7 +1219,6 @@ func (l *Logger) Style(style lx.StyleType) *Logger { func (l *Logger) Timestamped(enable bool, format ...string) *Logger { l.mu.Lock() defer l.mu.Unlock() - if h, ok := l.handler.(lx.Timestamper); ok { h.Timestamped(enable, format...) } @@ -1241,7 +1231,6 @@ func (l *Logger) Toggle(v bool) *Logger { l.Resume() return l.Enable() } - l.Suspend() return l.Disable() } @@ -1258,18 +1247,16 @@ func (l *Logger) Toggle(v bool) *Logger { // } // return nil // })) -// logger.Info("Ignored") // No output +// logger.Info("Ignored") // Inactive output // mw.Remove() // logger.Info("Now logged") // Output: [app] INFO: Now logged func (l *Logger) Use(fn lx.Handler) *Middleware { l.mu.Lock() defer l.mu.Unlock() - // Assign a unique ID to the middleware id := len(l.middleware) + 1 // Append middleware to the chain l.middleware = append(l.middleware, Middleware{id: id, fn: fn}) - return &Middleware{ logger: l, id: id, @@ -1286,12 +1273,10 @@ func (l *Logger) Warn(args ...any) { if l.suspend.Load() { return } - // Skip logging if Warn level is not enabled if !l.shouldLog(lx.LevelWarn) { return } - l.log(lx.LevelWarn, lx.ClassText, cat.Space(args...), nil, false) } @@ -1304,7 +1289,6 @@ func (l *Logger) Warnf(format string, args ...any) { if l.suspend.Load() { return } - l.Warn(fmt.Sprintf(format, args...)) } @@ -1324,7 +1308,7 @@ func (l *Logger) joinPath(base, relative string) string { if separator == "" { separator = lx.Slash // Default separator } - return base + separator + relative + return cat.Concat(base, separator, relative) } // log is the internal method for processing a log entry, applying rate limiting, sampling, @@ -1335,76 +1319,114 @@ func (l *Logger) joinPath(base, relative string) string { // // logger := New("app").Enable() // logger.Info("Test") // Calls log(lx.LevelInfo, "Test", nil, false) +// +// log is the internal method for processing a log entry, applying rate limiting, sampling, +// middleware, and context before passing to the handler. Middleware returning a non-nil +// error stops the log. It is thread-safe with read/write locks for configuration and stack +// trace buffer. func (l *Logger) log(level lx.LevelType, class lx.ClassType, msg string, fields lx.Fields, withStack bool) { - // Skip logging if level is not enabled + // Skip logging if level is not enabled (fast path) if !l.shouldLog(level) { return } var stack []byte - - // Capture stack trace if requested + // Capture stack trace if requested (outside lock) if withStack { l.mu.RLock() - buf := make([]byte, l.stackBufferSize) + size := l.stackBufferSize l.mu.RUnlock() + + buf := stackBufPool.Get().([]byte) + if cap(buf) < size { + buf = make([]byte, size) + } else { + buf = buf[:size] + } n := runtime.Stack(buf, false) - stack = buf[:n] + stack = append([]byte(nil), buf[:n]...) + stackBufPool.Put(buf) } + // Read-only config snapshot (minimal lock scope) l.mu.RLock() - defer l.mu.RUnlock() + handler := l.handler + prefix := l.prefix + indent := l.indent + context := l.context + style := l.style + currentPath := l.currentPath + middleware := l.middleware + l.mu.RUnlock() - // Apply prefix and indentation to the message + // Apply prefix and indentation to the message (outside lock) var builder strings.Builder - if l.indent > 0 { - builder.WriteString(strings.Repeat(lx.DoubleSpace, l.indent)) + // Optimization: Pre-grow buffer if indent/prefix known + if indent > 0 { + builder.Grow(indent*2 + len(prefix) + len(msg)) + builder.WriteString(strings.Repeat(lx.DoubleSpace, indent)) + } else { + builder.Grow(len(prefix) + len(msg)) } - if l.prefix != "" { - builder.WriteString(l.prefix) + + if prefix != "" { + builder.WriteString(prefix) } builder.WriteString(msg) finalMsg := builder.String() - // Create combined fields slice - THIS PRESERVES ORDER! - // Optimized slice allocation + // Optimized field merging - avoid allocation when possible var combinedFields lx.Fields - if len(l.context) == 0 { + var pooledFields *lx.Fields // Track if we allocated from pool + + if len(context) == 0 { combinedFields = fields } else if len(fields) == 0 { - combinedFields = l.context + combinedFields = context } else { - combinedFields = make(lx.Fields, 0, len(l.context)+len(fields)) - // Add context fields first (in order) - combinedFields = append(combinedFields, l.context...) - // Add immediate fields + // Get pooled slice + pooledFields = fieldsSlicePool.Get().(*lx.Fields) + combinedFields = (*pooledFields)[:0] // Reset length, keep capacity + combinedFields = append(combinedFields, context...) combinedFields = append(combinedFields, fields...) } - // Create log entry with ordered fields - entry := &lx.Entry{ - Timestamp: time.Now(), - Level: level, - Message: finalMsg, - Namespace: l.currentPath, - Fields: combinedFields, // Already ordered! - Style: l.style, - Class: class, - Stack: stack, - } + // Get entry from pool + entry := entryPool.Get().(*lx.Entry) + + // Ensure pool return on ALL paths (including middleware errors) + defer func() { + // Reset slices to zero length but keep capacity for pool reuse + entry.Fields = entry.Fields[:0] + entry.Stack = entry.Stack[:0] + entryPool.Put(entry) + }() + + entry.Timestamp = time.Now() + entry.Level = level + entry.Message = finalMsg + entry.Namespace = currentPath + entry.Fields = combinedFields + entry.Style = style + entry.Class = class + entry.Stack = stack + entry.Error = nil + entry.Id = 0 // Apply middleware, stopping if any returns an error - for _, mw := range l.middleware { + for _, mw := range middleware { if err := mw.fn.Handle(entry); err != nil { + // Defer handles pool return return } } // Pass to handler if set - if l.handler != nil { - _ = l.handler.Handle(entry) + if handler != nil { + _ = handler.Handle(entry) l.entries.Add(1) } + // Defer handles pool return } // shouldLog determines if a log should be emitted based on enabled state, level, namespaces, @@ -1422,23 +1444,16 @@ func (l *Logger) shouldLog(level lx.LevelType) bool { return false } - // check for suspend mode - if l.suspend.Load() { - return false - } - // Atomic fast path: read level without lock if level > lx.LevelType(atomic.LoadInt32(&l.atomicLevel)) { return false } - - separator := l.separator - if separator == "" { - separator = lx.Slash - } - - // Check namespace rules if path is set + // Check namespace rules if path is set (minimal lock scope) if l.currentPath != "" { + separator := l.separator + if separator == "" { + separator = lx.Slash + } isEnabledByNSRule, isDisabledByNSRule := l.namespaces.Enabled(l.currentPath, separator) if isDisabledByNSRule { return false @@ -1447,11 +1462,5 @@ func (l *Logger) shouldLog(level lx.LevelType) bool { return true } } - - // Fall back to logger's enabled state - if !l.enabled { - return false - } - - return true + return l.enabled.Load() == lx.Active } diff --git a/vendor/github.com/olekukonko/ll/lx/interface.go b/vendor/github.com/olekukonko/ll/lx/interface.go index 8d1c5339e95..6486b972266 100644 --- a/vendor/github.com/olekukonko/ll/lx/interface.go +++ b/vendor/github.com/olekukonko/ll/lx/interface.go @@ -65,3 +65,8 @@ type Timestamper interface { // It takes an existing handler as input and returns a new, wrapped handler // that adds functionality (like filtering, transformation, or routing). type Wrap func(next Handler) Handler + +// Deduper defines how to calculate a deduplication key for an entry. +type Deduper interface { + Calculate(*Entry) uint64 +} diff --git a/vendor/github.com/olekukonko/ll/lx/lx.go b/vendor/github.com/olekukonko/ll/lx/lx.go index f0b8743c9f1..4e7f42ca288 100644 --- a/vendor/github.com/olekukonko/ll/lx/lx.go +++ b/vendor/github.com/olekukonko/ll/lx/lx.go @@ -21,6 +21,11 @@ const ( // Set to false to prevent logging until explicitly enabled. const ( DefaultEnabled = true // Default state for new loggers (disabled) + True = true + False = false + Active = 1 + Inactive = -1 + Unknown = 0 ) // Log level constants, ordered by increasing severity. @@ -55,6 +60,8 @@ const ( InspectString = "INSPECT" DbgString = "DBG" TimedString = "TIMED" + StackString = "STACK" + OutputString = "OUTPUT" ) // Log class constants, defining the type of log entry. @@ -69,6 +76,8 @@ const ( ClassInspect // Inspect entries for debugging ClassDbg // Inspect entries for debugging ClassTimed // Inspect entries for debugging + ClassStack // Inspect entries for debugging + ClassOutput // Inspect entries for debugging ClassUnknown // Unknown output ) diff --git a/vendor/github.com/olekukonko/ll/lx/namespace.go b/vendor/github.com/olekukonko/ll/lx/namespace.go index 5d30c93940a..33b76944439 100644 --- a/vendor/github.com/olekukonko/ll/lx/namespace.go +++ b/vendor/github.com/olekukonko/ll/lx/namespace.go @@ -3,12 +3,14 @@ package lx import ( "strings" "sync" + "sync/atomic" ) // namespaceRule stores the cached result of Enabled. type namespaceRule struct { isEnabledByRule bool isDisabledByRule bool + generation uint64 // NEW: track cache validity } // Namespace manages thread-safe namespace enable/disable states with caching. @@ -16,22 +18,22 @@ type namespaceRule struct { // The cache holds computed effective states for paths (path -> namespaceRule) // based on hierarchical rules to optimize lookups. type Namespace struct { - store sync.Map // path (string) -> rule (bool: true=enable, false=disable) - cache sync.Map // path (string) -> namespaceRule + store sync.Map // path (string) -> rule (bool) + cache sync.Map // path (string) -> namespaceRule + genCounter uint64 // NEW: atomic generation counter } // Set defines an explicit enable/disable rule for a namespace path. // It clears the cache to ensure subsequent lookups reflect the change. func (ns *Namespace) Set(path string, enabled bool) { ns.store.Store(path, enabled) - ns.clearCache() + ns.invalidatePathCache(path) } -// Load retrieves an explicit rule from the store for a path. -// Returns the rule (true=enable, false=disable) and whether it exists. -// Does not consider hierarchy or caching. -func (ns *Namespace) Load(path string) (rule interface{}, found bool) { - return ns.store.Load(path) +// invalidatePathCache increments generation counter instead of scanning cache. +func (ns *Namespace) invalidatePathCache(path string) { + // Atomic increment - O(1), no lock contention on cache + atomic.AddUint64(&ns.genCounter, 1) } // Store directly sets a rule in the store, bypassing cache invalidation. @@ -61,23 +63,26 @@ func (ns *Namespace) clearCache() { // // If both are false, no explicit rule applies to the path or its prefixes. func (ns *Namespace) Enabled(path string, separator string) (isEnabledByRule bool, isDisabledByRule bool) { - if path == "" { // Root path has no explicit rule + if path == "" { return false, false } - // Check cache + // Check cache with generation validation if cachedValue, found := ns.cache.Load(path); found { if state, ok := cachedValue.(namespaceRule); ok { - return state.isEnabledByRule, state.isDisabledByRule + // If cache generation matches current, result is valid + if state.generation == atomic.LoadUint64(&ns.genCounter) { + return state.isEnabledByRule, state.isDisabledByRule + } + // Stale cache - fall through to recompute + ns.cache.Delete(path) } - ns.cache.Delete(path) // Remove invalid cache entry } - // Compute: Most specific rule wins + // Compute: Most specific rule wins (original logic) parts := strings.Split(path, separator) computedIsEnabled := false computedIsDisabled := false - for i := len(parts); i >= 1; i-- { currentPrefix := strings.Join(parts[:i], separator) if val, ok := ns.store.Load(currentPrefix); ok { @@ -92,11 +97,11 @@ func (ns *Namespace) Enabled(path string, separator string) (isEnabledByRule boo } } - // Cache result, including (false, false) for no rule + // Cache result with current generation ns.cache.Store(path, namespaceRule{ isEnabledByRule: computedIsEnabled, isDisabledByRule: computedIsDisabled, + generation: atomic.LoadUint64(&ns.genCounter), }) - return computedIsEnabled, computedIsDisabled } diff --git a/vendor/github.com/olekukonko/ll/lx/types.go b/vendor/github.com/olekukonko/ll/lx/types.go index 58013fa2b5e..6c2905cddbc 100644 --- a/vendor/github.com/olekukonko/ll/lx/types.go +++ b/vendor/github.com/olekukonko/ll/lx/types.go @@ -5,6 +5,17 @@ import ( "time" ) +// levelStrings provides O(1) lookup for level string conversion +var levelStrings = [7]string{ + LevelNone: NoneString, + LevelInfo: InfoString, + LevelWarn: WarnString, + LevelError: ErrorString, + LevelFatal: FatalString, + LevelDebug: DebugString, + LevelUnknown: UnknownString, +} + // LevelType represents the severity of a log message. // It is an integer type used to define log levels (Debug, Info, Warn, Error, None), with associated // string representations for display in log output. @@ -18,22 +29,10 @@ type LevelType int // var level lx.LevelType = lx.LevelInfo // fmt.Println(level.String()) // Output: INFO func (l LevelType) String() string { - switch l { - case LevelDebug: - return DebugString - case LevelInfo: - return InfoString - case LevelWarn: - return WarnString - case LevelError: - return ErrorString - case LevelFatal: - return FatalString - case LevelNone: - return NoneString - default: - return UnknownString + if l >= 0 && int(l) < len(levelStrings) { + return levelStrings[l] } + return UnknownString } func (l LevelType) Name(class ClassType) string { @@ -101,10 +100,8 @@ type ClassType int func (t ClassType) String() string { switch t { case ClassText: - return TextString case ClassJSON: - return JSONString case ClassDump: return DumpString @@ -118,6 +115,10 @@ func (t ClassType) String() string { return RawString case ClassTimed: return TimedString + case ClassStack: + return StackString + case ClassOutput: + return OutputString default: return UnknownString } diff --git a/vendor/github.com/olekukonko/ll/middleware.go b/vendor/github.com/olekukonko/ll/middleware.go index 694f75fac25..17365e8fb5a 100644 --- a/vendor/github.com/olekukonko/ll/middleware.go +++ b/vendor/github.com/olekukonko/ll/middleware.go @@ -39,11 +39,13 @@ func (m *Middleware) Remove() { // Acquire write lock to modify middleware slice m.logger.mu.Lock() defer m.logger.mu.Unlock() + // Iterate through middleware slice to find and remove matching ID for i, entry := range m.logger.middleware { if entry.id == m.id { - // Remove middleware by slicing out the matching entry - m.logger.middleware = append(m.logger.middleware[:i], m.logger.middleware[i+1:]...) + last := len(m.logger.middleware) - 1 + m.logger.middleware[i] = m.logger.middleware[last] + m.logger.middleware = m.logger.middleware[:last] return } } diff --git a/vendor/github.com/olekukonko/ll/options.go b/vendor/github.com/olekukonko/ll/options.go index 50fa194422e..ae8ebbdb2bc 100644 --- a/vendor/github.com/olekukonko/ll/options.go +++ b/vendor/github.com/olekukonko/ll/options.go @@ -1,6 +1,8 @@ package ll -import "github.com/olekukonko/ll/lx" +import ( + "github.com/olekukonko/ll/lx" +) // WithHandler sets the handler for the logger as a functional option for configuring // a new logger instance. @@ -38,7 +40,7 @@ func WithTimestamped(enable bool, format ...string) Option { // logger := New("app", WithLevel(lx.LevelWarn)) func WithLevel(level lx.LevelType) Option { return func(l *Logger) { - l.level = level + l.Level(level) } } diff --git a/vendor/github.com/olekukonko/ll/writer.go b/vendor/github.com/olekukonko/ll/writer.go new file mode 100644 index 00000000000..195fd12c797 --- /dev/null +++ b/vendor/github.com/olekukonko/ll/writer.go @@ -0,0 +1,53 @@ +package ll + +import ( + "bytes" + "io" + "strings" + + "github.com/olekukonko/ll/lx" +) + +// Writer returns an io.Writer that logs every write operation at the given level. +// Useful for capturing Stdout/Stderr from external processes. +func (l *Logger) Writer(level lx.LevelType) io.Writer { + return &logWriter{ + logger: l, + level: level, + } +} + +// logWriter implements io.Writer to bridge external streams to ll.Logger +type logWriter struct { + logger *Logger + level lx.LevelType + buf bytes.Buffer // Buffer for incomplete lines +} + +func (w *logWriter) Write(p []byte) (n int, err error) { + if len(p) == 0 { + return 0, nil + } + + // Buffer handling for partial lines (streams often write byte-by-byte) + w.buf.Write(p) + + // Process complete lines + for { + line, err := w.buf.ReadString('\n') + if err != nil { // No newline found, buffer remains + w.buf.WriteString(line) + break + } + + // Clean and log the complete line + msg := strings.TrimSuffix(line, "\n") + msg = strings.TrimSuffix(msg, "\r") + + if msg != "" { + w.logger.log(w.level, lx.ClassText, msg, nil, false) + } + } + + return len(p), nil +} diff --git a/vendor/github.com/opentracing-contrib/go-grpc/client.go b/vendor/github.com/opentracing-contrib/go-grpc/client.go index b515feb7b11..5dad94b8a4e 100644 --- a/vendor/github.com/opentracing-contrib/go-grpc/client.go +++ b/vendor/github.com/opentracing-contrib/go-grpc/client.go @@ -126,15 +126,11 @@ func OpenTracingStreamClientInterceptor(tracer opentracing.Tracer, optFuncs ...O clientSpan.Finish() return cs, err } - return newOpenTracingClientStream(cs, method, desc, clientSpan, otgrpcOpts), nil + return newOpenTracingClientStream(ctx, cs, method, desc, clientSpan, otgrpcOpts), nil } } -func newOpenTracingClientStream(cs grpc.ClientStream, method string, desc *grpc.StreamDesc, clientSpan opentracing.Span, otgrpcOpts *options) grpc.ClientStream { - // Grab the client stream context because when the finish function or the goroutine below will be - // executed it's not guaranteed cs.Context() will be valid. - csCtx := cs.Context() - +func newOpenTracingClientStream(ctx context.Context, cs grpc.ClientStream, method string, desc *grpc.StreamDesc, clientSpan opentracing.Span, otgrpcOpts *options) grpc.ClientStream { finishChan := make(chan struct{}) isFinished := new(int32) @@ -154,7 +150,7 @@ func newOpenTracingClientStream(cs grpc.ClientStream, method string, desc *grpc. SetSpanTags(clientSpan, err, true) } if otgrpcOpts.decorator != nil { - otgrpcOpts.decorator(csCtx, clientSpan, method, nil, nil, err) + otgrpcOpts.decorator(ctx, clientSpan, method, nil, nil, err) } } go func() { @@ -162,8 +158,15 @@ func newOpenTracingClientStream(cs grpc.ClientStream, method string, desc *grpc. case <-finishChan: // The client span is being finished by another code path; hence, no // action is necessary. - case <-csCtx.Done(): - finishFunc(csCtx.Err()) + case <-ctx.Done(): + // Why use ctx rather than cs.Context()? Two reasons: + // 1. According to its docs, cs.Context() should not be used until after the first Header() or + // RecvMsg() call has returned. + // 2. ClientStream implementations cancel their context as soon as an error is received in Header(), + // RecvMsg(), SendMsg() or CloseSend(). This causes a race between the interceptor logging the + // returned error and this method logging the canceled context. + // Using ctx avoids both of these issues. + finishFunc(ctx.Err()) } }() otcs := &openTracingClientStream{ diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/config/config.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/config/config.go index a0647363b5a..c0c225043cc 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/config/config.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/config/config.go @@ -1,5 +1,8 @@ package config +import "errors" + +// Option configures JSONPath compilation and evaluation. type Option func(*config) // WithPropertyNameExtension enables the use of the "~" character to access a property key. @@ -28,6 +31,20 @@ func WithStrictRFC9535() Option { } } +// WithSpectralCompatibility enables the safe Spectral expression dialect. +// +// Spectral compatibility includes JSONPath Plus context variables, parent +// selection and the property-name extension. It cannot be combined with +// WithStrictRFC9535; callers should validate Config before use. NewPath does +// this automatically. +func WithSpectralCompatibility() Option { + return func(cfg *config) { + cfg.spectralCompatibility = true + cfg.propertyNameExtension = true + } +} + +// Config exposes the resolved JSONPath dialect and context-tracking settings. type Config interface { PropertyNameEnabled() bool JSONPathPlusEnabled() bool @@ -38,6 +55,7 @@ type config struct { propertyNameExtension bool strictRFC9535 bool lazyContextTracking bool + spectralCompatibility bool } func (c *config) PropertyNameEnabled() bool { @@ -57,6 +75,24 @@ func (c *config) LazyContextTrackingEnabled() bool { return c.lazyContextTracking } +// SpectralCompatibilityEnabled reports whether cfg enables the safe Spectral dialect. +// It is a function rather than a Config method so adding the dialect does not +// break external implementations of the existing Config interface. +func SpectralCompatibilityEnabled(cfg Config) bool { + resolved, ok := cfg.(*config) + return ok && resolved.spectralCompatibility +} + +// Validate rejects incompatible dialect options without making option order significant. +func Validate(cfg Config) error { + resolved, ok := cfg.(*config) + if ok && resolved.strictRFC9535 && resolved.spectralCompatibility { + return errors.New("config.WithStrictRFC9535 and config.WithSpectralCompatibility cannot be combined") + } + return nil +} + +// New resolves options into an immutable-by-interface configuration view. func New(opts ...Option) Config { cfg := &config{} for _, opt := range opts { diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/context_usage.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/context_usage.go index 4ee137fc0aa..6d5e7d97dcc 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/context_usage.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/context_usage.go @@ -63,7 +63,7 @@ func (q *jsonPathAST) hasPropertyNameReferencesPtr() bool { // hasPropertyNameReferences reports whether the segment references the property name selector func (s *segment) hasPropertyNameReferences() bool { - if s.kind == segmentKindProperyName { + if s.kind == segmentKindProperyName || s.kind == segmentKindRecursivePropertyName { return true } if s.child != nil && s.child.hasPropertyNameReferences() { @@ -87,7 +87,7 @@ func (s *innerSegment) hasPropertyNameReferences() bool { // hasPropertyNameReferences reports whether the selector references the property name selector func (s *selector) hasPropertyNameReferences() bool { - if s.filter != nil && s.filter.hasPropertyNameReferences() { + if s.filter.present() && s.filter.hasPropertyNameReferences() { return true } return false @@ -95,6 +95,9 @@ func (s *selector) hasPropertyNameReferences() bool { // hasPropertyNameReferences reports whether the filter selector references the property name selector func (f *filterSelector) hasPropertyNameReferences() bool { + if f.spectralExpression != nil { + return f.spectralExpression.usesPropertyNameSelector + } if f.expression == nil { return false } @@ -256,13 +259,25 @@ func (s *innerSegment) collectContextVarUsage(usage *contextVarUsage) { // collectContextVarUsage records usage from a selector func (s *selector) collectContextVarUsage(usage *contextVarUsage) { - if s.filter != nil { + if s.filter.present() { s.filter.collectContextVarUsage(usage) } } // collectContextVarUsage records usage from a filter selector func (f *filterSelector) collectContextVarUsage(usage *contextVarUsage) { + if f.spectralExpression != nil { + usage.property = usage.property || f.spectralExpression.usage.property + // Parent-property typing needs the container of the parent so sequence + // indexes remain numeric under lazy context tracking. + usage.parent = usage.parent || f.spectralExpression.usage.parent || f.spectralExpression.usage.parentProperty + usage.parentProperty = usage.parentProperty || f.spectralExpression.usage.parentProperty + usage.path = usage.path || f.spectralExpression.usage.path + // Spectral @property is numeric for sequence elements, so lazy mode + // needs the index even when @index is not referenced explicitly. + usage.index = usage.index || f.spectralExpression.usage.index || f.spectralExpression.usage.property + return + } if f.expression != nil { f.expression.collectContextVarUsage(usage) } diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/filter.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/filter.go index 67afe7e8a06..a481039a504 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/filter.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/filter.go @@ -1,81 +1,89 @@ package jsonpath import ( - "go.yaml.in/yaml/v4" - "strconv" - "strings" + "go.yaml.in/yaml/v4" + "strconv" + "strings" ) // filter-selector = "?" S logical-expr type filterSelector struct { - // logical-expr = logical-or-expr - expression *logicalOrExpr + // logical-expr = logical-or-expr + expression *logicalOrExpr + spectralExpression *spectralBoolExpr +} + +func (s filterSelector) present() bool { + return s.expression != nil || s.spectralExpression != nil } func (s filterSelector) ToString() string { - return s.expression.ToString() + if s.spectralExpression != nil { + return s.spectralExpression.String() + } + return s.expression.ToString() } // logical-or-expr = logical-and-expr *(S "||" S logical-and-expr) type logicalOrExpr struct { - expressions []*logicalAndExpr + expressions []*logicalAndExpr } func (e logicalOrExpr) ToString() string { - builder := strings.Builder{} - for i, expr := range e.expressions { - if i > 0 { - builder.WriteString(" || ") - } - builder.WriteString(expr.ToString()) - } - return builder.String() + builder := strings.Builder{} + for i, expr := range e.expressions { + if i > 0 { + builder.WriteString(" || ") + } + builder.WriteString(expr.ToString()) + } + return builder.String() } // logical-and-expr = basic-expr *(S "&&" S basic-expr) type logicalAndExpr struct { - expressions []*basicExpr + expressions []*basicExpr } func (e logicalAndExpr) ToString() string { - builder := strings.Builder{} - for i, expr := range e.expressions { - if i > 0 { - builder.WriteString(" && ") - } - builder.WriteString(expr.ToString()) - } - return builder.String() + builder := strings.Builder{} + for i, expr := range e.expressions { + if i > 0 { + builder.WriteString(" && ") + } + builder.WriteString(expr.ToString()) + } + return builder.String() } // relQuery rel-query = current-node-identifier segments // current-node-identifier = "@" type relQuery struct { - segments []*segment + segments []*segment } func (q relQuery) ToString() string { - builder := strings.Builder{} - builder.WriteString("@") - for _, segment := range q.segments { - builder.WriteString(segment.ToString()) - } - return builder.String() + builder := strings.Builder{} + builder.WriteString("@") + for _, segment := range q.segments { + builder.WriteString(segment.ToString()) + } + return builder.String() } // filterQuery filter-query = rel-query / jsonpath-query type filterQuery struct { - relQuery *relQuery - jsonPathQuery *jsonPathAST + relQuery *relQuery + jsonPathQuery *jsonPathAST } func (q filterQuery) ToString() string { - if q.relQuery != nil { - return q.relQuery.ToString() - } else if q.jsonPathQuery != nil { - return q.jsonPathQuery.ToString() - } - return "" + if q.relQuery != nil { + return q.relQuery.ToString() + } else if q.jsonPathQuery != nil { + return q.jsonPathQuery.ToString() + } + return "" } // functionArgument function-argument = literal / @@ -84,69 +92,69 @@ func (q filterQuery) ToString() string { // logical-expr / // function-expr type functionArgument struct { - literal *literal - filterQuery *filterQuery - logicalExpr *logicalOrExpr - functionExpr *functionExpr - contextVar *contextVariable // JSONPath Plus context variables + literal *literal + filterQuery *filterQuery + logicalExpr *logicalOrExpr + functionExpr *functionExpr + contextVar *contextVariable // JSONPath Plus context variables } type functionArgType int const ( - functionArgTypeLiteral functionArgType = iota - functionArgTypeNodes + functionArgTypeLiteral functionArgType = iota + functionArgTypeNodes ) type resolvedArgument struct { - kind functionArgType - literal *literal - nodes []*literal + kind functionArgType + literal *literal + nodes []*literal } func (a functionArgument) Eval(idx index, node *yaml.Node, root *yaml.Node) resolvedArgument { - if a.literal != nil { - return resolvedArgument{kind: functionArgTypeLiteral, literal: a.literal} - } else if a.filterQuery != nil { - result := a.filterQuery.Query(idx, node, root) - lits := make([]*literal, len(result)) - for i, node := range result { - lit := nodeToLiteral(node) - lits[i] = &lit - } - if len(result) != 1 { - return resolvedArgument{kind: functionArgTypeNodes, nodes: lits} - } else { - return resolvedArgument{kind: functionArgTypeLiteral, literal: lits[0]} - } - } else if a.logicalExpr != nil { - res := a.logicalExpr.Matches(idx, node, root) - return resolvedArgument{kind: functionArgTypeLiteral, literal: &literal{bool: &res}} - } else if a.functionExpr != nil { - res := a.functionExpr.Evaluate(idx, node, root) - return resolvedArgument{kind: functionArgTypeLiteral, literal: &res} - } else if a.contextVar != nil { - // Evaluate context variable and return as literal - res := a.contextVar.Evaluate(idx, node, root) - return resolvedArgument{kind: functionArgTypeLiteral, literal: &res} - } - return resolvedArgument{} + if a.literal != nil { + return resolvedArgument{kind: functionArgTypeLiteral, literal: a.literal} + } else if a.filterQuery != nil { + result := a.filterQuery.Query(idx, node, root) + lits := make([]*literal, len(result)) + for i, node := range result { + lit := nodeToLiteral(node) + lits[i] = &lit + } + if len(result) != 1 { + return resolvedArgument{kind: functionArgTypeNodes, nodes: lits} + } else { + return resolvedArgument{kind: functionArgTypeLiteral, literal: lits[0]} + } + } else if a.logicalExpr != nil { + res := a.logicalExpr.Matches(idx, node, root) + return resolvedArgument{kind: functionArgTypeLiteral, literal: &literal{bool: &res}} + } else if a.functionExpr != nil { + res := a.functionExpr.Evaluate(idx, node, root) + return resolvedArgument{kind: functionArgTypeLiteral, literal: &res} + } else if a.contextVar != nil { + // Evaluate context variable and return as literal + res := a.contextVar.Evaluate(idx, node, root) + return resolvedArgument{kind: functionArgTypeLiteral, literal: &res} + } + return resolvedArgument{} } func (a functionArgument) ToString() string { - builder := strings.Builder{} - if a.literal != nil { - builder.WriteString(a.literal.ToString()) - } else if a.filterQuery != nil { - builder.WriteString(a.filterQuery.ToString()) - } else if a.logicalExpr != nil { - builder.WriteString(a.logicalExpr.ToString()) - } else if a.functionExpr != nil { - builder.WriteString(a.functionExpr.ToString()) - } else if a.contextVar != nil { - builder.WriteString(a.contextVar.ToString()) - } - return builder.String() + builder := strings.Builder{} + if a.literal != nil { + builder.WriteString(a.literal.ToString()) + } else if a.filterQuery != nil { + builder.WriteString(a.filterQuery.ToString()) + } else if a.logicalExpr != nil { + builder.WriteString(a.logicalExpr.ToString()) + } else if a.functionExpr != nil { + builder.WriteString(a.functionExpr.ToString()) + } else if a.contextVar != nil { + builder.WriteString(a.contextVar.ToString()) + } + return builder.String() } //function-name = function-name-first *function-name-char @@ -158,74 +166,74 @@ func (a functionArgument) ToString() string { type functionType int const ( - functionTypeLength functionType = iota - functionTypeCount - functionTypeMatch - functionTypeSearch - functionTypeValue - // JSONPath Plus type selector functions - functionTypeIsNull - functionTypeIsBoolean - functionTypeIsNumber - functionTypeIsString - functionTypeIsArray - functionTypeIsObject - functionTypeIsInteger + functionTypeLength functionType = iota + functionTypeCount + functionTypeMatch + functionTypeSearch + functionTypeValue + // JSONPath Plus type selector functions + functionTypeIsNull + functionTypeIsBoolean + functionTypeIsNumber + functionTypeIsString + functionTypeIsArray + functionTypeIsObject + functionTypeIsInteger ) var functionTypeMap = map[string]functionType{ - "length": functionTypeLength, - "count": functionTypeCount, - "match": functionTypeMatch, - "search": functionTypeSearch, - "value": functionTypeValue, + "length": functionTypeLength, + "count": functionTypeCount, + "match": functionTypeMatch, + "search": functionTypeSearch, + "value": functionTypeValue, } // typeSelectorFunctionMap maps JSONPath Plus type selector function names to their types. // These are extensions enabled when JSONPath Plus mode is active. var typeSelectorFunctionMap = map[string]functionType{ - "isNull": functionTypeIsNull, - "isBoolean": functionTypeIsBoolean, - "isNumber": functionTypeIsNumber, - "isString": functionTypeIsString, - "isArray": functionTypeIsArray, - "isObject": functionTypeIsObject, - "isInteger": functionTypeIsInteger, + "isNull": functionTypeIsNull, + "isBoolean": functionTypeIsBoolean, + "isNumber": functionTypeIsNumber, + "isString": functionTypeIsString, + "isArray": functionTypeIsArray, + "isObject": functionTypeIsObject, + "isInteger": functionTypeIsInteger, } func (f functionType) String() string { - for k, v := range functionTypeMap { - if v == f { - return k - } - } - for k, v := range typeSelectorFunctionMap { - if v == f { - return k - } - } - return "unknown" + for k, v := range functionTypeMap { + if v == f { + return k + } + } + for k, v := range typeSelectorFunctionMap { + if v == f { + return k + } + } + return "unknown" } // functionExpr function-expr = function-name "(" S [function-argument // *(S "," S function-argument)] S ")" type functionExpr struct { - funcType functionType - args []*functionArgument + funcType functionType + args []*functionArgument } func (e functionExpr) ToString() string { - builder := strings.Builder{} - builder.WriteString(e.funcType.String()) - builder.WriteString("(") - for i, arg := range e.args { - if i > 0 { - builder.WriteString(", ") - } - builder.WriteString(arg.ToString()) - } - builder.WriteString(")") - return builder.String() + builder := strings.Builder{} + builder.WriteString(e.funcType.String()) + builder.WriteString("(") + for i, arg := range e.args { + if i > 0 { + builder.WriteString(", ") + } + builder.WriteString(arg.ToString()) + } + builder.WriteString(")") + return builder.String() } // testExpr test-expr = [logical-not-op S] @@ -233,22 +241,22 @@ func (e functionExpr) ToString() string { // (filter-query / ; existence/non-existence // function-expr) ; LogicalType or NodesType type testExpr struct { - not bool - filterQuery *filterQuery - functionExpr *functionExpr + not bool + filterQuery *filterQuery + functionExpr *functionExpr } func (e testExpr) ToString() string { - builder := strings.Builder{} - if e.not { - builder.WriteString("!") - } - if e.filterQuery != nil { - builder.WriteString(e.filterQuery.ToString()) - } else if e.functionExpr != nil { - builder.WriteString(e.functionExpr.ToString()) - } - return builder.String() + builder := strings.Builder{} + if e.not { + builder.WriteString("!") + } + if e.filterQuery != nil { + builder.WriteString(e.filterQuery.ToString()) + } else if e.functionExpr != nil { + builder.WriteString(e.functionExpr.ToString()) + } + return builder.String() } // basicExpr basic-expr = @@ -257,166 +265,166 @@ func (e testExpr) ToString() string { // comparison-expr / // test-expr type basicExpr struct { - parenExpr *parenExpr - comparisonExpr *comparisonExpr - testExpr *testExpr + parenExpr *parenExpr + comparisonExpr *comparisonExpr + testExpr *testExpr } func (e basicExpr) ToString() string { - if e.parenExpr != nil { - return e.parenExpr.ToString() - } else if e.comparisonExpr != nil { - return e.comparisonExpr.ToString() - } else if e.testExpr != nil { - return e.testExpr.ToString() - } - return "" + if e.parenExpr != nil { + return e.parenExpr.ToString() + } else if e.comparisonExpr != nil { + return e.comparisonExpr.ToString() + } else if e.testExpr != nil { + return e.testExpr.ToString() + } + return "" } // literal literal = number / // . string-literal / // . true / false / null type literal struct { - // we generally decompose these into their component parts for easier evaluation - integer *int - float64 *float64 - string *string - bool *bool - null *bool - node *yaml.Node + // we generally decompose these into their component parts for easier evaluation + integer *int + float64 *float64 + string *string + bool *bool + null *bool + node *yaml.Node } func (l literal) ToString() string { - if l.integer != nil { - return strconv.Itoa(*l.integer) - } else if l.float64 != nil { - return strconv.FormatFloat(*l.float64, 'f', -1, 64) - } else if l.string != nil { - builder := strings.Builder{} - builder.WriteString("'") - builder.WriteString(escapeString(*l.string)) - builder.WriteString("'") - return builder.String() - } else if l.bool != nil { - if *l.bool { - return "true" - } else { - return "false" - } - } else if l.null != nil { - if *l.null { - return "null" - } else { - return "null" - } - } else if l.node != nil { - switch l.node.Kind { - case yaml.ScalarNode: - return l.node.Value - case yaml.SequenceNode: - builder := strings.Builder{} - builder.WriteString("[") - for i, child := range l.node.Content { - if i > 0 { - builder.WriteString(",") - } - builder.WriteString(literal{node: child}.ToString()) - } - builder.WriteString("]") - return builder.String() - case yaml.MappingNode: - builder := strings.Builder{} - builder.WriteString("{") - for i, child := range l.node.Content { - if i > 0 { - builder.WriteString(",") - } - builder.WriteString(literal{node: child}.ToString()) - } - builder.WriteString("}") - return builder.String() - } - } - return "" + if l.integer != nil { + return strconv.Itoa(*l.integer) + } else if l.float64 != nil { + return strconv.FormatFloat(*l.float64, 'f', -1, 64) + } else if l.string != nil { + builder := strings.Builder{} + builder.WriteString("'") + builder.WriteString(escapeString(*l.string)) + builder.WriteString("'") + return builder.String() + } else if l.bool != nil { + if *l.bool { + return "true" + } else { + return "false" + } + } else if l.null != nil { + if *l.null { + return "null" + } else { + return "null" + } + } else if l.node != nil { + switch l.node.Kind { + case yaml.ScalarNode: + return l.node.Value + case yaml.SequenceNode: + builder := strings.Builder{} + builder.WriteString("[") + for i, child := range l.node.Content { + if i > 0 { + builder.WriteString(",") + } + builder.WriteString(literal{node: child}.ToString()) + } + builder.WriteString("]") + return builder.String() + case yaml.MappingNode: + builder := strings.Builder{} + builder.WriteString("{") + for i, child := range l.node.Content { + if i > 0 { + builder.WriteString(",") + } + builder.WriteString(literal{node: child}.ToString()) + } + builder.WriteString("}") + return builder.String() + } + } + return "" } func escapeString(value string) string { - b := strings.Builder{} - for i := 0; i < len(value); i++ { - if value[i] == '\n' { - b.WriteString("\\\\n") - } else if value[i] == '\\' { - b.WriteString("\\\\") - } else if value[i] == '\'' { - b.WriteString("\\'") - } else { - b.WriteByte(value[i]) - } - } - return b.String() + b := strings.Builder{} + for i := 0; i < len(value); i++ { + if value[i] == '\n' { + b.WriteString("\\\\n") + } else if value[i] == '\\' { + b.WriteString("\\\\") + } else if value[i] == '\'' { + b.WriteString("\\'") + } else { + b.WriteByte(value[i]) + } + } + return b.String() } type absQuery jsonPathAST func (q absQuery) ToString() string { - builder := strings.Builder{} - builder.WriteString("$") - for _, segment := range q.segments { - builder.WriteString(segment.ToString()) - } - return builder.String() + builder := strings.Builder{} + builder.WriteString("$") + for _, segment := range q.segments { + builder.WriteString(segment.ToString()) + } + return builder.String() } // singularQuery singular-query = rel-singular-query / abs-singular-query type singularQuery struct { - relQuery *relQuery - absQuery *absQuery + relQuery *relQuery + absQuery *absQuery } func (q singularQuery) ToString() string { - if q.relQuery != nil { - return q.relQuery.ToString() - } else if q.absQuery != nil { - return q.absQuery.ToString() - } - return "" + if q.relQuery != nil { + return q.relQuery.ToString() + } else if q.absQuery != nil { + return q.absQuery.ToString() + } + return "" } // contextVarKind represents the type of context variable type contextVarKind int const ( - contextVarProperty contextVarKind = iota // @property - current property name - contextVarRoot // @root - root node access - contextVarParent // @parent - parent node - contextVarParentProperty // @parentProperty - parent's property name - contextVarPath // @path - absolute path to current node - contextVarIndex // @index - current array index + contextVarProperty contextVarKind = iota // @property - current property name + contextVarRoot // @root - root node access + contextVarParent // @parent - parent node + contextVarParentProperty // @parentProperty - parent's property name + contextVarPath // @path - absolute path to current node + contextVarIndex // @index - current array index ) // contextVariable represents a JSONPath Plus context variable in filter expressions. // These provide access to metadata about the current node being evaluated. type contextVariable struct { - kind contextVarKind + kind contextVarKind } func (cv contextVariable) ToString() string { - switch cv.kind { - case contextVarProperty: - return "@property" - case contextVarRoot: - return "@root" - case contextVarParent: - return "@parent" - case contextVarParentProperty: - return "@parentProperty" - case contextVarPath: - return "@path" - case contextVarIndex: - return "@index" - default: - return "@unknown" - } + switch cv.kind { + case contextVarProperty: + return "@property" + case contextVarRoot: + return "@root" + case contextVarParent: + return "@parent" + case contextVarParentProperty: + return "@parentProperty" + case contextVarPath: + return "@path" + case contextVarIndex: + return "@index" + default: + return "@unknown" + } } // comparable @@ -426,23 +434,23 @@ func (cv contextVariable) ToString() string { // function-expr ; ValueType // context-variable ; JSONPath Plus extension type comparable struct { - literal *literal - singularQuery *singularQuery - functionExpr *functionExpr - contextVar *contextVariable // JSONPath Plus extension + literal *literal + singularQuery *singularQuery + functionExpr *functionExpr + contextVar *contextVariable // JSONPath Plus extension } func (c comparable) ToString() string { - if c.literal != nil { - return c.literal.ToString() - } else if c.singularQuery != nil { - return c.singularQuery.ToString() - } else if c.functionExpr != nil { - return c.functionExpr.ToString() - } else if c.contextVar != nil { - return c.contextVar.ToString() - } - return "" + if c.literal != nil { + return c.literal.ToString() + } else if c.singularQuery != nil { + return c.singularQuery.ToString() + } else if c.functionExpr != nil { + return c.functionExpr.ToString() + } else if c.contextVar != nil { + return c.contextVar.ToString() + } + return "" } // comparisonExpr represents a comparison expression @@ -457,73 +465,73 @@ func (c comparable) ToString() string { // "<=" / ">=" / // "<" / ">" type comparisonExpr struct { - left *comparable - op comparisonOperator - right *comparable + left *comparable + op comparisonOperator + right *comparable } func (e comparisonExpr) ToString() string { - builder := strings.Builder{} - builder.WriteString(e.left.ToString()) - builder.WriteString(" ") - builder.WriteString(e.op.ToString()) - builder.WriteString(" ") - builder.WriteString(e.right.ToString()) - return builder.String() + builder := strings.Builder{} + builder.WriteString(e.left.ToString()) + builder.WriteString(" ") + builder.WriteString(e.op.ToString()) + builder.WriteString(" ") + builder.WriteString(e.right.ToString()) + return builder.String() } // existExpr represents an existence expression type existExpr struct { - query string + query string } // parenExpr represents a parenthesized expression // // paren-expr = [logical-not-op S] "(" S logical-expr S ")" type parenExpr struct { - // "!" - not bool - // "(" logicalOrExpr ")" - expr *logicalOrExpr + // "!" + not bool + // "(" logicalOrExpr ")" + expr *logicalOrExpr } func (e parenExpr) ToString() string { - builder := strings.Builder{} - if e.not { - builder.WriteString("!") - } - builder.WriteString("(") - builder.WriteString(e.expr.ToString()) - builder.WriteString(")") - return builder.String() + builder := strings.Builder{} + if e.not { + builder.WriteString("!") + } + builder.WriteString("(") + builder.WriteString(e.expr.ToString()) + builder.WriteString(")") + return builder.String() } // comparisonOperator represents a comparison operator type comparisonOperator int const ( - equalTo comparisonOperator = iota - notEqualTo - lessThan - lessThanEqualTo - greaterThan - greaterThanEqualTo + equalTo comparisonOperator = iota + notEqualTo + lessThan + lessThanEqualTo + greaterThan + greaterThanEqualTo ) func (o comparisonOperator) ToString() string { - switch o { - case equalTo: - return "==" - case notEqualTo: - return "!=" - case lessThan: - return "<" - case lessThanEqualTo: - return "<=" - case greaterThan: - return ">" - case greaterThanEqualTo: - return ">=" - } - return "" + switch o { + case equalTo: + return "==" + case notEqualTo: + return "!=" + case lessThan: + return "<" + case lessThanEqualTo: + return "<=" + case greaterThan: + return ">" + case greaterThanEqualTo: + return ">=" + } + return "" } diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/jsonpath.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/jsonpath.go index 229dbebb2c7..aaacda68fb9 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/jsonpath.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/jsonpath.go @@ -1,35 +1,82 @@ package jsonpath import ( - "fmt" - "github.com/pb33f/jsonpath/pkg/jsonpath/config" - "github.com/pb33f/jsonpath/pkg/jsonpath/token" - "go.yaml.in/yaml/v4" + "fmt" + "github.com/pb33f/jsonpath/pkg/jsonpath/config" + "github.com/pb33f/jsonpath/pkg/jsonpath/token" + "go.yaml.in/yaml/v4" ) +// NewPath compiles input into a reusable JSONPath using the supplied options. func NewPath(input string, opts ...config.Option) (*JSONPath, error) { - tokenizer := token.NewTokenizer(input, opts...) - tokens := tokenizer.Tokenize() - for i := 0; i < len(tokens); i++ { - if tokens[i].Token == token.ILLEGAL { - return nil, fmt.Errorf("%s", tokenizer.ErrorString(&tokens[i], "unexpected token")) - } - } - parser := newParserPrivate(tokenizer, tokens, opts...) - err := parser.parse() - if err != nil { - return nil, err - } - return parser, nil + cfg := config.New(opts...) + if err := config.Validate(cfg); err != nil { + return nil, err + } + tokenizer := token.NewTokenizerWithConfig(input, cfg) + tokens := tokenizer.Tokenize() + for i := 0; i < len(tokens); i++ { + if tokens[i].Token == token.ILLEGAL { + message := "unexpected token" + if config.SpectralCompatibilityEnabled(cfg) && tokens[i].Literal != "" { + message = "Spectral compatibility mode: " + tokens[i].Literal + } else if !cfg.JSONPathPlusEnabled() && tokens[i].Literal != "" { + message = tokens[i].Literal + } + return nil, fmt.Errorf("%s", tokenizer.ErrorString(&tokens[i], message)) + } + } + parser := newParserPrivateWithConfig(tokenizer, tokens, cfg) + err := parser.parse() + if err != nil { + return nil, err + } + return parser, nil } +// Query evaluates the compiled path against root. func (p *JSONPath) Query(root *yaml.Node) []*yaml.Node { - return p.ast.Query(root, root) + return p.ast.Query(root, root) } +// String returns a stable normalized representation of the compiled path. func (p *JSONPath) String() string { - if p == nil { - return "" - } - return p.ast.ToString() + if p == nil { + return "" + } + return p.ast.ToString() +} + +// IsSingular reports whether the path can select at most one node. +func (p *JSONPath) IsSingular() bool { + if p == nil { + return false + } + return p.ast.isSingular() +} + +// SegmentInfo describes a member-name or array-index segment in a singular path. +type SegmentInfo struct { + Kind SegmentKind + Key string + Index int64 + HasIndex bool +} + +// SegmentKind identifies the public kind of a singular path segment. +type SegmentKind int + +const ( + // SegmentKindMemberName identifies a mapping member segment. + SegmentKindMemberName SegmentKind = iota + // SegmentKindArrayIndex identifies a sequence index segment. + SegmentKindArrayIndex +) + +// GetSegmentInfo returns public segment metadata for a singular path. +func (p *JSONPath) GetSegmentInfo() ([]SegmentInfo, error) { + if p == nil { + return nil, fmt.Errorf("nil path") + } + return p.ast.getSegmentInfo() } diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/parser.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/parser.go index ec1109a2dd6..f321abd1f1d 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/parser.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/parser.go @@ -1,12 +1,12 @@ package jsonpath import ( - "errors" - "fmt" - "github.com/pb33f/jsonpath/pkg/jsonpath/config" - "github.com/pb33f/jsonpath/pkg/jsonpath/token" - "strconv" - "strings" + "errors" + "fmt" + "github.com/pb33f/jsonpath/pkg/jsonpath/config" + "github.com/pb33f/jsonpath/pkg/jsonpath/token" + "strconv" + "strings" ) const MaxSafeFloat int64 = 9007199254740991 @@ -14,794 +14,811 @@ const MaxSafeFloat int64 = 9007199254740991 type mode int const ( - modeNormal mode = iota - modeSingular + modeNormal mode = iota + modeSingular ) // contextVarTokenMap maps context variable tokens to their kinds // CONTEXT_ROOT is handled separately as it requires path parsing var contextVarTokenMap = map[token.Token]contextVarKind{ - token.CONTEXT_PROPERTY: contextVarProperty, - token.CONTEXT_PARENT: contextVarParent, - token.CONTEXT_PARENT_PROPERTY: contextVarParentProperty, - token.CONTEXT_PATH: contextVarPath, - token.CONTEXT_INDEX: contextVarIndex, + token.CONTEXT_PROPERTY: contextVarProperty, + token.CONTEXT_PARENT: contextVarParent, + token.CONTEXT_PARENT_PROPERTY: contextVarParentProperty, + token.CONTEXT_PATH: contextVarPath, + token.CONTEXT_INDEX: contextVarIndex, } // JSONPath represents a JSONPath parser. type JSONPath struct { - tokenizer *token.Tokenizer - tokens []token.TokenInfo - ast jsonPathAST - current int - mode []mode - config config.Config - filterDepth int // tracks nesting depth inside filter expressions + tokenizer *token.Tokenizer + tokens []token.TokenInfo + ast jsonPathAST + current int + mode []mode + config config.Config + filterDepth int // tracks nesting depth inside filter expressions } // newParserPrivate creates a new JSONPath with the given tokens. func newParserPrivate(tokenizer *token.Tokenizer, tokens []token.TokenInfo, opts ...config.Option) *JSONPath { - cfg := config.New(opts...) - return &JSONPath{tokenizer, tokens, jsonPathAST{lazyContextTracking: cfg.LazyContextTrackingEnabled(), jsonPathPlus: cfg.JSONPathPlusEnabled()}, 0, []mode{modeNormal}, cfg, 0} + return newParserPrivateWithConfig(tokenizer, tokens, config.New(opts...)) +} + +func newParserPrivateWithConfig(tokenizer *token.Tokenizer, tokens []token.TokenInfo, cfg config.Config) *JSONPath { + return &JSONPath{tokenizer, tokens, jsonPathAST{lazyContextTracking: cfg.LazyContextTrackingEnabled(), jsonPathPlus: cfg.JSONPathPlusEnabled()}, 0, []mode{modeNormal}, cfg, 0} } // parse parses the JSONPath tokens and returns the root node of the AST. // // jsonpath-query = root-identifier segments func (p *JSONPath) parse() error { - if len(p.tokens) == 0 { - return fmt.Errorf("empty JSONPath expression") - } - - if p.tokens[p.current].Token != token.ROOT { - return p.parseFailure(&p.tokens[p.current], "expected '$'") - } - p.current++ - - for p.current < len(p.tokens) { - segment, err := p.parseSegment() - if err != nil { - return err - } - p.ast.segments = append(p.ast.segments, segment) - } - return nil + if len(p.tokens) == 0 { + return fmt.Errorf("empty JSONPath expression") + } + + if p.tokens[p.current].Token != token.ROOT { + return p.parseFailure(&p.tokens[p.current], "expected '$'") + } + p.current++ + + for p.current < len(p.tokens) { + segment, err := p.parseSegment() + if err != nil { + return err + } + p.ast.segments = append(p.ast.segments, segment) + } + return nil } func (p *JSONPath) parseFailure(target *token.TokenInfo, msg string) error { - return errors.New(p.tokenizer.ErrorString(target, msg)) + return errors.New(p.tokenizer.ErrorString(target, msg)) } // peek returns true if the upcoming token matches the given token type. func (p *JSONPath) peek(token token.Token) bool { - return p.current+1 < len(p.tokens) && p.tokens[p.current+1].Token == token + return p.current+1 < len(p.tokens) && p.tokens[p.current+1].Token == token } // peek returns true if the upcoming token matches the given token type. func (p *JSONPath) next(token token.Token) bool { - return p.current < len(p.tokens) && p.tokens[p.current].Token == token + return p.current < len(p.tokens) && p.tokens[p.current].Token == token } // expect consumes the current token if it matches the given token type. func (p *JSONPath) expect(token token.Token) bool { - if p.peek(token) { - p.current++ - return true - } - return false + if p.peek(token) { + p.current++ + return true + } + return false } // isComparisonOperator returns true if the given token is a comparison operator. func (p *JSONPath) isComparisonOperator(tok token.Token) bool { - return tok == token.EQ || tok == token.NE || tok == token.GT || tok == token.GE || tok == token.LT || tok == token.LE + return tok == token.EQ || tok == token.NE || tok == token.GT || tok == token.GE || tok == token.LT || tok == token.LE } func (p *JSONPath) parseSegment() (*segment, error) { - currentToken := p.tokens[p.current] - if currentToken.Token == token.RECURSIVE { - if p.mode[len(p.mode)-1] == modeSingular { - return nil, p.parseFailure(&p.tokens[p.current], "unexpected recursive descent in singular query") - } - p.current++ - child, err := p.parseInnerSegment() - if err != nil { - return nil, err - } - return &segment{kind: segmentKindDescendant, descendant: child}, nil - } else if currentToken.Token == token.CHILD || currentToken.Token == token.BRACKET_LEFT { - if currentToken.Token == token.CHILD { - p.current++ - } - child, err := p.parseInnerSegment() - if err != nil { - return nil, err - } - return &segment{kind: segmentKindChild, child: child}, nil - } else if p.config.PropertyNameEnabled() && currentToken.Token == token.PROPERTY_NAME { - p.current++ - return &segment{kind: segmentKindProperyName}, nil - } else if p.config.JSONPathPlusEnabled() && currentToken.Token == token.PARENT_SELECTOR { - // JSONPath Plus parent selector: ^ returns parent of current node - p.current++ - return &segment{kind: segmentKindParent}, nil - } - return nil, p.parseFailure(¤tToken, "unexpected token when parsing segment") + currentToken := p.tokens[p.current] + if currentToken.Token == token.RECURSIVE { + if p.mode[len(p.mode)-1] == modeSingular { + return nil, p.parseFailure(&p.tokens[p.current], "unexpected recursive descent in singular query") + } + p.current++ + child, err := p.parseInnerSegment() + if err != nil { + return nil, err + } + return &segment{kind: segmentKindDescendant, descendant: child}, nil + } else if currentToken.Token == token.CHILD || currentToken.Token == token.BRACKET_LEFT { + if currentToken.Token == token.CHILD { + if config.SpectralCompatibilityEnabled(p.config) && p.current+1 < len(p.tokens) && p.tokens[p.current+1].Token == token.PROPERTY_NAME { + p.current += 2 + return &segment{kind: segmentKindRecursivePropertyName}, nil + } + p.current++ + } + child, err := p.parseInnerSegment() + if err != nil { + return nil, err + } + return &segment{kind: segmentKindChild, child: child}, nil + } else if p.config.PropertyNameEnabled() && currentToken.Token == token.PROPERTY_NAME { + p.current++ + return &segment{kind: segmentKindProperyName}, nil + } else if p.config.JSONPathPlusEnabled() && currentToken.Token == token.PARENT_SELECTOR { + // JSONPath Plus parent selector: ^ returns parent of current node + p.current++ + return &segment{kind: segmentKindParent}, nil + } + return nil, p.parseFailure(¤tToken, "unexpected token when parsing segment") } func (p *JSONPath) parseInnerSegment() (retValue *innerSegment, err error) { - defer func() { - if p.mode[len(p.mode)-1] == modeSingular && retValue != nil { - if len(retValue.selectors) > 1 { - retValue = nil - err = p.parseFailure(&p.tokens[p.current], "unexpected multiple selectors in singular query") - return - } else if retValue.kind == segmentDotWildcard { - retValue = nil - err = p.parseFailure(&p.tokens[p.current], "unexpected wildcard in singular query") - return - } - } - }() - // .* - // .STRING - // [] - if p.current >= len(p.tokens) { - return nil, p.parseFailure(nil, "unexpected end of input") - } - firstToken := p.tokens[p.current] - if firstToken.Token == token.WILDCARD { - p.current += 1 - return &innerSegment{segmentDotWildcard, "", nil}, nil - } else if firstToken.Token == token.STRING { - dotName := p.tokens[p.current].Literal - p.current += 1 - return &innerSegment{segmentDotMemberName, dotName, nil}, nil - } else if firstToken.Token == token.INTEGER && p.config.JSONPathPlusEnabled() && p.current >= 3 { - // JSONPath Plus: treat .201 as a member name (common for HTTP status codes in OpenAPI). - // Only when we're past the root (p.current >= 3 means at least $, ., and something before this). - dotName := p.tokens[p.current].Literal - p.current += 1 - return &innerSegment{segmentDotMemberName, dotName, nil}, nil - } else if firstToken.Token == token.BRACKET_LEFT { - prior := p.current - p.current += 1 - selectors := []*selector{} - for p.current < len(p.tokens) { - innerSelector, err := p.parseSelector() - if err != nil { - p.current = prior - return nil, err - } - selectors = append(selectors, innerSelector) - if len(p.tokens) <= p.current { - return nil, p.parseFailure(&p.tokens[p.current-1], "unexpected end of input") - } - if p.tokens[p.current].Token == token.BRACKET_RIGHT { - break - } else if p.tokens[p.current].Token == token.COMMA { - p.current++ - } - } - if p.tokens[p.current].Token != token.BRACKET_RIGHT { - prior = p.current - return nil, p.parseFailure(&p.tokens[p.current], "expected ']'") - } - p.current += 1 - return &innerSegment{kind: segmentLongHand, dotName: "", selectors: selectors}, nil - } - return nil, p.parseFailure(&firstToken, "unexpected token when parsing inner segment") + defer func() { + if p.mode[len(p.mode)-1] == modeSingular && retValue != nil { + if len(retValue.selectors) > 1 { + retValue = nil + err = p.parseFailure(&p.tokens[p.current], "unexpected multiple selectors in singular query") + return + } else if retValue.kind == segmentDotWildcard { + retValue = nil + err = p.parseFailure(&p.tokens[p.current], "unexpected wildcard in singular query") + return + } + } + }() + // .* + // .STRING + // [] + if p.current >= len(p.tokens) { + return nil, p.parseFailure(nil, "unexpected end of input") + } + firstToken := p.tokens[p.current] + if firstToken.Token == token.WILDCARD { + p.current += 1 + return &innerSegment{segmentDotWildcard, "", nil}, nil + } else if firstToken.Token == token.STRING { + dotName := p.tokens[p.current].Literal + p.current += 1 + return &innerSegment{segmentDotMemberName, dotName, nil}, nil + } else if firstToken.Token == token.INTEGER && p.config.JSONPathPlusEnabled() && p.current >= 3 { + // JSONPath Plus: treat .201 as a member name (common for HTTP status codes in OpenAPI). + // Only when we're past the root (p.current >= 3 means at least $, ., and something before this). + dotName := p.tokens[p.current].Literal + p.current += 1 + return &innerSegment{segmentDotMemberName, dotName, nil}, nil + } else if firstToken.Token == token.BRACKET_LEFT { + prior := p.current + p.current += 1 + selectors := []*selector{} + for p.current < len(p.tokens) { + innerSelector, err := p.parseSelector() + if err != nil { + p.current = prior + return nil, err + } + selectors = append(selectors, innerSelector) + if len(p.tokens) <= p.current { + return nil, p.parseFailure(&p.tokens[p.current-1], "unexpected end of input") + } + if p.tokens[p.current].Token == token.BRACKET_RIGHT { + break + } else if p.tokens[p.current].Token == token.COMMA { + p.current++ + } + } + if p.tokens[p.current].Token != token.BRACKET_RIGHT { + prior = p.current + return nil, p.parseFailure(&p.tokens[p.current], "expected ']'") + } + p.current += 1 + return &innerSegment{kind: segmentLongHand, dotName: "", selectors: selectors}, nil + } + return nil, p.parseFailure(&firstToken, "unexpected token when parsing inner segment") } func (p *JSONPath) parseSelector() (retSelector *selector, err error) { - //selector = name-selector / - // wildcard-selector / - // slice-selector / - // index-selector / - // filter-selector - initial := p.current - defer func() { - if p.mode[len(p.mode)-1] == modeSingular && retSelector != nil { - if retSelector.kind == selectorSubKindWildcard { - err = p.parseFailure(&p.tokens[initial], "unexpected wildcard in singular query") - retSelector = nil - } else if retSelector.kind == selectorSubKindArraySlice { - err = p.parseFailure(&p.tokens[initial], "unexpected slice in singular query") - retSelector = nil - } - } - }() - - // name-selector = string-literal - if p.tokens[p.current].Token == token.STRING_LITERAL { - name := p.tokens[p.current].Literal - p.current++ - return &selector{kind: selectorSubKindName, name: name}, nil - // wildcard-selector = "*" - } else if p.tokens[p.current].Token == token.WILDCARD { - p.current++ - return &selector{kind: selectorSubKindWildcard}, nil - } else if p.tokens[p.current].Token == token.INTEGER { - // peek ahead to see if it's a slice - if p.peek(token.ARRAY_SLICE) { - slice, err := p.parseSliceSelector() - if err != nil { - return nil, err - } - return &selector{kind: selectorSubKindArraySlice, slice: slice}, nil - } - // peek ahead to see if we close the array index properly - if !p.peek(token.BRACKET_RIGHT) && !p.peek(token.COMMA) { - return nil, p.parseFailure(&p.tokens[p.current], "expected ']' or ','") - } - // else it's an index - lit := p.tokens[p.current].Literal - // make sure it's not -0 - if lit == "-0" { - return nil, p.parseFailure(&p.tokens[p.current], "-0 unexpected") - } - // make sure lit is an integer - i, err := strconv.ParseInt(lit, 10, 64) - if err != nil { - return nil, p.parseFailure(&p.tokens[p.current], "expected an integer") - } - err = p.checkSafeInteger(i, lit) - if err != nil { - return nil, err - } - - p.current++ - - return &selector{kind: selectorSubKindArrayIndex, index: i, jsonPathPlus: p.config.JSONPathPlusEnabled() && p.filterDepth == 0}, nil - } else if p.tokens[p.current].Token == token.ARRAY_SLICE { - slice, err := p.parseSliceSelector() - if err != nil { - return nil, err - } - return &selector{kind: selectorSubKindArraySlice, slice: slice}, nil - } else if p.tokens[p.current].Token == token.FILTER { - return p.parseFilterSelector() - } - - return nil, p.parseFailure(&p.tokens[p.current], "unexpected token when parsing selector") + //selector = name-selector / + // wildcard-selector / + // slice-selector / + // index-selector / + // filter-selector + initial := p.current + defer func() { + if p.mode[len(p.mode)-1] == modeSingular && retSelector != nil { + if retSelector.kind == selectorSubKindWildcard { + err = p.parseFailure(&p.tokens[initial], "unexpected wildcard in singular query") + retSelector = nil + } else if retSelector.kind == selectorSubKindArraySlice { + err = p.parseFailure(&p.tokens[initial], "unexpected slice in singular query") + retSelector = nil + } + } + }() + + // name-selector = string-literal + if p.tokens[p.current].Token == token.STRING_LITERAL { + name := p.tokens[p.current].Literal + p.current++ + return &selector{kind: selectorSubKindName, name: name}, nil + // wildcard-selector = "*" + } else if p.tokens[p.current].Token == token.WILDCARD { + p.current++ + return &selector{kind: selectorSubKindWildcard}, nil + } else if p.tokens[p.current].Token == token.INTEGER { + // peek ahead to see if it's a slice + if p.peek(token.ARRAY_SLICE) { + slice, err := p.parseSliceSelector() + if err != nil { + return nil, err + } + return &selector{kind: selectorSubKindArraySlice, slice: slice}, nil + } + // peek ahead to see if we close the array index properly + if !p.peek(token.BRACKET_RIGHT) && !p.peek(token.COMMA) { + return nil, p.parseFailure(&p.tokens[p.current], "expected ']' or ','") + } + // else it's an index + lit := p.tokens[p.current].Literal + // make sure it's not -0 + if lit == "-0" { + return nil, p.parseFailure(&p.tokens[p.current], "-0 unexpected") + } + // make sure lit is an integer + i, err := strconv.ParseInt(lit, 10, 64) + if err != nil { + return nil, p.parseFailure(&p.tokens[p.current], "expected an integer") + } + err = p.checkSafeInteger(i, lit) + if err != nil { + return nil, err + } + + p.current++ + + return &selector{ + kind: selectorSubKindArrayIndex, + index: i, + jsonPathPlus: p.config.JSONPathPlusEnabled() && p.filterDepth == 0, + spectral: config.SpectralCompatibilityEnabled(p.config), + }, nil + } else if p.tokens[p.current].Token == token.ARRAY_SLICE { + slice, err := p.parseSliceSelector() + if err != nil { + return nil, err + } + return &selector{kind: selectorSubKindArraySlice, slice: slice}, nil + } else if p.tokens[p.current].Token == token.FILTER { + return p.parseFilterSelector() + } + + return nil, p.parseFailure(&p.tokens[p.current], "unexpected token when parsing selector") } func (p *JSONPath) parseSliceSelector() (*slice, error) { - // slice-selector = [start S] ":" S [end S] [":" [S step]] - var start, end, step *int64 - - // parse the start index - if p.tokens[p.current].Token == token.INTEGER { - literal := p.tokens[p.current].Literal - i, err := strconv.ParseInt(literal, 10, 64) - if err != nil { - return nil, p.parseFailure(&p.tokens[p.current], "expected an integer") - } - err = p.checkSafeInteger(i, literal) - if err != nil { - return nil, err - } - - start = &i - p.current += 1 - } - - // Expect a colon - if p.tokens[p.current].Token != token.ARRAY_SLICE { - return nil, p.parseFailure(&p.tokens[p.current], "expected ':'") - } - p.current++ - - // parse the end index - if p.tokens[p.current].Token == token.INTEGER { - literal := p.tokens[p.current].Literal - i, err := strconv.ParseInt(literal, 10, 64) - if err != nil { - return nil, p.parseFailure(&p.tokens[p.current], "expected an integer") - } - err = p.checkSafeInteger(i, literal) - if err != nil { - return nil, err - } - - end = &i - p.current++ - } - - // Check for an optional second colon and step value - if p.tokens[p.current].Token == token.ARRAY_SLICE { - p.current++ - if p.tokens[p.current].Token == token.INTEGER { - literal := p.tokens[p.current].Literal - i, err := strconv.ParseInt(literal, 10, 64) - if err != nil { - return nil, p.parseFailure(&p.tokens[p.current], "expected an integer") - } - err = p.checkSafeInteger(i, literal) - if err != nil { - return nil, err - } - - step = &i - p.current++ - } - } - if p.tokens[p.current].Token != token.BRACKET_RIGHT { - return nil, p.parseFailure(&p.tokens[p.current], "expected ']'") - } - - return &slice{start: start, end: end, step: step}, nil + // slice-selector = [start S] ":" S [end S] [":" [S step]] + var start, end, step *int64 + + // parse the start index + if p.tokens[p.current].Token == token.INTEGER { + literal := p.tokens[p.current].Literal + i, err := strconv.ParseInt(literal, 10, 64) + if err != nil { + return nil, p.parseFailure(&p.tokens[p.current], "expected an integer") + } + err = p.checkSafeInteger(i, literal) + if err != nil { + return nil, err + } + + start = &i + p.current += 1 + } + + // Expect a colon + if p.tokens[p.current].Token != token.ARRAY_SLICE { + return nil, p.parseFailure(&p.tokens[p.current], "expected ':'") + } + p.current++ + + // parse the end index + if p.tokens[p.current].Token == token.INTEGER { + literal := p.tokens[p.current].Literal + i, err := strconv.ParseInt(literal, 10, 64) + if err != nil { + return nil, p.parseFailure(&p.tokens[p.current], "expected an integer") + } + err = p.checkSafeInteger(i, literal) + if err != nil { + return nil, err + } + + end = &i + p.current++ + } + + // Check for an optional second colon and step value + if p.tokens[p.current].Token == token.ARRAY_SLICE { + p.current++ + if p.tokens[p.current].Token == token.INTEGER { + literal := p.tokens[p.current].Literal + i, err := strconv.ParseInt(literal, 10, 64) + if err != nil { + return nil, p.parseFailure(&p.tokens[p.current], "expected an integer") + } + err = p.checkSafeInteger(i, literal) + if err != nil { + return nil, err + } + + step = &i + p.current++ + } + } + if p.tokens[p.current].Token != token.BRACKET_RIGHT { + return nil, p.parseFailure(&p.tokens[p.current], "expected ']'") + } + + return &slice{start: start, end: end, step: step}, nil } func (p *JSONPath) checkSafeInteger(i int64, literal string) error { - if i > MaxSafeFloat || i < -MaxSafeFloat { - return p.parseFailure(&p.tokens[p.current], "outside bounds for safe integers") - } - if literal == "-0" { - return p.parseFailure(&p.tokens[p.current], "-0 unexpected") - } - return nil + if i > MaxSafeFloat || i < -MaxSafeFloat { + return p.parseFailure(&p.tokens[p.current], "outside bounds for safe integers") + } + if literal == "-0" { + return p.parseFailure(&p.tokens[p.current], "-0 unexpected") + } + return nil } func (p *JSONPath) parseFilterSelector() (*selector, error) { - if p.tokens[p.current].Token != token.FILTER { - return nil, p.parseFailure(&p.tokens[p.current], "expected '?'") - } - p.current++ - p.filterDepth++ - defer func() { p.filterDepth-- }() - - expr, err := p.parseLogicalOrExpr() - if err != nil { - return nil, err - } - - return &selector{kind: selectorSubKindFilter, filter: &filterSelector{expr}}, nil + if p.tokens[p.current].Token != token.FILTER { + return nil, p.parseFailure(&p.tokens[p.current], "expected '?'") + } + p.current++ + p.filterDepth++ + defer func() { p.filterDepth-- }() + if config.SpectralCompatibilityEnabled(p.config) { + expr, err := p.parseSpectralExpression() + if err != nil { + return nil, err + } + return &selector{kind: selectorSubKindFilter, filter: filterSelector{spectralExpression: expr}}, nil + } + + expr, err := p.parseLogicalOrExpr() + if err != nil { + return nil, err + } + + return &selector{kind: selectorSubKindFilter, filter: filterSelector{expression: expr}}, nil } func (p *JSONPath) parseLogicalOrExpr() (*logicalOrExpr, error) { - var expr logicalOrExpr - - for { - andExpr, err := p.parseLogicalAndExpr() - if err != nil { - return nil, err - } - expr.expressions = append(expr.expressions, andExpr) - - if !p.next(token.OR) { - break - } - p.current++ - } - - return &expr, nil + var expr logicalOrExpr + + for { + andExpr, err := p.parseLogicalAndExpr() + if err != nil { + return nil, err + } + expr.expressions = append(expr.expressions, andExpr) + + if !p.next(token.OR) { + break + } + p.current++ + } + + return &expr, nil } func (p *JSONPath) parseLogicalAndExpr() (*logicalAndExpr, error) { - var expr logicalAndExpr - - for { - basicExpr, err := p.parseBasicExpr() - if err != nil { - return nil, err - } - expr.expressions = append(expr.expressions, basicExpr) - - if !p.next(token.AND) { - break - } - p.current++ - } - - return &expr, nil + var expr logicalAndExpr + + for { + basicExpr, err := p.parseBasicExpr() + if err != nil { + return nil, err + } + expr.expressions = append(expr.expressions, basicExpr) + + if !p.next(token.AND) { + break + } + p.current++ + } + + return &expr, nil } func (p *JSONPath) parseBasicExpr() (*basicExpr, error) { - //basic-expr = paren-expr / - // comparison-expr / - // test-expr - - switch p.tokens[p.current].Token { - case token.NOT: - p.current++ - expr, err := p.parseLogicalOrExpr() - if err != nil { - return nil, err - } - // Inspect if the expr is topped by a parenExpr -- if so we can simplify - if len(expr.expressions) == 1 && len(expr.expressions[0].expressions) == 1 && expr.expressions[0].expressions[0].parenExpr != nil { - child := expr.expressions[0].expressions[0].parenExpr - child.not = !child.not - return &basicExpr{parenExpr: child}, nil - } - return &basicExpr{parenExpr: &parenExpr{not: true, expr: expr}}, nil - case token.PAREN_LEFT: - p.current++ - expr, err := p.parseLogicalOrExpr() - if err != nil { - return nil, err - } - if p.tokens[p.current].Token != token.PAREN_RIGHT { - return nil, p.parseFailure(&p.tokens[p.current], "expected ')'") - } - p.current++ - return &basicExpr{parenExpr: &parenExpr{not: false, expr: expr}}, nil - } - prevCurrent := p.current - comparisonExpr, comparisonErr := p.parseComparisonExpr() - if comparisonErr == nil { - return &basicExpr{comparisonExpr: comparisonExpr}, nil - } - p.current = prevCurrent - testExpr, testErr := p.parseTestExpr() - if testErr == nil { - return &basicExpr{testExpr: testExpr}, nil - } - p.current = prevCurrent - return nil, p.parseFailure(&p.tokens[p.current], fmt.Sprintf("could not parse query: expected either testExpr [err: %s] or comparisonExpr: [err: %s]", testErr.Error(), comparisonErr.Error())) + //basic-expr = paren-expr / + // comparison-expr / + // test-expr + + switch p.tokens[p.current].Token { + case token.NOT: + p.current++ + expr, err := p.parseLogicalOrExpr() + if err != nil { + return nil, err + } + // Inspect if the expr is topped by a parenExpr -- if so we can simplify + if len(expr.expressions) == 1 && len(expr.expressions[0].expressions) == 1 && expr.expressions[0].expressions[0].parenExpr != nil { + child := expr.expressions[0].expressions[0].parenExpr + child.not = !child.not + return &basicExpr{parenExpr: child}, nil + } + return &basicExpr{parenExpr: &parenExpr{not: true, expr: expr}}, nil + case token.PAREN_LEFT: + p.current++ + expr, err := p.parseLogicalOrExpr() + if err != nil { + return nil, err + } + if p.tokens[p.current].Token != token.PAREN_RIGHT { + return nil, p.parseFailure(&p.tokens[p.current], "expected ')'") + } + p.current++ + return &basicExpr{parenExpr: &parenExpr{not: false, expr: expr}}, nil + } + prevCurrent := p.current + comparisonExpr, comparisonErr := p.parseComparisonExpr() + if comparisonErr == nil { + return &basicExpr{comparisonExpr: comparisonExpr}, nil + } + p.current = prevCurrent + testExpr, testErr := p.parseTestExpr() + if testErr == nil { + return &basicExpr{testExpr: testExpr}, nil + } + p.current = prevCurrent + return nil, p.parseFailure(&p.tokens[p.current], fmt.Sprintf("could not parse query: expected either testExpr [err: %s] or comparisonExpr: [err: %s]", testErr.Error(), comparisonErr.Error())) } func (p *JSONPath) parseComparisonExpr() (*comparisonExpr, error) { - left, err := p.parseComparable() - if err != nil { - return nil, err - } - - if !p.isComparisonOperator(p.tokens[p.current].Token) { - return nil, p.parseFailure(&p.tokens[p.current], "expected comparison operator") - } - operator := p.tokens[p.current].Token - var op comparisonOperator - switch operator { - case token.EQ: - op = equalTo - case token.NE: - op = notEqualTo - case token.LT: - op = lessThan - case token.LE: - op = lessThanEqualTo - case token.GT: - op = greaterThan - case token.GE: - op = greaterThanEqualTo - default: - return nil, p.parseFailure(&p.tokens[p.current], "expected comparison operator") - } - p.current++ - - right, err := p.parseComparable() - if err != nil { - return nil, err - } - - return &comparisonExpr{left: left, op: op, right: right}, nil + left, err := p.parseComparable() + if err != nil { + return nil, err + } + + if !p.isComparisonOperator(p.tokens[p.current].Token) { + return nil, p.parseFailure(&p.tokens[p.current], "expected comparison operator") + } + operator := p.tokens[p.current].Token + var op comparisonOperator + switch operator { + case token.EQ: + op = equalTo + case token.NE: + op = notEqualTo + case token.LT: + op = lessThan + case token.LE: + op = lessThanEqualTo + case token.GT: + op = greaterThan + case token.GE: + op = greaterThanEqualTo + default: + return nil, p.parseFailure(&p.tokens[p.current], "expected comparison operator") + } + p.current++ + + right, err := p.parseComparable() + if err != nil { + return nil, err + } + + return &comparisonExpr{left: left, op: op, right: right}, nil } func (p *JSONPath) parseComparable() (*comparable, error) { - // comparable = literal / - // singular-query / ; singular query value - // function-expr ; ValueType - // context-variable ; JSONPath Plus extension - if literal, err := p.parseLiteral(); err == nil { - return &comparable{literal: literal}, nil - } - if funcExpr, err := p.parseFunctionExpr(); err == nil { - if funcExpr.funcType == functionTypeMatch { - return nil, p.parseFailure(&p.tokens[p.current], "match result cannot be compared") - } else if funcExpr.funcType == functionTypeSearch { - return nil, p.parseFailure(&p.tokens[p.current], "search result cannot be compared") - } - return &comparable{functionExpr: funcExpr}, nil - } - switch p.tokens[p.current].Token { - case token.ROOT: - p.current++ - query, err := p.parseSingleQuery() - if err != nil { - return nil, err - } - return &comparable{singularQuery: &singularQuery{absQuery: &absQuery{segments: query.segments}}}, nil - case token.CURRENT: - p.current++ - query, err := p.parseSingleQuery() - if err != nil { - return nil, err - } - return &comparable{singularQuery: &singularQuery{relQuery: &relQuery{segments: query.segments}}}, nil - - case token.CONTEXT_ROOT: - // @root followed by a path - parse as a query starting from root - p.current++ - query, err := p.parseSingleQuery() - if err != nil { - return nil, err - } - return &comparable{singularQuery: &singularQuery{absQuery: &absQuery{segments: query.segments}}}, nil - - default: - // Check for JSONPath Plus context variables - if varKind, ok := contextVarTokenMap[p.tokens[p.current].Token]; ok { - p.current++ - return &comparable{contextVar: &contextVariable{kind: varKind}}, nil - } - return nil, p.parseFailure(&p.tokens[p.current], "expected literal or query") - } + // comparable = literal / + // singular-query / ; singular query value + // function-expr ; ValueType + // context-variable ; JSONPath Plus extension + if literal, err := p.parseLiteral(); err == nil { + return &comparable{literal: literal}, nil + } + if funcExpr, err := p.parseFunctionExpr(); err == nil { + if funcExpr.funcType == functionTypeMatch { + return nil, p.parseFailure(&p.tokens[p.current], "match result cannot be compared") + } else if funcExpr.funcType == functionTypeSearch { + return nil, p.parseFailure(&p.tokens[p.current], "search result cannot be compared") + } + return &comparable{functionExpr: funcExpr}, nil + } + switch p.tokens[p.current].Token { + case token.ROOT: + p.current++ + query, err := p.parseSingleQuery() + if err != nil { + return nil, err + } + return &comparable{singularQuery: &singularQuery{absQuery: &absQuery{segments: query.segments}}}, nil + case token.CURRENT: + p.current++ + query, err := p.parseSingleQuery() + if err != nil { + return nil, err + } + return &comparable{singularQuery: &singularQuery{relQuery: &relQuery{segments: query.segments}}}, nil + + case token.CONTEXT_ROOT: + // @root followed by a path - parse as a query starting from root + p.current++ + query, err := p.parseSingleQuery() + if err != nil { + return nil, err + } + return &comparable{singularQuery: &singularQuery{absQuery: &absQuery{segments: query.segments}}}, nil + + default: + // Check for JSONPath Plus context variables + if varKind, ok := contextVarTokenMap[p.tokens[p.current].Token]; ok { + p.current++ + return &comparable{contextVar: &contextVariable{kind: varKind}}, nil + } + return nil, p.parseFailure(&p.tokens[p.current], "expected literal or query") + } } func (p *JSONPath) parseQuery() (*jsonPathAST, error) { - var query jsonPathAST - p.mode = append(p.mode, modeNormal) - - for p.current < len(p.tokens) { - prior := p.current - segment, err := p.parseSegment() - if err != nil { - p.current = prior - break - } - query.segments = append(query.segments, segment) - } - p.mode = p.mode[:len(p.mode)-1] - return &query, nil + var query jsonPathAST + p.mode = append(p.mode, modeNormal) + + for p.current < len(p.tokens) { + prior := p.current + segment, err := p.parseSegment() + if err != nil { + p.current = prior + break + } + query.segments = append(query.segments, segment) + } + p.mode = p.mode[:len(p.mode)-1] + return &query, nil } func (p *JSONPath) parseTestExpr() (*testExpr, error) { - //test-expr = [logical-not-op S] - // (filter-query / ; existence/non-existence - // function-expr) ; LogicalType or NodesType - //filter-query = rel-query / jsonpath-query - //rel-query = current-node-identifier segments - //current-node-identifier = "@" - not := false - if p.tokens[p.current].Token == token.NOT { - not = true - p.current++ - } - switch p.tokens[p.current].Token { - case token.CURRENT: - p.current++ - query, err := p.parseQuery() - if err != nil { - return nil, err - } - return &testExpr{filterQuery: &filterQuery{relQuery: &relQuery{segments: query.segments}}, not: not}, nil - case token.ROOT: - p.current++ - query, err := p.parseQuery() - if err != nil { - return nil, err - } - return &testExpr{filterQuery: &filterQuery{jsonPathQuery: &jsonPathAST{ - segments: query.segments, - lazyContextTracking: p.config.LazyContextTrackingEnabled(), - }}, not: not}, nil - default: - funcExpr, err := p.parseFunctionExpr() - if err != nil { - return nil, err - } - if funcExpr.funcType == functionTypeCount { - return nil, p.parseFailure(&p.tokens[p.current], "count function must be compared") - } - if funcExpr.funcType == functionTypeLength { - return nil, p.parseFailure(&p.tokens[p.current], "length function must be compared") - } - if funcExpr.funcType == functionTypeValue { - return nil, p.parseFailure(&p.tokens[p.current], "length function must be compared") - } - return &testExpr{functionExpr: funcExpr, not: not}, nil - } - - return nil, p.parseFailure(&p.tokens[p.current], "unexpected token when parsing test expression") + //test-expr = [logical-not-op S] + // (filter-query / ; existence/non-existence + // function-expr) ; LogicalType or NodesType + //filter-query = rel-query / jsonpath-query + //rel-query = current-node-identifier segments + //current-node-identifier = "@" + not := false + if p.tokens[p.current].Token == token.NOT { + not = true + p.current++ + } + switch p.tokens[p.current].Token { + case token.CURRENT: + p.current++ + query, err := p.parseQuery() + if err != nil { + return nil, err + } + return &testExpr{filterQuery: &filterQuery{relQuery: &relQuery{segments: query.segments}}, not: not}, nil + case token.ROOT: + p.current++ + query, err := p.parseQuery() + if err != nil { + return nil, err + } + return &testExpr{filterQuery: &filterQuery{jsonPathQuery: &jsonPathAST{ + segments: query.segments, + lazyContextTracking: p.config.LazyContextTrackingEnabled(), + }}, not: not}, nil + default: + funcExpr, err := p.parseFunctionExpr() + if err != nil { + return nil, err + } + if funcExpr.funcType == functionTypeCount { + return nil, p.parseFailure(&p.tokens[p.current], "count function must be compared") + } + if funcExpr.funcType == functionTypeLength { + return nil, p.parseFailure(&p.tokens[p.current], "length function must be compared") + } + if funcExpr.funcType == functionTypeValue { + return nil, p.parseFailure(&p.tokens[p.current], "length function must be compared") + } + return &testExpr{functionExpr: funcExpr, not: not}, nil + } } func (p *JSONPath) parseFunctionExpr() (*functionExpr, error) { - // RFC 9535: function name must be immediately followed by '(' (no whitespace) - // The tokenizer only emits FUNCTION token when function name is directly followed by '(' - if p.tokens[p.current].Token != token.FUNCTION { - return nil, p.parseFailure(&p.tokens[p.current], "expected function") - } - functionName := p.tokens[p.current].Literal - if p.current+1 >= len(p.tokens) || p.tokens[p.current+1].Token != token.PAREN_LEFT { - return nil, p.parseFailure(&p.tokens[p.current], "expected '(' after function") - } - p.current += 2 - args := []*functionArgument{} - - // Check type selector functions first (JSONPath Plus) - // These take a single argument and return boolean - if funcType, ok := typeSelectorFunctionMap[functionName]; ok { - arg, err := p.parseFunctionArgument(false) - if err != nil { - return nil, err - } - args = append(args, arg) - if p.tokens[p.current].Token != token.PAREN_RIGHT { - return nil, p.parseFailure(&p.tokens[p.current], "expected ')'") - } - p.current++ - return &functionExpr{funcType: funcType, args: args}, nil - } - - switch functionTypeMap[functionName] { - case functionTypeLength: - arg, err := p.parseFunctionArgument(true) - if err != nil { - return nil, err - } - args = append(args, arg) - case functionTypeCount: - arg, err := p.parseFunctionArgument(false) - if err != nil { - return nil, err - } - if arg.literal != nil && arg.literal.node == nil { - return nil, p.parseFailure(&p.tokens[p.current], "count function only supports containers") - } - args = append(args, arg) - case functionTypeValue: - arg, err := p.parseFunctionArgument(false) - if err != nil { - return nil, err - } - args = append(args, arg) - case functionTypeMatch: - fallthrough - case functionTypeSearch: - arg, err := p.parseFunctionArgument(false) - if err != nil { - return nil, err - } - args = append(args, arg) - if p.tokens[p.current].Token != token.COMMA { - return nil, p.parseFailure(&p.tokens[p.current], "expected ','") - } - p.current++ - arg, err = p.parseFunctionArgument(false) - if err != nil { - return nil, err - } - args = append(args, arg) - default: - return nil, p.parseFailure(&p.tokens[p.current], "unknown function: "+functionName) - } - if p.tokens[p.current].Token != token.PAREN_RIGHT { - return nil, p.parseFailure(&p.tokens[p.current], "expected ')'") - } - p.current++ - return &functionExpr{funcType: functionTypeMap[functionName], args: args}, nil + // RFC 9535: function name must be immediately followed by '(' (no whitespace) + // The tokenizer only emits FUNCTION token when function name is directly followed by '(' + if p.tokens[p.current].Token != token.FUNCTION { + return nil, p.parseFailure(&p.tokens[p.current], "expected function") + } + functionName := p.tokens[p.current].Literal + if p.current+1 >= len(p.tokens) || p.tokens[p.current+1].Token != token.PAREN_LEFT { + return nil, p.parseFailure(&p.tokens[p.current], "expected '(' after function") + } + p.current += 2 + args := []*functionArgument{} + + // Check type selector functions first (JSONPath Plus) + // These take a single argument and return boolean + if funcType, ok := typeSelectorFunctionMap[functionName]; ok { + arg, err := p.parseFunctionArgument(false) + if err != nil { + return nil, err + } + args = append(args, arg) + if p.tokens[p.current].Token != token.PAREN_RIGHT { + return nil, p.parseFailure(&p.tokens[p.current], "expected ')'") + } + p.current++ + return &functionExpr{funcType: funcType, args: args}, nil + } + + switch functionTypeMap[functionName] { + case functionTypeLength: + arg, err := p.parseFunctionArgument(true) + if err != nil { + return nil, err + } + args = append(args, arg) + case functionTypeCount: + arg, err := p.parseFunctionArgument(false) + if err != nil { + return nil, err + } + if arg.literal != nil && arg.literal.node == nil { + return nil, p.parseFailure(&p.tokens[p.current], "count function only supports containers") + } + args = append(args, arg) + case functionTypeValue: + arg, err := p.parseFunctionArgument(false) + if err != nil { + return nil, err + } + args = append(args, arg) + case functionTypeMatch: + fallthrough + case functionTypeSearch: + arg, err := p.parseFunctionArgument(false) + if err != nil { + return nil, err + } + args = append(args, arg) + if p.tokens[p.current].Token != token.COMMA { + return nil, p.parseFailure(&p.tokens[p.current], "expected ','") + } + p.current++ + arg, err = p.parseFunctionArgument(false) + if err != nil { + return nil, err + } + args = append(args, arg) + default: + return nil, p.parseFailure(&p.tokens[p.current], "unknown function: "+functionName) + } + if p.tokens[p.current].Token != token.PAREN_RIGHT { + return nil, p.parseFailure(&p.tokens[p.current], "expected ')'") + } + p.current++ + return &functionExpr{funcType: functionTypeMap[functionName], args: args}, nil } func (p *JSONPath) parseSingleQuery() (*jsonPathAST, error) { - var query jsonPathAST - for p.current < len(p.tokens) { - try := p.current - p.mode = append(p.mode, modeSingular) - segment, err := p.parseSegment() - if err != nil { - // rollback - p.mode = p.mode[:len(p.mode)-1] - p.current = try - break - } - p.mode = p.mode[:len(p.mode)-1] - query.segments = append(query.segments, segment) - } - //if len(query.segments) == 0 { - // return nil, p.parseFailure(p.tokens[p.current], "expected at least one segment") - //} - return &query, nil + var query jsonPathAST + for p.current < len(p.tokens) { + try := p.current + p.mode = append(p.mode, modeSingular) + segment, err := p.parseSegment() + if err != nil { + // rollback + p.mode = p.mode[:len(p.mode)-1] + p.current = try + break + } + p.mode = p.mode[:len(p.mode)-1] + query.segments = append(query.segments, segment) + } + //if len(query.segments) == 0 { + // return nil, p.parseFailure(p.tokens[p.current], "expected at least one segment") + //} + return &query, nil } func (p *JSONPath) parseFunctionArgument(single bool) (*functionArgument, error) { - //function-argument = literal / - // filter-query / ; (includes singular-query) - // logical-expr / - // function-expr - - if lit, err := p.parseLiteral(); err == nil { - return &functionArgument{literal: lit}, nil - } - switch p.tokens[p.current].Token { - case token.CURRENT: - p.current++ - var query *jsonPathAST - var err error - if single { - query, err = p.parseSingleQuery() - } else { - query, err = p.parseQuery() - } - if err != nil { - return nil, err - } - return &functionArgument{filterQuery: &filterQuery{relQuery: &relQuery{segments: query.segments}}}, nil - case token.ROOT: - p.current++ - var query *jsonPathAST - var err error - if single { - query, err = p.parseSingleQuery() - } else { - query, err = p.parseQuery() - } - if err != nil { - return nil, err - } - return &functionArgument{filterQuery: &filterQuery{jsonPathQuery: &jsonPathAST{ - segments: query.segments, - lazyContextTracking: p.config.LazyContextTrackingEnabled(), - }}}, nil - } - - // Check for JSONPath Plus context variables as function arguments - if varKind, ok := contextVarTokenMap[p.tokens[p.current].Token]; ok { - p.current++ - return &functionArgument{contextVar: &contextVariable{kind: varKind}}, nil - } - - if expr, err := p.parseLogicalOrExpr(); err == nil { - return &functionArgument{logicalExpr: expr}, nil - } - if funcExpr, err := p.parseFunctionExpr(); err == nil { - return &functionArgument{functionExpr: funcExpr}, nil - } - - return nil, p.parseFailure(&p.tokens[p.current], "unexpected token for function argument") + //function-argument = literal / + // filter-query / ; (includes singular-query) + // logical-expr / + // function-expr + + if lit, err := p.parseLiteral(); err == nil { + return &functionArgument{literal: lit}, nil + } + switch p.tokens[p.current].Token { + case token.CURRENT: + p.current++ + var query *jsonPathAST + var err error + if single { + query, err = p.parseSingleQuery() + } else { + query, err = p.parseQuery() + } + if err != nil { + return nil, err + } + return &functionArgument{filterQuery: &filterQuery{relQuery: &relQuery{segments: query.segments}}}, nil + case token.ROOT: + p.current++ + var query *jsonPathAST + var err error + if single { + query, err = p.parseSingleQuery() + } else { + query, err = p.parseQuery() + } + if err != nil { + return nil, err + } + return &functionArgument{filterQuery: &filterQuery{jsonPathQuery: &jsonPathAST{ + segments: query.segments, + lazyContextTracking: p.config.LazyContextTrackingEnabled(), + }}}, nil + } + + // Check for JSONPath Plus context variables as function arguments + if varKind, ok := contextVarTokenMap[p.tokens[p.current].Token]; ok { + p.current++ + return &functionArgument{contextVar: &contextVariable{kind: varKind}}, nil + } + + if expr, err := p.parseLogicalOrExpr(); err == nil { + return &functionArgument{logicalExpr: expr}, nil + } + if funcExpr, err := p.parseFunctionExpr(); err == nil { + return &functionArgument{functionExpr: funcExpr}, nil + } + + return nil, p.parseFailure(&p.tokens[p.current], "unexpected token for function argument") } func (p *JSONPath) parseLiteral() (*literal, error) { - switch p.tokens[p.current].Token { - case token.STRING_LITERAL: - lit := p.tokens[p.current].Literal - p.current++ - return &literal{string: &lit}, nil - case token.INTEGER: - lit := p.tokens[p.current].Literal - p.current++ - i, err := strconv.Atoi(lit) - if err != nil { - return nil, p.parseFailure(&p.tokens[p.current], "expected integer") - } - return &literal{integer: &i}, nil - case token.FLOAT: - lit := p.tokens[p.current].Literal - p.current++ - f, err := strconv.ParseFloat(lit, 64) - if err != nil { - return nil, p.parseFailure(&p.tokens[p.current], "expected float") - } - return &literal{float64: &f}, nil - case token.TRUE: - p.current++ - res := true - return &literal{bool: &res}, nil - case token.FALSE: - p.current++ - res := false - return &literal{bool: &res}, nil - case token.NULL: - p.current++ - res := true - return &literal{null: &res}, nil - } - return nil, p.parseFailure(&p.tokens[p.current], "expected literal") + switch p.tokens[p.current].Token { + case token.STRING_LITERAL: + lit := p.tokens[p.current].Literal + p.current++ + return &literal{string: &lit}, nil + case token.INTEGER: + lit := p.tokens[p.current].Literal + p.current++ + i, err := strconv.Atoi(lit) + if err != nil { + return nil, p.parseFailure(&p.tokens[p.current], "expected integer") + } + return &literal{integer: &i}, nil + case token.FLOAT: + lit := p.tokens[p.current].Literal + p.current++ + f, err := strconv.ParseFloat(lit, 64) + if err != nil { + return nil, p.parseFailure(&p.tokens[p.current], "expected float") + } + return &literal{float64: &f}, nil + case token.TRUE: + p.current++ + res := true + return &literal{bool: &res}, nil + case token.FALSE: + p.current++ + res := false + return &literal{bool: &res}, nil + case token.NULL: + p.current++ + res := true + return &literal{null: &res}, nil + } + return nil, p.parseFailure(&p.tokens[p.current], "expected literal") } type jsonPathAST struct { - // "$" - segments []*segment - lazyContextTracking bool - jsonPathPlus bool // JSONPath Plus extensions enabled (unquoted brackets, mapping index fallback) + // "$" + segments []*segment + lazyContextTracking bool + jsonPathPlus bool // JSONPath Plus extensions enabled (unquoted brackets, mapping index fallback) } func (q jsonPathAST) ToString() string { - b := strings.Builder{} - b.WriteString("$") - for _, seg := range q.segments { - b.WriteString(seg.ToString()) - } - return b.String() + b := strings.Builder{} + b.WriteString("$") + for _, seg := range q.segments { + b.WriteString(seg.ToString()) + } + return b.String() } diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/segment.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/segment.go index c698b21e601..e4e9ec3197e 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/segment.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/segment.go @@ -1,88 +1,188 @@ package jsonpath import ( - "go.yaml.in/yaml/v4" - "strings" + "fmt" + "go.yaml.in/yaml/v4" + "strings" ) type segmentKind int const ( - segmentKindChild segmentKind = iota // . - segmentKindDescendant // .. - segmentKindProperyName // ~ (extension only) - segmentKindParent // ^ (JSONPath Plus parent selector) + segmentKindChild segmentKind = iota // . + segmentKindDescendant // .. + segmentKindProperyName // ~ (extension only) + segmentKindParent // ^ (JSONPath Plus parent selector) + segmentKindRecursivePropertyName // .~ (Spectral/JSONPath Plus recursive property names) ) type segment struct { - kind segmentKind - child *innerSegment - descendant *innerSegment + kind segmentKind + child *innerSegment + descendant *innerSegment } type segmentSubKind int const ( - segmentDotWildcard segmentSubKind = iota // .* - segmentDotMemberName // .property - segmentLongHand // [ selector[] ] + segmentDotWildcard segmentSubKind = iota // .* + segmentDotMemberName // .property + segmentLongHand // [ selector[] ] ) func (s segment) ToString() string { - switch s.kind { - case segmentKindChild: - if s.child.kind != segmentLongHand { - return "." + s.child.ToString() - } else { - return s.child.ToString() - } - case segmentKindDescendant: - return ".." + s.descendant.ToString() - case segmentKindProperyName: - return "~" - case segmentKindParent: - return "^" - } - panic("unknown segment kind") + switch s.kind { + case segmentKindChild: + if s.child.kind != segmentLongHand { + return "." + s.child.ToString() + } else { + return s.child.ToString() + } + case segmentKindDescendant: + return ".." + s.descendant.ToString() + case segmentKindProperyName: + return "~" + case segmentKindParent: + return "^" + case segmentKindRecursivePropertyName: + return ".~" + } + panic("unknown segment kind") } type innerSegment struct { - kind segmentSubKind - dotName string - selectors []*selector + kind segmentSubKind + dotName string + selectors []*selector } func (s innerSegment) ToString() string { - builder := strings.Builder{} - switch s.kind { - case segmentDotWildcard: - builder.WriteString("*") - break - case segmentDotMemberName: - builder.WriteString(s.dotName) - break - case segmentLongHand: - builder.WriteString("[") - for i, selector := range s.selectors { - builder.WriteString(selector.ToString()) - if i < len(s.selectors)-1 { - builder.WriteString(", ") - } - } - builder.WriteString("]") - break - default: - panic("unknown child segment kind") - } - return builder.String() + builder := strings.Builder{} + switch s.kind { + case segmentDotWildcard: + builder.WriteString("*") + break + case segmentDotMemberName: + builder.WriteString(s.dotName) + break + case segmentLongHand: + builder.WriteString("[") + for i, selector := range s.selectors { + builder.WriteString(selector.ToString()) + if i < len(s.selectors)-1 { + builder.WriteString(", ") + } + } + builder.WriteString("]") + break + default: + panic("unknown child segment kind") + } + return builder.String() } func descendApply(value *yaml.Node, apply func(*yaml.Node)) { - if value == nil { - return - } - apply(value) - for _, child := range value.Content { - descendApply(child, apply) - } + if value == nil { + return + } + apply(value) + for _, child := range value.Content { + descendApply(child, apply) + } +} + +func (s segment) IsSingular() bool { + switch s.kind { + case segmentKindDescendant, segmentKindRecursivePropertyName: + return false + case segmentKindParent: + return true + case segmentKindProperyName: + return false + case segmentKindChild: + if s.child == nil { + return false + } + return s.child.IsSingular() + default: + return false + } +} + +func (s innerSegment) IsSingular() bool { + switch s.kind { + case segmentDotWildcard: + return false + case segmentDotMemberName: + return true + case segmentLongHand: + if len(s.selectors) != 1 { + return false + } + return s.selectors[0].IsSingular() + default: + return false + } +} + +func (s selector) IsSingular() bool { + switch s.kind { + case selectorSubKindName: + return true + case selectorSubKindArrayIndex: + return true + case selectorSubKindWildcard: + return false + case selectorSubKindArraySlice: + return false + case selectorSubKindFilter: + return false + default: + return false + } +} + +func (s segment) getSegmentInfo() ([]SegmentInfo, error) { + switch s.kind { + case segmentKindChild: + if s.child == nil { + return nil, fmt.Errorf("nil child segment") + } + return s.child.getSegmentInfo() + case segmentKindDescendant: + return nil, fmt.Errorf("recursive descent not supported for upsert") + case segmentKindParent, segmentKindProperyName, segmentKindRecursivePropertyName: + return nil, fmt.Errorf("parent/property selectors not supported for upsert") + default: + return nil, fmt.Errorf("unknown segment kind") + } +} + +func (s innerSegment) getSegmentInfo() ([]SegmentInfo, error) { + switch s.kind { + case segmentDotMemberName: + return []SegmentInfo{{Kind: SegmentKindMemberName, Key: s.dotName}}, nil + case segmentLongHand: + if len(s.selectors) != 1 { + return nil, fmt.Errorf("multiple selectors not supported for upsert") + } + return s.selectors[0].getSegmentInfo() + case segmentDotWildcard: + return nil, fmt.Errorf("wildcard not supported for upsert") + default: + return nil, fmt.Errorf("unknown inner segment kind") + } +} + +func (s selector) getSegmentInfo() ([]SegmentInfo, error) { + switch s.kind { + case selectorSubKindName: + return []SegmentInfo{{Kind: SegmentKindMemberName, Key: s.name}}, nil + case selectorSubKindArrayIndex: + return []SegmentInfo{{Kind: SegmentKindArrayIndex, Index: s.index, HasIndex: true}}, nil + case selectorSubKindWildcard, selectorSubKindArraySlice, selectorSubKindFilter: + return nil, fmt.Errorf("%v selector not supported for upsert", s.kind) + default: + return nil, fmt.Errorf("unknown selector kind") + } } diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/selector.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/selector.go index 9f5ea06fb54..b06cb2e17d8 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/selector.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/selector.go @@ -27,8 +27,9 @@ type selector struct { name string index int64 slice *slice - filter *filterSelector + filter filterSelector jsonPathPlus bool // when true, enables MappingNode fallback for array index selectors + spectral bool // when true, enables Spectral-only context typing for array index selectors } func (s selector) ToString() string { @@ -60,5 +61,4 @@ func (s selector) ToString() string { default: panic(fmt.Sprintf("unimplemented selector kind: %v", s.kind)) } - return "" } diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/spectral_eval.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/spectral_eval.go new file mode 100644 index 00000000000..0abaadd5897 --- /dev/null +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/spectral_eval.go @@ -0,0 +1,529 @@ +package jsonpath + +import ( + "math" + "strconv" + "unicode/utf16" + + "github.com/pb33f/jsonpath/pkg/jsonpath/token" + "go.yaml.in/yaml/v4" +) + +type spectralRuntimeKind uint8 + +const ( + spectralMissing spectralRuntimeKind = iota + spectralInvalid + spectralNull + spectralBoolean + spectralNumber + spectralString + spectralNode + spectralRegexValue +) + +type spectralRuntimeValue struct { + kind spectralRuntimeKind + boolean bool + number float64 + string string + node *yaml.Node + regex *spectralRegex + propertyMethodCoercion bool +} + +type spectralEvalContext struct { + index index + current *yaml.Node + root *yaml.Node +} + +func (e *spectralBoolExpr) Matches(idx index, node *yaml.Node, root *yaml.Node) bool { + result, valid := e.evaluate(spectralEvalContext{index: idx, current: node, root: unwrapDocument(root)}) + return valid && result +} + +func (e *spectralBoolExpr) evaluate(ctx spectralEvalContext) (bool, bool) { + if e == nil { + return false, false + } + switch e.kind { + case spectralBoolValue: + value := e.value.evaluate(ctx) + return value.truthy(), value.kind != spectralInvalid + case spectralBoolNot: + result, valid := e.left.evaluate(ctx) + return !result, valid + case spectralBoolAnd: + left, valid := e.left.evaluate(ctx) + if !valid || !left { + return left, valid + } + return e.right.evaluate(ctx) + case spectralBoolOr: + left, valid := e.left.evaluate(ctx) + if !valid || left { + return left, valid + } + return e.right.evaluate(ctx) + case spectralBoolCompare: + left := e.left.value.evaluate(ctx) + right := e.right.value.evaluate(ctx) + if left.kind == spectralInvalid || right.kind == spectralInvalid { + return false, false + } + return spectralCompare(left, right, e.op), true + case spectralBoolParen: + return e.left.evaluate(ctx) + default: + return false, false + } +} + +func (e *spectralValueExpr) evaluate(ctx spectralEvalContext) spectralRuntimeValue { + if e == nil { + return spectralRuntimeValue{} + } + var value spectralRuntimeValue + switch e.kind { + case spectralValueLiteral: + value = spectralRuntimeFromLiteral(e.literal) + case spectralValueCurrent: + value = spectralRuntimeValue{kind: spectralNode, node: ctx.current} + case spectralValueRoot: + value = spectralRuntimeValue{kind: spectralNode, node: ctx.root} + case spectralValueContext: + value = spectralContextValue(e.context, ctx) + case spectralValueRegex: + value = spectralRuntimeValue{kind: spectralRegexValue, regex: e.regex} + case spectralValueUndefined: + value = spectralRuntimeValue{} + case spectralValueFunction: + value = spectralRuntimeFromLiteral(e.function.Evaluate(ctx.index, ctx.current, ctx.root)) + } + + if len(e.segments) > 0 { + if value.kind != spectralNode || value.node == nil { + return spectralRuntimeValue{} + } + resolved := value.node + for _, segment := range e.segments { + resolved = spectralResolveSegment(resolved, segment) + if resolved == nil { + return spectralRuntimeValue{} + } + } + value = spectralRuntimeFromNode(resolved) + } else if value.kind == spectralNode { + value = spectralRuntimeFromNode(value.node) + } + + for _, postfix := range e.postfix { + value = spectralApplyPostfix(value, postfix) + if value.kind == spectralMissing { + break + } + } + return value +} + +func spectralRuntimeFromLiteral(value literal) spectralRuntimeValue { + switch { + case value.integer != nil: + return spectralRuntimeValue{kind: spectralNumber, number: float64(*value.integer)} + case value.float64 != nil: + return spectralRuntimeValue{kind: spectralNumber, number: *value.float64} + case value.string != nil: + return spectralRuntimeValue{kind: spectralString, string: *value.string} + case value.bool != nil: + return spectralRuntimeValue{kind: spectralBoolean, boolean: *value.bool} + case value.null != nil: + return spectralRuntimeValue{kind: spectralNull} + case value.node != nil: + return spectralRuntimeFromNode(value.node) + default: + return spectralRuntimeValue{} + } +} + +func spectralRuntimeFromNode(node *yaml.Node) spectralRuntimeValue { + node = unwrapDocument(node) + if node == nil { + return spectralRuntimeValue{} + } + if node.Kind == yaml.SequenceNode || node.Kind == yaml.MappingNode { + return spectralRuntimeValue{kind: spectralNode, node: node} + } + switch node.Tag { + case "!!null": + return spectralRuntimeValue{kind: spectralNull} + case "!!bool": + value, err := strconv.ParseBool(node.Value) + if err != nil { + return spectralRuntimeValue{} + } + return spectralRuntimeValue{kind: spectralBoolean, boolean: value} + case "!!int": + value, err := strconv.ParseFloat(node.Value, 64) + if err != nil { + return spectralRuntimeValue{} + } + return spectralRuntimeValue{kind: spectralNumber, number: value} + case "!!float": + value, err := strconv.ParseFloat(node.Value, 64) + if err != nil { + return spectralRuntimeValue{} + } + return spectralRuntimeValue{kind: spectralNumber, number: value} + case "!!str": + return spectralRuntimeValue{kind: spectralString, string: node.Value} + default: + if node.Kind == yaml.ScalarNode { + return spectralRuntimeValue{kind: spectralString, string: node.Value} + } + return spectralRuntimeValue{kind: spectralNode, node: node} + } +} + +func spectralContextValue(kind contextVarKind, ctx spectralEvalContext) spectralRuntimeValue { + filterCtx, ok := ctx.index.(FilterContext) + if !ok { + return spectralRuntimeValue{} + } + switch kind { + case contextVarProperty: + if filterCtx.Index() >= 0 { + return spectralRuntimeValue{kind: spectralNumber, number: float64(filterCtx.Index()), propertyMethodCoercion: true} + } + return spectralRuntimeValue{kind: spectralString, string: filterCtx.PropertyName()} + case contextVarRoot: + return spectralRuntimeFromNode(ctx.root) + case contextVarParent: + return spectralRuntimeFromNode(filterCtx.Parent()) + case contextVarParentProperty: + parent := filterCtx.Parent() + if parent != nil { + if parentContainer := ctx.index.getParentNode(parent); parentContainer != nil && parentContainer.Kind == yaml.SequenceNode { + if parentIndex, err := strconv.Atoi(filterCtx.ParentPropertyName()); err == nil { + return spectralRuntimeValue{kind: spectralNumber, number: float64(parentIndex), propertyMethodCoercion: true} + } + } + } + return spectralRuntimeValue{kind: spectralString, string: filterCtx.ParentPropertyName()} + case contextVarPath: + return spectralRuntimeValue{kind: spectralString, string: filterCtx.Path()} + case contextVarIndex: + return spectralRuntimeValue{kind: spectralNumber, number: float64(filterCtx.Index())} + default: + return spectralRuntimeValue{} + } +} + +func spectralResolveSegment(node *yaml.Node, segment spectralPathSegment) *yaml.Node { + node = unwrapDocument(node) + if node == nil { + return nil + } + if segment.index != nil { + if node.Kind != yaml.SequenceNode { + return nil + } + index := *segment.index + if index < 0 { + index += int64(len(node.Content)) + } + if index < 0 || index >= int64(len(node.Content)) { + return nil + } + return node.Content[index] + } + if node.Kind != yaml.MappingNode { + return nil + } + for i := 0; i+1 < len(node.Content); i += 2 { + if node.Content[i].Value == segment.name { + return node.Content[i+1] + } + } + return nil +} + +func spectralApplyPostfix(value spectralRuntimeValue, postfix spectralPostfix) spectralRuntimeValue { + if value.kind == spectralNumber && value.propertyMethodCoercion && + (postfix.kind == spectralPostfixMatch || postfix.kind == spectralPostfixIndexOf || postfix.kind == spectralPostfixIncludes) { + value = spectralRuntimeValue{kind: spectralString, string: strconv.FormatFloat(value.number, 'f', -1, 64)} + } + switch postfix.kind { + case spectralPostfixMatch: + if value.kind != spectralString { + return spectralRuntimeValue{kind: spectralInvalid} + } + return spectralRuntimeValue{kind: spectralBoolean, boolean: postfix.regex.compiled.MatchString(value.string)} + case spectralPostfixIndexOf: + if value.kind != spectralString { + return spectralRuntimeValue{kind: spectralInvalid} + } + from := 0 + if postfix.fromIndex != nil { + from = int(math.Trunc(*postfix.fromIndex)) + } + return spectralRuntimeValue{kind: spectralNumber, number: float64(spectralUTF16IndexOf(value.string, postfix.search, from))} + case spectralPostfixLength: + switch value.kind { + case spectralString: + return spectralRuntimeValue{kind: spectralNumber, number: float64(len(utf16.Encode([]rune(value.string))))} + case spectralNode: + if value.node != nil && value.node.Kind == yaml.SequenceNode { + return spectralRuntimeValue{kind: spectralNumber, number: float64(len(value.node.Content))} + } + } + return spectralRuntimeValue{kind: spectralInvalid} + case spectralPostfixConstructorName: + name := "" + switch value.kind { + case spectralString: + name = "String" + case spectralNumber: + name = "Number" + case spectralBoolean: + name = "Boolean" + case spectralNode: + if value.node != nil && value.node.Kind == yaml.SequenceNode { + name = "Array" + } else if value.node != nil && value.node.Kind == yaml.MappingNode { + name = "Object" + } + } + if name == "" { + return spectralRuntimeValue{kind: spectralInvalid} + } + return spectralRuntimeValue{kind: spectralString, string: name} + case spectralPostfixIncludes: + argument := spectralRuntimeFromLiteral(postfix.argument) + from := 0 + if postfix.fromIndex != nil { + from = int(math.Trunc(*postfix.fromIndex)) + } + switch value.kind { + case spectralString: + if argument.kind != spectralString { + return spectralRuntimeValue{kind: spectralInvalid} + } + if from < 0 { + from = 0 + } + return spectralRuntimeValue{kind: spectralBoolean, boolean: spectralUTF16IndexOf(value.string, argument.string, from) >= 0} + case spectralNode: + if value.node == nil || value.node.Kind != yaml.SequenceNode { + return spectralRuntimeValue{kind: spectralInvalid} + } + if from < 0 { + from += len(value.node.Content) + if from < 0 { + from = 0 + } + } + if from > len(value.node.Content) { + return spectralRuntimeValue{kind: spectralBoolean, boolean: false} + } + for _, item := range value.node.Content[from:] { + if spectralStrictEqual(spectralRuntimeFromNode(item), argument) { + return spectralRuntimeValue{kind: spectralBoolean, boolean: true} + } + } + return spectralRuntimeValue{kind: spectralBoolean, boolean: false} + default: + return spectralRuntimeValue{kind: spectralInvalid} + } + default: + return spectralRuntimeValue{kind: spectralInvalid} + } +} + +func spectralUTF16IndexOf(value, search string, from int) int { + valueUnits := utf16.Encode([]rune(value)) + searchUnits := utf16.Encode([]rune(search)) + if from < 0 { + from = 0 + } + if from > len(valueUnits) { + from = len(valueUnits) + } + if len(searchUnits) == 0 { + return from + } + for i := from; i+len(searchUnits) <= len(valueUnits); i++ { + matched := true + for j := range searchUnits { + if valueUnits[i+j] != searchUnits[j] { + matched = false + break + } + } + if matched { + return i + } + } + return -1 +} + +func (value spectralRuntimeValue) truthy() bool { + switch value.kind { + case spectralMissing, spectralInvalid, spectralNull: + return false + case spectralBoolean: + return value.boolean + case spectralNumber: + return value.number != 0 && !math.IsNaN(value.number) + case spectralString: + return value.string != "" + case spectralNode, spectralRegexValue: + return true + default: + return false + } +} + +func spectralCompare(left, right spectralRuntimeValue, operator token.Token) bool { + switch operator { + case token.STRICT_EQ: + return spectralStrictEqual(left, right) + case token.STRICT_NE: + return !spectralStrictEqual(left, right) + case token.EQ: + return spectralLooseEqual(left, right) + case token.NE: + return !spectralLooseEqual(left, right) + case token.LT, token.LE, token.GT, token.GE: + comparison, ok := spectralRelationalCompare(left, right) + if !ok { + return false + } + switch operator { + case token.LT: + return comparison < 0 + case token.LE: + return comparison <= 0 + case token.GT: + return comparison > 0 + case token.GE: + return comparison >= 0 + } + } + return false +} + +func spectralStrictEqual(left, right spectralRuntimeValue) bool { + if left.kind == spectralInvalid || right.kind == spectralInvalid { + return false + } + if left.kind != right.kind { + return false + } + switch left.kind { + case spectralMissing, spectralNull: + return true + case spectralBoolean: + return left.boolean == right.boolean + case spectralNumber: + return left.number == right.number + case spectralString: + return left.string == right.string + case spectralNode: + return left.node == right.node + case spectralRegexValue: + return left.regex == right.regex + default: + return false + } +} + +func spectralLooseEqual(left, right spectralRuntimeValue) bool { + if spectralStrictEqual(left, right) { + return true + } + if (left.kind == spectralNull && right.kind == spectralMissing) || (left.kind == spectralMissing && right.kind == spectralNull) { + return true + } + if left.kind == spectralBoolean { + left = spectralRuntimeValue{kind: spectralNumber, number: spectralBooleanNumber(left.boolean)} + } + if right.kind == spectralBoolean { + right = spectralRuntimeValue{kind: spectralNumber, number: spectralBooleanNumber(right.boolean)} + } + if spectralStrictEqual(left, right) { + return true + } + if left.kind == spectralString && right.kind == spectralNumber { + number, ok := spectralStringNumber(left.string) + return ok && number == right.number + } + if left.kind == spectralNumber && right.kind == spectralString { + number, ok := spectralStringNumber(right.string) + return ok && left.number == number + } + return false +} + +func spectralBooleanNumber(value bool) float64 { + if value { + return 1 + } + return 0 +} + +func spectralStringNumber(value string) (float64, bool) { + if value == "" { + return 0, true + } + number, err := strconv.ParseFloat(value, 64) + return number, err == nil +} + +func spectralRelationalCompare(left, right spectralRuntimeValue) (int, bool) { + if left.kind == spectralString && right.kind == spectralString { + switch { + case left.string < right.string: + return -1, true + case left.string > right.string: + return 1, true + default: + return 0, true + } + } + leftNumber, leftOK := spectralComparableNumber(left) + rightNumber, rightOK := spectralComparableNumber(right) + if !leftOK || !rightOK || math.IsNaN(leftNumber) || math.IsNaN(rightNumber) { + return 0, false + } + switch { + case leftNumber < rightNumber: + return -1, true + case leftNumber > rightNumber: + return 1, true + default: + return 0, true + } +} + +func spectralComparableNumber(value spectralRuntimeValue) (float64, bool) { + switch value.kind { + case spectralNumber: + return value.number, true + case spectralString: + return spectralStringNumber(value.string) + case spectralBoolean: + return spectralBooleanNumber(value.boolean), true + case spectralNull: + return 0, true + default: + return 0, false + } +} + +func unwrapDocument(node *yaml.Node) *yaml.Node { + if node != nil && node.Kind == yaml.DocumentNode && len(node.Content) == 1 { + return node.Content[0] + } + return node +} diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/spectral_expr.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/spectral_expr.go new file mode 100644 index 00000000000..50a89b9376c --- /dev/null +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/spectral_expr.go @@ -0,0 +1,659 @@ +package jsonpath + +import ( + "fmt" + "regexp" + "strconv" + "strings" + + "github.com/pb33f/jsonpath/pkg/jsonpath/token" +) + +type spectralBoolKind uint8 + +const ( + spectralBoolValue spectralBoolKind = iota + spectralBoolNot + spectralBoolAnd + spectralBoolOr + spectralBoolCompare + spectralBoolParen +) + +type spectralBoolExpr struct { + kind spectralBoolKind + value *spectralValueExpr + left *spectralBoolExpr + right *spectralBoolExpr + op token.Token + usage contextVarUsage + usesPropertyNameSelector bool +} + +func (e *spectralBoolExpr) String() string { + if e == nil { + return "" + } + switch e.kind { + case spectralBoolValue: + return e.value.String() + case spectralBoolNot: + return "!" + e.left.String() + case spectralBoolAnd: + return e.left.String() + " && " + e.right.String() + case spectralBoolOr: + return e.left.String() + " || " + e.right.String() + case spectralBoolCompare: + return e.left.String() + " " + e.op.String() + " " + e.right.String() + case spectralBoolParen: + return "(" + e.left.String() + ")" + default: + return "" + } +} + +type spectralValueKind uint8 + +const ( + spectralValueLiteral spectralValueKind = iota + spectralValueCurrent + spectralValueRoot + spectralValueContext + spectralValueRegex + spectralValueUndefined + spectralValueFunction +) + +type spectralPathSegment struct { + name string + index *int64 +} + +type spectralPostfixKind uint8 + +const ( + spectralPostfixMatch spectralPostfixKind = iota + spectralPostfixIndexOf + spectralPostfixLength + spectralPostfixConstructorName + spectralPostfixIncludes +) + +type spectralPostfix struct { + kind spectralPostfixKind + regex *spectralRegex + search string + fromIndex *float64 + argument literal +} + +type spectralRegex struct { + source string + pattern string + flags string + compiled *regexp.Regexp +} + +type spectralValueExpr struct { + kind spectralValueKind + literal literal + context contextVarKind + regex *spectralRegex + function *functionExpr + segments []spectralPathSegment + postfix []spectralPostfix +} + +func (e *spectralValueExpr) String() string { + if e == nil { + return "" + } + var b strings.Builder + switch e.kind { + case spectralValueLiteral: + b.WriteString(e.literal.ToString()) + case spectralValueCurrent: + b.WriteByte('@') + case spectralValueRoot: + b.WriteByte('$') + case spectralValueContext: + b.WriteString(contextVariable{kind: e.context}.ToString()) + case spectralValueRegex: + b.WriteString(e.regex.source) + case spectralValueUndefined: + b.WriteString("void 0") + case spectralValueFunction: + b.WriteString(e.function.ToString()) + } + for _, segment := range e.segments { + if segment.index != nil { + b.WriteByte('[') + b.WriteString(strconv.FormatInt(*segment.index, 10)) + b.WriteByte(']') + } else if spectralDotMemberName(segment.name) { + b.WriteByte('.') + b.WriteString(segment.name) + } else { + b.WriteString("['") + b.WriteString(escapeString(segment.name)) + b.WriteString("']") + } + } + for _, postfix := range e.postfix { + switch postfix.kind { + case spectralPostfixMatch: + b.WriteString(".match(") + b.WriteString(postfix.regex.source) + b.WriteByte(')') + case spectralPostfixIndexOf: + b.WriteString(".indexOf('") + b.WriteString(escapeString(postfix.search)) + b.WriteByte('\'') + if postfix.fromIndex != nil { + b.WriteString(", ") + b.WriteString(strconv.FormatFloat(*postfix.fromIndex, 'f', -1, 64)) + } + b.WriteByte(')') + case spectralPostfixLength: + b.WriteString(".length") + case spectralPostfixConstructorName: + b.WriteString(".constructor.name") + case spectralPostfixIncludes: + b.WriteString(".includes(") + b.WriteString(postfix.argument.ToString()) + if postfix.fromIndex != nil { + b.WriteString(", ") + b.WriteString(strconv.FormatFloat(*postfix.fromIndex, 'f', -1, 64)) + } + b.WriteByte(')') + } + } + return b.String() +} + +func spectralDotMemberName(name string) bool { + if name == "$ref" { + return true + } + if name == "" { + return false + } + for i := 0; i < len(name); i++ { + ch := name[i] + if 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 { + continue + } + if i > 0 && '0' <= ch && ch <= '9' { + continue + } + return false + } + return true +} + +func (p *JSONPath) parseSpectralExpression() (*spectralBoolExpr, error) { + expr, err := p.parseSpectralOr() + if err != nil { + return nil, err + } + if p.current >= len(p.tokens) || p.tokens[p.current].Token != token.BRACKET_RIGHT { + return nil, p.spectralFailure(p.current, "expected the end of the Spectral filter expression") + } + return expr, nil +} + +func (p *JSONPath) parseSpectralOr() (*spectralBoolExpr, error) { + left, err := p.parseSpectralAnd() + if err != nil { + return nil, err + } + for p.spectralNext(token.OR) { + p.current++ + right, err := p.parseSpectralAnd() + if err != nil { + return nil, err + } + left = p.spectralBool(spectralBoolOr, left, right, 0) + } + return left, nil +} + +func (p *JSONPath) parseSpectralAnd() (*spectralBoolExpr, error) { + left, err := p.parseSpectralUnary() + if err != nil { + return nil, err + } + for p.spectralNext(token.AND) { + p.current++ + right, err := p.parseSpectralUnary() + if err != nil { + return nil, err + } + left = p.spectralBool(spectralBoolAnd, left, right, 0) + } + return left, nil +} + +func (p *JSONPath) parseSpectralUnary() (*spectralBoolExpr, error) { + if p.spectralNext(token.NOT) { + p.current++ + child, err := p.parseSpectralUnary() + if err != nil { + return nil, err + } + return p.spectralBool(spectralBoolNot, child, nil, 0), nil + } + if p.spectralNext(token.PAREN_LEFT) { + p.current++ + child, err := p.parseSpectralOr() + if err != nil { + return nil, err + } + if !p.spectralNext(token.PAREN_RIGHT) { + return nil, p.spectralFailure(p.current, "expected ')' in Spectral filter expression") + } + p.current++ + return p.spectralBool(spectralBoolParen, child, nil, 0), nil + } + return p.parseSpectralComparison() +} + +func (p *JSONPath) parseSpectralComparison() (*spectralBoolExpr, error) { + left, err := p.parseSpectralValue() + if err != nil { + return nil, err + } + leftBool := p.spectralValueBool(left) + if p.current >= len(p.tokens) || !isSpectralComparison(p.tokens[p.current].Token) { + if len(left.postfix) > 0 && left.postfix[len(left.postfix)-1].kind == spectralPostfixMatch { + return leftBool, nil + } + return leftBool, nil + } + op := p.tokens[p.current].Token + if len(left.postfix) > 0 && left.postfix[len(left.postfix)-1].kind == spectralPostfixMatch { + return nil, p.spectralFailure(p.current, "match(...) results are only supported as truthy tests and cannot be compared or chained") + } + p.current++ + right, err := p.parseSpectralValue() + if err != nil { + return nil, err + } + if len(right.postfix) > 0 && right.postfix[len(right.postfix)-1].kind == spectralPostfixMatch { + return nil, p.spectralFailure(p.current-1, "match(...) results are only supported as truthy tests and cannot be compared or chained") + } + return p.spectralBool(spectralBoolCompare, leftBool, p.spectralValueBool(right), op), nil +} + +func (p *JSONPath) parseSpectralValue() (*spectralValueExpr, error) { + if p.current >= len(p.tokens) { + return nil, p.spectralFailure(p.current, "expected a Spectral value expression") + } + tok := p.tokens[p.current] + value := &spectralValueExpr{} + switch tok.Token { + case token.STRING_LITERAL, token.INTEGER, token.FLOAT, token.TRUE, token.FALSE, token.NULL: + lit, err := p.parseLiteral() + if err != nil { + return nil, err + } + value.kind = spectralValueLiteral + value.literal = *lit + case token.CURRENT: + value.kind = spectralValueCurrent + p.current++ + case token.ROOT, token.CONTEXT_ROOT: + value.kind = spectralValueRoot + p.current++ + case token.CONTEXT_PROPERTY, token.CONTEXT_PARENT, token.CONTEXT_PARENT_PROPERTY, token.CONTEXT_PATH, token.CONTEXT_INDEX: + value.kind = spectralValueContext + value.context = contextVarTokenMap[tok.Token] + p.current++ + case token.REGEX: + rx, err := compileSpectralRegex(tok.Literal) + if err != nil { + return nil, p.spectralFailure(p.current, err.Error()) + } + value.kind = spectralValueRegex + value.regex = rx + p.current++ + case token.FUNCTION: + function, err := p.parseFunctionExpr() + if err != nil { + return nil, err + } + value.kind = spectralValueFunction + value.function = function + case token.STRING: + if tok.Literal != "void" || p.current+1 >= len(p.tokens) || p.tokens[p.current+1].Token != token.INTEGER || p.tokens[p.current+1].Literal != "0" { + return nil, p.spectralFailure(p.current, "unsupported identifier; only the safe undefined expression 'void 0' is supported") + } + value.kind = spectralValueUndefined + p.current += 2 + default: + return nil, p.spectralFailure(p.current, "expected a literal, query, context value or regex literal") + } + + for p.current < len(p.tokens) { + if len(value.postfix) > 0 && (p.tokens[p.current].Token == token.CHILD || p.tokens[p.current].Token == token.BRACKET_LEFT) { + return nil, p.spectralFailure(p.current, "postfix results cannot be chained in Spectral compatibility mode") + } + if p.tokens[p.current].Token == token.BRACKET_LEFT { + if value.kind != spectralValueCurrent && value.kind != spectralValueRoot { + return nil, p.spectralFailure(p.current, "computed member access is not supported in Spectral compatibility mode") + } + if err := p.parseSpectralBracketSegment(value); err != nil { + return nil, err + } + continue + } + if p.tokens[p.current].Token != token.CHILD { + break + } + childAt := p.current + p.current++ + if p.current >= len(p.tokens) { + return nil, p.spectralFailure(childAt, "expected a member or method name after '.'") + } + nameToken := p.tokens[p.current] + nameTokenWidth := 1 + if nameToken.Token == token.ROOT { + if p.current+1 >= len(p.tokens) || p.tokens[p.current+1].Token != token.STRING || p.tokens[p.current+1].Literal != "ref" { + return nil, p.spectralFailure(p.current, "only $ref is supported as a '$'-prefixed member name") + } + nameToken.Literal = "$ref" + nameTokenWidth = 2 + } else if nameToken.Token != token.STRING && nameToken.Token != token.FUNCTION { + return nil, p.spectralFailure(p.current, "expected a member or method name after '.'") + } + name := nameToken.Literal + p.current += nameTokenWidth + if p.spectralNext(token.PAREN_LEFT) { + if err := p.parseSpectralMethod(value, name, childAt); err != nil { + return nil, err + } + continue + } + switch name { + case "length": + value.postfix = append(value.postfix, spectralPostfix{kind: spectralPostfixLength}) + case "constructor": + if !p.spectralNext(token.CHILD) || p.current+1 >= len(p.tokens) || p.tokens[p.current+1].Literal != "name" { + return nil, p.spectralFailure(childAt, "only the complete read-only constructor.name shape is supported") + } + p.current += 2 + value.postfix = append(value.postfix, spectralPostfix{kind: spectralPostfixConstructorName}) + case "__proto__", "prototype", "__defineGetter__", "__defineSetter__": + return nil, p.spectralFailure(childAt, "prototype and executable-object access is not supported") + default: + if len(value.postfix) > 0 { + return nil, p.spectralFailure(childAt, "postfix results cannot be chained in Spectral compatibility mode") + } + if value.kind != spectralValueCurrent && value.kind != spectralValueRoot { + return nil, p.spectralFailure(childAt, "member access is only supported on singular queries") + } + value.segments = append(value.segments, spectralPathSegment{name: name}) + } + } + return value, nil +} + +func (p *JSONPath) parseSpectralBracketSegment(value *spectralValueExpr) error { + start := p.current + p.current++ + if p.current >= len(p.tokens) { + return p.spectralFailure(start, "unterminated computed member access") + } + tok := p.tokens[p.current] + segment := spectralPathSegment{} + switch tok.Token { + case token.STRING_LITERAL: + if tok.Literal == "constructor" || tok.Literal == "__proto__" || tok.Literal == "prototype" { + return p.spectralFailure(p.current, "computed constructor and prototype access is not supported") + } + segment.name = tok.Literal + case token.INTEGER: + index, err := strconv.ParseInt(tok.Literal, 10, 64) + if err != nil { + return p.spectralFailure(p.current, "invalid singular query index") + } + segment.index = &index + default: + return p.spectralFailure(p.current, "only literal member names and indexes are supported in singular queries") + } + p.current++ + if !p.spectralNext(token.BRACKET_RIGHT) { + return p.spectralFailure(p.current, "expected ']' after singular query member") + } + p.current++ + value.segments = append(value.segments, segment) + return nil +} + +func (p *JSONPath) parseSpectralMethod(value *spectralValueExpr, name string, at int) error { + if len(value.postfix) > 0 { + return p.spectralFailure(at, "method results cannot be chained in Spectral compatibility mode") + } + p.current++ + switch name { + case "match": + if !p.spectralNext(token.REGEX) { + return p.spectralFailure(p.current, "match requires one regex literal argument") + } + rx, err := compileSpectralRegex(p.tokens[p.current].Literal) + if err != nil { + return p.spectralFailure(p.current, err.Error()) + } + p.current++ + if !p.spectralNext(token.PAREN_RIGHT) { + return p.spectralFailure(p.current, "match requires exactly one regex literal argument") + } + p.current++ + value.postfix = append(value.postfix, spectralPostfix{kind: spectralPostfixMatch, regex: rx}) + case "indexOf": + if !p.spectralNext(token.STRING_LITERAL) { + return p.spectralFailure(p.current, "indexOf requires a string argument") + } + postfix := spectralPostfix{kind: spectralPostfixIndexOf, search: p.tokens[p.current].Literal} + p.current++ + if p.spectralNext(token.COMMA) { + p.current++ + if p.current >= len(p.tokens) || (p.tokens[p.current].Token != token.INTEGER && p.tokens[p.current].Token != token.FLOAT) { + return p.spectralFailure(p.current, "indexOf fromIndex must be numeric") + } + from, err := strconv.ParseFloat(p.tokens[p.current].Literal, 64) + if err != nil { + return p.spectralFailure(p.current, "invalid indexOf fromIndex") + } + postfix.fromIndex = &from + p.current++ + } + if !p.spectralNext(token.PAREN_RIGHT) { + return p.spectralFailure(p.current, "indexOf accepts one string and an optional numeric fromIndex") + } + p.current++ + value.postfix = append(value.postfix, postfix) + case "includes": + argument, err := p.parseLiteral() + if err != nil { + return p.spectralFailure(p.current, "includes requires a scalar literal argument") + } + postfix := spectralPostfix{kind: spectralPostfixIncludes, argument: *argument} + if p.spectralNext(token.COMMA) { + p.current++ + if p.current >= len(p.tokens) || (p.tokens[p.current].Token != token.INTEGER && p.tokens[p.current].Token != token.FLOAT) { + return p.spectralFailure(p.current, "includes fromIndex must be numeric") + } + from, err := strconv.ParseFloat(p.tokens[p.current].Literal, 64) + if err != nil { + return p.spectralFailure(p.current, "invalid includes fromIndex") + } + postfix.fromIndex = &from + p.current++ + } + if !p.spectralNext(token.PAREN_RIGHT) { + return p.spectralFailure(p.current, "includes accepts one scalar and an optional numeric fromIndex") + } + p.current++ + value.postfix = append(value.postfix, postfix) + default: + return p.spectralFailure(at, fmt.Sprintf("unsupported method %q; supported methods are match, indexOf and includes", name)) + } + return nil +} + +func (p *JSONPath) spectralBool(kind spectralBoolKind, left, right *spectralBoolExpr, op token.Token) *spectralBoolExpr { + expr := &spectralBoolExpr{kind: kind, left: left, right: right, op: op} + if left != nil { + expr.usage = left.usage + expr.usesPropertyNameSelector = left.usesPropertyNameSelector + } + if right != nil { + expr.usage.property = expr.usage.property || right.usage.property + expr.usage.parent = expr.usage.parent || right.usage.parent + expr.usage.parentProperty = expr.usage.parentProperty || right.usage.parentProperty + expr.usage.path = expr.usage.path || right.usage.path + expr.usage.index = expr.usage.index || right.usage.index + expr.usesPropertyNameSelector = expr.usesPropertyNameSelector || right.usesPropertyNameSelector + } + return expr +} + +func (p *JSONPath) spectralValueBool(value *spectralValueExpr) *spectralBoolExpr { + expr := &spectralBoolExpr{kind: spectralBoolValue, value: value} + switch value.kind { + case spectralValueContext: + expr.usage.mark(value.context) + case spectralValueFunction: + value.function.collectContextVarUsage(&expr.usage) + expr.usesPropertyNameSelector = value.function.hasPropertyNameReferences() + } + return expr +} + +func (p *JSONPath) spectralNext(tok token.Token) bool { + return p.current < len(p.tokens) && p.tokens[p.current].Token == tok +} + +func (p *JSONPath) spectralFailure(at int, message string) error { + if len(p.tokens) == 0 { + return fmt.Errorf("spectral compatibility mode: %s", message) + } + if at >= len(p.tokens) { + at = len(p.tokens) - 1 + } + return p.parseFailure(&p.tokens[at], "Spectral compatibility mode: "+message) +} + +func isSpectralComparison(tok token.Token) bool { + switch tok { + case token.EQ, token.NE, token.STRICT_EQ, token.STRICT_NE, token.GT, token.GE, token.LT, token.LE: + return true + default: + return false + } +} + +func compileSpectralRegex(source string) (*spectralRegex, error) { + if len(source) < 2 || source[0] != '/' { + return nil, fmt.Errorf("invalid regex literal") + } + closing := -1 + escaped := false + inClass := false + for i := 1; i < len(source); i++ { + ch := source[i] + if escaped { + escaped = false + continue + } + if ch == '\\' { + escaped = true + continue + } + if ch == '[' { + inClass = true + } else if ch == ']' { + inClass = false + } else if ch == '/' && !inClass { + closing = i + break + } + } + if closing < 0 { + return nil, fmt.Errorf("unterminated regex literal") + } + pattern := source[1:closing] + flags := source[closing+1:] + seen := [256]bool{} + for i := 0; i < len(flags); i++ { + flag := flags[i] + if seen[flag] { + return nil, fmt.Errorf("duplicate regex flag %q", flag) + } + seen[flag] = true + } + var modes strings.Builder + for i := 0; i < len(flags); i++ { + flag := flags[i] + switch flag { + case 'i', 'm', 's': + modes.WriteByte(flag) + case 'g': + case 'u': + if strings.Contains(pattern, `\u{`) { + return nil, fmt.Errorf("regex u flag code-point escapes are not supported by the safe RE2 evaluator") + } + case 'd', 'v', 'y': + return nil, fmt.Errorf("regex flag %q is not supported by the safe RE2 evaluator", flag) + default: + return nil, fmt.Errorf("unknown regex flag %q", flag) + } + } + if err := validateSpectralRegexPattern(pattern); err != nil { + return nil, err + } + pattern = strings.ReplaceAll(pattern, `\/`, `/`) + compiledPattern := pattern + if modes.Len() > 0 { + compiledPattern = "(?" + modes.String() + ")" + pattern + } + compiled, err := regexp.Compile(compiledPattern) + if err != nil { + return nil, fmt.Errorf("invalid or unsupported regex: %v", err) + } + return &spectralRegex{source: source, pattern: pattern, flags: flags, compiled: compiled}, nil +} + +func validateSpectralRegexPattern(pattern string) error { + inClass := false + for i := 0; i < len(pattern); i++ { + switch pattern[i] { + case '\\': + if i+1 >= len(pattern) { + return fmt.Errorf("malformed regex escape") + } + if pattern[i+1] >= '1' && pattern[i+1] <= '9' { + return fmt.Errorf("regex backreferences are not supported by the safe RE2 evaluator") + } + i++ + case '[': + if !inClass { + inClass = true + } + case ']': + if inClass { + inClass = false + } + case '(': + if inClass || i+2 >= len(pattern) || pattern[i+1] != '?' { + continue + } + if pattern[i+2] == '=' || pattern[i+2] == '!' || + (pattern[i+2] == '<' && i+3 < len(pattern) && (pattern[i+3] == '=' || pattern[i+3] == '!')) { + return fmt.Errorf("regex lookaround is not supported by the safe RE2 evaluator") + } + } + } + return nil +} diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/token/token.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/token/token.go index 7e92c120e4f..ef7a1fe70a4 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/token/token.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/token/token.go @@ -1,10 +1,10 @@ package token import ( - "fmt" - "github.com/pb33f/jsonpath/pkg/jsonpath/config" - "strconv" - "strings" + "fmt" + "github.com/pb33f/jsonpath/pkg/jsonpath/config" + "strconv" + "strings" ) // ***************************************************************************** @@ -162,245 +162,254 @@ type Token int // The list of tokens. const ( - ILLEGAL Token = iota - STRING - INTEGER - FLOAT - STRING_LITERAL - TRUE - FALSE - NULL - ROOT - CURRENT - WILDCARD - PROPERTY_NAME - RECURSIVE - CHILD - ARRAY_SLICE - FILTER - PAREN_LEFT - PAREN_RIGHT - BRACKET_LEFT - BRACKET_RIGHT - COMMA - TILDE - AND - OR - NOT - EQ - NE - GT - GE - LT - LE - MATCHES - FUNCTION - - // JSONPath Plus context variable tokens - CONTEXT_PROPERTY // @property - current property name - CONTEXT_ROOT // @root - root node access in filter - CONTEXT_PARENT // @parent - parent node reference - CONTEXT_PARENT_PROPERTY // @parentProperty - parent's property name - CONTEXT_PATH // @path - absolute path to current node - CONTEXT_INDEX // @index - current array index - - // JSONPath Plus parent selector - PARENT_SELECTOR // ^ - select parent of current node + ILLEGAL Token = iota + STRING + INTEGER + FLOAT + STRING_LITERAL + TRUE + FALSE + NULL + ROOT + CURRENT + WILDCARD + PROPERTY_NAME + RECURSIVE + CHILD + ARRAY_SLICE + FILTER + PAREN_LEFT + PAREN_RIGHT + BRACKET_LEFT + BRACKET_RIGHT + COMMA + TILDE + AND + OR + NOT + EQ + NE + GT + GE + LT + LE + MATCHES + FUNCTION + + // JSONPath Plus context variable tokens + CONTEXT_PROPERTY // @property - current property name + CONTEXT_ROOT // @root - root node access in filter + CONTEXT_PARENT // @parent - parent node reference + CONTEXT_PARENT_PROPERTY // @parentProperty - parent's property name + CONTEXT_PATH // @path - absolute path to current node + CONTEXT_INDEX // @index - current array index + + // JSONPath Plus parent selector + PARENT_SELECTOR // ^ - select parent of current node + + // Spectral compatibility tokens are appended to preserve every existing + // exported token's numeric value. + REGEX + STRICT_EQ + STRICT_NE ) var SimpleTokens = [...]Token{ - STRING, - INTEGER, - STRING_LITERAL, - CHILD, - BRACKET_LEFT, - BRACKET_RIGHT, - ROOT, + STRING, + INTEGER, + STRING_LITERAL, + CHILD, + BRACKET_LEFT, + BRACKET_RIGHT, + ROOT, } var tokens = [...]string{ - ILLEGAL: "ILLEGAL", - STRING: "STRING", - INTEGER: "INTEGER", - FLOAT: "FLOAT", - STRING_LITERAL: "STRING_LITERAL", - TRUE: "TRUE", - FALSE: "FALSE", - NULL: "NULL", - // root node identifier (Section 2.2) - ROOT: "$", - // current node identifier (Section 2.3.5) - // (valid only within filter selectors) - CURRENT: "@", - WILDCARD: "*", - RECURSIVE: "..", - CHILD: ".", - // start:end:step array slice operator (Section 2.3.4) - ARRAY_SLICE: ":", - // filter selector (Section 2.3.5): selects - // particular children using a logical - // expression - FILTER: "?", - PAREN_LEFT: "(", - PAREN_RIGHT: ")", - BRACKET_LEFT: "[", - BRACKET_RIGHT: "]", - COMMA: ",", - TILDE: "~", - AND: "&&", - OR: "||", - NOT: "!", - EQ: "==", - NE: "!=", - GT: ">", - GE: ">=", - LT: "<", - LE: "<=", - MATCHES: "=~", - FUNCTION: "FUNCTION", - - // JSONPath Plus context variables - CONTEXT_PROPERTY: "@property", - CONTEXT_ROOT: "@root", - CONTEXT_PARENT: "@parent", - CONTEXT_PARENT_PROPERTY: "@parentProperty", - CONTEXT_PATH: "@path", - CONTEXT_INDEX: "@index", - - // JSONPath Plus parent selector - PARENT_SELECTOR: "^", + ILLEGAL: "ILLEGAL", + STRING: "STRING", + INTEGER: "INTEGER", + FLOAT: "FLOAT", + STRING_LITERAL: "STRING_LITERAL", + TRUE: "TRUE", + FALSE: "FALSE", + NULL: "NULL", + // root node identifier (Section 2.2) + ROOT: "$", + // current node identifier (Section 2.3.5) + // (valid only within filter selectors) + CURRENT: "@", + WILDCARD: "*", + RECURSIVE: "..", + CHILD: ".", + // start:end:step array slice operator (Section 2.3.4) + ARRAY_SLICE: ":", + // filter selector (Section 2.3.5): selects + // particular children using a logical + // expression + FILTER: "?", + PAREN_LEFT: "(", + PAREN_RIGHT: ")", + BRACKET_LEFT: "[", + BRACKET_RIGHT: "]", + COMMA: ",", + TILDE: "~", + AND: "&&", + OR: "||", + NOT: "!", + EQ: "==", + NE: "!=", + GT: ">", + GE: ">=", + LT: "<", + LE: "<=", + MATCHES: "=~", + FUNCTION: "FUNCTION", + REGEX: "REGEX", + STRICT_EQ: "===", + STRICT_NE: "!==", + + // JSONPath Plus context variables + CONTEXT_PROPERTY: "@property", + CONTEXT_ROOT: "@root", + CONTEXT_PARENT: "@parent", + CONTEXT_PARENT_PROPERTY: "@parentProperty", + CONTEXT_PATH: "@path", + CONTEXT_INDEX: "@index", + + // JSONPath Plus parent selector + PARENT_SELECTOR: "^", } // String returns the string representation of the token. func (tok Token) String() string { - if tok >= 0 && tok < Token(len(tokens)) { - return tokens[tok] - } - return "token(" + strconv.Itoa(int(tok)) + ")" + if tok >= 0 && tok < Token(len(tokens)) { + return tokens[tok] + } + return "token(" + strconv.Itoa(int(tok)) + ")" } func (tok Tokens) IsSimple() bool { - if len(tok) == 0 { - return false - } - if tok[0].Token != ROOT { - return false - } - for _, token := range tok { - isSimple := false - for _, simpleToken := range SimpleTokens { - if token.Token == simpleToken { - isSimple = true - } - } - if !isSimple { - return false - } - } - return true + if len(tok) == 0 { + return false + } + if tok[0].Token != ROOT { + return false + } + for _, token := range tok { + isSimple := false + for _, simpleToken := range SimpleTokens { + if token.Token == simpleToken { + isSimple = true + } + } + if !isSimple { + return false + } + } + return true } // When there's an error in the tokenizer, this helps represent it. func (t Tokenizer) ErrorString(target *TokenInfo, msg string) string { - var errorBuilder strings.Builder - - var token TokenInfo - if target == nil { - // grab last token (as value) - token = t.tokens[len(t.tokens)-1] - // set column to +1 - token.Column++ - target = &token - } - - // Write the error message with line and column information - errorBuilder.WriteString(fmt.Sprintf("Error at line %d, column %d: %s\n", target.Line, target.Column, msg)) - - // Find the start and end positions of the line containing the target token - lineStart := 0 - lineEnd := len(t.input) - for i := target.Line - 1; i > 0; i-- { - if pos := strings.LastIndexByte(t.input[:lineStart], '\n'); pos != -1 { - lineStart = pos + 1 - break - } - } - if pos := strings.IndexByte(t.input[lineStart:], '\n'); pos != -1 { - lineEnd = lineStart + pos - } - - // Extract the line containing the target token - line := t.input[lineStart:lineEnd] - errorBuilder.WriteString(line) - errorBuilder.WriteString("\n") - - // Calculate the number of spaces before the target token - spaces := strings.Repeat(" ", target.Column) - - // Write the caret symbol pointing to the target token - errorBuilder.WriteString(spaces) - dots := "" - if target.Len > 0 { - dots = strings.Repeat(".", target.Len-1) - } - errorBuilder.WriteString("^" + dots + "\n") - - return errorBuilder.String() + var errorBuilder strings.Builder + + var token TokenInfo + if target == nil { + // grab last token (as value) + token = t.tokens[len(t.tokens)-1] + // set column to +1 + token.Column++ + target = &token + } + + // Write the error message with line and column information + errorBuilder.WriteString(fmt.Sprintf("Error at line %d, column %d: %s\n", target.Line, target.Column, msg)) + + // Find the start and end positions of the line containing the target token + lineStart := 0 + lineEnd := len(t.input) + for i := target.Line - 1; i > 0; i-- { + if pos := strings.LastIndexByte(t.input[:lineStart], '\n'); pos != -1 { + lineStart = pos + 1 + break + } + } + if pos := strings.IndexByte(t.input[lineStart:], '\n'); pos != -1 { + lineEnd = lineStart + pos + } + + // Extract the line containing the target token + line := t.input[lineStart:lineEnd] + errorBuilder.WriteString(line) + errorBuilder.WriteString("\n") + + // Calculate the number of spaces before the target token + spaces := strings.Repeat(" ", target.Column) + + // Write the caret symbol pointing to the target token + errorBuilder.WriteString(spaces) + dots := "" + if target.Len > 0 { + dots = strings.Repeat(".", target.Len-1) + } + errorBuilder.WriteString("^" + dots + "\n") + + return errorBuilder.String() } // When there's an error func (t Tokenizer) ErrorTokenString(target *TokenInfo, msg string) string { - var errorBuilder strings.Builder - var token TokenInfo - if target == nil { - // grab last token (as value) - token = t.tokens[len(t.tokens)-1] - // set column to +1 - token.Column++ - target = &token - } - // Write the error message with line and column information - errorBuilder.WriteString(t.ErrorString(target, msg)) - - // Find the start and end positions of the line containing the target token - lineStart := 0 - lineEnd := len(t.input) - for i := target.Line - 1; i > 0; i-- { - if pos := strings.LastIndexByte(t.input[:lineStart], '\n'); pos != -1 { - lineStart = pos + 1 - break - } - } - if pos := strings.IndexByte(t.input[lineStart:], '\n'); pos != -1 { - lineEnd = lineStart + pos - } - - // Extract the line containing the target token - line := t.input[lineStart:lineEnd] - - // Calculate the number of spaces before the target token - for _, token := range t.tokens { - errorBuilder.WriteString(line) - errorBuilder.WriteString("\n") - spaces := strings.Repeat(" ", token.Column) - dots := "" - if token.Len > 0 { - dots = strings.Repeat(".", token.Len-1) - } - errorBuilder.WriteString(spaces) - errorBuilder.WriteString(fmt.Sprintf("^%s %s\n", dots, tokens[token.Token])) - } - - return errorBuilder.String() + var errorBuilder strings.Builder + var token TokenInfo + if target == nil { + // grab last token (as value) + token = t.tokens[len(t.tokens)-1] + // set column to +1 + token.Column++ + target = &token + } + // Write the error message with line and column information + errorBuilder.WriteString(t.ErrorString(target, msg)) + + // Find the start and end positions of the line containing the target token + lineStart := 0 + lineEnd := len(t.input) + for i := target.Line - 1; i > 0; i-- { + if pos := strings.LastIndexByte(t.input[:lineStart], '\n'); pos != -1 { + lineStart = pos + 1 + break + } + } + if pos := strings.IndexByte(t.input[lineStart:], '\n'); pos != -1 { + lineEnd = lineStart + pos + } + + // Extract the line containing the target token + line := t.input[lineStart:lineEnd] + + // Calculate the number of spaces before the target token + for _, token := range t.tokens { + errorBuilder.WriteString(line) + errorBuilder.WriteString("\n") + spaces := strings.Repeat(" ", token.Column) + dots := "" + if token.Len > 0 { + dots = strings.Repeat(".", token.Len-1) + } + errorBuilder.WriteString(spaces) + errorBuilder.WriteString(fmt.Sprintf("^%s %s\n", dots, tokens[token.Token])) + } + + return errorBuilder.String() } // TokenInfo represents a token and its associated information. type TokenInfo struct { - Token Token - Line int - Column int - Literal string - Len int + Token Token + Line int + Column int + Literal string + Len int } // Tokens represents the list of tokens @@ -408,512 +417,622 @@ type Tokens []TokenInfo // Tokenizer represents a JSONPath tokenizer. type Tokenizer struct { - input string - pos int - line int - column int - tokens []TokenInfo - stack []Token - illegalWhitespace bool - config config.Config - bracketFilterState []bool // lazy-init: nil until first BRACKET_LEFT; tracks filter context per bracket depth + input string + pos int + line int + column int + tokens []TokenInfo + stack []Token + illegalWhitespace bool + config config.Config + bracketFilterState []bool // lazy-init: nil until first BRACKET_LEFT; tracks filter context per bracket depth } // NewTokenizer creates a new JSONPath tokenizer for the given input string. func NewTokenizer(input string, opts ...config.Option) *Tokenizer { - cfg := config.New(opts...) - return &Tokenizer{ - input: input, - config: cfg, - line: 1, - stack: make([]Token, 0), - } + return NewTokenizerWithConfig(input, config.New(opts...)) +} + +// NewTokenizerWithConfig creates a tokenizer using an already resolved +// configuration. It avoids resolving the same options again when a caller +// owns both tokenization and parsing. +func NewTokenizerWithConfig(input string, cfg config.Config) *Tokenizer { + if cfg == nil { + cfg = config.New() + } + return &Tokenizer{ + input: input, + config: cfg, + line: 1, + stack: make([]Token, 0), + } } // Tokenize tokenizes the input string and returns a slice of TokenInfo. func (t *Tokenizer) Tokenize() Tokens { - for t.pos < len(t.input) { - if !t.illegalWhitespace { - t.skipWhitespace() - } - if t.pos >= len(t.input) { - break - } - - switch ch := t.input[t.pos]; { - case ch == '$': - t.addToken(ROOT, 1, "") - case ch == '@': - // Check for JSONPath Plus context variables when enabled - handled := false - if t.config.JSONPathPlusEnabled() { - if contextToken, length := t.tryContextVariable(); contextToken != ILLEGAL { - t.addToken(contextToken, length, "") - // Advance past the token (minus 1 because main loop does pos++) - t.pos += length - 1 - t.column += length - 1 - handled = true - } - } - if !handled { - t.addToken(CURRENT, 1, "") - } - case ch == '*': - t.addToken(WILDCARD, 1, "") - case ch == '~': - if t.config.PropertyNameEnabled() { - t.addToken(PROPERTY_NAME, 1, "") - } else { - t.addToken(ILLEGAL, 1, "invalid property name token without config.PropertyNameExtension set to true") - } - case ch == '^': - // JSONPath Plus parent selector - if t.config.JSONPathPlusEnabled() { - t.addToken(PARENT_SELECTOR, 1, "") - } else { - t.addToken(ILLEGAL, 1, "parent selector ^ requires JSONPath Plus mode (enabled by default, disabled with StrictRFC9535)") - } - case ch == '.': - if t.peek() == '.' { - t.addToken(RECURSIVE, 2, "") - t.pos++ - t.column++ - t.illegalWhitespace = true - } else { - t.addToken(CHILD, 1, "") - t.illegalWhitespace = true - } - case ch == ',': - t.addToken(COMMA, 1, "") - case ch == ':': - t.addToken(ARRAY_SLICE, 1, "") - case ch == '?': - t.addToken(FILTER, 1, "") - // Mark current bracket as filter context - if len(t.bracketFilterState) > 0 { - t.bracketFilterState[len(t.bracketFilterState)-1] = true - } - case ch == '(': - t.addToken(PAREN_LEFT, 1, "") - t.stack = append(t.stack, PAREN_LEFT) - case ch == ')': - t.addToken(PAREN_RIGHT, 1, "") - if len(t.stack) > 0 && t.stack[len(t.stack)-1] == PAREN_LEFT { - t.stack = t.stack[:len(t.stack)-1] - } else { - t.addToken(ILLEGAL, 1, "unmatched closing parenthesis") - } - case ch == '[': - t.addToken(BRACKET_LEFT, 1, "") - t.stack = append(t.stack, BRACKET_LEFT) - // Lazy-init bracketFilterState on first bracket - if t.bracketFilterState == nil { - t.bracketFilterState = make([]bool, 0, 4) - } - // Inherit parent filter state: if parent is in filter context, so is this bracket - inFilter := len(t.bracketFilterState) > 0 && t.bracketFilterState[len(t.bracketFilterState)-1] - t.bracketFilterState = append(t.bracketFilterState, inFilter) - case ch == ']': - if len(t.stack) > 0 && t.stack[len(t.stack)-1] == BRACKET_LEFT { - t.addToken(BRACKET_RIGHT, 1, "") - t.stack = t.stack[:len(t.stack)-1] - // Pop bracket filter state - if len(t.bracketFilterState) > 0 { - t.bracketFilterState = t.bracketFilterState[:len(t.bracketFilterState)-1] - } - } else { - t.addToken(ILLEGAL, 1, "unmatched closing bracket") - } - case ch == '&': - if t.peek() == '&' { - t.addToken(AND, 2, "") - t.pos++ - t.column++ - } else { - t.addToken(ILLEGAL, 1, "invalid token") - } - case ch == '|': - if t.peek() == '|' { - t.addToken(OR, 2, "") - t.pos++ - t.column++ - } else { - t.addToken(ILLEGAL, 1, "invalid token") - } - case ch == '!': - if t.peek() == '=' { - // Check for JavaScript !== (strict not-equals) - treat as RFC 9535 != - if t.pos+2 < len(t.input) && t.input[t.pos+2] == '=' { - t.addToken(NE, 3, "") // !== becomes != - t.pos += 2 - t.column += 2 - } else { - t.addToken(NE, 2, "") - t.pos++ - t.column++ - } - } else { - t.addToken(NOT, 1, "") - } - case ch == '=': - if t.peek() == '=' { - // Check for JavaScript === (strict equals) - treat as RFC 9535 == - if t.pos+2 < len(t.input) && t.input[t.pos+2] == '=' { - t.addToken(EQ, 3, "") // === becomes == - t.pos += 2 - t.column += 2 - } else { - t.addToken(EQ, 2, "") - t.pos++ - t.column++ - } - } else if t.peek() == '~' { - t.addToken(MATCHES, 2, "") - t.pos++ - t.column++ - } else { - t.addToken(ILLEGAL, 1, "invalid token") - } - case ch == '>': - if t.peek() == '=' { - t.addToken(GE, 2, "") - t.pos++ - t.column++ - } else { - t.addToken(GT, 1, "") - } - case ch == '<': - if t.peek() == '=' { - t.addToken(LE, 2, "") - t.pos++ - t.column++ - } else { - t.addToken(LT, 1, "") - } - case ch == '"' || ch == '\'': - t.scanString(rune(ch)) - case ch == '-' && isDigit(t.peek()): - fallthrough - case isDigit(ch): - t.scanNumber() - case isLiteralChar(ch): - if t.config.JSONPathPlusEnabled() && t.isInsideBracket() && !t.isInFilterContext() { - t.scanUnquotedBracketString() - } else { - t.scanLiteral() - } - default: - // JSONPath Plus: handle special characters inside brackets as unquoted strings - // e.g., application/vnd.api+json where / and + would otherwise be ILLEGAL - if t.config.JSONPathPlusEnabled() && t.isInsideBracket() && !t.isInFilterContext() && isUnquotedBracketStartChar(ch) { - t.scanUnquotedBracketString() - } else { - t.addToken(ILLEGAL, 1, string(ch)) - } - } - t.pos++ - t.column++ - } - - if len(t.stack) > 0 { - t.addToken(ILLEGAL, 1, fmt.Sprintf("unmatched %s", t.stack[len(t.stack)-1].String())) - } - return t.tokens + for t.pos < len(t.input) { + if !t.illegalWhitespace { + t.skipWhitespace() + } + if t.pos >= len(t.input) { + break + } + + switch ch := t.input[t.pos]; { + case ch == '$': + if config.SpectralCompatibilityEnabled(t.config) && t.spectralDollarMemberCanStartHere() { + t.addToken(STRING, 4, "$ref") + t.pos += 3 + t.column += 3 + } else { + t.addToken(ROOT, 1, "") + } + case ch == '@': + // Check for JSONPath Plus context variables when enabled + handled := false + if t.config.JSONPathPlusEnabled() { + if contextToken, length := t.tryContextVariable(); contextToken != ILLEGAL { + t.addToken(contextToken, length, "") + // Advance past the token (minus 1 because main loop does pos++) + t.pos += length - 1 + t.column += length - 1 + handled = true + } + } + if !handled { + t.addToken(CURRENT, 1, "") + } + case ch == '*': + t.addToken(WILDCARD, 1, "") + case ch == '~': + if t.config.PropertyNameEnabled() { + t.addToken(PROPERTY_NAME, 1, "") + } else { + t.addToken(ILLEGAL, 1, "invalid property name token without config.PropertyNameExtension set to true") + } + case ch == '^': + // JSONPath Plus parent selector + if t.config.JSONPathPlusEnabled() { + t.addToken(PARENT_SELECTOR, 1, "") + } else { + t.addToken(ILLEGAL, 1, "parent selector ^ requires JSONPath Plus mode (enabled by default, disabled with StrictRFC9535)") + } + case ch == '.': + if t.peek() == '.' { + t.addToken(RECURSIVE, 2, "") + t.pos++ + t.column++ + t.illegalWhitespace = true + } else { + t.addToken(CHILD, 1, "") + t.illegalWhitespace = true + } + case ch == ',': + t.addToken(COMMA, 1, "") + case ch == ':': + t.addToken(ARRAY_SLICE, 1, "") + case ch == '?': + t.addToken(FILTER, 1, "") + // Mark current bracket as filter context + if len(t.bracketFilterState) > 0 { + t.bracketFilterState[len(t.bracketFilterState)-1] = true + } + case ch == '(': + t.addToken(PAREN_LEFT, 1, "") + t.stack = append(t.stack, PAREN_LEFT) + case ch == ')': + t.addToken(PAREN_RIGHT, 1, "") + if len(t.stack) > 0 && t.stack[len(t.stack)-1] == PAREN_LEFT { + t.stack = t.stack[:len(t.stack)-1] + } else { + t.addToken(ILLEGAL, 1, "unmatched closing parenthesis") + } + case ch == '[': + t.addToken(BRACKET_LEFT, 1, "") + t.stack = append(t.stack, BRACKET_LEFT) + // Lazy-init bracketFilterState on first bracket + if t.bracketFilterState == nil { + t.bracketFilterState = make([]bool, 0, 4) + } + // Inherit parent filter state: if parent is in filter context, so is this bracket + inFilter := len(t.bracketFilterState) > 0 && t.bracketFilterState[len(t.bracketFilterState)-1] + t.bracketFilterState = append(t.bracketFilterState, inFilter) + case ch == ']': + if len(t.stack) > 0 && t.stack[len(t.stack)-1] == BRACKET_LEFT { + t.addToken(BRACKET_RIGHT, 1, "") + t.stack = t.stack[:len(t.stack)-1] + // Pop bracket filter state + if len(t.bracketFilterState) > 0 { + t.bracketFilterState = t.bracketFilterState[:len(t.bracketFilterState)-1] + } + } else { + t.addToken(ILLEGAL, 1, "unmatched closing bracket") + } + case ch == '&': + if t.peek() == '&' { + t.addToken(AND, 2, "") + t.pos++ + t.column++ + } else { + t.addToken(ILLEGAL, 1, "invalid token") + } + case ch == '|': + if t.peek() == '|' { + t.addToken(OR, 2, "") + t.pos++ + t.column++ + } else { + t.addToken(ILLEGAL, 1, "invalid token") + } + case ch == '!': + if t.peek() == '=' { + if t.pos+2 < len(t.input) && t.input[t.pos+2] == '=' { + if config.SpectralCompatibilityEnabled(t.config) { + t.addToken(STRICT_NE, 3, "") + } else if !t.config.JSONPathPlusEnabled() { + t.addToken(ILLEGAL, 3, "strict JavaScript inequality is not part of RFC 9535") + } else { + t.addToken(NE, 3, "") + } + t.pos += 2 + t.column += 2 + } else { + t.addToken(NE, 2, "") + t.pos++ + t.column++ + } + } else { + t.addToken(NOT, 1, "") + } + case ch == '=': + if t.peek() == '=' { + if t.pos+2 < len(t.input) && t.input[t.pos+2] == '=' { + if config.SpectralCompatibilityEnabled(t.config) { + t.addToken(STRICT_EQ, 3, "") + } else if !t.config.JSONPathPlusEnabled() { + t.addToken(ILLEGAL, 3, "strict JavaScript equality is not part of RFC 9535") + } else { + t.addToken(EQ, 3, "") + } + t.pos += 2 + t.column += 2 + } else { + t.addToken(EQ, 2, "") + t.pos++ + t.column++ + } + } else if t.peek() == '~' { + t.addToken(MATCHES, 2, "") + t.pos++ + t.column++ + } else { + message := "invalid token" + if config.SpectralCompatibilityEnabled(t.config) && t.isInFilterContext() { + message = "assignments are not supported" + } + t.addToken(ILLEGAL, 1, message) + } + case ch == '>': + if t.peek() == '=' { + t.addToken(GE, 2, "") + t.pos++ + t.column++ + } else { + t.addToken(GT, 1, "") + } + case ch == '<': + if t.peek() == '=' { + t.addToken(LE, 2, "") + t.pos++ + t.column++ + } else { + t.addToken(LT, 1, "") + } + case ch == '"' || ch == '\'': + t.scanString(rune(ch)) + case ch == '/' && config.SpectralCompatibilityEnabled(t.config) && t.isInFilterContext() && t.regexCanStartHere(): + t.scanRegex() + case ch == '-' && isDigit(t.peek()): + fallthrough + case isDigit(ch): + t.scanNumber() + case isLiteralChar(ch): + if t.config.JSONPathPlusEnabled() && t.isInsideBracket() && !t.isInFilterContext() { + t.scanUnquotedBracketString() + } else { + t.scanLiteral() + } + default: + // JSONPath Plus: handle special characters inside brackets as unquoted strings + // e.g., application/vnd.api+json where / and + would otherwise be ILLEGAL + if t.config.JSONPathPlusEnabled() && t.isInsideBracket() && !t.isInFilterContext() && isUnquotedBracketStartChar(ch) { + t.scanUnquotedBracketString() + } else { + message := string(ch) + if config.SpectralCompatibilityEnabled(t.config) && t.isInFilterContext() && ch == ';' { + message = "statement separators are not supported" + } else if config.SpectralCompatibilityEnabled(t.config) && t.isInFilterContext() && (ch == '{' || ch == '}') { + message = "function declarations and statement blocks are not supported" + } + t.addToken(ILLEGAL, 1, message) + } + } + t.pos++ + t.column++ + } + + if len(t.stack) > 0 { + t.addToken(ILLEGAL, 1, fmt.Sprintf("unmatched %s", t.stack[len(t.stack)-1].String())) + } + return t.tokens +} + +func (t *Tokenizer) spectralDollarMemberCanStartHere() bool { + if len(t.tokens) == 0 || t.tokens[len(t.tokens)-1].Token != CHILD || !strings.HasPrefix(t.input[t.pos:], "$ref") { + return false + } + end := t.pos + len("$ref") + return end == len(t.input) || !isLiteralChar(t.input[end]) && !isDigit(t.input[end]) +} + +// regexCanStartHere distinguishes a Spectral regex primary from an unquoted +// bracket member. A regex may begin only where an expression or argument is +// expected. +func (t *Tokenizer) regexCanStartHere() bool { + if len(t.tokens) == 0 { + return false + } + switch t.tokens[len(t.tokens)-1].Token { + case PAREN_LEFT, COMMA, AND, OR, NOT, EQ, NE, STRICT_EQ, STRICT_NE, GT, GE, LT, LE: + return true + default: + return false + } +} + +// scanRegex scans a JavaScript-style regex literal without interpreting its +// pattern. Compatibility validation and compilation happen once in the parser. +func (t *Tokenizer) scanRegex() { + start := t.pos + inClass := false + escaped := false + for i := start + 1; i < len(t.input); i++ { + ch := t.input[i] + if ch == '\n' || ch == '\r' { + t.addToken(ILLEGAL, i-start, "unterminated regex literal") + t.pos = i - 1 + t.column += i - start - 1 + return + } + if escaped { + escaped = false + continue + } + if ch == '\\' { + escaped = true + continue + } + switch ch { + case '[': + inClass = true + case ']': + inClass = false + case '/': + if inClass { + continue + } + end := i + 1 + for end < len(t.input) && isLiteralChar(t.input[end]) { + end++ + } + t.addToken(REGEX, end-start, t.input[start:end]) + t.pos = end - 1 + t.column += end - start - 1 + return + } + } + msg := "unterminated regex literal" + if inClass { + msg = "unterminated regex character class" + } + t.addToken(ILLEGAL, len(t.input)-start, msg) + t.pos = len(t.input) - 1 + t.column += len(t.input) - start - 1 } func (t *Tokenizer) addToken(token Token, len int, literal string) { - t.tokens = append(t.tokens, TokenInfo{ - Token: token, - Line: t.line, - Column: t.column, - Len: len, - Literal: literal, - }) - t.illegalWhitespace = false + t.tokens = append(t.tokens, TokenInfo{ + Token: token, + Line: t.line, + Column: t.column, + Len: len, + Literal: literal, + }) + t.illegalWhitespace = false } func (t *Tokenizer) scanString(quote rune) { - start := t.pos + 1 - var literal strings.Builder + start := t.pos + 1 + var literal strings.Builder illegal: - for i := start; i < len(t.input); i++ { - if t.input[i] == byte(quote) { - t.addToken(STRING_LITERAL, len(t.input[start:i])+2, literal.String()) - t.pos = i - t.column += i - start + 1 - return - } - if t.input[i] == '\\' { - i++ - if i >= len(t.input) { - t.addToken(ILLEGAL, len(t.input[start:]), literal.String()) - t.pos = len(t.input) - 1 - t.column = len(t.input) - 1 - return - } - switch t.input[i] { - case 'b': - literal.WriteByte('\b') - case 'f': - literal.WriteByte('\f') - case 'n': - literal.WriteByte('\n') - case 'r': - literal.WriteByte('\n') - case 't': - literal.WriteByte('\t') - case '\'': - if quote != '\'' { - // don't escape it, when we're not in a single quoted string - break illegal - } else { - literal.WriteByte(t.input[i]) - } - case '"': - if quote != '"' { - // don't escape it, when we're not in a single quoted string - break illegal - } else { - literal.WriteByte(t.input[i]) - } - case '\\', '/': - literal.WriteByte(t.input[i]) - default: - break illegal - } - } else { - literal.WriteByte(t.input[i]) - } - } - t.addToken(ILLEGAL, len(t.input[start:]), literal.String()) - t.pos = len(t.input) - 1 - t.column = len(t.input) - 1 + for i := start; i < len(t.input); i++ { + if t.input[i] == byte(quote) { + t.addToken(STRING_LITERAL, len(t.input[start:i])+2, literal.String()) + t.pos = i + t.column += i - start + 1 + return + } + if t.input[i] == '\\' { + i++ + if i >= len(t.input) { + t.addToken(ILLEGAL, len(t.input[start:]), literal.String()) + t.pos = len(t.input) - 1 + t.column = len(t.input) - 1 + return + } + switch t.input[i] { + case 'b': + literal.WriteByte('\b') + case 'f': + literal.WriteByte('\f') + case 'n': + literal.WriteByte('\n') + case 'r': + literal.WriteByte('\n') + case 't': + literal.WriteByte('\t') + case '\'': + if quote != '\'' { + // don't escape it, when we're not in a single quoted string + break illegal + } else { + literal.WriteByte(t.input[i]) + } + case '"': + if quote != '"' { + // don't escape it, when we're not in a single quoted string + break illegal + } else { + literal.WriteByte(t.input[i]) + } + case '\\', '/': + literal.WriteByte(t.input[i]) + default: + break illegal + } + } else { + literal.WriteByte(t.input[i]) + } + } + t.addToken(ILLEGAL, len(t.input[start:]), literal.String()) + t.pos = len(t.input) - 1 + t.column = len(t.input) - 1 } func (t *Tokenizer) scanNumber() { - start := t.pos - tokenType := INTEGER - dotSeen := false - exponentSeen := false - - for i := start; i < len(t.input); i++ { - if i == start && t.input[i] == '-' { - continue - } - - if t.input[i] == '.' { - if dotSeen || exponentSeen { - t.addToken(ILLEGAL, len(t.input[start:i]), t.input[start:i]) - t.pos = i - t.column += i - start - return - } - // Peek ahead: if '.' is NOT followed by a digit, it's a CHILD separator, - // not a decimal point. Stop the number scan here. - if i+1 >= len(t.input) || !isDigit(t.input[i+1]) { - literal := t.input[start:i] - t.addToken(tokenType, len(literal), literal) - t.pos = i - 1 - t.column += i - start - 1 - return - } - tokenType = FLOAT - dotSeen = true - continue - } - - if t.input[i] == 'e' || t.input[i] == 'E' { - if exponentSeen || (len(t.input) > 0 && t.input[i-1] == '.') { - t.addToken(ILLEGAL, len(t.input[start:i]), t.input[start:i]) - t.pos = i - t.column += i - start - return - } - tokenType = FLOAT - exponentSeen = true - if i+1 < len(t.input) && (t.input[i+1] == '+' || t.input[i+1] == '-') { - i++ - } - continue - } - - if !isDigit(t.input[i]) { - literal := t.input[start:i] - // check for legal numbers - _, err := strconv.ParseFloat(literal, 64) - if err != nil { - tokenType = ILLEGAL - } - // conformance spec - if len(literal) > 1 && literal[0] == '0' && !dotSeen { - // no leading zero - tokenType = ILLEGAL - } else if len(literal) > 2 && literal[0] == '-' && literal[1] == '0' && !dotSeen { - // no negative zero without fraction - tokenType = ILLEGAL - } else if len(literal) > 0 && literal[len(literal)-1] == '.' { - // no trailing dot - tokenType = ILLEGAL - } else if literal[len(literal)-1] == 'e' || literal[len(literal)-1] == 'E' { - // no exponent - tokenType = ILLEGAL - } - - t.addToken(tokenType, len(literal), literal) - t.pos = i - 1 - t.column += i - start - 1 - return - } - } - - if exponentSeen && !isDigit(t.input[len(t.input)-1]) { - t.addToken(ILLEGAL, len(t.input[start:]), t.input[start:]) - t.pos = len(t.input) - 1 - t.column = len(t.input) - 1 - return - } - - literal := t.input[start:] - t.addToken(tokenType, len(literal), literal) - t.pos = len(t.input) - 1 - t.column = len(t.input) - 1 + start := t.pos + tokenType := INTEGER + dotSeen := false + exponentSeen := false + + for i := start; i < len(t.input); i++ { + if i == start && t.input[i] == '-' { + continue + } + + if t.input[i] == '.' { + if dotSeen || exponentSeen { + t.addToken(ILLEGAL, len(t.input[start:i]), t.input[start:i]) + t.pos = i + t.column += i - start + return + } + // Peek ahead: if '.' is NOT followed by a digit, it's a CHILD separator, + // not a decimal point. Stop the number scan here. + if i+1 >= len(t.input) || !isDigit(t.input[i+1]) { + literal := t.input[start:i] + t.addToken(tokenType, len(literal), literal) + t.pos = i - 1 + t.column += i - start - 1 + return + } + tokenType = FLOAT + dotSeen = true + continue + } + + if t.input[i] == 'e' || t.input[i] == 'E' { + if exponentSeen || (len(t.input) > 0 && t.input[i-1] == '.') { + t.addToken(ILLEGAL, len(t.input[start:i]), t.input[start:i]) + t.pos = i + t.column += i - start + return + } + tokenType = FLOAT + exponentSeen = true + if i+1 < len(t.input) && (t.input[i+1] == '+' || t.input[i+1] == '-') { + i++ + } + continue + } + + if !isDigit(t.input[i]) { + literal := t.input[start:i] + // check for legal numbers + _, err := strconv.ParseFloat(literal, 64) + if err != nil { + tokenType = ILLEGAL + } + // conformance spec + if len(literal) > 1 && literal[0] == '0' && !dotSeen { + // no leading zero + tokenType = ILLEGAL + } else if len(literal) > 2 && literal[0] == '-' && literal[1] == '0' && !dotSeen { + // no negative zero without fraction + tokenType = ILLEGAL + } else if len(literal) > 0 && literal[len(literal)-1] == '.' { + // no trailing dot + tokenType = ILLEGAL + } else if literal[len(literal)-1] == 'e' || literal[len(literal)-1] == 'E' { + // no exponent + tokenType = ILLEGAL + } + + t.addToken(tokenType, len(literal), literal) + t.pos = i - 1 + t.column += i - start - 1 + return + } + } + + if exponentSeen && !isDigit(t.input[len(t.input)-1]) { + t.addToken(ILLEGAL, len(t.input[start:]), t.input[start:]) + t.pos = len(t.input) - 1 + t.column = len(t.input) - 1 + return + } + + literal := t.input[start:] + t.addToken(tokenType, len(literal), literal) + t.pos = len(t.input) - 1 + t.column = len(t.input) - 1 } func (t *Tokenizer) scanLiteral() { - start := t.pos - for i := start; i < len(t.input); i++ { - if !isLiteralChar(t.input[i]) && !isDigit(t.input[i]) { - literal := t.input[start:i] - switch literal { - case "true": - t.addToken(TRUE, len(literal), literal) - case "false": - t.addToken(FALSE, len(literal), literal) - case "null": - t.addToken(NULL, len(literal), literal) - default: - // Only treat as FUNCTION if it's a function name AND followed by '(' - // Otherwise it's a property name (STRING) - if isFunctionName(literal) && i < len(t.input) && t.input[i] == '(' { - t.addToken(FUNCTION, len(literal), literal) - t.illegalWhitespace = true - } else { - t.addToken(STRING, len(literal), literal) - } - } - t.pos = i - 1 - t.column += i - start - 1 - return - } - } - literal := t.input[start:] - switch literal { - case "true": - t.addToken(TRUE, len(literal), literal) - case "false": - t.addToken(FALSE, len(literal), literal) - case "null": - t.addToken(NULL, len(literal), literal) - default: - t.addToken(STRING, len(literal), literal) - } - t.pos = len(t.input) - 1 - t.column = len(t.input) - 1 + start := t.pos + for i := start; i < len(t.input); i++ { + if !isLiteralChar(t.input[i]) && !isDigit(t.input[i]) { + literal := t.input[start:i] + switch literal { + case "true": + t.addToken(TRUE, len(literal), literal) + case "false": + t.addToken(FALSE, len(literal), literal) + case "null": + t.addToken(NULL, len(literal), literal) + default: + // Only treat as FUNCTION if it's a function name AND followed by '(' + // Otherwise it's a property name (STRING) + if isFunctionName(literal) && i < len(t.input) && t.input[i] == '(' { + t.addToken(FUNCTION, len(literal), literal) + t.illegalWhitespace = true + } else { + t.addToken(STRING, len(literal), literal) + } + } + t.pos = i - 1 + t.column += i - start - 1 + return + } + } + literal := t.input[start:] + switch literal { + case "true": + t.addToken(TRUE, len(literal), literal) + case "false": + t.addToken(FALSE, len(literal), literal) + case "null": + t.addToken(NULL, len(literal), literal) + default: + t.addToken(STRING, len(literal), literal) + } + t.pos = len(t.input) - 1 + t.column = len(t.input) - 1 } func isFunctionName(literal string) bool { - switch literal { - // RFC 9535 standard functions - case "length", "count", "match", "search", "value": - return true - // JSONPath Plus type selector functions - case "isNull", "isBoolean", "isNumber", "isString", "isArray", "isObject", "isInteger": - return true - } - return false + switch literal { + // RFC 9535 standard functions + case "length", "count", "match", "search", "value": + return true + // JSONPath Plus type selector functions + case "isNull", "isBoolean", "isNumber", "isString", "isArray", "isObject", "isInteger": + return true + } + return false } func (t *Tokenizer) skipWhitespace() { - // S = *B ; optional blank space - // B = %x20 / ; Space - // %x09 / ; Horizontal tab - // %x0A / ; Line feed or New line - // %x0D ; Carriage return - for len(t.tokens) > 0 && t.pos+1 < len(t.input) { - ch := t.input[t.pos] - if ch == '\n' { - t.line++ - t.pos++ - t.column = 0 - } else if !isSpace(ch) { - break - } else { - t.pos++ - t.column++ - } - } + // S = *B ; optional blank space + // B = %x20 / ; Space + // %x09 / ; Horizontal tab + // %x0A / ; Line feed or New line + // %x0D ; Carriage return + for len(t.tokens) > 0 && t.pos+1 < len(t.input) { + ch := t.input[t.pos] + if ch == '\n' { + t.line++ + t.pos++ + t.column = 0 + } else if !isSpace(ch) { + break + } else { + t.pos++ + t.column++ + } + } } func (t *Tokenizer) peek() byte { - if t.pos+1 < len(t.input) { - return t.input[t.pos+1] - } - return 0 + if t.pos+1 < len(t.input) { + return t.input[t.pos+1] + } + return 0 } // isInsideBracket returns true if the tokenizer is currently inside a bracket pair. // Nil-safe: returns false when bracketFilterState has not been initialized. func (t *Tokenizer) isInsideBracket() bool { - return len(t.bracketFilterState) > 0 + return len(t.bracketFilterState) > 0 } // isInFilterContext returns true if the current bracket context is a filter expression. func (t *Tokenizer) isInFilterContext() bool { - return len(t.bracketFilterState) > 0 && t.bracketFilterState[len(t.bracketFilterState)-1] + return len(t.bracketFilterState) > 0 && t.bracketFilterState[len(t.bracketFilterState)-1] } // scanUnquotedBracketString scans an unquoted string inside brackets (JSONPath Plus extension). // Handles values like: get, post, application/vnd.api+json, default, etc. // Zero-allocation: uses direct substring of t.input, matching scanLiteral's pattern. func (t *Tokenizer) scanUnquotedBracketString() { - start := t.pos - end := start - for end < len(t.input) { - ch := t.input[end] - if ch == ']' || ch == ',' || ch == '[' || ch == '\'' || ch == '"' || ch == '?' { - break - } - if isSpace(ch) { - break - } - end++ - } - // Trim trailing whitespace by adjusting end index - trimEnd := end - for trimEnd > start && isSpace(t.input[trimEnd-1]) { - trimEnd-- - } - if trimEnd <= start { - t.addToken(ILLEGAL, 1, string(t.input[t.pos])) - return - } - literal := t.input[start:trimEnd] - t.addToken(STRING_LITERAL, len(literal), literal) - t.pos = end - 1 - t.column += end - start - 1 + start := t.pos + end := start + for end < len(t.input) { + ch := t.input[end] + if ch == ']' || ch == ',' || ch == '[' || ch == '\'' || ch == '"' || ch == '?' { + break + } + if isSpace(ch) { + break + } + end++ + } + // Trim trailing whitespace by adjusting end index + trimEnd := end + for trimEnd > start && isSpace(t.input[trimEnd-1]) { + trimEnd-- + } + if trimEnd <= start { + t.addToken(ILLEGAL, 1, string(t.input[t.pos])) + return + } + literal := t.input[start:trimEnd] + t.addToken(STRING_LITERAL, len(literal), literal) + t.pos = end - 1 + t.column += end - start - 1 } func isDigit(ch byte) bool { - return '0' <= ch && ch <= '9' + return '0' <= ch && ch <= '9' } func isLiteralChar(ch byte) bool { - // allow unicode characters - return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 + // allow unicode characters + return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 } func isSpace(ch byte) bool { - return ch == ' ' || ch == '\t' || ch == '\r' + return ch == ' ' || ch == '\t' || ch == '\r' } // isUnquotedBracketStartChar returns true if ch can start an unquoted bracket string @@ -922,50 +1041,50 @@ func isSpace(ch byte) bool { // Characters like + that appear mid-value (e.g., application/vnd.api+json) are handled // by scanUnquotedBracketString which scans until a delimiter is found. func isUnquotedBracketStartChar(ch byte) bool { - return ch == '/' || ch == '%' || ch == '#' + return ch == '/' || ch == '%' || ch == '#' } // contextVariableKeywords maps context variable names to their token types. // These are JSONPath Plus extensions for accessing filter context. var contextVariableKeywords = map[string]Token{ - "property": CONTEXT_PROPERTY, - "root": CONTEXT_ROOT, - "parent": CONTEXT_PARENT, - "parentProperty": CONTEXT_PARENT_PROPERTY, - "path": CONTEXT_PATH, - "index": CONTEXT_INDEX, + "property": CONTEXT_PROPERTY, + "root": CONTEXT_ROOT, + "parent": CONTEXT_PARENT, + "parentProperty": CONTEXT_PARENT_PROPERTY, + "path": CONTEXT_PATH, + "index": CONTEXT_INDEX, } // tryContextVariable checks if the current position starts a context variable. // It returns the token type and total length (including @) if found, or ILLEGAL and 0 if not. // Context variables are @property, @root, @parent, @parentProperty, @path, @index. func (t *Tokenizer) tryContextVariable() (Token, int) { - // Must start with @ - if t.pos >= len(t.input) || t.input[t.pos] != '@' { - return ILLEGAL, 0 - } - - // Extract the word following @ - start := t.pos + 1 - if start >= len(t.input) { - return ILLEGAL, 0 - } - - // Find the end of the identifier - end := start - for end < len(t.input) && isLiteralChar(t.input[end]) { - end++ - } - - if end == start { - return ILLEGAL, 0 - } - - keyword := t.input[start:end] - if tok, ok := contextVariableKeywords[keyword]; ok { - // Return the token and total length including @ - return tok, end - t.pos - } - - return ILLEGAL, 0 + // Must start with @ + if t.pos >= len(t.input) || t.input[t.pos] != '@' { + return ILLEGAL, 0 + } + + // Extract the word following @ + start := t.pos + 1 + if start >= len(t.input) { + return ILLEGAL, 0 + } + + // Find the end of the identifier + end := start + for end < len(t.input) && isLiteralChar(t.input[end]) { + end++ + } + + if end == start { + return ILLEGAL, 0 + } + + keyword := t.input[start:end] + if tok, ok := contextVariableKeywords[keyword]; ok { + // Return the token and total length including @ + return tok, end - t.pos + } + + return ILLEGAL, 0 } diff --git a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/yaml_query.go b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/yaml_query.go index 855f9030b19..5c8096343e3 100644 --- a/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/yaml_query.go +++ b/vendor/github.com/pb33f/jsonpath/pkg/jsonpath/yaml_query.go @@ -10,8 +10,6 @@ type Evaluator interface { Query(current *yaml.Node, root *yaml.Node) []*yaml.Node } -// index is the basic interface for tracking property key relationships. -// This is kept for backward compatibility; FilterContext extends this. type index interface { setPropertyKey(key *yaml.Node, value *yaml.Node) getPropertyKey(key *yaml.Node) *yaml.Node @@ -21,7 +19,7 @@ type index interface { type _index struct { propertyKeys map[*yaml.Node]*yaml.Node - parentNodes map[*yaml.Node]*yaml.Node // Maps child nodes to their parent nodes + parentNodes map[*yaml.Node]*yaml.Node } func (i *_index) setPropertyKey(key *yaml.Node, value *yaml.Node) { @@ -50,7 +48,6 @@ func (i *_index) getParentNode(child *yaml.Node) *yaml.Node { return nil } -// jsonPathAST can be Evaluated var _ Evaluator = jsonPathAST{} func (q jsonPathAST) Query(current *yaml.Node, root *yaml.Node) []*yaml.Node { @@ -65,7 +62,6 @@ func (q jsonPathAST) Query(current *yaml.Node, root *yaml.Node) []*yaml.Node { ctx = NewFilterContext(root) } - // Only enable parent tracking if the query uses ^ or @parent if q.hasParentReferences() { ctx.EnableParentTracking() } @@ -102,7 +98,27 @@ func (q jsonPathAST) Query(current *yaml.Node, root *yaml.Node) []*yaml.Node { return result } -// hasParentReferences checks if the AST uses parent selectors (^) or @parent context variable +func (q jsonPathAST) isSingular() bool { + for _, seg := range q.segments { + if !seg.IsSingular() { + return false + } + } + return true +} + +func (q jsonPathAST) getSegmentInfo() ([]SegmentInfo, error) { + result := make([]SegmentInfo, 0, len(q.segments)) + for _, seg := range q.segments { + info, err := seg.getSegmentInfo() + if err != nil { + return nil, err + } + result = append(result, info...) + } + return result, nil +} + func (q jsonPathAST) hasParentReferences() bool { for _, seg := range q.segments { if seg.hasParentReferences() { @@ -135,13 +151,16 @@ func (s *innerSegment) hasParentReferences() bool { } func (s *selector) hasParentReferences() bool { - if s.filter != nil && s.filter.hasParentReferences() { + if s.filter.present() && s.filter.hasParentReferences() { return true } return false } func (f *filterSelector) hasParentReferences() bool { + if f.spectralExpression != nil { + return f.spectralExpression.usage.parent + } if f.expression != nil { return f.expression.hasParentReferences() } @@ -218,7 +237,6 @@ func (e *testExpr) hasParentReferences() bool { return false } -// parentTrackingEnabled checks if parent tracking is enabled in the index func parentTrackingEnabled(idx index) bool { if fc, ok := idx.(FilterContext); ok { return fc.ParentTrackingEnabled() @@ -245,540 +263,566 @@ func enableIndexTracking(ctx FilterContext) { } func (s segment) Query(idx index, value *yaml.Node, root *yaml.Node) []*yaml.Node { - switch s.kind { - case segmentKindChild: - return s.child.Query(idx, value, root) - case segmentKindDescendant: - // run the inner segment against this node - var result = []*yaml.Node{} - descendApply(value, func(child *yaml.Node) { - result = append(result, s.descendant.Query(idx, child, root)...) - }) - // make children unique by pointer value - result = unique(result) - return result - case segmentKindProperyName: - found := idx.getPropertyKey(value) - if found != nil { - return []*yaml.Node{found} - } - return []*yaml.Node{} - case segmentKindParent: - // JSONPath Plus parent selector: ^ returns the parent of the current node - parent := idx.getParentNode(value) - if parent != nil { - return []*yaml.Node{parent} - } - // No parent found (could be root node) - return []*yaml.Node{} - } - panic("no segment type") + switch s.kind { + case segmentKindChild: + return s.child.Query(idx, value, root) + case segmentKindDescendant: + var result = []*yaml.Node{} + descendApply(value, func(child *yaml.Node) { + result = append(result, s.descendant.Query(idx, child, root)...) + }) + result = unique(result) + return result + case segmentKindProperyName: + found := idx.getPropertyKey(value) + if found != nil { + return []*yaml.Node{found} + } + return []*yaml.Node{} + case segmentKindRecursivePropertyName: + return recursivePropertyNames(idx, value) + case segmentKindParent: + parent := idx.getParentNode(value) + if parent != nil { + return []*yaml.Node{parent} + } + return []*yaml.Node{} + } + panic("no segment type") +} + +func recursivePropertyNames(idx index, value *yaml.Node) []*yaml.Node { + var result []*yaml.Node + if current := idx.getPropertyKey(value); current != nil { + result = append(result, current) + } + var walk func(*yaml.Node) + walk = func(node *yaml.Node) { + if node == nil { + return + } + switch node.Kind { + case yaml.MappingNode: + for i := 0; i+1 < len(node.Content); i += 2 { + key, child := node.Content[i], node.Content[i+1] + idx.setPropertyKey(key, node) + idx.setPropertyKey(child, key) + result = append(result, key) + walk(child) + } + case yaml.SequenceNode: + for _, child := range node.Content { + walk(child) + } + } + } + walk(value) + return result } func unique(nodes []*yaml.Node) []*yaml.Node { - // stably returns a new slice containing only the unique elements from nodes - res := make([]*yaml.Node, 0) - seen := make(map[*yaml.Node]bool) - for _, node := range nodes { - if _, ok := seen[node]; !ok { - res = append(res, node) - seen[node] = true - } - } - return res + res := make([]*yaml.Node, 0) + seen := make(map[*yaml.Node]bool) + for _, node := range nodes { + if _, ok := seen[node]; !ok { + res = append(res, node) + seen[node] = true + } + } + return res } func (s innerSegment) Query(idx index, value *yaml.Node, root *yaml.Node) []*yaml.Node { - result := []*yaml.Node{} - trackParents := parentTrackingEnabled(idx) - - switch s.kind { - case segmentDotWildcard: - // Check for inherited pending segment from previous wildcard/slice - var inheritedPending string - if fc, ok := idx.(FilterContext); ok { - inheritedPending = fc.GetAndClearPendingPathSegment(value) - } - - switch value.Kind { - case yaml.MappingNode: - for i, child := range value.Content { - if i%2 == 1 { - keyNode := value.Content[i-1] - idx.setPropertyKey(keyNode, value) - idx.setPropertyKey(child, keyNode) - if trackParents { - idx.setParentNode(child, value) - } - // Track pending path segment and property name for this node - if fc, ok := idx.(FilterContext); ok { - thisSegment := normalizePathSegment(keyNode.Value) - fc.SetPendingPathSegment(child, inheritedPending+thisSegment) - fc.SetPendingPropertyName(child, keyNode.Value) // For @parentProperty - } - result = append(result, child) - } - } - case yaml.SequenceNode: - for i, child := range value.Content { - if trackParents { - idx.setParentNode(child, value) - } - // Track pending path segment and property name for this node - if fc, ok := idx.(FilterContext); ok { - thisSegment := normalizeIndexSegment(i) - fc.SetPendingPathSegment(child, inheritedPending+thisSegment) - fc.SetPendingPropertyName(child, strconv.Itoa(i)) // For @parentProperty (array index as string) - } - result = append(result, child) - } - } - return result - case segmentDotMemberName: - if value.Kind == yaml.MappingNode { - // Check for inherited pending segment from wildcard/slice - var inheritedPending string - if fc, ok := idx.(FilterContext); ok { - inheritedPending = fc.GetAndClearPendingPathSegment(value) - } - - for i := 0; i < len(value.Content); i += 2 { - key := value.Content[i] - val := value.Content[i+1] - - if key.Value == s.dotName { - idx.setPropertyKey(key, value) - idx.setPropertyKey(val, key) - if trackParents { - idx.setParentNode(val, value) - } - if fc, ok := idx.(FilterContext); ok { - thisSegment := normalizePathSegment(key.Value) - if inheritedPending != "" { - // Propagate combined pending to result for later consumption - fc.SetPendingPathSegment(val, inheritedPending+thisSegment) - } else { - // No wildcard ancestry - push directly to path - fc.PushPathSegment(thisSegment) - } - fc.SetPropertyName(key.Value) - } - result = append(result, val) - break - } - } - } - - case segmentLongHand: - for _, selector := range s.selectors { - result = append(result, selector.Query(idx, value, root)...) - } - default: - panic("unknown child segment kind") - } - - return result + result := []*yaml.Node{} + trackParents := parentTrackingEnabled(idx) + + switch s.kind { + case segmentDotWildcard: + var inheritedPending string + if fc, ok := idx.(FilterContext); ok { + inheritedPending = fc.GetAndClearPendingPathSegment(value) + } + + switch value.Kind { + case yaml.MappingNode: + for i, child := range value.Content { + if i%2 == 1 { + keyNode := value.Content[i-1] + idx.setPropertyKey(keyNode, value) + idx.setPropertyKey(child, keyNode) + if trackParents { + idx.setParentNode(child, value) + } + if fc, ok := idx.(FilterContext); ok { + thisSegment := normalizePathSegment(keyNode.Value) + fc.SetPendingPathSegment(child, inheritedPending+thisSegment) + fc.SetPendingPropertyName(child, keyNode.Value) + } + result = append(result, child) + } + } + case yaml.SequenceNode: + for i, child := range value.Content { + if trackParents { + idx.setParentNode(child, value) + } + if fc, ok := idx.(FilterContext); ok { + thisSegment := normalizeIndexSegment(i) + fc.SetPendingPathSegment(child, inheritedPending+thisSegment) + fc.SetPendingPropertyName(child, strconv.Itoa(i)) + } + result = append(result, child) + } + } + return result + case segmentDotMemberName: + if value.Kind == yaml.MappingNode { + var inheritedPending string + if fc, ok := idx.(FilterContext); ok { + inheritedPending = fc.GetAndClearPendingPathSegment(value) + } + + for i := 0; i < len(value.Content); i += 2 { + key := value.Content[i] + val := value.Content[i+1] + + if key.Value == s.dotName { + idx.setPropertyKey(key, value) + idx.setPropertyKey(val, key) + if trackParents { + idx.setParentNode(val, value) + } + if fc, ok := idx.(FilterContext); ok { + thisSegment := normalizePathSegment(key.Value) + if inheritedPending != "" { + fc.SetPendingPathSegment(val, inheritedPending+thisSegment) + } else { + fc.PushPathSegment(thisSegment) + } + fc.SetPropertyName(key.Value) + } + result = append(result, val) + break + } + } + } + case segmentLongHand: + for _, selector := range s.selectors { + result = append(result, selector.Query(idx, value, root)...) + } + default: + panic("unknown child segment kind") + } + + return result } func (s selector) Query(idx index, value *yaml.Node, root *yaml.Node) []*yaml.Node { - trackParents := parentTrackingEnabled(idx) - fc, hasFc := idx.(FilterContext) - - switch s.kind { - case selectorSubKindName: - if value.Kind != yaml.MappingNode { - return nil - } - var inheritedPending string - if hasFc { - inheritedPending = fc.GetAndClearPendingPathSegment(value) - } - - var key string - for i, child := range value.Content { - if i%2 == 0 { - key = child.Value - continue - } - if key == s.name && i%2 == 1 { - idx.setPropertyKey(value.Content[i], value.Content[i-1]) - idx.setPropertyKey(value.Content[i-1], value) - if trackParents { - idx.setParentNode(child, value) - } - if hasFc { - thisSegment := normalizePathSegment(key) - if inheritedPending != "" { - fc.SetPendingPathSegment(child, inheritedPending+thisSegment) - } else { - fc.PushPathSegment(thisSegment) - } - fc.SetPropertyName(key) - } - return []*yaml.Node{child} - } - } - case selectorSubKindArrayIndex: - if s.jsonPathPlus && value.Kind == yaml.MappingNode && s.index >= 0 { - // JSONPath Plus fallback: treat integer index as a string key lookup on mapping nodes. - // This handles YAML mappings with numeric keys like $.responses[200]. - keyStr := strconv.FormatInt(s.index, 10) - for i := 0; i < len(value.Content); i += 2 { - if value.Content[i].Value == keyStr { - child := value.Content[i+1] - idx.setPropertyKey(value.Content[i], value) - idx.setPropertyKey(child, value.Content[i]) - if trackParents { - idx.setParentNode(child, value) - } - return []*yaml.Node{child} - } - } - return nil - } - if value.Kind != yaml.SequenceNode { - return nil - } - if s.index >= int64(len(value.Content)) || s.index < -int64(len(value.Content)) { - return nil - } - var inheritedPending string - if hasFc { - inheritedPending = fc.GetAndClearPendingPathSegment(value) - } - - var child *yaml.Node - var actualIndex int - if s.index < 0 { - actualIndex = int(int64(len(value.Content)) + s.index) - child = value.Content[actualIndex] - } else { - actualIndex = int(s.index) - child = value.Content[s.index] - } - if trackParents { - idx.setParentNode(child, value) - } - if hasFc { - thisSegment := normalizeIndexSegment(actualIndex) - if inheritedPending != "" { - fc.SetPendingPathSegment(child, inheritedPending+thisSegment) - } else { - fc.PushPathSegment(thisSegment) - } - } - return []*yaml.Node{child} - case selectorSubKindWildcard: - var inheritedPending string - if hasFc { - inheritedPending = fc.GetAndClearPendingPathSegment(value) - } - - if value.Kind == yaml.SequenceNode { - for i, child := range value.Content { - if trackParents { - idx.setParentNode(child, value) - } - if hasFc { - thisSegment := normalizeIndexSegment(i) - fc.SetPendingPathSegment(child, inheritedPending+thisSegment) - fc.SetPendingPropertyName(child, strconv.Itoa(i)) - } - } - return value.Content - } else if value.Kind == yaml.MappingNode { - var result []*yaml.Node - for i, child := range value.Content { - if i%2 == 1 { - keyNode := value.Content[i-1] - idx.setPropertyKey(keyNode, value) - idx.setPropertyKey(child, keyNode) - if trackParents { - idx.setParentNode(child, value) - } - if hasFc { - thisSegment := normalizePathSegment(keyNode.Value) - fc.SetPendingPathSegment(child, inheritedPending+thisSegment) - fc.SetPendingPropertyName(child, keyNode.Value) - } - result = append(result, child) - } - } - return result - } - return nil - case selectorSubKindArraySlice: - if value.Kind != yaml.SequenceNode { - return nil - } - if len(value.Content) == 0 { - return nil - } - var inheritedPending string - if hasFc { - inheritedPending = fc.GetAndClearPendingPathSegment(value) - } - - step := int64(1) - if s.slice.step != nil { - step = *s.slice.step - } - if step == 0 { - return nil - } - - start, end := s.slice.start, s.slice.end - lower, upper := bounds(start, end, step, int64(len(value.Content))) - - var result []*yaml.Node - if step > 0 { - for i := lower; i < upper; i += step { - child := value.Content[i] - if trackParents { - idx.setParentNode(child, value) - } - if hasFc { - thisSegment := normalizeIndexSegment(int(i)) - fc.SetPendingPathSegment(child, inheritedPending+thisSegment) - fc.SetPendingPropertyName(child, strconv.Itoa(int(i))) - } - result = append(result, child) - } - } else { - for i := upper; i > lower; i += step { - child := value.Content[i] - if trackParents { - idx.setParentNode(child, value) - } - if hasFc { - thisSegment := normalizeIndexSegment(int(i)) - fc.SetPendingPathSegment(child, inheritedPending+thisSegment) - fc.SetPendingPropertyName(child, strconv.Itoa(int(i))) - } - result = append(result, child) - } - } - - return result - case selectorSubKindFilter: - var result []*yaml.Node - var parentPropName string - var pushedPendingSegment bool - if hasFc { - if pendingPropName := fc.GetAndClearPendingPropertyName(value); pendingPropName != "" { - parentPropName = pendingPropName - } else { - parentPropName = fc.PropertyName() - } - if pendingSeg := fc.GetAndClearPendingPathSegment(value); pendingSeg != "" { - fc.PushPathSegment(pendingSeg) - pushedPendingSegment = true - } - } - switch value.Kind { - case yaml.MappingNode: - for i := 1; i < len(value.Content); i += 2 { - keyNode := value.Content[i-1] - valueNode := value.Content[i] - idx.setPropertyKey(keyNode, value) - idx.setPropertyKey(valueNode, keyNode) - if trackParents { - idx.setParentNode(valueNode, value) - } - - if hasFc { - fc.SetParentPropertyName(parentPropName) - fc.SetPropertyName(keyNode.Value) - fc.SetParent(value) - fc.SetIndex(-1) - fc.PushPathSegment(normalizePathSegment(keyNode.Value)) - } - - if s.filter.Matches(idx, valueNode, root) { - result = append(result, valueNode) - } - - if hasFc { - fc.PopPathSegment() - } - } - case yaml.SequenceNode: - for i, child := range value.Content { - if trackParents { - idx.setParentNode(child, value) - } - - if hasFc { - fc.SetParentPropertyName(parentPropName) - fc.SetPropertyName(strconv.Itoa(i)) - fc.SetParent(value) - fc.SetIndex(i) - fc.PushPathSegment(normalizeIndexSegment(i)) - } - - if s.filter.Matches(idx, child, root) { - result = append(result, child) - } - - if hasFc { - fc.PopPathSegment() - } - } - } - if pushedPendingSegment { - if hasFc { - fc.PopPathSegment() - } - } - return result - } - return nil + trackParents := parentTrackingEnabled(idx) + fc, hasFc := idx.(FilterContext) + + switch s.kind { + case selectorSubKindName: + if value.Kind != yaml.MappingNode { + return nil + } + var inheritedPending string + if hasFc { + inheritedPending = fc.GetAndClearPendingPathSegment(value) + } + + var key string + for i, child := range value.Content { + if i%2 == 0 { + key = child.Value + continue + } + if key == s.name && i%2 == 1 { + idx.setPropertyKey(value.Content[i], value.Content[i-1]) + idx.setPropertyKey(value.Content[i-1], value) + if trackParents { + idx.setParentNode(child, value) + } + if hasFc { + thisSegment := normalizePathSegment(key) + if inheritedPending != "" { + fc.SetPendingPathSegment(child, inheritedPending+thisSegment) + } else { + fc.PushPathSegment(thisSegment) + } + fc.SetPropertyName(key) + } + return []*yaml.Node{child} + } + } + case selectorSubKindArrayIndex: + if s.jsonPathPlus && value.Kind == yaml.MappingNode && s.index >= 0 { + keyStr := strconv.FormatInt(s.index, 10) + for i := 0; i < len(value.Content); i += 2 { + if value.Content[i].Value == keyStr { + child := value.Content[i+1] + idx.setPropertyKey(value.Content[i], value) + idx.setPropertyKey(child, value.Content[i]) + if trackParents { + idx.setParentNode(child, value) + } + if hasFc && s.spectral { + fc.SetPropertyName(keyStr) + } + return []*yaml.Node{child} + } + } + return nil + } + if value.Kind != yaml.SequenceNode { + return nil + } + if s.index >= int64(len(value.Content)) || s.index < -int64(len(value.Content)) { + return nil + } + var inheritedPending string + if hasFc { + inheritedPending = fc.GetAndClearPendingPathSegment(value) + } + + var child *yaml.Node + var actualIndex int + if s.index < 0 { + actualIndex = int(int64(len(value.Content)) + s.index) + child = value.Content[actualIndex] + } else { + actualIndex = int(s.index) + child = value.Content[s.index] + } + if trackParents { + idx.setParentNode(child, value) + } + if hasFc { + thisSegment := normalizeIndexSegment(actualIndex) + if inheritedPending != "" { + fc.SetPendingPathSegment(child, inheritedPending+thisSegment) + } else { + fc.PushPathSegment(thisSegment) + } + if s.spectral { + fc.SetPropertyName(strconv.Itoa(actualIndex)) + } + } + return []*yaml.Node{child} + case selectorSubKindWildcard: + var inheritedPending string + if hasFc { + inheritedPending = fc.GetAndClearPendingPathSegment(value) + } + + if value.Kind == yaml.SequenceNode { + for i, child := range value.Content { + if trackParents { + idx.setParentNode(child, value) + } + if hasFc { + thisSegment := normalizeIndexSegment(i) + fc.SetPendingPathSegment(child, inheritedPending+thisSegment) + fc.SetPendingPropertyName(child, strconv.Itoa(i)) + } + } + return value.Content + } else if value.Kind == yaml.MappingNode { + var result []*yaml.Node + for i, child := range value.Content { + if i%2 == 1 { + keyNode := value.Content[i-1] + idx.setPropertyKey(keyNode, value) + idx.setPropertyKey(child, keyNode) + if trackParents { + idx.setParentNode(child, value) + } + if hasFc { + thisSegment := normalizePathSegment(keyNode.Value) + fc.SetPendingPathSegment(child, inheritedPending+thisSegment) + fc.SetPendingPropertyName(child, keyNode.Value) + } + result = append(result, child) + } + } + return result + } + return nil + case selectorSubKindArraySlice: + if value.Kind != yaml.SequenceNode { + return nil + } + if len(value.Content) == 0 { + return nil + } + var inheritedPending string + if hasFc { + inheritedPending = fc.GetAndClearPendingPathSegment(value) + } + + step := int64(1) + if s.slice.step != nil { + step = *s.slice.step + } + if step == 0 { + return nil + } + + start, end := s.slice.start, s.slice.end + lower, upper := bounds(start, end, step, int64(len(value.Content))) + + var result []*yaml.Node + if step > 0 { + for i := lower; i < upper; i += step { + child := value.Content[i] + if trackParents { + idx.setParentNode(child, value) + } + if hasFc { + thisSegment := normalizeIndexSegment(int(i)) + fc.SetPendingPathSegment(child, inheritedPending+thisSegment) + fc.SetPendingPropertyName(child, strconv.Itoa(int(i))) + } + result = append(result, child) + } + } else { + for i := upper; i > lower; i += step { + child := value.Content[i] + if trackParents { + idx.setParentNode(child, value) + } + if hasFc { + thisSegment := normalizeIndexSegment(int(i)) + fc.SetPendingPathSegment(child, inheritedPending+thisSegment) + fc.SetPendingPropertyName(child, strconv.Itoa(int(i))) + } + result = append(result, child) + } + } + + return result + case selectorSubKindFilter: + var result []*yaml.Node + var parentPropName string + var pushedPendingSegment bool + if hasFc { + if pendingPropName := fc.GetAndClearPendingPropertyName(value); pendingPropName != "" { + parentPropName = pendingPropName + } else { + parentPropName = fc.PropertyName() + } + if pendingSeg := fc.GetAndClearPendingPathSegment(value); pendingSeg != "" { + fc.PushPathSegment(pendingSeg) + pushedPendingSegment = true + } + } + switch value.Kind { + case yaml.MappingNode: + for i := 1; i < len(value.Content); i += 2 { + keyNode := value.Content[i-1] + valueNode := value.Content[i] + idx.setPropertyKey(keyNode, value) + idx.setPropertyKey(valueNode, keyNode) + if trackParents { + idx.setParentNode(valueNode, value) + } + + if hasFc { + fc.SetParentPropertyName(parentPropName) + fc.SetPropertyName(keyNode.Value) + fc.SetParent(value) + fc.SetIndex(-1) + fc.PushPathSegment(normalizePathSegment(keyNode.Value)) + } + + if s.filter.Matches(idx, valueNode, root) { + result = append(result, valueNode) + } + + if hasFc { + fc.PopPathSegment() + } + } + case yaml.SequenceNode: + for i, child := range value.Content { + if trackParents { + idx.setParentNode(child, value) + } + + if hasFc { + fc.SetParentPropertyName(parentPropName) + fc.SetPropertyName(strconv.Itoa(i)) + fc.SetParent(value) + fc.SetIndex(i) + fc.PushPathSegment(normalizeIndexSegment(i)) + } + + if s.filter.Matches(idx, child, root) { + result = append(result, child) + } + + if hasFc { + fc.PopPathSegment() + } + } + } + if pushedPendingSegment { + if hasFc { + fc.PopPathSegment() + } + } + return result + } + return nil } func normalize(i, length int64) int64 { - if i >= 0 { - return i - } - return length + i + if i >= 0 { + return i + } + return length + i } func bounds(start, end *int64, step, length int64) (int64, int64) { - var nStart, nEnd int64 - if start != nil { - nStart = normalize(*start, length) - } else if step > 0 { - nStart = 0 - } else { - nStart = length - 1 - } - if end != nil { - nEnd = normalize(*end, length) - } else if step > 0 { - nEnd = length - } else { - nEnd = -1 - } - - var lower, upper int64 - if step >= 0 { - lower = max(min(nStart, length), 0) - upper = min(max(nEnd, 0), length) - } else { - upper = min(max(nStart, -1), length-1) - lower = min(max(nEnd, -1), length-1) - } - - return lower, upper + var nStart, nEnd int64 + if start != nil { + nStart = normalize(*start, length) + } else if step > 0 { + nStart = 0 + } else { + nStart = length - 1 + } + if end != nil { + nEnd = normalize(*end, length) + } else if step > 0 { + nEnd = length + } else { + nEnd = -1 + } + + var lower, upper int64 + if step >= 0 { + lower = max(min(nStart, length), 0) + upper = min(max(nEnd, 0), length) + } else { + upper = min(max(nStart, -1), length-1) + lower = min(max(nEnd, -1), length-1) + } + + return lower, upper } func (s filterSelector) Matches(idx index, node *yaml.Node, root *yaml.Node) bool { - return s.expression.Matches(idx, node, root) + if s.spectralExpression != nil { + return s.spectralExpression.Matches(idx, node, root) + } + return s.expression.Matches(idx, node, root) } func (e logicalOrExpr) Matches(idx index, node *yaml.Node, root *yaml.Node) bool { - for _, expr := range e.expressions { - if expr.Matches(idx, node, root) { - return true - } - } - return false + for _, expr := range e.expressions { + if expr.Matches(idx, node, root) { + return true + } + } + return false } func (e logicalAndExpr) Matches(idx index, node *yaml.Node, root *yaml.Node) bool { - for _, expr := range e.expressions { - if !expr.Matches(idx, node, root) { - return false - } - } - return true + for _, expr := range e.expressions { + if !expr.Matches(idx, node, root) { + return false + } + } + return true } func (e basicExpr) Matches(idx index, node *yaml.Node, root *yaml.Node) bool { - if e.parenExpr != nil { - result := e.parenExpr.expr.Matches(idx, node, root) - if e.parenExpr.not { - return !result - } - return result - } else if e.comparisonExpr != nil { - return e.comparisonExpr.Matches(idx, node, root) - } else if e.testExpr != nil { - return e.testExpr.Matches(idx, node, root) - } - return false + if e.parenExpr != nil { + result := e.parenExpr.expr.Matches(idx, node, root) + if e.parenExpr.not { + return !result + } + return result + } else if e.comparisonExpr != nil { + return e.comparisonExpr.Matches(idx, node, root) + } else if e.testExpr != nil { + return e.testExpr.Matches(idx, node, root) + } + return false } func (e comparisonExpr) Matches(idx index, node *yaml.Node, root *yaml.Node) bool { - leftValue := e.left.Evaluate(idx, node, root) - rightValue := e.right.Evaluate(idx, node, root) - - switch e.op { - case equalTo: - return leftValue.Equals(rightValue) - case notEqualTo: - return !leftValue.Equals(rightValue) - case lessThan: - return leftValue.LessThan(rightValue) - case lessThanEqualTo: - return leftValue.LessThanOrEqual(rightValue) - case greaterThan: - return rightValue.LessThan(leftValue) - case greaterThanEqualTo: - return rightValue.LessThanOrEqual(leftValue) - default: - return false - } + leftValue := e.left.Evaluate(idx, node, root) + rightValue := e.right.Evaluate(idx, node, root) + + switch e.op { + case equalTo: + return leftValue.Equals(rightValue) + case notEqualTo: + return !leftValue.Equals(rightValue) + case lessThan: + return leftValue.LessThan(rightValue) + case lessThanEqualTo: + return leftValue.LessThanOrEqual(rightValue) + case greaterThan: + return rightValue.LessThan(leftValue) + case greaterThanEqualTo: + return rightValue.LessThanOrEqual(leftValue) + default: + return false + } } func (e testExpr) Matches(idx index, node *yaml.Node, root *yaml.Node) bool { - var result bool - if e.filterQuery != nil { - result = len(e.filterQuery.Query(idx, node, root)) > 0 - } else if e.functionExpr != nil { - funcResult := e.functionExpr.Evaluate(idx, node, root) - if funcResult.bool != nil { - result = *funcResult.bool - } else if funcResult.null == nil { - result = true - } - } - if e.not { - return !result - } - return result + var result bool + if e.filterQuery != nil { + result = len(e.filterQuery.Query(idx, node, root)) > 0 + } else if e.functionExpr != nil { + funcResult := e.functionExpr.Evaluate(idx, node, root) + if funcResult.bool != nil { + result = *funcResult.bool + } else if funcResult.null == nil { + result = true + } + } + if e.not { + return !result + } + return result } func (q filterQuery) Query(idx index, node *yaml.Node, root *yaml.Node) []*yaml.Node { - if q.relQuery != nil { - return q.relQuery.Query(idx, node, root) - } - if q.jsonPathQuery != nil { - return q.jsonPathQuery.Query(node, root) - } - return nil + if q.relQuery != nil { + return q.relQuery.Query(idx, node, root) + } + if q.jsonPathQuery != nil { + return q.jsonPathQuery.Query(node, root) + } + return nil } func (q relQuery) Query(idx index, node *yaml.Node, root *yaml.Node) []*yaml.Node { - result := []*yaml.Node{node} - for _, seg := range q.segments { - var newResult []*yaml.Node - for _, value := range result { - newResult = append(newResult, seg.Query(idx, value, root)...) - } - result = newResult - } - return result + result := []*yaml.Node{node} + for _, seg := range q.segments { + var newResult []*yaml.Node + for _, value := range result { + newResult = append(newResult, seg.Query(idx, value, root)...) + } + result = newResult + } + return result } func (q absQuery) Query(idx index, node *yaml.Node, root *yaml.Node) []*yaml.Node { - result := []*yaml.Node{root} - for _, seg := range q.segments { - var newResult []*yaml.Node - for _, value := range result { - newResult = append(newResult, seg.Query(idx, value, root)...) - } - result = newResult - } - return result + result := []*yaml.Node{root} + for _, seg := range q.segments { + var newResult []*yaml.Node + for _, value := range result { + newResult = append(newResult, seg.Query(idx, value, root)...) + } + result = newResult + } + return result } diff --git a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm64.s b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm64.s index d2fe11b8ea1..8df7df9101d 100644 --- a/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm64.s +++ b/vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_arm64.s @@ -27,9 +27,15 @@ #define tmp2 R16 #define tmp3 R17 #define tmp4 R19 +#define dstend32 R20 // dstend - 32 (shortcut guard) // func decodeBlock(dst, src, dict []byte) int -TEXT ·decodeBlock(SB), NOFRAME+NOSPLIT, $0-80 +// +// Frame: 48 bytes for calling runtime·memmove in the long-match fast path +// (arg0..arg2 at 0/8/16(SP), spill of dst-after-match and src at 24/32(SP)). +// NOSPLIT is preserved -- memmove's own stack use is well under the nosplit +// margin. +TEXT ·decodeBlock(SB), NOSPLIT, $48-80 LDP dst_base+0(FP), (dst, dstend) ADD dst, dstend MOVD dst, dstorig @@ -38,9 +44,11 @@ TEXT ·decodeBlock(SB), NOFRAME+NOSPLIT, $0-80 CBZ srcend, shortSrc ADD src, srcend - // dstend16 = max(dstend-16, 0) and similarly for srcend16. + // dstend16 = max(dstend-16, 0) and similarly for dstend32, srcend16. SUBS $16, dstend, dstend16 CSEL LO, ZR, dstend16, dstend16 + SUBS $32, dstend, dstend32 + CSEL LO, ZR, dstend32, dstend32 SUBS $16, srcend, srcend16 CSEL LO, ZR, srcend16, srcend16 @@ -52,7 +60,57 @@ loop: MOVBU.P 1(src), token LSR $4, token, len CMP $15, len - BNE readLitlenDone + BEQ readLitlenLoop // len == 15: extended read, slow path. + + // Shortcut: literal length is 0..14. If we also have at least 32 bytes + // of dst and 16 bytes of src remaining, copy 16 literal bytes in one + // shot, then try to finish the token's match with an 18-byte copy. + // Falls back to the slow path on any guard failure. Mirrors the + // "copy shortcut" in decode_amd64.s. + CMP dstend32, dst + BHS readLitlenDone // <32 bytes left in dst: slow path. + CMP srcend16, src + BHS readLitlenDone // <16 bytes left in src: slow path. + + // 16-byte literal copy (bytes past len get overwritten next iter). + LDP (src), (tmp1, tmp2) + STP (tmp1, tmp2), (dst) + ADD len, src + ADD len, dst + + // Derive initial matchlen from token's low nibble. + AND $15, token, len + + // Read 2-byte offset (src has >=2 bytes left by the guard above). + MOVHU (src), offset + ADD $2, src + CBZ offset, corrupt + + // Fast-match preconditions: matchlen != 15, offset >= 8, match is + // within the current block (>= dstorig -- not a dict reference). + CMP $15, len + BEQ readMatchlen // extended matchlen: slow path. + CMP $8, offset + BLO readMatchlen // small offset: use existing <8 path. + SUB offset, dst, match + CMP dstorig, match + BLO readMatchlen // dict reference: use existing dict path. + + // 18-byte match copy as sequenced 8+8+2 (like the C decoder). + // dst-space is guaranteed: dst < dstend-32 and matchlen+minMatch + // <= 18; bytes past the match get overwritten next iter. 8-byte + // loads are more likely than an LDP to be forwarded from the + // in-flight stores of the previous sequences (Neoverse), and the + // sequencing keeps offset == 8 cycling correct. + MOVD (match), tmp1 + MOVD tmp1, (dst) + MOVD 8(match), tmp2 + MOVD tmp2, 8(dst) + MOVHU 16(match), tmp3 + MOVH tmp3, 16(dst) + ADD $const_minMatch, len + ADD len, dst + B copyMatchDone readLitlenLoop: CMP src, srcend @@ -132,6 +190,7 @@ copyLiteralDone: MOVHU -2(src), offset CBZ offset, corrupt +readMatchlen: // Read rest of match length. CMP $15, len BNE readMatchlenDone @@ -181,12 +240,75 @@ copyDict: SUB dstorig, dst, offset copyMatchTry8: - // Copy doublewords if both len and offset are at least eight. - // A 16-at-a-time loop doesn't provide a further speedup. + // Non-overlapping bulk copy: len >= 256 and offset >= len means the + // whole match can be served by runtime.memmove (scalar 64B/iter + // LDP/STP with source alignment), which outruns the 16B/iter loop + // below for long copies. Below 256 bytes the call-and-spill + // overhead dominates, so the inline loops stay. + CMP $256, len + BLO copyMatchTry8_inline + CMP len, offset + BLO copyMatchTry8_inline // offset < len -> match cycles, can't memmove. + B copyMatchViaMemmove + +copyMatchTry8_inline: + // Copy quadwords (16 bytes/iter via LDP/STP) if len and offset are both + // large enough. offset >= 32 guarantees there is no store-to-load + // forwarding dependency between iterations: iter N+1's LDP reads bytes + // at (match+16) which, since match = dst - offset, sits at + // dst - (offset-16). For offset >= 32 that is pre-dst, untouched by + // iter N's STP. Kibble columnar data (int64c/float64c/varstring.dictc/ + // hexc) shows ~81% of matches with len >= 19 have offset >= 32, and + // those long matches produce ~75% of total match-copy bytes, so this + // is the dominant path for columnar workloads. + // CCMP immediate is 5-bit unsigned (0..31); we can't encode $32 directly, + // so compare offset against $31 with BLS (lower or same) to match + // "offset < 32" exactly. The first-CMP "len < 16" case falls into BLS + // via NZCV=$0 (C=0 => LS). + CMP $16, len + CCMP HS, offset, $31, $0 + BLS copyMatchTry8Narrow + + AND $15, len, lenRem + SUB $16, len +copyMatchLoop16: + LDP.P 16(match), (tmp1, tmp2) + STP.P (tmp1, tmp2), 16(dst) + SUBS $16, len + BPL copyMatchLoop16 + + // LDP lacks a (base)(index) addressing mode, so compute match+len + // into a scratch register first. + ADD match, len, tmp3 // tmp3 = match + lenRem - 16 + LDP (tmp3), (tmp1, tmp2) + ADD lenRem, dst + MOVD $0, len + STP (tmp1, tmp2), -16(dst) + B copyMatchDone + +copyMatchTry8Narrow: + // Offsets in [8, 32) (or any offset >= 8 via the dict remainder + // path). Long matches take the load-free tiles; short ones the + // 8-byte loop. CMP $8, len CCMP HS, offset, $8, $0 BLO copyMatchTry4 + CMP $32, len + BLO copyMatchLoop8Setup // short match: 8-byte loop. + CMP $32, offset + BHS copyMatchLoop8Setup // offset >= 32 only via the dict remainder path. + CMP $8, offset + BEQ copyMatchTile8 + CMP $16, offset + BEQ copyMatchTile16 + BLO copyMatchTile // 9..15: generic 16-byte tile (prefill = offset). + CMP $24, offset + BEQ copyMatchTile24 + B copyMatchTile32 // 17..23, 25..31: 32-byte tile. + +copyMatchLoop8Setup: + // 8-byte loop, store-to-load-forwarding bound; fine for short matches. AND $7, len, lenRem SUB $8, len copyMatchLoop8: @@ -213,16 +335,234 @@ copyMatchTry4: BEQ copyMatchDone copyMatchLoop1: + // For offset <= 2 and len >= 8, splat the 1- or 2-byte pattern + // and store 8-16 bytes at a time. Offsets 3..7 with enough length + // go to their own splat/tile paths (reachable only with offset < 8: + // len >= 8 at this point implies the offset >= 8 cases went through + // copyMatchTry8Narrow). Everything else falls to the byte loop. + CMP $8, len + BLO copyMatchByteLoop // len < 8: byte loop is shorter. + CMP $2, offset + BHI copyMatchMidPeriod // offsets 3..7. + BEQ copyMatchSplat2 // offset == 2 + + // offset == 1: splat a single byte to all 8 bytes of tmp3. + MOVBU (match), tmp3 + ORR tmp3<<8, tmp3, tmp3 + ORR tmp3<<16, tmp3, tmp3 + B copyMatchSplatTile32 + +copyMatchMidPeriod: + // offsets 3..7 with len >= 8. + CMP $4, offset + BEQ copyMatchSplat4 + CMP $16, len + BHS copyMatchTile + B copyMatchByteLoop + +copyMatchSplat4: + // offset == 4: splat a word to all 8 bytes of tmp3, then reuse the + // 16-byte splat store loop below. + MOVWU (match), tmp3 + B copyMatchSplatTile32 + +copyMatchTile: + // offsets 3, 5, 6, 7 with len >= 16. The output is periodic with + // period == offset. Prefill step = (16/offset)*offset bytes (12..15, + // the largest multiple of offset <= 16) byte-by-byte, which makes + // [match0, dst) hold >= 16 pattern bytes and leaves dst phase-aligned + // to the pattern start. Then load one 16-byte tile from match0 and + // store it repeatedly, advancing dst by step so the phase is + // preserved. The loop has no loads, so unlike an overlapped-copy + // loop it incurs no store-to-load-forwarding stalls. + MOVD $16, tmp1 + UDIV offset, tmp1, tmp2 + MUL offset, tmp2, tmp4 // tmp4 = step + MOVD match, lenRem // lenRem = match0, the tile source. + MOVD tmp4, tmp1 // tmp1 = prefill byte count. + +copyMatchTilePrefill: + MOVBU.P 1(match), tmp3 + MOVB.P tmp3, 1(dst) + SUBS $1, tmp1 + BNE copyMatchTilePrefill + + SUB tmp4, len + LDP (lenRem), (tmp1, tmp2) // 16-byte pattern tile. + +copyMatchTileLoop: + // Store 16 bytes while at least 16 remain, consuming step bytes per + // iteration; the 16-step overlap is rewritten by the next store (or + // the tail loop) with identical values. + CMP $16, len + BLO copyMatchTileTail + STP (tmp1, tmp2), (dst) + ADD tmp4, dst + SUB tmp4, len + B copyMatchTileLoop + +copyMatchTileTail: + CBZ len, copyMatchDone + SUB offset, dst, match // Re-derive match for the tail copy. + CMP $8, len + BLO copyMatchByteLoop + B copyMatchTry8Narrow + + // Load-free tiles for offsets 8..31 with len >= 32 (constant or + // short-period columns): load the pattern once, then only store. +copyMatchTile8: + // The splat loop consumes multiples of 8, so dst stays phase-aligned + // and its byte-loop tail (reading from the un-advanced match) is right. + MOVD (match), tmp3 + B copyMatchSplatLoop + +copyMatchTile16: + LDP (match), (tmp1, tmp2) +copyMatchTile16Loop: + CMP $16, len + BLO copyMatchTileTail + STP.P (tmp1, tmp2), 16(dst) + SUB $16, len + B copyMatchTile16Loop + +copyMatchTile24: + // Dedicated tile: the generic 32-byte tile would overlap its stores + // by 8 bytes at this stride, which is markedly slower. + LDP (match), (tmp1, tmp2) + MOVD 16(match), tmp3 +copyMatchTile24Loop: + CMP $24, len + BLO copyMatchTileTail + STP (tmp1, tmp2), (dst) + MOVD tmp3, 16(dst) + ADD $24, dst + SUB $24, len + B copyMatchTile24Loop + +copyMatchTile32: + // offset in 17..23, 25..31: prefill one period (8-byte copies never + // read ahead of the writes since offset >= 8), so [dst-2*offset, dst) + // holds two periods (>= 34 bytes) and dst is phase-aligned; then + // store a 32-byte tile from there, advancing by offset. The overlap + // between consecutive stores is rewritten with identical bytes. + MOVD offset, tmp4 +copyMatchTile32Pre8: + MOVD.P 8(match), tmp1 + MOVD.P tmp1, 8(dst) + SUB $8, tmp4 + CMP $8, tmp4 + BHS copyMatchTile32Pre8 + CBZ tmp4, copyMatchTile32Load +copyMatchTile32Pre1: + MOVBU.P 1(match), tmp1 + MOVB.P tmp1, 1(dst) + SUBS $1, tmp4 + BNE copyMatchTile32Pre1 +copyMatchTile32Load: + SUB offset, len + SUB offset<<1, dst, lenRem // lenRem = dst - 2*offset: tile source. + LDP (lenRem), (tmp1, tmp2) + LDP 16(lenRem), (tmp3, tmp4) +copyMatchTile32Loop: + CMP $32, len + BLO copyMatchTileTail + STP (tmp1, tmp2), (dst) + STP (tmp3, tmp4), 16(dst) + ADD offset, dst + SUB offset, len + B copyMatchTile32Loop + +copyMatchSplat2: + // offset == 2: splat a halfword. + MOVHU (match), tmp3 + ORR tmp3<<16, tmp3, tmp3 + +copyMatchSplatTile32: + ORR tmp3<<32, tmp3, tmp3 + + // 16-byte store-pair loop for the bulk. G2 onwards (Neoverse N1 and + // every later core, and Apple M-series) can retire an STP of two + // X-registers as a single 16-byte store; doubling the store width + // halves the iteration count and the per-iteration loop overhead. + // + // PCALIGN bumps decodeBlock's own alignment to 64B, fixing a 2-3% M4 + // regression the tile paths above caused in offset 1-7 code below by + // shifting it off-alignment. + PCALIGN $64 +copyMatchSplatLoop: + CMP $16, len + BLO copyMatchSplatTail + STP.P (tmp3, tmp3), 16(dst) + SUB $16, len + B copyMatchSplatLoop + +copyMatchSplatTail: + // 0..15 bytes remain. If >= 8, emit one more 8-byte store. + CBZ len, copyMatchDone + CMP $8, len + BLO copyMatchByteLoop + MOVD.P tmp3, 8(dst) + SUBS $8, len + BEQ copyMatchDone + // fall through with 1..7 bytes remaining. + +copyMatchByteLoop: // Byte-at-a-time copy for small offsets <= 3. MOVBU.P 1(match), tmp2 MOVB.P tmp2, 1(dst) SUBS $1, len - BNE copyMatchLoop1 + BNE copyMatchByteLoop copyMatchDone: CMP src, srcend BNE loop + B end + +copyMatchViaMemmove: + // runtime·memmove(dst, match, len). Caller must guarantee offset >= len + // (non-overlapping) and a stack frame of at least 48 bytes. + // + // Go's arm64 ABI0 places a callee's args at caller_SP + 8 (the 0 + // offset is reserved for the callee's LR save slot), so arg0..arg2 go + // at 8/16/24(RSP) from our POV. The callee may clobber R0..R18 and + // most NEON regs; only R19..R28 and V8..V15 are preserved. Every + // working register we use is caller-save from memmove's perspective, + // so we spill the advanced dst and src to the frame and rebuild + // dstend/dstend16/dstend32/srcend/srcend16/dict/dictlen/dictend from + // the FP slots after the call. + MOVD dst, 8(RSP) // memmove arg0: to + MOVD match, 16(RSP) // memmove arg1: from + MOVD len, 24(RSP) // memmove arg2: n + ADD len, dst, dst // post-match dst position + MOVD dst, 32(RSP) // spill advanced dst + MOVD src, 40(RSP) // spill src + BL runtime·memmove(SB) + MOVD 32(RSP), dst + MOVD 40(RSP), src + + // Rebuild derived pointers/ends. dstorig := dst_base; dstend := dst_base + dst_len; etc. + MOVD dst_base+0(FP), dstorig + MOVD dst_len+8(FP), dstend + ADD dstorig, dstend, dstend + SUBS $16, dstend, dstend16 + CSEL LO, ZR, dstend16, dstend16 + SUBS $32, dstend, dstend32 + CSEL LO, ZR, dstend32, dstend32 + + MOVD src_base+24(FP), tmp1 + MOVD src_len+32(FP), srcend + ADD tmp1, srcend, srcend + SUBS $16, srcend, srcend16 + CSEL LO, ZR, srcend16, srcend16 + + MOVD dict_base+48(FP), dict + MOVD dict_len+56(FP), dictlen + ADD dict, dictlen, dictend + + MOVD $0, len + B copyMatchDone + end: CBNZ len, corrupt SUB dstorig, dst, tmp1 diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go index 651d10c1047..747a5b308bd 100644 --- a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go +++ b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero.go @@ -110,8 +110,11 @@ func updateGo(v *[4]uint32, buf *[16]byte, input []byte) { // Sum32 returns the 32 bits Hash value. func (xxh *XXHZero) Sum32() uint32 { + // The length term is taken modulo 2^32, but whether the accumulator lanes + // are folded in depends on the true length: a 4 GiB input is not a short + // input even though its truncated length is 0. h32 := uint32(xxh.totalLen) - if h32 >= 16 { + if xxh.totalLen >= 16 { h32 += rol1(xxh.v[0]) + rol7(xxh.v[1]) + rol12(xxh.v[2]) + rol18(xxh.v[3]) } else { h32 += prime5 diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm64.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm64.go new file mode 100644 index 00000000000..ce83146edd3 --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm64.go @@ -0,0 +1,12 @@ +//go:build !noasm && gc +// +build !noasm,gc + +package xxh32 + +// ChecksumZero returns the 32-bit hash of input. +// +//go:noescape +func ChecksumZero(input []byte) uint32 + +//go:noescape +func update(v *[4]uint32, buf *[16]byte, input []byte) diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm64.s b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm64.s new file mode 100644 index 00000000000..b8e8523814f --- /dev/null +++ b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm64.s @@ -0,0 +1,160 @@ +// +build gc +// +build !noasm + +#include "textflag.h" + +// Register allocation. h and v1 deliberately share a register: v1 is dead +// by the time h is computed, and the tail loops reuse the register file. +#define p R0 +#define n R1 +#define h R2 +#define v1 R2 // Alias for h. +#define v2 R3 +#define v3 R4 +#define v4 R5 +#define x1 R6 +#define x2 R7 +#define x3 R8 +#define x4 R9 +#define pend R10 +#define prime1r R11 +#define prime2r R12 +#define prime3r R13 +#define prime4r R14 +#define prime5r R15 +#define total R16 +#define saved R17 + +// 16-byte round. Matches the multiplier-pipe-bound schedule gcc emits for +// the reference C: two LDPW pairs, then MADD/ROR/MUL per lane, one pointer +// increment, and nothing else -- the byte-count bookkeeping the Go compiler +// adds to the portable version costs ~15% on Cortex-A72. +#define round16 \ + LDPW (p), (x1, x2) \ + LDPW 8(p), (x3, x4) \ + ADD $16, p \ + MADDW prime2r, v1, x1, v1 \ + MADDW prime2r, v2, x2, v2 \ + MADDW prime2r, v3, x3, v3 \ + MADDW prime2r, v4, x4, v4 \ + RORW $19, v1, v1 \ + RORW $19, v2, v2 \ + RORW $19, v3, v3 \ + RORW $19, v4, v4 \ + MULW prime1r, v1, v1 \ + MULW prime1r, v2, v2 \ + MULW prime1r, v3, v3 \ + MULW prime1r, v4, v4 + +// func ChecksumZero(input []byte) uint32 +TEXT ·ChecksumZero(SB), NOSPLIT, $0-28 + MOVD input_base+0(FP), p + MOVD input_len+8(FP), n + + MOVD $2654435761, prime1r + MOVD $2246822519, prime2r + MOVD $3266489917, prime3r + MOVD $668265263, prime4r + MOVD $374761393, prime5r + + MOVD n, total + CMP $16, n + BLT small + + // Accumulator init: prime1plus2, prime2, 0, prime1minus. + MOVD $606290984, v1 + MOVD $2246822519, v2 + MOVD $0, v3 + MOVD $1640531535, v4 + + AND $-16, n, x1 + ADD x1, p, pend + AND $15, n, n + +loop16: + round16 + CMP pend, p + BLO loop16 + + // h = uint32(total) + rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4). + RORW $31, v1, v1 + RORW $25, v2, v2 + RORW $20, v3, v3 + RORW $14, v4, v4 + ADDW v2, v1 + ADDW v3, v1 + ADDW v4, v1 + ADDW total, h // v1 is h. + B tail4 + +small: + ADDW prime5r, total, h + +tail4: + CMP $4, n + BLT tail1 + MOVWU.P 4(p), x1 + MADDW prime3r, h, x1, h + RORW $15, h, h + MULW prime4r, h, h + SUB $4, n + B tail4 + +tail1: + CBZ n, avalanche + MOVBU.P 1(p), x1 + MADDW prime5r, h, x1, h + RORW $21, h, h + MULW prime1r, h, h + SUB $1, n + B tail1 + +avalanche: + EORW h>>15, h, h + MULW prime2r, h, h + EORW h>>13, h, h + MULW prime3r, h, h + EORW h>>16, h, h + MOVW h, ret+24(FP) + RET + +// func update(v *[4]uint32, buf *[16]byte, input []byte) +// +// Processes buf (when non-nil) and then every full 16-byte block of input; +// the caller retains the trailing partial block, matching updateGo. +TEXT ·update(SB), NOSPLIT, $0-40 + MOVD v+0(FP), x1 + MOVD buf+8(FP), saved + MOVD input_base+16(FP), p + MOVD input_len+24(FP), n + + MOVD $2654435761, prime1r + MOVD $2246822519, prime2r + + LDPW (x1), (v1, v2) + LDPW 8(x1), (v3, v4) + + CBZ saved, blocks + + // One round over *buf, preserving the input cursor. + MOVD p, total + MOVD saved, p + round16 + MOVD total, p + +blocks: + AND $-16, n, x1 + ADD x1, p, pend + CMP pend, p + BHS store + +loop: + round16 + CMP pend, p + BLO loop + +store: + MOVD v+0(FP), x1 + STPW (v1, v2), (x1) + STPW (v3, v4), 8(x1) + RET diff --git a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go index c96b59b8c3f..445500ad15a 100644 --- a/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go +++ b/vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go @@ -1,4 +1,5 @@ -// +build !arm noasm +//go:build (!arm && !arm64) || noasm || (arm64 && !gc) +// +build !arm,!arm64 noasm arm64,!gc package xxh32 diff --git a/vendor/github.com/pierrec/lz4/v4/writer.go b/vendor/github.com/pierrec/lz4/v4/writer.go index 5637acde473..514933548f9 100644 --- a/vendor/github.com/pierrec/lz4/v4/writer.go +++ b/vendor/github.com/pierrec/lz4/v4/writer.go @@ -222,6 +222,7 @@ func (w *Writer) ReadFrom(r io.Reader) (n int64, err error) { switch err { case nil: case io.EOF, io.ErrUnexpectedEOF: // read may be partial + err = nil done = true default: return diff --git a/vendor/github.com/power-devops/perfstat/c_helpers.c b/vendor/github.com/power-devops/perfstat/c_helpers.c index 49ba1ad7eb6..f0a5c77c856 100644 --- a/vendor/github.com/power-devops/perfstat/c_helpers.c +++ b/vendor/github.com/power-devops/perfstat/c_helpers.c @@ -135,6 +135,7 @@ int getfsinfo(char *fsname, char *devname, char *host, char *options, int flags, struct fsinfo *get_all_fs(int *rc) { struct vmount *mnt; + struct vmount *vm_base; struct fsinfo *fs_all; int nmounts; @@ -144,6 +145,7 @@ struct fsinfo *get_all_fs(int *rc) { return NULL; } + vm_base = mnt; fs_all = (struct fsinfo *)calloc(sizeof(struct fsinfo), nmounts); while ((*rc)++, nmounts--) { getfsinfo(vmt2dataptr(mnt, VMT_STUB), @@ -155,5 +157,16 @@ struct fsinfo *get_all_fs(int *rc) { &fs_all[*rc]); mnt = (struct vmount *)((char *)mnt + mnt->vmt_length); } + free(vm_base); return fs_all; } + +void free_all_fs(struct fsinfo *fs_all, int n) { + int i; + if (!fs_all) return; + for (i = 0; i < n; i++) { + free(fs_all[i].devname); // free(NULL) is safe for the "ignore" path + free(fs_all[i].fsname); + } + free(fs_all); +} diff --git a/vendor/github.com/power-devops/perfstat/c_helpers.h b/vendor/github.com/power-devops/perfstat/c_helpers.h index b66bc53c3c1..b21689615ae 100644 --- a/vendor/github.com/power-devops/perfstat/c_helpers.h +++ b/vendor/github.com/power-devops/perfstat/c_helpers.h @@ -54,5 +54,6 @@ int get_mounts(struct vmount **); void fill_statfs(struct statfs, struct fsinfo *); int getfsinfo(char *, char *, char *, char *, int, int, struct fsinfo *); struct fsinfo *get_all_fs(int *); +void free_all_fs(struct fsinfo *, int); #endif diff --git a/vendor/github.com/power-devops/perfstat/cpustat.go b/vendor/github.com/power-devops/perfstat/cpustat.go index 10f543fa4d5..5d561e30de1 100644 --- a/vendor/github.com/power-devops/perfstat/cpustat.go +++ b/vendor/github.com/power-devops/perfstat/cpustat.go @@ -37,7 +37,9 @@ func CpuStat() ([]CPU, error) { cpustat_len := C.sizeof_perfstat_cpu_t * C.ulong(ncpu) cpustat = (*C.perfstat_cpu_t)(C.malloc(cpustat_len)) defer C.free(unsafe.Pointer(cpustat)) - C.strcpy(&cpu.name[0], C.CString(C.FIRST_CPU)) + cstr := C.CString(C.FIRST_CPU) + C.strcpy(&cpu.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_cpu(&cpu, cpustat, C.sizeof_perfstat_cpu_t, C.int(ncpu)) if r <= 0 { return nil, fmt.Errorf("error perfstat_cpu()") diff --git a/vendor/github.com/power-devops/perfstat/diskstat.go b/vendor/github.com/power-devops/perfstat/diskstat.go index 06763b4bc9f..10c5de782db 100644 --- a/vendor/github.com/power-devops/perfstat/diskstat.go +++ b/vendor/github.com/power-devops/perfstat/diskstat.go @@ -41,7 +41,9 @@ func DiskAdapterStat() ([]DiskAdapter, error) { adapter_len := C.sizeof_perfstat_diskadapter_t * C.ulong(numadpt) adapter = (*C.perfstat_diskadapter_t)(C.malloc(adapter_len)) defer C.free(unsafe.Pointer(adapter)) - C.strcpy(&adptname.name[0], C.CString(C.FIRST_DISKADAPTER)) + cstr := C.CString(C.FIRST_DISKADAPTER) + C.strcpy(&adptname.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_diskadapter(&adptname, adapter, C.sizeof_perfstat_diskadapter_t, numadpt) if r < 0 { return nil, fmt.Errorf("perfstat_diskadapter() error") @@ -68,7 +70,9 @@ func DiskStat() ([]Disk, error) { disk_len := C.sizeof_perfstat_disk_t * C.ulong(numdisk) disk = (*C.perfstat_disk_t)(C.malloc(disk_len)) defer C.free(unsafe.Pointer(disk)) - C.strcpy(&diskname.name[0], C.CString(C.FIRST_DISK)) + cstr := C.CString(C.FIRST_DISK) + C.strcpy(&diskname.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_disk(&diskname, disk, C.sizeof_perfstat_disk_t, numdisk) if r < 0 { return nil, fmt.Errorf("perfstat_disk() error") @@ -95,7 +99,9 @@ func DiskPathStat() ([]DiskPath, error) { path_len := C.sizeof_perfstat_diskpath_t * C.ulong(numpaths) diskpath = (*C.perfstat_diskpath_t)(C.malloc(path_len)) defer C.free(unsafe.Pointer(diskpath)) - C.strcpy(&pathname.name[0], C.CString(C.FIRST_DISKPATH)) + cstr := C.CString(C.FIRST_DISKPATH) + C.strcpy(&pathname.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_diskpath(&pathname, diskpath, C.sizeof_perfstat_diskpath_t, numpaths) if r < 0 { return nil, fmt.Errorf("perfstat_diskpath() error") @@ -122,7 +128,9 @@ func FCAdapterStat() ([]FCAdapter, error) { fcstat_len := C.sizeof_perfstat_fcstat_t * C.ulong(numadpt) fcstat = (*C.perfstat_fcstat_t)(C.malloc(fcstat_len)) defer C.free(unsafe.Pointer(fcstat)) - C.strcpy(&fcname.name[0], C.CString(C.FIRST_NETINTERFACE)) + cstr := C.CString(C.FIRST_NETINTERFACE) + C.strcpy(&fcname.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_fcstat(&fcname, fcstat, C.sizeof_perfstat_fcstat_t, numadpt) if r < 0 { return nil, fmt.Errorf("perfstat_fcstat() error") diff --git a/vendor/github.com/power-devops/perfstat/fsstat.go b/vendor/github.com/power-devops/perfstat/fsstat.go index d3913197acb..f3350da286c 100644 --- a/vendor/github.com/power-devops/perfstat/fsstat.go +++ b/vendor/github.com/power-devops/perfstat/fsstat.go @@ -20,6 +20,7 @@ func FileSystemStat() ([]FileSystem, error) { if nmounts <= 0 { return nil, fmt.Errorf("No mounts found") } + defer C.free_all_fs(fsinfo, nmounts) fs := make([]FileSystem, nmounts) for i := 0; i < int(nmounts); i++ { diff --git a/vendor/github.com/power-devops/perfstat/lvmstat.go b/vendor/github.com/power-devops/perfstat/lvmstat.go index 2ce99086ad0..5e4434ec44b 100644 --- a/vendor/github.com/power-devops/perfstat/lvmstat.go +++ b/vendor/github.com/power-devops/perfstat/lvmstat.go @@ -30,7 +30,9 @@ func LogicalVolumeStat() ([]LogicalVolume, error) { lv_len := C.sizeof_perfstat_logicalvolume_t * C.ulong(numlvs) lv = (*C.perfstat_logicalvolume_t)(C.malloc(lv_len)) defer C.free(unsafe.Pointer(lv)) - C.strcpy(&lvname.name[0], C.CString("")) + cstr := C.CString("") + C.strcpy(&lvname.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_logicalvolume(&lvname, lv, C.sizeof_perfstat_logicalvolume_t, numlvs) if r < 0 { return nil, fmt.Errorf("perfstat_logicalvolume() error") @@ -57,7 +59,9 @@ func VolumeGroupStat() ([]VolumeGroup, error) { vg_len := C.sizeof_perfstat_volumegroup_t * C.ulong(numvgs) vg = (*C.perfstat_volumegroup_t)(C.malloc(vg_len)) defer C.free(unsafe.Pointer(vg)) - C.strcpy(&vgname.name[0], C.CString("")) + cstr := C.CString("") + C.strcpy(&vgname.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_volumegroup(&vgname, vg, C.sizeof_perfstat_volumegroup_t, numvgs) if r < 0 { return nil, fmt.Errorf("perfstat_volumegroup() error") diff --git a/vendor/github.com/power-devops/perfstat/memstat.go b/vendor/github.com/power-devops/perfstat/memstat.go index 52133f0a848..23be29d0a9f 100644 --- a/vendor/github.com/power-devops/perfstat/memstat.go +++ b/vendor/github.com/power-devops/perfstat/memstat.go @@ -69,7 +69,9 @@ func PagingSpaceStat() ([]PagingSpace, error) { ps_len := C.sizeof_perfstat_pagingspace_t * C.ulong(numps) pspace = (*C.perfstat_pagingspace_t)(C.malloc(ps_len)) defer C.free(unsafe.Pointer(pspace)) - C.strcpy(&fps.name[0], C.CString(C.FIRST_PAGINGSPACE)) + cstr := C.CString(C.FIRST_PAGINGSPACE) + C.strcpy(&fps.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_pagingspace(&fps, pspace, C.sizeof_perfstat_pagingspace_t, numps) if r < 1 { return nil, fmt.Errorf("perfstat_pagingspace() error") diff --git a/vendor/github.com/power-devops/perfstat/netstat.go b/vendor/github.com/power-devops/perfstat/netstat.go index 847d2946eec..8710058df09 100644 --- a/vendor/github.com/power-devops/perfstat/netstat.go +++ b/vendor/github.com/power-devops/perfstat/netstat.go @@ -42,7 +42,9 @@ func NetBufferStat() ([]NetBuffer, error) { nblen := C.sizeof_perfstat_netbuffer_t * C.ulong(numbuf) nbuf = (*C.perfstat_netbuffer_t)(C.malloc(nblen)) defer C.free(unsafe.Pointer(nbuf)) - C.strcpy(&first.name[0], C.CString(C.FIRST_NETBUFFER)) + cstr := C.CString(C.FIRST_NETBUFFER) + C.strcpy(&first.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_netbuffer(&first, nbuf, C.sizeof_perfstat_netbuffer_t, numbuf) if r < 0 { return nil, fmt.Errorf("perfstat_netbuffer() error") @@ -72,7 +74,9 @@ func NetIfaceStat() ([]NetIface, error) { iflen := C.sizeof_perfstat_netinterface_t * C.ulong(numif) nif = (*C.perfstat_netinterface_t)(C.malloc(iflen)) defer C.free(unsafe.Pointer(nif)) - C.strcpy(&first.name[0], C.CString(C.FIRST_NETINTERFACE)) + cstr := C.CString(C.FIRST_NETINTERFACE) + C.strcpy(&first.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_netinterface(&first, nif, C.sizeof_perfstat_netinterface_t, numif) if r < 0 { return nil, fmt.Errorf("perfstat_netinterface() error") @@ -102,7 +106,9 @@ func NetAdapterStat() ([]NetAdapter, error) { adplen := C.sizeof_perfstat_netadapter_t * C.ulong(numad) adapters = (*C.perfstat_netadapter_t)(C.malloc(adplen)) defer C.free(unsafe.Pointer(adapters)) - C.strcpy(&first.name[0], C.CString(C.FIRST_NETINTERFACE)) + cstr := C.CString(C.FIRST_NETINTERFACE) + C.strcpy(&first.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_netadapter(&first, adapters, C.sizeof_perfstat_netadapter_t, numad) if r < 0 { return nil, fmt.Errorf("perfstat_netadapter() error") diff --git a/vendor/github.com/power-devops/perfstat/procstat.go b/vendor/github.com/power-devops/perfstat/procstat.go index 957ec2b33ac..2a01a02990b 100644 --- a/vendor/github.com/power-devops/perfstat/procstat.go +++ b/vendor/github.com/power-devops/perfstat/procstat.go @@ -31,7 +31,9 @@ func ProcessStat() ([]Process, error) { plen := C.sizeof_perfstat_process_t * C.ulong(numproc) proc = (*C.perfstat_process_t)(C.malloc(plen)) defer C.free(unsafe.Pointer(proc)) - C.strcpy(&first.name[0], C.CString("")) + cstr := C.CString("") + C.strcpy(&first.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_process(&first, proc, C.sizeof_perfstat_process_t, numproc) if r < 0 { return nil, fmt.Errorf("perfstat_process() error") @@ -59,7 +61,9 @@ func ThreadStat() ([]Thread, error) { thlen := C.sizeof_perfstat_thread_t * C.ulong(numthr) thread = (*C.perfstat_thread_t)(C.malloc(thlen)) defer C.free(unsafe.Pointer(thread)) - C.strcpy(&first.name[0], C.CString("")) + cstr := C.CString("") + C.strcpy(&first.name[0], cstr) + C.free(unsafe.Pointer(cstr)) r := C.perfstat_thread(&first, thread, C.sizeof_perfstat_thread_t, numthr) if r < 0 { return nil, fmt.Errorf("perfstat_thread() error") diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/.golangci.yml b/vendor/github.com/santhosh-tekuri/jsonschema/v6/.golangci.yml index 6534d53166c..94a3eca377b 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/.golangci.yml +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/.golangci.yml @@ -1,4 +1,3 @@ -version: "2" linters: enable: - nakedret diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/.swp b/vendor/github.com/santhosh-tekuri/jsonschema/v6/.swp deleted file mode 100644 index e511900313abf7ae50f168b5af6bf15bdabc11fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20480 zcmeHNON`q@7@krnlu|$-0hJJ%2C7Xqu{YW5BfFx~0#YRk?XI+Kp<1nA5<44ry>=8k z*=|wQD-sf103jiuAb~ja#tjZ|sl*K-jyw(=3tW&;Z@@QWXY+J6n>de3W9hSFJD&OH zn}2@K_j|I*3oo9b3u=;JdzkOM?dEAh9A>!%+bLA91szxY|2fJTmV4f|HyiP9z?b(B@-Gq+UjYT+3H}=ijCJ4}Bswkv zKcT(6&1b_+P|yKyag<-u-EzsIMRm1UGAuVAjp$Z+i{_bO>RKd525bUV+S)L|jhGmo z6;}t^&Q^{q%q;74tL(Tmt5e$o^7MogNl?c{H*7fSY1^=(+gJ;eptu@|4W=hTZTHd= zRZ{Z{iFq3L4!B_2c5yLGa;K&gCB*W=D=IuH+Yd`P$#UKw5pa`o*2xw0E#}Y@S^}V3 z%*6!_&a$bl?%rKXt~Xsst%v7I0fSeVS{=RPVrw}4!~2GBtwXx8e=I(xt6dTf;hb!~ zwN^dRM0m)R8+mH#R zq?22^}xEGI``%{9*@)P)TUu+VyAA{wYn5Vp)BAY9?&mSmY&aNlUY@r*H|hw&1fo_oST`c z6`>jVJOcfO;Wm{NTq(8Krmo@DFG|rZmNj+Et4;A{bQXzH(MyhDTZ=R@9U;8^sl*KC z;fXX|S|VP1&c=A{d2SF8ErPLstYqLt><>_=him-ALcfk6R!WC zf%Lx)aQ$EXzW))l{UY!qbbK0k8@l~JX!T9td+75C;4|p*ThQXK1MfkL9|E?a!#{@x z{~a3qIPey<_dn3x7lG^0-G4%Fp8|M&pYS^O*yvbpUhjC*dGJ~Dld-ba^OteA((~Zy zWM)RsBvn<*XEGUmwq*p46|)WDV3%MFuHD~b>Jpt^J|kv$EE%hNLyef8y6T0ZZPk=H z8=A{fBr1c74EuVHIXbd@$WSGa-z~0r z={|lw{C;(|4dnbO|4Kv`Pa^OC3Vx|kcc-YwdP_j|#FqC4Ln;?x%;{6p_hi5x4+%BA zFekoCi9#3=q%y&&h*iKr$d1kPJu$Bm*@D`hQmsw*)fW>iVnApH)}*l)5tf z*>r!#Q(9pq$`yb^&++{oK)uipmcA|QjaDeMRE$oFvmvUOo_P;*Ia<#~bbe47kAzJ} zBcc6$*}v-w!i~dOJk_!4er_tld(T$ASC~vyRrT@$cZwgAekd69vz${em{EN09%oab z<-M?_TRB#A$|iFWhfM>yHLUNw0~y RxuO-kkumD8)T>*U_diiX^HBf* diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/format.go b/vendor/github.com/santhosh-tekuri/jsonschema/v6/format.go index b78b22e2a5b..0d7f5903279 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/format.go +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/format.go @@ -318,7 +318,7 @@ func validateEmail(v any) error { return LocalizableError("local part more than 64 characters long") } - if len(local) > 1 && strings.HasPrefix(local, `"`) && strings.HasPrefix(local, `"`) { + if len(local) > 1 && strings.HasPrefix(local, `"`) && strings.HasSuffix(local, `"`) { // quoted local := local[1 : len(local)-1] if strings.IndexByte(local, '\\') != -1 || strings.IndexByte(local, '"') != -1 { diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/go.work.sum b/vendor/github.com/santhosh-tekuri/jsonschema/v6/go.work.sum index 2b5b811d99f..c268feb511f 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/go.work.sum +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/go.work.sum @@ -1,4 +1,4 @@ -github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/kind/kind.go b/vendor/github.com/santhosh-tekuri/jsonschema/v6/kind/kind.go index a37fb0b9786..62efa755b09 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/kind/kind.go +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/kind/kind.go @@ -511,7 +511,7 @@ func (*ContentMediaType) KeywordPath() []string { } func (k *ContentMediaType) LocalizedString(p *message.Printer) string { - return p.Sprintf("value if not of mediatype %s: %v", quote(k.Want), k.Err) + return p.Sprintf("value is not of mediatype %s: %v", quote(k.Want), k.Err) } // -- diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/objcompiler.go b/vendor/github.com/santhosh-tekuri/jsonschema/v6/objcompiler.go index f1494b13a86..d47efa89b27 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/objcompiler.go +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/objcompiler.go @@ -355,9 +355,13 @@ func (c *objCompiler) enqueueRef(pname string) (*Schema, error) { if ref == nil { return nil, nil } + return c.enqueueRefVal(*ref) +} + +func (c *objCompiler) enqueueRefVal(ref string) (*Schema, error) { baseURL := c.res.id // baseURL := c.r.baseURL(c.up.ptr) - uf, err := baseURL.join(*ref) + uf, err := baseURL.join(ref) if err != nil { return nil, err } diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/schema.go b/vendor/github.com/santhosh-tekuri/jsonschema/v6/schema.go index b4c1f37afb8..ab2474facd2 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/schema.go +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/schema.go @@ -1,8 +1,25 @@ +/* +Package jsonschema provides json-schema compilation and validation. + +The schema is compiled against the version specified in "$schema" property. +If "$schema" property is missing, it uses latest draft which currently implemented +by this library. + +You can force to use specific draft, when "$schema" is missing, as follows: + + compiler := jsonschema.NewCompiler() + compiler.DefaultDraft(jsonschema.Draft4) + +This package supports loading json-schema from filePath and fileURL. + +see examples for usage. +*/ package jsonschema import ( "encoding/json" "fmt" + "math" "math/big" ) @@ -110,12 +127,22 @@ const ( ) func typeOf(v any) jsonType { - switch v.(type) { + switch v := v.(type) { case nil: return nullType case bool: return booleanType - case json.Number, float32, float64, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64: + case float64: + if math.IsNaN(v) || math.IsInf(v, 0) { + return invalidType + } + return numberType + case float32: + if math.IsNaN(float64(v)) || math.IsInf(float64(v), 0) { + return invalidType + } + return numberType + case json.Number, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64: return numberType case string: return stringType diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/util.go b/vendor/github.com/santhosh-tekuri/jsonschema/v6/util.go index c6f8e77526c..8cd32aae764 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/util.go +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/util.go @@ -320,6 +320,9 @@ func equals(v1, v2 any) (bool, ErrorKind) { v2, ok := v2.(string) return ok && v1 == v2, nil case json.Number, float32, float64, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64: + if typeOf(v2) != numberType { + return false, nil + } num1, ok1 := new(big.Rat).SetString(fmt.Sprint(v1)) num2, ok2 := new(big.Rat).SetString(fmt.Sprint(v2)) return ok1 && ok2 && num1.Cmp(num2) == 0, nil diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/validator.go b/vendor/github.com/santhosh-tekuri/jsonschema/v6/validator.go index e2ace37a9fe..53a4c730b83 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/validator.go +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/validator.go @@ -293,6 +293,7 @@ func (vd *validator) objValidate(obj map[string]any) { } if err := sch.validate(pname, vd.regexpEngine, meta, resources, vd.assertVocabs, vd.vocabularies); err != nil { verr := err.(*ValidationError) + verr.InstanceLocation = vd.vloc verr.SchemaURL = s.PropertyNames.Location verr.ErrorKind = &kind.PropertyNames{Property: pname} vd.addErr(verr) @@ -375,7 +376,7 @@ func (vd *validator) arrValidate(arr []any) { } case *Schema: for i, item := range arr[evaluated:] { - vd.addErr(vd.validateVal(additional, item, strconv.Itoa(i))) + vd.addErr(vd.validateVal(additional, item, strconv.Itoa(evaluated+i))) } } } @@ -390,7 +391,7 @@ func (vd *validator) arrValidate(arr []any) { // items2020 -- if s.Items2020 != nil { for i, item := range arr[evaluated:] { - vd.addErr(vd.validateVal(s.Items2020, item, strconv.Itoa(i))) + vd.addErr(vd.validateVal(s.Items2020, item, strconv.Itoa(evaluated+i))) } } } @@ -503,6 +504,7 @@ func (vd *validator) strValidate(str string) { } if err = sch.validate(*deserialized, vd.regexpEngine, meta, resources, vd.assertVocabs, vd.vocabularies); err != nil { verr := err.(*ValidationError) + verr.InstanceLocation = vd.vloc verr.SchemaURL = s.Location verr.ErrorKind = &kind.ContentSchema{} vd.addErr(verr) diff --git a/vendor/github.com/santhosh-tekuri/jsonschema/v6/vocab.go b/vendor/github.com/santhosh-tekuri/jsonschema/v6/vocab.go index c81cb700f10..eaed8c95fea 100644 --- a/vendor/github.com/santhosh-tekuri/jsonschema/v6/vocab.go +++ b/vendor/github.com/santhosh-tekuri/jsonschema/v6/vocab.go @@ -14,6 +14,10 @@ func (ctx *CompilerContext) Enqueue(schPath []string) *Schema { return ctx.c.enqueuePtr(ptr) } +func (ctx *CompilerContext) EnqueueRef(ref string) (*Schema, error) { + return ctx.c.enqueueRefVal(ref) +} + // Vocabulary defines a set of keywords, their syntax and // their semantics. type Vocabulary struct { diff --git a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin.go b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin.go index d3b6dbc5329..847a91621d2 100644 --- a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin.go +++ b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin.go @@ -143,7 +143,7 @@ func perCPUTimes(sys *common.SystemLib) ([]TimesStat, error) { var cpuload *hostCpuLoadInfoData status := sys.HostProcessorInfo(sys.MachHostSelf(), processorCpuLoadInfo, - &ncpu, uintptr(unsafe.Pointer(&cpuload)), &count) + &ncpu, unsafe.Pointer(&cpuload), &count) if status != common.KERN_SUCCESS { return nil, fmt.Errorf("host_processor_info error=%d", status) @@ -177,7 +177,7 @@ func allCPUTimes(sys *common.SystemLib) ([]TimesStat, error) { count := uint32(cpuStateMax) status := sys.HostStatistics(sys.MachHostSelf(), common.HOST_CPU_LOAD_INFO, - uintptr(unsafe.Pointer(&cpuload)), &count) + unsafe.Pointer(&cpuload), &count) if status != common.KERN_SUCCESS { return nil, fmt.Errorf("host_statistics error=%d", status) diff --git a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd.go b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd.go index 3e0aeb26a45..38abcd0ebe6 100644 --- a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd.go +++ b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd.go @@ -81,6 +81,9 @@ func TimesWithContext(_ context.Context, percpu bool) ([]TimesStat, error) { if err != nil { return nil, err } + if len(buf) < int(unsafe.Sizeof(cpuTimes{})) { + return nil, fmt.Errorf("unexpected size: kern.cp_time, %d", len(buf)) + } times := (*cpuTimes)(unsafe.Pointer(&buf[0])) return []TimesStat{*timeStat("cpu-total", times)}, nil diff --git a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd.go b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd.go index 9e23edb6ea5..bb383129935 100644 --- a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd.go +++ b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd.go @@ -44,6 +44,9 @@ func TimesWithContext(_ context.Context, percpu bool) ([]TimesStat, error) { if err != nil { return ret, err } + if len(buf) < int(unsafe.Sizeof(cpuTimes{})) { + return ret, fmt.Errorf("unexpected size: kern.cp_time, %d", len(buf)) + } times := (*cpuTimes)(unsafe.Pointer(&buf[0])) ret = append(ret, TimesStat{ CPU: "cpu-total", @@ -68,6 +71,9 @@ func TimesWithContext(_ context.Context, percpu bool) ([]TimesStat, error) { if err != nil { return ret, err } + if len(buf) < int(unsafe.Sizeof(cpuTimes{})) { + continue + } stats := (*cpuTimes)(unsafe.Pointer(&buf[0])) ret = append(ret, TimesStat{ diff --git a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd.go b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd.go index 9b37d296a85..01654339997 100644 --- a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd.go @@ -62,6 +62,9 @@ func TimesWithContext(_ context.Context, percpu bool) ([]TimesStat, error) { if err != nil { return ret, err } + if len(buf) < int(unsafe.Sizeof(cpuTimes{})) { + return ret, fmt.Errorf("unexpected size: kern.cp_time, %d", len(buf)) + } times := (*cpuTimes)(unsafe.Pointer(&buf[0])) ret = append(ret, TimesStat{ CPU: "cpu-total", @@ -86,6 +89,9 @@ func TimesWithContext(_ context.Context, percpu bool) ([]TimesStat, error) { if err != nil { return ret, err } + if len(buf) < int(unsafe.Sizeof(cpuStats{})) { + continue + } stats := (*cpuStats)(unsafe.Pointer(&buf[0])) if (stats.Flags & cpuOnline) == 0 { diff --git a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_windows.go b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_windows.go index c15a085b75c..ee96405c5e7 100644 --- a/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_windows.go +++ b/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_windows.go @@ -104,14 +104,78 @@ func Times(percpu bool) ([]TimesStat, error) { } func TimesWithContext(_ context.Context, percpu bool) ([]TimesStat, error) { + // Get the CPU performance counters per processor via Windows API + stats, err := perfInfo() + if err == nil && len(stats) == 0 { + err = errors.New("no processor performance information returned") + } + if err != nil { + if percpu { + return nil, err + } + // perfInfo relies on the undocumented NtQuerySystemInformation, which + // may be unavailable in restricted environments. Fall back to the + // public GetSystemTimes for the total rather than failing outright. + return systemTimes() + } + if percpu { - return perCPUTimes() + ret := make([]TimesStat, 0, len(stats)) + for core, v := range stats { + c := TimesStat{ + CPU: fmt.Sprintf("cpu%d", core), + User: float64(v.UserTime) / ClocksPerSec, + System: float64(v.KernelTime-v.IdleTime) / ClocksPerSec, + Idle: float64(v.IdleTime) / ClocksPerSec, + Irq: float64(v.InterruptTime) / ClocksPerSec, + } + ret = append(ret, c) + } + return ret, nil + } + + // Accumulate the times over all CPUs as GetSystemTimes() will only return + // the counters for the current processor group. This causes issues for + // machines with more than 64 logical processors when the current thread is + // switched to another processor group as then the counters are not + // monotonic anymore. + // + // Do all arithmetic on the integer tick counts and convert to float64 only + // once. Converting each counter first loses precision on large counters and + // can make the returned values non-monotonic. See issue #2110. + var idle, kernel, user, interrupt int64 + for _, v := range stats { + idle += v.IdleTime + kernel += v.KernelTime + user += v.UserTime + interrupt += v.InterruptTime } - var ret []TimesStat - var lpIdleTime common.FILETIME - var lpKernelTime common.FILETIME - var lpUserTime common.FILETIME + return []TimesStat{ + { + CPU: "cpu-total", + User: float64(user) / ClocksPerSec, + System: float64(kernel-idle) / ClocksPerSec, // kernel time includes idle time + Idle: float64(idle) / ClocksPerSec, + Irq: float64(interrupt) / ClocksPerSec, + }, + }, nil +} + +// systemTimes returns the combined CPU times reported by GetSystemTimes. +// +// This is only a fallback for TimesWithContext(ctx, false): GetSystemTimes is a +// documented public API but returns the counters of the calling thread's +// processor group only, so on hosts with more than 64 logical processors the +// values are not monotonic once the thread is migrated to another group. It +// also cannot report Irq, which is left at zero here. +// +// Whether perfInfo works is a property of the environment, so in practice a +// process stays on one path for its whole lifetime. Should perfInfo fail only +// intermittently on a multi-group host, the two paths cover a different number +// of processors, and Percent may report one bogus sample before recovering. +func systemTimes() ([]TimesStat, error) { + var lpIdleTime, lpKernelTime, lpUserTime common.FILETIME // GetSystemTimes returns 0 for error, in which case we check err, // see https://pkg.go.dev/golang.org/x/sys/windows#LazyProc.Call r, _, err := common.ProcGetSystemTimes.Call( @@ -122,20 +186,19 @@ func TimesWithContext(_ context.Context, percpu bool) ([]TimesStat, error) { return nil, err } - LOT := float64(0.0000001) - HIT := (LOT * 4294967296.0) - idle := ((HIT * float64(lpIdleTime.DwHighDateTime)) + (LOT * float64(lpIdleTime.DwLowDateTime))) - user := ((HIT * float64(lpUserTime.DwHighDateTime)) + (LOT * float64(lpUserTime.DwLowDateTime))) - kernel := ((HIT * float64(lpKernelTime.DwHighDateTime)) + (LOT * float64(lpKernelTime.DwLowDateTime))) - system := (kernel - idle) - - ret = append(ret, TimesStat{ - CPU: "cpu-total", - Idle: float64(idle), - User: float64(user), - System: float64(system), - }) - return ret, nil + // See the note on integer arithmetic in TimesWithContext and issue #2110. + idle := uint64(lpIdleTime.DwHighDateTime)<<32 | uint64(lpIdleTime.DwLowDateTime) + user := uint64(lpUserTime.DwHighDateTime)<<32 | uint64(lpUserTime.DwLowDateTime) + kernel := uint64(lpKernelTime.DwHighDateTime)<<32 | uint64(lpKernelTime.DwLowDateTime) + + return []TimesStat{ + { + CPU: "cpu-total", + User: float64(user) / ClocksPerSec, + System: float64(kernel-idle) / ClocksPerSec, // kernel time includes idle time + Idle: float64(idle) / ClocksPerSec, + }, + }, nil } func Info() ([]InfoStat, error) { @@ -242,35 +305,22 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) { return ret, nil } -// perCPUTimes returns times stat per cpu, per core and overall for all CPUs -func perCPUTimes() ([]TimesStat, error) { - var ret []TimesStat - stats, err := perfInfo() - if err != nil { - return nil, err - } - for core, v := range stats { - c := TimesStat{ - CPU: fmt.Sprintf("cpu%d", core), - User: float64(v.UserTime) / ClocksPerSec, - System: float64(v.KernelTime-v.IdleTime) / ClocksPerSec, - Idle: float64(v.IdleTime) / ClocksPerSec, - Irq: float64(v.InterruptTime) / ClocksPerSec, - } - ret = append(ret, c) - } - return ret, nil -} - // makes call to Windows API function to retrieve performance information for each core func perfInfo() ([]win32_SystemProcessorPerformanceInformation, error) { // On hosts with more than 64 logical CPUs Windows splits CPUs into Processor Groups // (up to 64 logical CPUs per group). The non-Ex NtQuerySystemInformation only returns // data for the calling thread's group, so whenever the Ex variant is available we // iterate every active group and concatenate the results. See issue #887. - if common.ProcNtQuerySystemInformationEx.Find() == nil { + // + // Every proc is resolved with Find before it is used: LazyProc.Call panics when it + // cannot resolve, and a panic would take the caller's process down instead of + // letting TimesWithContext fall back to GetSystemTimes. + if common.ProcNtQuerySystemInformationEx.Find() == nil && procGetActiveProcessorGroupCount.Find() == nil { return perfInfoAllGroups() } + if err := common.ProcNtQuerySystemInformation.Find(); err != nil { + return nil, err + } return perfInfoSingleGroup() } @@ -474,18 +524,23 @@ func getSMBIOSProcessorInfo() (family uint8, processorId string, err error) { func getSystemLogicalProcessorInformationEx(relationship relationship) ([]systemLogicalProcessorInformationEx, error) { var length uint32 - // First call to determine the required buffer size - _, _, err := procGetLogicalProcessorInformationEx.Call(uintptr(relationship), 0, uintptr(unsafe.Pointer(&length))) - if err != nil && !errors.Is(err, windows.ERROR_INSUFFICIENT_BUFFER) { + // First call to determine the required buffer size. It is expected to + // fail with ERROR_INSUFFICIENT_BUFFER; the error returned by Call is + // only meaningful once the BOOL return value says the call failed. + ret, _, err := procGetLogicalProcessorInformationEx.Call(uintptr(relationship), 0, uintptr(unsafe.Pointer(&length))) + if ret == 0 && !errors.Is(err, windows.ERROR_INSUFFICIENT_BUFFER) { return nil, fmt.Errorf("failed to get buffer size: %w", err) } + if length == 0 { + return nil, errors.New("failed to get buffer size: reported size is zero") + } // Allocate the buffer buffer := make([]byte, length) // Second call to retrieve the processor information - _, _, err = procGetLogicalProcessorInformationEx.Call(uintptr(relationship), uintptr(unsafe.Pointer(&buffer[0])), uintptr(unsafe.Pointer(&length))) - if err != nil && !errors.Is(err, windows.NTE_OP_OK) { + ret, _, err = procGetLogicalProcessorInformationEx.Call(uintptr(relationship), uintptr(unsafe.Pointer(&buffer[0])), uintptr(unsafe.Pointer(&length))) + if ret == 0 { return nil, fmt.Errorf("failed to get logical processor information: %w", err) } diff --git a/vendor/github.com/shirou/gopsutil/v4/internal/common/common_darwin.go b/vendor/github.com/shirou/gopsutil/v4/internal/common/common_darwin.go index caa1b8d9816..2cf72875fb4 100644 --- a/vendor/github.com/shirou/gopsutil/v4/internal/common/common_darwin.go +++ b/vendor/github.com/shirou/gopsutil/v4/internal/common/common_darwin.go @@ -27,16 +27,37 @@ const ( SystemLibPath = "/usr/lib/libSystem.B.dylib" ) +// Library handles are opened once and shared for the process lifetime. +// Opening and closing them on every call causes SIGBUS/SIGSEGV crashes because +// the Go runtime (GC, timers) can interact with invalidated library handles +// after Dlclose. Sharing also keeps the resolved-symbol cache in fnMap warm, +// so a symbol lookup is not repeated on every call. +// See: https://github.com/shirou/gopsutil/issues/1832 +var ( + libCacheMu sync.Mutex + libCache = make(map[string]*library) +) + func newLibrary(path string) (*library, error) { - lib, err := purego.Dlopen(path, purego.RTLD_LAZY|purego.RTLD_GLOBAL) + libCacheMu.Lock() + defer libCacheMu.Unlock() + + if lib, ok := libCache[path]; ok { + return lib, nil + } + + handle, err := purego.Dlopen(path, purego.RTLD_LAZY|purego.RTLD_GLOBAL) if err != nil { return nil, err } - return &library{ - handle: lib, + lib := &library{ + handle: handle, fnMap: make(map[string]any), - }, nil + } + libCache[path] = lib + + return lib, nil } func (lib *library) Dlsym(symbol string) (uintptr, error) { @@ -69,9 +90,10 @@ func getFunc[T any](lib *library, symbol string) T { return dlfun.fn } -func (lib *library) Close() { - purego.Dlclose(lib.handle) -} +// Close is a no-op, kept so that existing defer-Close call sites keep working. +// Library handles are shared process-wide and are deliberately never unloaded; +// see newLibrary for why. +func (*library) Close() {} type dlFunc[T any] struct { sym string @@ -103,12 +125,12 @@ func (c *CoreFoundationLib) CFGetTypeID(cf uintptr) int64 { return fn(cf) } -func (c *CoreFoundationLib) CFNumberCreate(allocator uintptr, theType int64, valuePtr uintptr) unsafe.Pointer { +func (c *CoreFoundationLib) CFNumberCreate(allocator uintptr, theType int64, valuePtr unsafe.Pointer) unsafe.Pointer { fn := getFunc[CFNumberCreateFunc](c.library, "CFNumberCreate") return fn(allocator, theType, valuePtr) } -func (c *CoreFoundationLib) CFNumberGetValue(num uintptr, theType int64, valuePtr uintptr) bool { +func (c *CoreFoundationLib) CFNumberGetValue(num uintptr, theType int64, valuePtr unsafe.Pointer) bool { fn := getFunc[CFNumberGetValueFunc](c.library, "CFNumberGetValue") return fn(num, theType, valuePtr) } @@ -247,7 +269,9 @@ func (l *IOKitLib) IOObjectRelease(object uint32) int32 { return fn(object) } -func (l *IOKitLib) IOConnectCallStructMethod(connection, selector uint32, inputStruct, inputStructCnt, outputStruct uintptr, outputStructCnt *uintptr) int32 { +func (l *IOKitLib) IOConnectCallStructMethod(connection, selector uint32, inputStruct unsafe.Pointer, inputStructCnt uintptr, + outputStruct unsafe.Pointer, outputStructCnt *uintptr, +) int32 { fn := getFunc[IOConnectCallStructMethodFunc](l.library, "IOConnectCallStructMethod") return fn(connection, selector, inputStruct, inputStructCnt, outputStruct, outputStructCnt) } @@ -294,14 +318,14 @@ func NewSystemLib() (*SystemLib, error) { return &SystemLib{library}, nil } -func (s *SystemLib) HostProcessorInfo(host uint32, flavor int32, outProcessorCount *uint32, outProcessorInfo uintptr, +func (s *SystemLib) HostProcessorInfo(host uint32, flavor int32, outProcessorCount *uint32, outProcessorInfo unsafe.Pointer, outProcessorInfoCnt *uint32, ) int32 { fn := getFunc[HostProcessorInfoFunc](s.library, "host_processor_info") return fn(host, flavor, outProcessorCount, outProcessorInfo, outProcessorInfoCnt) } -func (s *SystemLib) HostStatistics(host uint32, flavor int32, hostInfoOut uintptr, hostInfoOutCnt *uint32) int32 { +func (s *SystemLib) HostStatistics(host uint32, flavor int32, hostInfoOut unsafe.Pointer, hostInfoOutCnt *uint32) int32 { fn := getFunc[HostStatisticsFunc](s.library, "host_statistics") return fn(host, flavor, hostInfoOut, hostInfoOutCnt) } @@ -316,7 +340,7 @@ func (s *SystemLib) MachTaskSelf() uint32 { return fn() } -func (s *SystemLib) MachTimeBaseInfo(info uintptr) int32 { +func (s *SystemLib) MachTimeBaseInfo(info unsafe.Pointer) int32 { fn := getFunc[MachTimeBaseInfoFunc](s.library, "mach_timebase_info") return fn(info) } @@ -326,21 +350,51 @@ func (s *SystemLib) VMDeallocate(targetTask uint32, vmAddress, vmSize uintptr) i return fn(targetTask, vmAddress, vmSize) } -func (s *SystemLib) ProcPidPath(pid int32, buffer uintptr, bufferSize uint32) int32 { +func (s *SystemLib) ProcPidPath(pid int32, buffer unsafe.Pointer, bufferSize uint32) int32 { fn := getFunc[ProcPidPathFunc](s.library, "proc_pidpath") return fn(pid, buffer, bufferSize) } -func (s *SystemLib) ProcPidInfo(pid, flavor int32, arg uint64, buffer uintptr, bufferSize int32) int32 { +func (s *SystemLib) ProcPidInfo(pid, flavor int32, arg uint64, buffer unsafe.Pointer, bufferSize int32) int32 { fn := getFunc[ProcPidInfoFunc](s.library, "proc_pidinfo") return fn(pid, flavor, arg, buffer, bufferSize) } +func (s *SystemLib) ProcPidRusage(pid, flavor int32, buffer unsafe.Pointer) int32 { + fn := getFunc[ProcPidRusageFunc](s.library, "proc_pid_rusage") + return fn(pid, flavor, buffer) +} + +// ErrnoLocation returns a pointer to the calling OS thread's errno, as given by +// libc's __error(). The pointer is thread-local, so callers must hold +// runtime.LockOSThread() across this call, the libc call being checked, and the +// dereference of the returned pointer. +// +// Resolve the pointer *before* the libc call whose errno is to be inspected. +// Resolving a symbol performs a dlsym and allocates, and either may overwrite +// errno; doing it afterwards would race with the value being read. +func (s *SystemLib) ErrnoLocation() *int32 { + fn := getFunc[ErrnoFunc](s.library, "__error") + return fn() +} + // status codes const ( KERN_SUCCESS = 0 ) +// Arguments that point at Go memory are declared as unsafe.Pointer, a Go +// pointer type, or a slice -- never as uintptr. purego maps uintptr to +// uintptr_t, i.e. a plain integer: it neither keeps the pointee alive nor makes +// it escape, so a Go local stays on the goroutine stack and the address goes +// stale the moment the stack grows. Every such call then reads or writes the old +// stack and silently sees or produces zeroes. The other kinds are passed through +// reflect.Value.Pointer() and stay reachable for the duration of the call. +// +// uintptr remains correct for handles that are not Go memory: CoreFoundation and +// IOKit object references, mach ports, addresses of dylib data symbols obtained +// through Dlsym, and kernel-allocated vm addresses. + // IOKit types and constants. type ( IOServiceGetMatchingServiceFunc func(mainPort uint32, matching uintptr) uint32 @@ -355,7 +409,8 @@ type ( IORegistryEntryCreateCFPropertiesFunc func(entry uint32, properties unsafe.Pointer, allocator uintptr, options uint32) int32 IOObjectConformsToFunc func(object uint32, className string) bool IOObjectReleaseFunc func(object uint32) int32 - IOConnectCallStructMethodFunc func(connection, selector uint32, inputStruct, inputStructCnt, outputStruct uintptr, outputStructCnt *uintptr) int32 + IOConnectCallStructMethodFunc func(connection, selector uint32, inputStruct unsafe.Pointer, inputStructCnt uintptr, + outputStruct unsafe.Pointer, outputStructCnt *uintptr) int32 IOHIDEventSystemClientCreateFunc func(allocator uintptr) unsafe.Pointer IOHIDEventSystemClientSetMatchingFunc func(client, match uintptr) int32 @@ -380,10 +435,14 @@ const ( ) // CoreFoundation types and constants. +// +// valuePtr on CFNumberCreate and CFNumberGetValue points at a caller-owned Go +// value that CoreFoundation reads from or writes into, hence unsafe.Pointer; see +// the note above the IOKit function types. type ( CFGetTypeIDFunc func(cf uintptr) int64 - CFNumberCreateFunc func(allocator uintptr, theType int64, valuePtr uintptr) unsafe.Pointer - CFNumberGetValueFunc func(num uintptr, theType int64, valuePtr uintptr) bool + CFNumberCreateFunc func(allocator uintptr, theType int64, valuePtr unsafe.Pointer) unsafe.Pointer + CFNumberGetValueFunc func(num uintptr, theType int64, valuePtr unsafe.Pointer) bool CFDictionaryCreateFunc func(allocator uintptr, keys, values *unsafe.Pointer, numValues int64, keyCallBacks, valueCallBacks uintptr) unsafe.Pointer CFDictionaryAddValueFunc func(theDict, key, value uintptr) @@ -413,13 +472,16 @@ type MachTimeBaseInfo struct { Denom uint32 } +// Buffers the kernel writes into are declared as unsafe.Pointer; see the note +// above the IOKit function types. vmAddress on VMDeallocateFunc stays a uintptr +// because it names kernel-allocated memory rather than Go memory. type ( - HostProcessorInfoFunc func(host uint32, flavor int32, outProcessorCount *uint32, outProcessorInfo uintptr, + HostProcessorInfoFunc func(host uint32, flavor int32, outProcessorCount *uint32, outProcessorInfo unsafe.Pointer, outProcessorInfoCnt *uint32) int32 - HostStatisticsFunc func(host uint32, flavor int32, hostInfoOut uintptr, hostInfoOutCnt *uint32) int32 + HostStatisticsFunc func(host uint32, flavor int32, hostInfoOut unsafe.Pointer, hostInfoOutCnt *uint32) int32 MachHostSelfFunc func() uint32 MachTaskSelfFunc func() uint32 - MachTimeBaseInfoFunc func(info uintptr) int32 + MachTimeBaseInfoFunc func(info unsafe.Pointer) int32 VMDeallocateFunc func(targetTask uint32, vmAddress, vmSize uintptr) int32 ) @@ -440,14 +502,18 @@ const ( ) type ( - ProcPidPathFunc func(pid int32, buffer uintptr, bufferSize uint32) int32 - ProcPidInfoFunc func(pid, flavor int32, arg uint64, buffer uintptr, bufferSize int32) int32 + ProcPidPathFunc func(pid int32, buffer unsafe.Pointer, bufferSize uint32) int32 + ProcPidInfoFunc func(pid, flavor int32, arg uint64, buffer unsafe.Pointer, bufferSize int32) int32 + ProcPidRusageFunc func(pid, flavor int32, buffer unsafe.Pointer) int32 + ErrnoFunc func() *int32 ) const ( - SysctlSym = "sysctl" - ProcPidPathSym = "proc_pidpath" - ProcPidInfoSym = "proc_pidinfo" + SysctlSym = "sysctl" + ProcPidPathSym = "proc_pidpath" + ProcPidInfoSym = "proc_pidinfo" + ProcPidRusageSym = "proc_pid_rusage" + ErrnoSym = "__error" ) const ( @@ -456,6 +522,10 @@ const ( PROC_PIDPATHINFO_MAXSIZE = 4 * MAXPATHLEN PROC_PIDTASKINFO = 4 PROC_PIDVNODEPATHINFO = 9 + + // RUSAGE_INFO_V2 is the proc_pid_rusage flavor that includes disk I/O bytes. + // See sys/resource.h rusage_info_v2. + RUSAGE_INFO_V2 = 2 ) // SMC represents a SMC instance. @@ -507,15 +577,18 @@ func NewSMC() (*SMC, error) { }, nil } -func (s *SMC) CallStruct(selector uint32, inputStruct, inputStructCnt, outputStruct uintptr, outputStructCnt *uintptr) int32 { +func (s *SMC) CallStruct(selector uint32, inputStruct unsafe.Pointer, inputStructCnt uintptr, + outputStruct unsafe.Pointer, outputStructCnt *uintptr, +) int32 { return s.lib.IOConnectCallStructMethod(s.conn, selector, inputStruct, inputStructCnt, outputStruct, outputStructCnt) } +// Close releases the SMC connection. The IOKit handle itself is shared +// process-wide and is deliberately left open; see newLibrary. func (s *SMC) Close() error { if result := s.lib.IOServiceClose(s.conn); result != 0 { return errors.New("ERROR: IOServiceClose failed") } - s.lib.Close() return nil } @@ -537,10 +610,6 @@ func (s CStr) Ptr() *byte { return &s[0] } -func (s CStr) Addr() uintptr { - return uintptr(unsafe.Pointer(s.Ptr())) -} - func (s CStr) GoString() string { if s == nil { return "" diff --git a/vendor/github.com/shirou/gopsutil/v4/internal/common/common_windows.go b/vendor/github.com/shirou/gopsutil/v4/internal/common/common_windows.go index 3778e4d95eb..e9175c2e8d5 100644 --- a/vendor/github.com/shirou/gopsutil/v4/internal/common/common_windows.go +++ b/vendor/github.com/shirou/gopsutil/v4/internal/common/common_windows.go @@ -184,7 +184,7 @@ func NewWin32PerformanceCounter(postName, counterName string) (*Win32Performance func (w *Win32PerformanceCounter) GetValue() (float64, error) { r, _, err := PdhCollectQueryData.Call(uintptr(w.Query)) - if r != 0 && err != nil { + if r != 0 { if r == PDH_NO_DATA { return 0.0, fmt.Errorf("%w: this counter has not data", err) } diff --git a/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin.go b/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin.go index 1b3e9f21beb..58746a613a2 100644 --- a/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin.go +++ b/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin.go @@ -95,7 +95,7 @@ func VirtualMemoryWithContext(_ context.Context) (*VirtualMemoryStat, error) { var vmstat vmStatisticsData status := sys.HostStatistics(sys.MachHostSelf(), common.HOST_VM_INFO, - uintptr(unsafe.Pointer(&vmstat)), &count) + unsafe.Pointer(&vmstat), &count) if status != common.KERN_SUCCESS { return nil, fmt.Errorf("host_statistics error=%d", status) diff --git a/vendor/github.com/shirou/gopsutil/v4/mem/mem_linux.go b/vendor/github.com/shirou/gopsutil/v4/mem/mem_linux.go index a888c5badaa..a33cd03b8e8 100644 --- a/vendor/github.com/shirou/gopsutil/v4/mem/mem_linux.go +++ b/vendor/github.com/shirou/gopsutil/v4/mem/mem_linux.go @@ -479,7 +479,7 @@ func parseSwapsFile(ctx context.Context, r io.Reader) ([]*SwapDevice, error) { // Check header headerFields are as expected headerFields := strings.Fields(scanner.Text()) - if len(headerFields) < usedCol { + if len(headerFields) <= usedCol { return nil, fmt.Errorf("couldn't parse %q: too few fields in header", swapsFilePath) } if headerFields[nameCol] != "Filename" { @@ -495,7 +495,7 @@ func parseSwapsFile(ctx context.Context, r io.Reader) ([]*SwapDevice, error) { var swapDevices []*SwapDevice for scanner.Scan() { fields := strings.Fields(scanner.Text()) - if len(fields) < usedCol { + if len(fields) <= usedCol { return nil, fmt.Errorf("couldn't parse %q: too few fields", swapsFilePath) } diff --git a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_386.go b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_386.go index 552e93f4a28..9014151f125 100644 --- a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_386.go +++ b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_386.go @@ -13,7 +13,7 @@ const ( ) const ( - sizeOfBcachestats = 0x90 + sizeOfBcachestats = 0x68 ) type Bcachestats struct { @@ -27,12 +27,7 @@ type Bcachestats struct { Numreads int64 Cachehits int64 Busymapped int64 - Dmapages int64 - Highpages int64 Delwribufs int64 Kvaslots int64 Avail int64 - Highflips int64 - Highflops int64 - Dmaflips int64 } diff --git a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_amd64.go b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_amd64.go index 73e5b72aa67..caad761eb21 100644 --- a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_amd64.go +++ b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_amd64.go @@ -11,7 +11,7 @@ const ( ) const ( - sizeOfBcachestats = 0x78 + sizeOfBcachestats = 0x68 ) type Bcachestats struct { @@ -25,8 +25,6 @@ type Bcachestats struct { Numreads int64 Cachehits int64 Busymapped int64 - Dmapages int64 - Highpages int64 Delwribufs int64 Kvaslots int64 Avail int64 diff --git a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm.go b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm.go index 57b5861de5b..ee6ed10c866 100644 --- a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm.go +++ b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm.go @@ -13,7 +13,7 @@ const ( ) const ( - sizeOfBcachestats = 0x90 + sizeOfBcachestats = 0x68 ) type Bcachestats struct { @@ -27,12 +27,7 @@ type Bcachestats struct { Numreads int64 Cachehits int64 Busymapped int64 - Dmapages int64 - Highpages int64 Delwribufs int64 Kvaslots int64 Avail int64 - Highflips int64 - Highflops int64 - Dmaflips int64 } diff --git a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm64.go b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm64.go index f39a6456b73..b7a16414d06 100644 --- a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm64.go +++ b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm64.go @@ -13,7 +13,7 @@ const ( ) const ( - sizeOfBcachestats = 0x90 + sizeOfBcachestats = 0x68 ) type Bcachestats struct { @@ -27,12 +27,7 @@ type Bcachestats struct { Numreads int64 Cachehits int64 Busymapped int64 - Dmapages int64 - Highpages int64 Delwribufs int64 Kvaslots int64 Avail int64 - Highflips int64 - Highflops int64 - Dmaflips int64 } diff --git a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_riscv64.go b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_riscv64.go index f9f838f54ed..bad8b715d62 100644 --- a/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_riscv64.go +++ b/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_riscv64.go @@ -13,7 +13,7 @@ const ( ) const ( - sizeOfBcachestats = 0x90 + sizeOfBcachestats = 0x68 ) type Bcachestats struct { @@ -27,12 +27,7 @@ type Bcachestats struct { Numreads int64 Cachehits int64 Busymapped int64 - Dmapages int64 - Highpages int64 Delwribufs int64 Kvaslots int64 Avail int64 - Highflips int64 - Highflops int64 - Dmaflips int64 } diff --git a/vendor/github.com/shirou/gopsutil/v4/net/net.go b/vendor/github.com/shirou/gopsutil/v4/net/net.go index 1d1f9f08b09..384e5673a0a 100644 --- a/vendor/github.com/shirou/gopsutil/v4/net/net.go +++ b/vendor/github.com/shirou/gopsutil/v4/net/net.go @@ -286,12 +286,25 @@ func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) { return IOCountersByFileWithContext(context.Background(), pernic, filename) } -// ProtoCounters returns network statistics for the entire system +// ProtoCounters returns network statistics for the entire system. // If protocols is empty then all protocols are returned, otherwise // just the protocols in the list are returned. +// // Available protocols: // [ip,icmp,icmpmsg,tcp,udp,udplite] -// Not Implemented for FreeBSD, Windows, OpenBSD, Darwin +// +// Key naming contract: +// The keys of the returned Stats map use MIB-II (RFC 1213) identifier +// names — e.g. "InSegs", "OutSegs", "RetransSegs", "ActiveOpens", +// "InDatagrams", "NoPorts". This contract was established by the +// original Linux implementation, which sources its keys from +// /proc/net/snmp (whose headers are MIB-II names). Per-platform +// implementations are expected to map their native counter sources +// (e.g. AIX `netstat -s`, BSD sysctl) to these MIB-II names. +// Native counters that have no MIB-II equivalent are not exposed +// through this API. +// +// Not Implemented for FreeBSD, Windows, OpenBSD, Darwin, Solaris. func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { return ProtoCountersWithContext(context.Background(), protocols) } diff --git a/vendor/github.com/shirou/gopsutil/v4/net/net_darwin.go b/vendor/github.com/shirou/gopsutil/v4/net/net_darwin.go index 9531ad5b189..f440266ea9f 100644 --- a/vendor/github.com/shirou/gopsutil/v4/net/net_darwin.go +++ b/vendor/github.com/shirou/gopsutil/v4/net/net_darwin.go @@ -24,14 +24,25 @@ const endOfLine = "\n" func parseNetstatLine(line string) (stat *IOCountersStat, linkID *uint, err error) { var ( - numericValue uint64 - columns = strings.Fields(line) + numericValue uint64 + columns = strings.Fields(line) + numberColumns = len(columns) ) - if columns[0] == "Name" { + if numberColumns > 0 && columns[0] == "Name" { return nil, nil, errNetstatHeader } + if numberColumns < 11 || numberColumns > 13 { + return nil, nil, fmt.Errorf("line %q has an invalid number of columns: %d", line, numberColumns) + } + + base := 1 + // sometimes Address is omitted + if numberColumns < 12 { + base = 0 + } + // try to extract the numeric value from if subMatch := netstatLinkRegexp.FindStringSubmatch(columns[2]); len(subMatch) == 2 { numericValue, err = strconv.ParseUint(subMatch[1], 10, 64) @@ -42,16 +53,6 @@ func parseNetstatLine(line string) (stat *IOCountersStat, linkID *uint, err erro linkID = &linkIDUint } - base := 1 - numberColumns := len(columns) - // sometimes Address is omitted - if numberColumns < 12 { - base = 0 - } - if numberColumns < 11 || numberColumns > 13 { - return nil, nil, fmt.Errorf("line %q do have an invalid number of columns %d", line, numberColumns) - } - parsed := make([]uint64, 0, 7) vv := []string{ columns[base+3], // Ipkts == PacketsRecv @@ -93,29 +94,20 @@ type netstatInterface struct { stat *IOCountersStat } -func parseNetstatOutput(output string) ([]netstatInterface, error) { - var ( - err error - lines = strings.Split(strings.Trim(output, endOfLine), endOfLine) - ) - - // number of interfaces is number of lines less one for the header - numberInterfaces := len(lines) - 1 - - interfaces := make([]netstatInterface, numberInterfaces) - // no output beside header - if numberInterfaces == 0 { - return interfaces, nil - } +func parseNetstatOutput(output string) []netstatInterface { + lines := strings.Split(strings.Trim(output, endOfLine), endOfLine) - for index := 0; index < numberInterfaces; index++ { - nsIface := netstatInterface{} - if nsIface.stat, nsIface.linkID, err = parseNetstatLine(lines[index+1]); err != nil { - return nil, err + interfaces := make([]netstatInterface, 0, len(lines)) + for _, line := range lines { + stat, linkID, err := parseNetstatLine(line) + if err != nil { + // Invoke combines stdout and stderr, so diagnostics can appear + // anywhere in the output. They are not netstat interface rows. + continue } - interfaces[index] = nsIface + interfaces = append(interfaces, netstatInterface{stat: stat, linkID: linkID}) } - return interfaces, nil + return interfaces } // map that hold the name of a network interface and the number of usage @@ -183,10 +175,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, return nil, err } - nsInterfaces, err := parseNetstatOutput(string(out)) - if err != nil { - return nil, err - } + nsInterfaces := parseNetstatOutput(string(out)) ifaceUsage := newMapInterfaceNameUsage(nsInterfaces) notTruncated := ifaceUsage.notTruncated() @@ -224,10 +213,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, if out, err = invoke.CommandWithContext(ctx, netstat, "-ibdnWI"+interfaceName); err != nil { return nil, err } - parsedIfaces, err := parseNetstatOutput(string(out)) - if err != nil { - return nil, err - } + parsedIfaces := parseNetstatOutput(string(out)) if len(parsedIfaces) == 0 { // interface had been removed since `ifconfig -l` had been executed continue diff --git a/vendor/github.com/shirou/gopsutil/v4/net/net_linux.go b/vendor/github.com/shirou/gopsutil/v4/net/net_linux.go index 96a78ff8053..06c98d1feca 100644 --- a/vendor/github.com/shirou/gopsutil/v4/net/net_linux.go +++ b/vendor/github.com/shirou/gopsutil/v4/net/net_linux.go @@ -50,6 +50,10 @@ func IOCountersByFileWithContext(_ context.Context, pernic bool, filename string return nil, err } + if len(lines) < 2 { + return nil, fmt.Errorf("malformed %s: expected at least 2 header lines, got %d", filename, len(lines)) + } + statlen := len(lines) - 1 ret := make([]IOCountersStat, 0, statlen) @@ -764,7 +768,7 @@ func processUnix(file string, kind netConnectionKindType, inodes map[string][]in // skip first line for _, line := range lines[1:] { tokens := strings.Fields(string(line)) - if len(tokens) < 6 { + if len(tokens) < 7 { continue } st, err := strconv.ParseInt(tokens[4], 10, 32) diff --git a/vendor/github.com/shirou/gopsutil/v4/net/net_windows.go b/vendor/github.com/shirou/gopsutil/v4/net/net_windows.go index f530e4e5733..22dae71483c 100644 --- a/vendor/github.com/shirou/gopsutil/v4/net/net_windows.go +++ b/vendor/github.com/shirou/gopsutil/v4/net/net_windows.go @@ -365,7 +365,7 @@ func getTCPConnections(family uint32) ([]ConnectionStat, error) { return nil, errors.New("faimly must be required") } - for { + for retry := 0; retry < 10; retry++ { switch family { case kindTCP4.family: if len(buf) > 0 { @@ -395,6 +395,12 @@ func getTCPConnections(family uint32) ([]ConnectionStat, error) { if !errors.Is(err, windows.ERROR_INSUFFICIENT_BUFFER) { return nil, err } + if retry == 9 { + return nil, errors.New("GetExtendedTcpTable: failed to allocate sufficient buffer after 10 retries") + } + + // Add 4KB padding to account for concurrent connection growth between calls. + size += 4096 buf = make([]byte, size) } @@ -446,7 +452,7 @@ func getUDPConnections(family uint32) ([]ConnectionStat, error) { return nil, errors.New("faimly must be required") } - for { + for retry := 0; retry < 10; retry++ { switch family { case kindUDP4.family: if len(buf) > 0 { @@ -478,6 +484,12 @@ func getUDPConnections(family uint32) ([]ConnectionStat, error) { if !errors.Is(err, windows.ERROR_INSUFFICIENT_BUFFER) { return nil, err } + if retry == 9 { + return nil, errors.New("GetExtendedUdpTable: failed to allocate sufficient buffer after 10 retries") + } + + // Add 4KB padding to account for concurrent connection growth between calls. + size += 4096 buf = make([]byte, size) } diff --git a/vendor/github.com/shirou/gopsutil/v4/process/process.go b/vendor/github.com/shirou/gopsutil/v4/process/process.go index 5db5ff48192..7fd0020c314 100644 --- a/vendor/github.com/shirou/gopsutil/v4/process/process.go +++ b/vendor/github.com/shirou/gopsutil/v4/process/process.go @@ -110,12 +110,14 @@ type IOCountersStat struct { // WriteCount is a number of read I/O operations such as syscalls. WriteCount uint64 `json:"writeCount"` // ReadBytes is a number of all I/O read in bytes. This includes disk I/O on Linux and Windows. + // Darwin does not expose this and reports 0; use DiskReadBytes there. ReadBytes uint64 `json:"readBytes"` - // WriteBytes is a number of all I/O write in bytes. This includes disk I/O on Linux and Windows. + // WriteBytes is a number of all I/O written in bytes. This includes disk I/O on Linux and Windows. + // Darwin does not expose this and reports 0; use DiskWriteBytes there. WriteBytes uint64 `json:"writeBytes"` - // DiskReadBytes is a number of disk I/O write in bytes. Currently only Linux has this value. + // DiskReadBytes is a number of disk I/O read in bytes. Currently, Linux and Darwin have this value. DiskReadBytes uint64 `json:"diskReadBytes"` - // DiskWriteBytes is a number of disk I/O read in bytes. Currently only Linux has this value. + // DiskWriteBytes is a number of disk I/O written in bytes. Currently, Linux and Darwin have this value. DiskWriteBytes uint64 `json:"diskWriteBytes"` } @@ -279,7 +281,7 @@ func (p *Process) PercentWithContext(ctx context.Context, interval time.Duration } numcpu := runtime.NumCPU() - delta := (now.Sub(p.lastCPUTime).Seconds()) * float64(numcpu) + delta := now.Sub(p.lastCPUTime).Seconds() * float64(numcpu) ret := calculatePercent(p.lastCPUTimes, cpuTimes, delta, numcpu) p.lastCPUTimes = cpuTimes p.lastCPUTime = now diff --git a/vendor/github.com/shirou/gopsutil/v4/process/process_darwin.go b/vendor/github.com/shirou/gopsutil/v4/process/process_darwin.go index 35c34adb3da..6bb88d7eedb 100644 --- a/vendor/github.com/shirou/gopsutil/v4/process/process_darwin.go +++ b/vendor/github.com/shirou/gopsutil/v4/process/process_darwin.go @@ -7,7 +7,6 @@ import ( "bytes" "context" "encoding/binary" - "errors" "fmt" "path/filepath" "runtime" @@ -179,8 +178,72 @@ func (p *Process) NiceWithContext(_ context.Context) (int32, error) { return int32(k.Proc.P_nice), nil } -func (*Process) IOCountersWithContext(_ context.Context) (*IOCountersStat, error) { - return nil, common.ErrNotImplementedError +// rusageInfoV2 mirrors Darwin's struct rusage_info_v2 from sys/resource.h. +// Only DiskIOBytesRead / DiskIOBytesWritten are used for IOCounters. +type rusageInfoV2 struct { + UUID [16]byte + UserTime uint64 + SystemTime uint64 + PkgIdleWkups uint64 + InterruptWkups uint64 + Pageins uint64 + WiredSize uint64 + ResidentSize uint64 + PhysFootprint uint64 + ProcStartAbstime uint64 + ProcExitAbstime uint64 + ChildUserTime uint64 + ChildSystemTime uint64 + ChildPkgIdleWkups uint64 + ChildInterruptWkups uint64 + ChildPageins uint64 + ChildElapsedAbstime uint64 + DiskIOBytesRead uint64 + DiskIOBytesWritten uint64 +} + +// IOCountersWithContext returns cumulative disk I/O bytes for the process via +// proc_pid_rusage(RUSAGE_INFO_V2). +// +// Darwin only reports disk I/O, so only DiskReadBytes and DiskWriteBytes are +// populated. ReadBytes/WriteBytes count all I/O including that served from +// cache on other platforms, which has no Darwin equivalent, and ReadCount / +// WriteCount are not exposed at all; all four stay zero. +// +// Access may fail with ErrorNotPermitted for protected processes. +func (p *Process) IOCountersWithContext(_ context.Context) (*IOCountersStat, error) { + funcs, err := loadProcFuncs() + if err != nil { + return nil, err + } + defer funcs.Close() + + // Lock the OS thread so that errno, which is thread-local, still belongs to + // the thread that made the call below by the time it is read. + runtime.LockOSThread() + defer runtime.UnlockOSThread() + + // Resolve the errno location up front: doing it after the call would run a + // dlsym and allocate in between, either of which can overwrite errno. + errnoPtr := funcs.lib.ErrnoLocation() + + var usage rusageInfoV2 + ret := funcs.lib.ProcPidRusage(p.Pid, common.RUSAGE_INFO_V2, unsafe.Pointer(&usage)) + if ret != 0 { + switch errno := unix.Errno(*errnoPtr); errno { + case unix.EPERM: + return nil, ErrorNotPermitted + case unix.ESRCH: + return nil, ErrorProcessNotRunning + default: + return nil, fmt.Errorf("proc_pid_rusage failed for pid %d: %w", p.Pid, errno) + } + } + + return &IOCountersStat{ + DiskReadBytes: usage.DiskIOBytesRead, + DiskWriteBytes: usage.DiskIOBytesWritten, + }, nil } func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { @@ -294,7 +357,7 @@ func loadProcFuncs() (*dlFuncs, error) { func (f *dlFuncs) getTimeScaleToNanoSeconds() float64 { var timeBaseInfo common.MachTimeBaseInfo - f.lib.MachTimeBaseInfo(uintptr(unsafe.Pointer(&timeBaseInfo))) + f.lib.MachTimeBaseInfo(unsafe.Pointer(&timeBaseInfo)) return float64(timeBaseInfo.Numer) / float64(timeBaseInfo.Denom) } @@ -311,7 +374,7 @@ func (p *Process) ExeWithContext(_ context.Context) (string, error) { defer funcs.Close() buf := common.NewCStr(common.PROC_PIDPATHINFO_MAXSIZE) - ret := funcs.lib.ProcPidPath(p.Pid, buf.Addr(), common.PROC_PIDPATHINFO_MAXSIZE) + ret := funcs.lib.ProcPidPath(p.Pid, unsafe.Pointer(buf.Ptr()), common.PROC_PIDPATHINFO_MAXSIZE) if ret <= 0 { return "", fmt.Errorf("unknown error: proc_pidpath returned %d", ret) @@ -332,20 +395,24 @@ func (p *Process) CwdWithContext(_ context.Context) (string, error) { } defer funcs.Close() - // Lock OS thread to ensure the errno does not change + // Lock the OS thread so that errno, which is thread-local, still belongs to + // the thread that made the call below by the time it is read. runtime.LockOSThread() defer runtime.UnlockOSThread() + // Resolve the errno location up front: doing it after the call would run a + // dlsym and allocate in between, either of which can overwrite errno. + errnoPtr := funcs.lib.ErrnoLocation() + var vpi vnodePathInfo const vpiSize = int32(unsafe.Sizeof(vpi)) - ret := funcs.lib.ProcPidInfo(p.Pid, common.PROC_PIDVNODEPATHINFO, 0, uintptr(unsafe.Pointer(&vpi)), vpiSize) - errno, _ := funcs.lib.Dlsym("errno") - err = *(**unix.Errno)(unsafe.Pointer(&errno)) - if errors.Is(err, unix.EPERM) { - return "", ErrorNotPermitted - } - + ret := funcs.lib.ProcPidInfo(p.Pid, common.PROC_PIDVNODEPATHINFO, 0, unsafe.Pointer(&vpi), vpiSize) if ret <= 0 { + // errno is only meaningful once the call has reported failure; reading it + // unconditionally can surface a stale value from an earlier call. + if errno := unix.Errno(*errnoPtr); errno == unix.EPERM { + return "", ErrorNotPermitted + } return "", fmt.Errorf("unknown error: proc_pidinfo returned %d", ret) } @@ -375,29 +442,49 @@ func (p *Process) cmdlineSlice() ([]string, error) { if err != nil { return nil, err } - // The first bytes hold the nargs int, skip it. - args := bytes.Split((pargs)[unsafe.Sizeof(int(0)):], []byte{0}) - var argStr string - // The first element is the actual binary/command path. - // command := args[0] - var argSlice []string - // var envSlice []string - // All other, non-zero elements are arguments. The first "nargs" elements - // are the arguments. Everything else in the slice is then the environment - // of the process. - for _, arg := range args[1:] { - argStr = string(arg) - if argStr != "" { - if nargs > 0 { - argSlice = append(argSlice, argStr) - nargs-- - continue - } - break - // envSlice = append(envSlice, argStr) - } - } - return argSlice, err + // procArgs reads nargs as a 4-byte uint32; skip exactly those 4 bytes + // (matches Apple's ps using sizeof(nargs)). The previous code used + // unsafe.Sizeof(int(0)) which is 8 on 64-bit and would discard the + // first 4 bytes of exec_path — harmless only because chunks[0] is + // dropped, but logically wrong. + return parseCmdline(pargs[4:], nargs), nil +} + +// parseCmdline extracts argv from the kern.procargs2 buffer with the leading +// nargs int already stripped. Layout: +// +// exec_path \0 [padding \0...] argv[0] \0 ... argv[nargs-1] \0 envp[0] \0 ... +// +// Empty argv elements within the nargs count are preserved — skipping them +// would advance past argv[nargs-1] into envp, leaking environment values +// (potentially secrets) into Cmdline output. +// +// Known limitation: a process whose argv[0] is itself an empty string is +// indistinguishable from padding by this parser, since XNU does not expose +// the exec/argv alignment boundary. Such a process will still see one envp +// entry leak. Fixing it requires libgetargv-style alignment math against +// the XNU exec layout, which is out of scope for this change. +func parseCmdline(args []byte, nargs int) []string { + chunks := bytes.Split(args, []byte{0}) + if len(chunks) <= 1 { + return nil + } + // Skip exec_path (chunks[0]) and any padding NULs before argv[0]. + i := 1 + for ; i < len(chunks) && len(chunks[i]) == 0; i++ { + } + if nargs > len(chunks)-i { + nargs = len(chunks) - i + } + if nargs < 0 { + nargs = 0 + } + argSlice := make([]string, 0, nargs) + for ; nargs > 0; nargs-- { + argSlice = append(argSlice, string(chunks[i])) + i++ + } + return argSlice } // cmdNameWithContext returns the command name (including spaces) without any arguments @@ -430,7 +517,7 @@ func (p *Process) NumThreadsWithContext(_ context.Context) (int32, error) { defer funcs.Close() var ti ProcTaskInfo - funcs.lib.ProcPidInfo(p.Pid, common.PROC_PIDTASKINFO, 0, uintptr(unsafe.Pointer(&ti)), int32(unsafe.Sizeof(ti))) + funcs.lib.ProcPidInfo(p.Pid, common.PROC_PIDTASKINFO, 0, unsafe.Pointer(&ti), int32(unsafe.Sizeof(ti))) return int32(ti.Threadnum), nil } @@ -443,7 +530,7 @@ func (p *Process) TimesWithContext(_ context.Context) (*cpu.TimesStat, error) { defer funcs.Close() var ti ProcTaskInfo - funcs.lib.ProcPidInfo(p.Pid, common.PROC_PIDTASKINFO, 0, uintptr(unsafe.Pointer(&ti)), int32(unsafe.Sizeof(ti))) + funcs.lib.ProcPidInfo(p.Pid, common.PROC_PIDTASKINFO, 0, unsafe.Pointer(&ti), int32(unsafe.Sizeof(ti))) timescaleToNanoSeconds := funcs.getTimeScaleToNanoSeconds() ret := &cpu.TimesStat{ @@ -462,7 +549,7 @@ func (p *Process) MemoryInfoWithContext(_ context.Context) (*MemoryInfoStat, err defer funcs.Close() var ti ProcTaskInfo - funcs.lib.ProcPidInfo(p.Pid, common.PROC_PIDTASKINFO, 0, uintptr(unsafe.Pointer(&ti)), int32(unsafe.Sizeof(ti))) + funcs.lib.ProcPidInfo(p.Pid, common.PROC_PIDTASKINFO, 0, unsafe.Pointer(&ti), int32(unsafe.Sizeof(ti))) ret := &MemoryInfoStat{ RSS: uint64(ti.Resident_size), @@ -493,8 +580,8 @@ func (p *Process) NumFDsWithContext(_ context.Context) (int32, error) { p.Pid, common.PROC_PIDLISTFDS, 0, - 0, // NULL buffer - 0, // 0 size + nil, // NULL buffer + 0, // 0 size ) if bufferSize <= 0 { return 0, fmt.Errorf("unknown error: proc_pidinfo returned %d", bufferSize) @@ -510,8 +597,8 @@ func (p *Process) NumFDsWithContext(_ context.Context) (int32, error) { p.Pid, common.PROC_PIDLISTFDS, 0, - uintptr(unsafe.Pointer(&buf[0])), // Real buffer - bufferSize, // Size from first call + unsafe.Pointer(&buf[0]), // Real buffer + bufferSize, // Size from first call ) if ret <= 0 { return 0, fmt.Errorf("unknown error: proc_pidinfo returned %d", ret) diff --git a/vendor/github.com/shirou/gopsutil/v4/process/process_linux.go b/vendor/github.com/shirou/gopsutil/v4/process/process_linux.go index dc2f03bb5f4..36d95d10132 100644 --- a/vendor/github.com/shirou/gopsutil/v4/process/process_linux.go +++ b/vendor/github.com/shirou/gopsutil/v4/process/process_linux.go @@ -350,6 +350,9 @@ func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) { continue } fields := splitProcStat(statContents) + if len(fields) < 5 { + continue + } pid, err := strconv.ParseInt(fields[1], 10, 32) if err != nil { continue @@ -756,6 +759,9 @@ func (p *Process) fillFromStatmWithContext(ctx context.Context) (*MemoryInfoStat return nil, nil, err } fields := strings.Split(string(contents), " ") + if len(fields) < 6 { + return nil, nil, fmt.Errorf("malformed statm file: expected at least 6 fields, got %d", len(fields)) + } vms, err := strconv.ParseUint(fields[0], 10, 64) if err != nil { @@ -861,6 +867,12 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error { // Ensure we have a copy and not reference into slice p.name = string([]byte(p.name)) case "State": + if value == "" { + // Clear rather than leave a stale status from a previous + // parse, since Process objects can be reused across calls. + p.status = "" + continue + } p.status = convertStatusChar(value[0:1]) // Ensure we have a copy and not reference into slice p.status = string([]byte(p.status)) @@ -1195,6 +1207,12 @@ func readPidsFromDir(path string) ([]int32, error) { func splitProcStat(content []byte) []string { nameStart := bytes.IndexByte(content, '(') nameEnd := bytes.LastIndexByte(content, ')') + // Guard against a malformed/truncated stat file that is missing the + // parentheses around comm, which would otherwise cause the slice + // operations below to panic. Callers validate the field count. + if nameStart < 0 || nameEnd < nameStart || nameEnd+2 > len(content) { + return nil + } restFields := strings.Fields(string(content[nameEnd+2:])) // +2 skip ') ' name := content[nameStart+1 : nameEnd] pid := strings.TrimSpace(string(content[:nameStart])) diff --git a/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd.go b/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd.go index 31fdb85bc9d..07257a85867 100644 --- a/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd.go +++ b/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd.go @@ -8,6 +8,7 @@ import ( "context" "encoding/binary" "errors" + "fmt" "io" "path/filepath" "sort" @@ -94,6 +95,9 @@ func (p *Process) CmdlineSliceWithContext(_ context.Context) ([]string, error) { pointers followed by the strings themselves. The last char pointer is a NULL pointer. */ var strParts []string + if len(buf) == 0 { + return strParts, nil + } r := bytes.NewReader(buf) baseAddr := uintptr(unsafe.Pointer(&buf[0])) for { @@ -105,7 +109,17 @@ func (p *Process) CmdlineSliceWithContext(_ context.Context) ([]string, error) { break } offset := argvp - baseAddr - length := uintptr(bytes.IndexByte(buf[offset:], 0)) + // Reject a malformed/truncated sysctl reply whose pointers fall + // outside buf or whose strings are not NUL-terminated, which would + // otherwise cause the slice operations below to panic. + if offset >= uintptr(len(buf)) { + return nil, fmt.Errorf("malformed KERN_PROC_ARGV reply for pid %d: argv pointer out of bounds", p.Pid) + } + idx := bytes.IndexByte(buf[offset:], 0) + if idx < 0 { + return nil, fmt.Errorf("malformed KERN_PROC_ARGV reply for pid %d: argv string not NUL-terminated", p.Pid) + } + length := uintptr(idx) str := string(buf[offset : offset+length]) strParts = append(strParts, str) } diff --git a/vendor/github.com/shirou/gopsutil/v4/process/process_windows.go b/vendor/github.com/shirou/gopsutil/v4/process/process_windows.go index a1e28be6985..0bd7f55ae5a 100644 --- a/vendor/github.com/shirou/gopsutil/v4/process/process_windows.go +++ b/vendor/github.com/shirou/gopsutil/v4/process/process_windows.go @@ -6,6 +6,7 @@ package process import ( "bufio" "context" + "encoding/binary" "errors" "fmt" "io" @@ -324,6 +325,9 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { if p.Pid == 0 { return "System Idle Process", nil } + if p.name != "" { + return p.name, nil + } if p.Pid == 4 { return "System", nil } @@ -333,7 +337,9 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) { return "", fmt.Errorf("could not get Name: %w", err) } - return filepath.Base(exe), nil + name := filepath.Base(exe) + p.name = name + return name, nil } func (*Process) TgidWithContext(_ context.Context) (int32, error) { @@ -598,6 +604,8 @@ func (p *Process) NumThreadsWithContext(_ context.Context) (int32, error) { p.setPpid(ppid) } + p.numThreads = ret + return ret, nil } @@ -900,6 +908,32 @@ func getFromSnapProcess(pid int32) (int32, int32, string, error) { //nolint:unpa return 0, 0, "", fmt.Errorf("couldn't find pid: %d", pid) } +func buildSnapProcessMap() (map[uint32]windows.ProcessEntry32, error) { + snap, err := windows.CreateToolhelp32Snapshot(windows.TH32CS_SNAPPROCESS, 0) + if err != nil { + return nil, err + } + defer windows.CloseHandle(snap) + + var pe32 windows.ProcessEntry32 + pe32.Size = uint32(unsafe.Sizeof(pe32)) + if err := windows.Process32First(snap, &pe32); err != nil { + return nil, err + } + + snapMap := make(map[uint32]windows.ProcessEntry32) + for { + snapMap[pe32.ProcessID] = pe32 + if err := windows.Process32Next(snap, &pe32); err != nil { + if errors.Is(err, windows.ERROR_NO_MORE_FILES) { + break + } + return nil, err + } + } + return snapMap, nil +} + func ProcessesWithContext(ctx context.Context) ([]*Process, error) { out := []*Process{} @@ -908,11 +942,25 @@ func ProcessesWithContext(ctx context.Context) ([]*Process, error) { return out, fmt.Errorf("could not get Processes %w", err) } + // Note: The PID enumeration and snapshot creation are separate calls + // and may not be perfectly consistent due to timing. + snapMap, err := buildSnapProcessMap() + if err != nil { + return out, fmt.Errorf("could not build process snapshot: %w", err) + } + for _, pid := range pids { p, err := NewProcessWithContext(ctx, pid) if err != nil { continue } + + if entry, ok := snapMap[uint32(pid)]; ok { + p.name = windows.UTF16ToString(entry.ExeFile[:]) + p.setPpid(int32(entry.ParentProcessID)) + p.numThreads = int32(entry.Threads) + } + out = append(out, p) } @@ -1157,14 +1205,82 @@ func (p *processReader) Read(buf []byte) (int, error) { func getProcessCommandLine(pid int32) (string, error) { h, err := windows.OpenProcess(processQueryInformation|windows.PROCESS_VM_READ, false, uint32(pid)) - if errors.Is(err, windows.ERROR_ACCESS_DENIED) || errors.Is(err, windows.ERROR_INVALID_PARAMETER) { + if err == nil { + defer syscall.CloseHandle(syscall.Handle(h)) + + cmdLine, pebErr := getProcessCommandLinePEB(h) + if pebErr == nil { + return cmdLine, nil + } + + // PEB read failed even though the handle opened. VM_READ may + // have been granted but ineffective against this process's + // protection driver. Fall back to the native query on the same handle. + if cmdLine, err := getProcessCommandLineNative(h, pid); err == nil { + return cmdLine, nil + } + return "", pebErr + } + + if errors.Is(err, windows.ERROR_INVALID_PARAMETER) { return "", nil } - if err != nil { + if !errors.Is(err, windows.ERROR_ACCESS_DENIED) { return "", err } - defer syscall.CloseHandle(syscall.Handle(h)) + // fallback in case it's a genuine PPL process, where + // PROCESS_VM_READ itself is denied at OpenProcess time. Retry with + // just PROCESS_QUERY_LIMITED_INFORMATION, which PPL still grants. + lh, lerr := windows.OpenProcess(processQueryInformation, false, uint32(pid)) + if lerr != nil { + return "", nil + } + defer syscall.CloseHandle(syscall.Handle(lh)) + cmdLine, _ := getProcessCommandLineNative(lh, pid) + return cmdLine, nil +} + +func getProcessCommandLineNative(handle windows.Handle, pid int32) (string, error) { + var returnLength uint32 + // first call is to get the actual returnLength + err := windows.NtQueryInformationProcess( + handle, + windows.ProcessCommandLineInformation, + nil, + 0, + &returnLength, + ) + if err != nil && + !errors.Is(err, windows.STATUS_INFO_LENGTH_MISMATCH) && + !errors.Is(err, windows.STATUS_BUFFER_OVERFLOW) && + !errors.Is(err, windows.STATUS_BUFFER_TOO_SMALL) { + return "", fmt.Errorf("querying command line size for pid %d: %w", pid, err) + } + if returnLength == 0 { + return "", fmt.Errorf("process %d returned zero-length command line info", pid) + } + + // second call: actually fetch it into a correctly-sized buffer + buf := make([]byte, returnLength) + err = windows.NtQueryInformationProcess( + handle, + windows.ProcessCommandLineInformation, + unsafe.Pointer(&buf[0]), + returnLength, + &returnLength, + ) + if err != nil { + return "", fmt.Errorf("reading command line for pid %d: %w", pid, err) + } + cmdLine, err := parseCommandLineInformation(buf) + if err != nil { + return "", fmt.Errorf("parsing command line for pid %d: %w", pid, err) + } + return cmdLine, nil +} + +func getProcessCommandLinePEB(h windows.Handle) (string, error) { procIs32Bits := is32BitProcess(h) if procIs32Bits { @@ -1211,3 +1327,19 @@ func convertUTF16ToString(src []byte) string { } return syscall.UTF16ToString(codePoints) } + +func parseCommandLineInformation(buf []byte) (string, error) { + if len(buf) < 2 { + return "", errors.New("command line buffer too small to read length") + } + length := binary.LittleEndian.Uint16(buf[0:2]) + if length == 0 { + return "", nil + } + strOffset := int(unsafe.Sizeof(windows.NTUnicodeString{})) + strEnd := strOffset + int(length) + if strEnd > len(buf) { + return "", errors.New("command line length exceeds buffer size") + } + return convertUTF16ToString(buf[strOffset:strEnd]), nil +} diff --git a/vendor/github.com/spiffe/go-spiffe/v2/bundle/spiffebundle/bundle.go b/vendor/github.com/spiffe/go-spiffe/v2/bundle/spiffebundle/bundle.go index 712ec636bdd..95a3c124300 100644 --- a/vendor/github.com/spiffe/go-spiffe/v2/bundle/spiffebundle/bundle.go +++ b/vendor/github.com/spiffe/go-spiffe/v2/bundle/spiffebundle/bundle.go @@ -14,6 +14,7 @@ import ( "github.com/go-jose/go-jose/v4" "github.com/spiffe/go-spiffe/v2/bundle/jwtbundle" "github.com/spiffe/go-spiffe/v2/bundle/x509bundle" + "github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle" "github.com/spiffe/go-spiffe/v2/internal/jwtutil" "github.com/spiffe/go-spiffe/v2/internal/x509util" "github.com/spiffe/go-spiffe/v2/spiffeid" @@ -22,6 +23,7 @@ import ( const ( x509SVIDUse = "x509-svid" jwtSVIDUse = "jwt-svid" + witSVIDUse = "wit-svid" ) type bundleDoc struct { @@ -41,6 +43,7 @@ type Bundle struct { refreshHint *time.Duration sequenceNumber *uint64 jwtAuthorities map[string]crypto.PublicKey + witAuthorities map[string]crypto.PublicKey x509Authorities []*x509.Certificate } @@ -49,6 +52,7 @@ func New(trustDomain spiffeid.TrustDomain) *Bundle { return &Bundle{ trustDomain: trustDomain, jwtAuthorities: make(map[string]crypto.PublicKey), + witAuthorities: make(map[string]crypto.PublicKey), } } @@ -105,7 +109,11 @@ func Parse(trustDomain spiffeid.TrustDomain, bundleBytes []byte) (*Bundle, error bundle.AddX509Authority(key.Certificates[0]) case jwtSVIDUse: if err := bundle.AddJWTAuthority(key.KeyID, key.Key); err != nil { - return nil, wrapSpiffebundleErr(fmt.Errorf("error adding authority %d of JWKS: %v", i, errors.Unwrap(err))) + return nil, wrapSpiffebundleErr(fmt.Errorf("error adding authority %d of JWKS: %w", i, errors.Unwrap(err))) + } + case witSVIDUse: + if err := bundle.AddWITAuthority(key.KeyID, key.Key); err != nil { + return nil, wrapSpiffebundleErr(fmt.Errorf("error adding WIT authority %d of JWKS: %w", i, errors.Unwrap(err))) } } } @@ -143,6 +151,21 @@ func FromJWTAuthorities(trustDomain spiffeid.TrustDomain, jwtAuthorities map[str return bundle } +// FromWITAuthorities creates a new bundle from WIT authorities. +func FromWITAuthorities(trustDomain spiffeid.TrustDomain, witAuthorities map[string]crypto.PublicKey) *Bundle { + bundle := New(trustDomain) + bundle.witAuthorities = jwtutil.CopyJWTAuthorities(witAuthorities) + return bundle +} + +// FromWITBundle creates a bundle from a WIT bundle. +// The function panics in case of a nil WIT bundle. +func FromWITBundle(witBundle *witbundle.Bundle) *Bundle { + bundle := New(witBundle.TrustDomain()) + bundle.witAuthorities = witBundle.WITAuthorities() + return bundle +} + // TrustDomain returns the trust domain that the bundle belongs to. func (b *Bundle) TrustDomain() spiffeid.TrustDomain { return b.trustDomain @@ -263,12 +286,70 @@ func (b *Bundle) SetJWTAuthorities(jwtAuthorities map[string]crypto.PublicKey) { b.jwtAuthorities = jwtutil.CopyJWTAuthorities(jwtAuthorities) } -// Empty returns true if the bundle has no X.509 and JWT authorities. +// WITAuthorities returns the WIT authorities in the bundle, keyed by key ID. +func (b *Bundle) WITAuthorities() map[string]crypto.PublicKey { + b.mtx.RLock() + defer b.mtx.RUnlock() + + return jwtutil.CopyJWTAuthorities(b.witAuthorities) +} + +// FindWITAuthority finds the WIT authority with the given key ID from the bundle. +// If the authority is found, it is returned and the boolean is true. Otherwise, +// the returned value is nil and the boolean is false. +func (b *Bundle) FindWITAuthority(keyID string) (crypto.PublicKey, bool) { + b.mtx.RLock() + defer b.mtx.RUnlock() + + witAuthority, ok := b.witAuthorities[keyID] + return witAuthority, ok +} + +// HasWITAuthority returns true if the bundle has a WIT authority with the given key ID. +func (b *Bundle) HasWITAuthority(keyID string) bool { + b.mtx.RLock() + defer b.mtx.RUnlock() + + _, ok := b.witAuthorities[keyID] + return ok +} + +// AddWITAuthority adds a WIT authority to the bundle. If a WIT authority already exists +// under the given key ID, it is replaced. A key ID must be specified. +func (b *Bundle) AddWITAuthority(keyID string, witAuthority crypto.PublicKey) error { + if keyID == "" { + return wrapSpiffebundleErr(errors.New("keyID cannot be empty")) + } + + b.mtx.Lock() + defer b.mtx.Unlock() + + b.witAuthorities[keyID] = witAuthority + return nil +} + +// RemoveWITAuthority removes the WIT authority identified by the key ID from the bundle. +func (b *Bundle) RemoveWITAuthority(keyID string) { + b.mtx.Lock() + defer b.mtx.Unlock() + + delete(b.witAuthorities, keyID) +} + +// SetWITAuthorities sets the WIT authorities in the bundle. +func (b *Bundle) SetWITAuthorities(witAuthorities map[string]crypto.PublicKey) { + b.mtx.Lock() + defer b.mtx.Unlock() + + b.witAuthorities = jwtutil.CopyJWTAuthorities(witAuthorities) +} + +// Empty returns true if the bundle has no X.509, JWT, or WIT authorities. func (b *Bundle) Empty() bool { b.mtx.RLock() defer b.mtx.RUnlock() - return len(b.x509Authorities) == 0 && len(b.jwtAuthorities) == 0 + return len(b.x509Authorities) == 0 && len(b.jwtAuthorities) == 0 && len(b.witAuthorities) == 0 } // RefreshHint returns the refresh hint. If the refresh hint is set in @@ -359,6 +440,14 @@ func (b *Bundle) Marshal() ([]byte, error) { }) } + for keyID, witAuthority := range b.witAuthorities { + jwks.Keys = append(jwks.Keys, jose.JSONWebKey{ + Key: witAuthority, + KeyID: keyID, + Use: witSVIDUse, + }) + } + return json.Marshal(jwks) } @@ -373,6 +462,7 @@ func (b *Bundle) Clone() *Bundle { sequenceNumber: copySequenceNumber(b.sequenceNumber), x509Authorities: x509util.CopyX509Authorities(b.x509Authorities), jwtAuthorities: jwtutil.CopyJWTAuthorities(b.jwtAuthorities), + witAuthorities: jwtutil.CopyJWTAuthorities(b.witAuthorities), } } @@ -437,6 +527,28 @@ func (b *Bundle) GetJWTBundleForTrustDomain(trustDomain spiffeid.TrustDomain) (* return b.JWTBundle(), nil } +// WITBundle returns a WIT bundle containing the WIT authorities in the SPIFFE bundle. +func (b *Bundle) WITBundle() *witbundle.Bundle { + b.mtx.RLock() + defer b.mtx.RUnlock() + + return witbundle.FromWITAuthorities(b.trustDomain, b.witAuthorities) +} + +// GetWITBundleForTrustDomain returns the WIT bundle of the given trust domain. +// It implements the witbundle.Source interface. An error will be returned if +// the trust domain does not match that of the bundle. +func (b *Bundle) GetWITBundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*witbundle.Bundle, error) { + b.mtx.RLock() + defer b.mtx.RUnlock() + + if b.trustDomain != trustDomain { + return nil, wrapSpiffebundleErr(fmt.Errorf("no WIT bundle for trust domain %q", trustDomain)) + } + + return b.WITBundle(), nil +} + // Equal compares the bundle for equality against the given bundle. func (b *Bundle) Equal(other *Bundle) bool { if b == nil || other == nil { @@ -447,6 +559,7 @@ func (b *Bundle) Equal(other *Bundle) bool { refreshHintEqual(b.refreshHint, other.refreshHint) && sequenceNumberEqual(b.sequenceNumber, other.sequenceNumber) && jwtutil.JWTAuthoritiesEqual(b.jwtAuthorities, other.jwtAuthorities) && + jwtutil.JWTAuthoritiesEqual(b.witAuthorities, other.witAuthorities) && x509util.CertsEqual(b.x509Authorities, other.x509Authorities) } diff --git a/vendor/github.com/spiffe/go-spiffe/v2/bundle/spiffebundle/set.go b/vendor/github.com/spiffe/go-spiffe/v2/bundle/spiffebundle/set.go index e0d5d4568bf..c2e02e6aad6 100644 --- a/vendor/github.com/spiffe/go-spiffe/v2/bundle/spiffebundle/set.go +++ b/vendor/github.com/spiffe/go-spiffe/v2/bundle/spiffebundle/set.go @@ -7,6 +7,7 @@ import ( "github.com/spiffe/go-spiffe/v2/bundle/jwtbundle" "github.com/spiffe/go-spiffe/v2/bundle/x509bundle" + "github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle" "github.com/spiffe/go-spiffe/v2/spiffeid" ) @@ -134,3 +135,17 @@ func (s *Set) GetJWTBundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*jwt return bundle.JWTBundle(), nil } + +// GetWITBundleForTrustDomain returns the WIT bundle for the given trust +// domain. It implements the witbundle.Source interface. +func (s *Set) GetWITBundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*witbundle.Bundle, error) { + s.mtx.RLock() + defer s.mtx.RUnlock() + + bundle, ok := s.bundles[trustDomain] + if !ok { + return nil, wrapSpiffebundleErr(fmt.Errorf("no WIT bundle for trust domain %q", trustDomain)) + } + + return bundle.WITBundle(), nil +} diff --git a/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/bundle.go b/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/bundle.go new file mode 100644 index 00000000000..dbf8cf3cd9f --- /dev/null +++ b/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/bundle.go @@ -0,0 +1,208 @@ +// Package witbundle provides support for WIT bundles, which are JWK Sets used +// to validate WIT-SVID signatures. +package witbundle + +import ( + "crypto" + "encoding/json" + "errors" + "fmt" + "io" + "os" + "sync" + + "github.com/go-jose/go-jose/v4" + "github.com/spiffe/go-spiffe/v2/internal/jwtutil" + "github.com/spiffe/go-spiffe/v2/spiffeid" +) + +// Bundle is a collection of trusted WIT authorities for a trust domain. +type Bundle struct { + trustDomain spiffeid.TrustDomain + + mtx sync.RWMutex + witAuthorities map[string]crypto.PublicKey +} + +// New creates a new empty bundle for the given trust domain. +func New(trustDomain spiffeid.TrustDomain) *Bundle { + return &Bundle{ + trustDomain: trustDomain, + witAuthorities: make(map[string]crypto.PublicKey), + } +} + +// FromWITAuthorities creates a new bundle from a map of WIT authorities keyed +// by key ID. +func FromWITAuthorities(trustDomain spiffeid.TrustDomain, witAuthorities map[string]crypto.PublicKey) *Bundle { + return &Bundle{ + trustDomain: trustDomain, + witAuthorities: jwtutil.CopyJWTAuthorities(witAuthorities), + } +} + +// Load loads a bundle from a file on disk. The file must contain a standard +// RFC 7517 JWKS document. +func Load(trustDomain spiffeid.TrustDomain, path string) (*Bundle, error) { + bundleBytes, err := os.ReadFile(path) + if err != nil { + return nil, wrapErr(fmt.Errorf("unable to read WIT bundle: %w", err)) + } + + return Parse(trustDomain, bundleBytes) +} + +// Read decodes a bundle from a reader. The contents must contain a standard +// RFC 7517 JWKS document. +func Read(trustDomain spiffeid.TrustDomain, r io.Reader) (*Bundle, error) { + b, err := io.ReadAll(r) + if err != nil { + return nil, wrapErr(fmt.Errorf("unable to read: %v", err)) + } + + return Parse(trustDomain, b) +} + +// Parse parses a bundle from a JWK Set JSON document. +func Parse(trustDomain spiffeid.TrustDomain, bundleBytes []byte) (*Bundle, error) { + jwks := new(jose.JSONWebKeySet) + if err := json.Unmarshal(bundleBytes, jwks); err != nil { + return nil, wrapErr(fmt.Errorf("unable to parse JWKS: %v", err)) + } + + bundle := New(trustDomain) + for i, key := range jwks.Keys { + if err := bundle.AddWITAuthority(key.KeyID, key.Key); err != nil { + return nil, wrapErr(fmt.Errorf("error adding authority %d of JWKS: %v", i, errors.Unwrap(err))) + } + } + + return bundle, nil +} + +// TrustDomain returns the trust domain that the bundle belongs to. +func (b *Bundle) TrustDomain() spiffeid.TrustDomain { + return b.trustDomain +} + +// WITAuthorities returns the WIT authorities in the bundle, keyed by key ID. +func (b *Bundle) WITAuthorities() map[string]crypto.PublicKey { + b.mtx.RLock() + defer b.mtx.RUnlock() + + return jwtutil.CopyJWTAuthorities(b.witAuthorities) +} + +// FindWITAuthority finds the WIT authority with the given key ID from the bundle. +// If the authority is found, it is returned and the boolean is true. Otherwise, +// the returned value is nil and the boolean is false. +func (b *Bundle) FindWITAuthority(keyID string) (crypto.PublicKey, bool) { + b.mtx.RLock() + defer b.mtx.RUnlock() + + if witAuthority, ok := b.witAuthorities[keyID]; ok { + return witAuthority, true + } + return nil, false +} + +// HasWITAuthority returns true if the bundle has a WIT authority with the +// given key ID. +func (b *Bundle) HasWITAuthority(keyID string) bool { + b.mtx.RLock() + defer b.mtx.RUnlock() + + _, ok := b.witAuthorities[keyID] + return ok +} + +// AddWITAuthority adds a WIT authority to the bundle. If a WIT authority already +// exists under the given key ID, it is replaced. A key ID must be specified. +func (b *Bundle) AddWITAuthority(keyID string, witAuthority crypto.PublicKey) error { + if keyID == "" { + return wrapErr(errors.New("keyID cannot be empty")) + } + + b.mtx.Lock() + defer b.mtx.Unlock() + + b.witAuthorities[keyID] = witAuthority + return nil +} + +// RemoveWITAuthority removes the WIT authority identified by the key ID from +// the bundle. +func (b *Bundle) RemoveWITAuthority(keyID string) { + b.mtx.Lock() + defer b.mtx.Unlock() + + delete(b.witAuthorities, keyID) +} + +// SetWITAuthorities sets the WIT authorities in the bundle. +func (b *Bundle) SetWITAuthorities(witAuthorities map[string]crypto.PublicKey) { + b.mtx.Lock() + defer b.mtx.Unlock() + + b.witAuthorities = jwtutil.CopyJWTAuthorities(witAuthorities) +} + +// Empty returns true if the bundle has no WIT authorities. +func (b *Bundle) Empty() bool { + b.mtx.RLock() + defer b.mtx.RUnlock() + + return len(b.witAuthorities) == 0 +} + +// Marshal marshals the WIT bundle into a standard RFC 7517 JWKS document. +func (b *Bundle) Marshal() ([]byte, error) { + b.mtx.RLock() + defer b.mtx.RUnlock() + + jwks := jose.JSONWebKeySet{} + for keyID, witAuthority := range b.witAuthorities { + jwks.Keys = append(jwks.Keys, jose.JSONWebKey{ + Key: witAuthority, + KeyID: keyID, + }) + } + + return json.Marshal(jwks) +} + +// Clone clones the bundle. +func (b *Bundle) Clone() *Bundle { + b.mtx.RLock() + defer b.mtx.RUnlock() + + return FromWITAuthorities(b.trustDomain, b.witAuthorities) +} + +// Equal compares the bundle for equality against the given bundle. +func (b *Bundle) Equal(other *Bundle) bool { + if b == nil || other == nil { + return b == other + } + + return b.trustDomain == other.trustDomain && + jwtutil.JWTAuthoritiesEqual(b.witAuthorities, other.witAuthorities) +} + +// GetWITBundleForTrustDomain returns the WIT bundle for the given trust domain. +// It implements the Source interface. An error will be returned if the trust +// domain does not match that of the bundle. +func (b *Bundle) GetWITBundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*Bundle, error) { + b.mtx.RLock() + defer b.mtx.RUnlock() + + if b.trustDomain != trustDomain { + return nil, wrapErr(fmt.Errorf("no WIT bundle for trust domain %q", trustDomain)) + } + + return b, nil +} + +func wrapErr(err error) error { + return fmt.Errorf("witbundle: %w", err) +} diff --git a/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/set.go b/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/set.go new file mode 100644 index 00000000000..2a44c5a5db8 --- /dev/null +++ b/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/set.go @@ -0,0 +1,106 @@ +package witbundle + +import ( + "fmt" + "sort" + "sync" + + "github.com/spiffe/go-spiffe/v2/spiffeid" +) + +// Set is a set of WIT bundles, keyed by trust domain. +type Set struct { + mtx sync.RWMutex + bundles map[spiffeid.TrustDomain]*Bundle +} + +// NewSet creates a new set initialized with the given bundles. +func NewSet(bundles ...*Bundle) *Set { + bundlesMap := make(map[spiffeid.TrustDomain]*Bundle) + + for _, b := range bundles { + if b != nil { + bundlesMap[b.trustDomain] = b + } + } + + return &Set{ + bundles: bundlesMap, + } +} + +// Add adds a new bundle into the set. If a bundle already exists for the +// trust domain, the existing bundle is replaced. +func (s *Set) Add(bundle *Bundle) { + s.mtx.Lock() + defer s.mtx.Unlock() + + if bundle != nil { + s.bundles[bundle.trustDomain] = bundle + } +} + +// Remove removes the bundle for the given trust domain. +func (s *Set) Remove(trustDomain spiffeid.TrustDomain) { + s.mtx.Lock() + defer s.mtx.Unlock() + + delete(s.bundles, trustDomain) +} + +// Has returns true if there is a bundle for the given trust domain. +func (s *Set) Has(trustDomain spiffeid.TrustDomain) bool { + s.mtx.RLock() + defer s.mtx.RUnlock() + + _, ok := s.bundles[trustDomain] + return ok +} + +// Get returns a bundle for the given trust domain. If the bundle is in the set +// it is returned and the boolean is true. Otherwise, the returned value is nil +// and the boolean is false. +func (s *Set) Get(trustDomain spiffeid.TrustDomain) (*Bundle, bool) { + s.mtx.RLock() + defer s.mtx.RUnlock() + + bundle, ok := s.bundles[trustDomain] + return bundle, ok +} + +// Bundles returns the bundles in the set sorted by trust domain. +func (s *Set) Bundles() []*Bundle { + s.mtx.RLock() + defer s.mtx.RUnlock() + + out := make([]*Bundle, 0, len(s.bundles)) + for _, bundle := range s.bundles { + out = append(out, bundle) + } + sort.Slice(out, func(a, b int) bool { + return out[a].TrustDomain().Compare(out[b].TrustDomain()) < 0 + }) + return out +} + +// Len returns the number of bundles in the set. +func (s *Set) Len() int { + s.mtx.RLock() + defer s.mtx.RUnlock() + + return len(s.bundles) +} + +// GetWITBundleForTrustDomain returns the WIT bundle for the given trust domain. +// It implements the Source interface. +func (s *Set) GetWITBundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*Bundle, error) { + s.mtx.RLock() + defer s.mtx.RUnlock() + + bundle, ok := s.bundles[trustDomain] + if !ok { + return nil, wrapErr(fmt.Errorf("no WIT bundle for trust domain %q", trustDomain)) + } + + return bundle, nil +} diff --git a/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/source.go b/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/source.go new file mode 100644 index 00000000000..183ebd1b3df --- /dev/null +++ b/vendor/github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle/source.go @@ -0,0 +1,10 @@ +package witbundle + +import "github.com/spiffe/go-spiffe/v2/spiffeid" + +// Source represents a source of WIT bundles keyed by trust domain. +type Source interface { + // GetWITBundleForTrustDomain returns the WIT bundle for the given trust + // domain. + GetWITBundleForTrustDomain(trustDomain spiffeid.TrustDomain) (*Bundle, error) +} diff --git a/vendor/github.com/stretchr/objx/README.md b/vendor/github.com/stretchr/objx/README.md index 78dc1f8b03e..e9ba8307354 100644 --- a/vendor/github.com/stretchr/objx/README.md +++ b/vendor/github.com/stretchr/objx/README.md @@ -1,8 +1,6 @@ # Objx [![Build Status](https://travis-ci.org/stretchr/objx.svg?branch=master)](https://travis-ci.org/stretchr/objx) [![Go Report Card](https://goreportcard.com/badge/github.com/stretchr/objx)](https://goreportcard.com/report/github.com/stretchr/objx) -[![Maintainability](https://api.codeclimate.com/v1/badges/1d64bc6c8474c2074f2b/maintainability)](https://codeclimate.com/github/stretchr/objx/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/1d64bc6c8474c2074f2b/test_coverage)](https://codeclimate.com/github/stretchr/objx/test_coverage) [![Sourcegraph](https://sourcegraph.com/github.com/stretchr/objx/-/badge.svg)](https://sourcegraph.com/github.com/stretchr/objx) [![GoDoc](https://pkg.go.dev/badge/github.com/stretchr/objx?utm_source=godoc)](https://pkg.go.dev/github.com/stretchr/objx) @@ -19,49 +17,62 @@ Objx provides the `objx.Map` type, which is a `map[string]interface{}` that expo ### Pattern Objx uses a predictable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: - m, err := objx.FromJSON(json) +```go +m, err := objx.FromJSON(json) +``` NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, the rest will be optimistic and try to figure things out without panicking. Use `Get` to access the value you're interested in. You can use dot and array notation too: - m.Get("places[0].latlng") +```go +m.Get("places[0].latlng") +``` Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type. - if m.Get("code").IsStr() { // Your code... } +```go +if m.Get("code").IsStr() { // Your code... } +``` Or you can just assume the type, and use one of the strong type methods to extract the real value: - m.Get("code").Int() +```go +m.Get("code").Int() +``` If there's no value there (or if it's the wrong type) then a default value will be returned, or you can be explicit about the default value. - Get("code").Int(-1) - +```go +Get("code").Int(-1) +``` If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating, manipulating and selecting that data. You can find out more by exploring the index below. ### Reading data A simple example of how to use Objx: - // Use MustFromJSON to make an objx.Map from some JSON - m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) +```go +// Use MustFromJSON to make an objx.Map from some JSON +m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`) - // Get the details - name := m.Get("name").Str() - age := m.Get("age").Int() +// Get the details +name := m.Get("name").Str() +age := m.Get("age").Int() - // Get their nickname (or use their name if they don't have one) - nickname := m.Get("nickname").Str(name) +// Get their nickname (or use their name if they don't have one) +nickname := m.Get("nickname").Str(name) +``` ### Ranging Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For example, to `range` the data, do what you would expect: - m := objx.MustFromJSON(json) - for key, value := range m { - // Your code... - } +```go +m := objx.MustFromJSON(json) +for key, value := range m { + // Your code... +} +``` ## Installation To install Objx, use go get: diff --git a/vendor/github.com/tinylib/msgp/msgp/json.go b/vendor/github.com/tinylib/msgp/msgp/json.go index 896d690ba09..49bd54bf124 100644 --- a/vendor/github.com/tinylib/msgp/msgp/json.go +++ b/vendor/github.com/tinylib/msgp/msgp/json.go @@ -131,11 +131,35 @@ func rwMap(dst jsWriter, src *Reader) (n int, err error) { n++ } - field, err = src.ReadMapKeyPtr() + var kt Type + kt, err = src.NextType() if err != nil { return } - nn, err = rwquoted(dst, field) + switch kt { + case IntType: + var i64 int64 + i64, err = src.ReadInt64() + if err != nil { + return + } + src.scratch = strconv.AppendInt(src.scratch[:0], i64, 10) + nn, err = rwquoted(dst, src.scratch) + case UintType: + var u64 uint64 + u64, err = src.ReadUint64() + if err != nil { + return + } + src.scratch = strconv.AppendUint(src.scratch[:0], u64, 10) + nn, err = rwquoted(dst, src.scratch) + default: + field, err = src.ReadMapKeyPtr() + if err != nil { + return + } + nn, err = rwquoted(dst, field) + } n += nn if err != nil { return diff --git a/vendor/github.com/tinylib/msgp/msgp/json_bytes.go b/vendor/github.com/tinylib/msgp/msgp/json_bytes.go index 7efd162f199..4aced1b16c3 100644 --- a/vendor/github.com/tinylib/msgp/msgp/json_bytes.go +++ b/vendor/github.com/tinylib/msgp/msgp/json_bytes.go @@ -144,6 +144,27 @@ func rwMapBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []by } func rwMapKeyBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) { + if len(msg) < 1 { + return msg, scratch, ErrShortBytes + } + switch getType(msg[0]) { + case IntType: + i, msg, err := ReadInt64Bytes(msg) + if err != nil { + return msg, scratch, err + } + scratch = strconv.AppendInt(scratch[:0], i, 10) + _, err = rwquoted(w, scratch) + return msg, scratch, err + case UintType: + u, msg, err := ReadUint64Bytes(msg) + if err != nil { + return msg, scratch, err + } + scratch = strconv.AppendUint(scratch[:0], u, 10) + _, err = rwquoted(w, scratch) + return msg, scratch, err + } msg, scratch, err := rwStringBytes(w, msg, scratch, depth) if err != nil { if tperr, ok := err.(TypeError); ok && tperr.Encoded == BinType { diff --git a/vendor/github.com/tinylib/msgp/msgp/read.go b/vendor/github.com/tinylib/msgp/msgp/read.go index 264933ad0ef..b029e5740c7 100644 --- a/vendor/github.com/tinylib/msgp/msgp/read.go +++ b/vendor/github.com/tinylib/msgp/msgp/read.go @@ -121,6 +121,10 @@ func Decode(r io.Reader, d Decodable) error { // reader will be buffered. func NewReader(r io.Reader) *Reader { p := readerPool.Get().(*Reader) + p.recursionDepth = 0 + p.maxElements = 0 + p.maxRecursionDepth = 0 + p.maxStrLen = 0 if p.R == nil { p.R = fwd.NewReader(r) } else { @@ -1009,6 +1013,62 @@ func (m *Reader) ReadBytes(scratch []byte) (b []byte, err error) { return } +// ReadBytesLimit reads a MessagePack 'bin' object +// from the reader and returns its value. It may +// use 'scratch' for storage if it is non-nil. +// If n >= 0 this will be the maximum bytes read. +// If n < 0, the cap(scratch) will be the limit. +// If SetMaxElements has been used on the Reader, +// that will only be checked if the scratch is too small. +func (m *Reader) ReadBytesLimit(scratch []byte, n int64) (b []byte, err error) { + var p []byte + var lead byte + p, err = m.R.Peek(2) + if err != nil { + return + } + lead = p[0] + var read int64 + switch lead { + case mbin8: + read = int64(p[1]) + m.R.Skip(2) + case mbin16: + p, err = m.R.Next(3) + if err != nil { + return + } + read = int64(big.Uint16(p[1:])) + case mbin32: + p, err = m.R.Next(5) + if err != nil { + return + } + read = int64(big.Uint32(p[1:])) + default: + err = badPrefix(BinType, lead) + return + } + if n < 0 { + n = int64(cap(scratch)) + } + if read > n { + err = ErrLimitExceeded + return + } + if int64(cap(scratch)) < read { + b = make([]byte, read) + if read > int64(m.GetMaxElements()) { + err = ErrLimitExceeded + return + } + } else { + b = scratch[0:read] + } + _, err = m.R.ReadFull(b) + return +} + // ReadBytesHeader reads the size header // of a MessagePack 'bin' object. The user // is responsible for dealing with the next diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/atomic_maybe_work.go b/vendor/github.com/twmb/franz-go/pkg/kgo/atomic_maybe_work.go index 1cf93ad68ed..63c360fb96f 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/atomic_maybe_work.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/atomic_maybe_work.go @@ -61,6 +61,18 @@ func (l *workLoop) maybeFinish(again bool) bool { return again } +// hardFinish forces the loop back to unstarted, discarding any pending +// continue-work bump that a concurrent maybeBegin may have set. Unlike +// maybeFinish, it does not observe or preserve that bump, so work a racing +// pusher enqueued can be stranded with no worker running. +// +// This is safe only where the strand is moot or compensated. Most callers +// hardFinish because their session or client context just died, so any +// stranded work is being torn down anyway. The one transient caller is +// loopFetch hitting noConsumerSession: it compensates by reloading the +// session after hardFinish and re-triggering if a new one appeared (the +// race the comment there walks through). A new transient caller must do +// the same. func (l *workLoop) hardFinish() { l.state.Store(stateUnstarted) } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/broker.go b/vendor/github.com/twmb/franz-go/pkg/kgo/broker.go index 2386eb24ba6..19e019a89cd 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/broker.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/broker.go @@ -36,6 +36,17 @@ var ctxPinReq = func() *string { v := "pin_req"; return &v }() type forceOpenReq struct{ kmsg.Request } +// reauthDrainReq is an internal sentinel pushed through the broker's request +// ring by a connection's handleResps worker as it exits with a sasl +// reauthentication pending. It runs handleReauthDrain on the broker worker +// goroutine: reauthenticate now that no reads are in flight, then replay the +// requests that parked while the pipeline drained. The embedded kmsg.Request +// is nil and never used; handleReq dispatches on the type before touching it. +type reauthDrainReq struct { + kmsg.Request + cxn *brokerCxn +} + type promisedReq struct { ctx context.Context req kmsg.Request @@ -137,10 +148,12 @@ type broker struct { addr string // net.JoinHostPort(meta.Host, meta.Port) meta BrokerMetadata - // versions tracks the first load of an ApiVersions. We store this - // after the first connect, which helps speed things up on future - // reconnects (across any of the three broker connections) because we - // will never look up API versions for this broker again. + // versions tracks the broker's last loaded ApiVersions. Every new + // connection re-issues ApiVersions and re-stores the result (see + // brokerCxn.init), but the stored value serves request version + // resolution across all five broker connections and client-level + // capability checks (supportsKeyVersion, supportsFeature) without + // opening a connection. versions atomic.Value // *brokerVersions // The cxn fields each manage a single tcp connection to one broker. @@ -222,6 +235,17 @@ func unknownSeedID(seedNum int) int32 { } func (cl *Client) newBroker(nodeID int32, host string, port int32, rack *string) *broker { + // Clone the Rack *string so the broker owns its own pointer. A + // user-issued cl.Request(MetadataRequest) is hijacked through + // fetchMetadata, which builds brokers from the response and then + // returns that same response to the user: a user writing *Rack + // through their response would race every internal deref of + // b.meta.Rack (brokerRacks, dups in RequestCachedMetadata, + // meta.equals on a later metadata update). + if rack != nil { + r := *rack + rack = &r + } return &broker{ cl: cl, @@ -243,14 +267,20 @@ func (b *broker) stopForever() { b.reqs.die() // no more pushing + // Snapshot the connections under reapMu but die outside of it: die + // runs the user's OnBrokerDisconnect hook, and a hook must not run + // under reapMu (a hook that waits on anything that itself needs + // reapMu, e.g. a concurrent request's loadConnection, would + // deadlock). b.dead is already set above and loadConnection re-checks + // it under reapMu before storing, so no new connection can be stored + // after this snapshot. b.reapMu.Lock() - defer b.reapMu.Unlock() + cxns := []*brokerCxn{b.cxnNormal, b.cxnProduce, b.cxnFetch, b.cxnGroup, b.cxnSlow} + b.reapMu.Unlock() - b.cxnNormal.die() - b.cxnProduce.die() - b.cxnFetch.die() - b.cxnGroup.die() - b.cxnSlow.die() + for _, cxn := range cxns { + cxn.die() + } } // do issues a request to the broker, eventually calling the response @@ -304,6 +334,11 @@ start: func (b *broker) handleReq(pr promisedReq) { req := pr.req + if r, ok := req.(*reauthDrainReq); ok { + b.handleReauthDrain(r.cxn) + pr.promise(nil, nil) // internal sentinel; the promise is a no-op + return + } var cxn *brokerCxn var retriedOnNewConnection bool start: @@ -400,17 +435,61 @@ start: } req.SetVersion(ourMax) - if !cxn.expiry.IsZero() && time.Now().After(cxn.expiry) { - // If we are after the reauth time, try to reauth. We - // can only have an expiry if we went the authenticate - // flow, so we know we are authenticating again. + if !cxn.expiry.IsZero() && time.Now().After(cxn.expiry) && !cxn.hasDiscard { + // If we are after the reauth time, reauthenticate, for KIP-368. + // We can only have an expiry if we went the authenticate flow, + // so we know we are authenticating again. + // + // Reauthenticating reads the handshake and authenticate + // responses on this goroutine, so it requires that nothing + // else can be reading the connection: + // + // * If any response is in flight (resps is non-empty -- an + // element stays in the ring while handleResps processes + // it), handleResps is reading this connection and our read + // would race it byte-by-byte, interleaving the two + // responses' bytes between the two readers. We park this + // request (and every following request for this connection) + // so the pipeline drains -- under sustained pipelining the + // pipeline never goes empty on its own, so we must stop + // feeding it. Our expiry is deliberately pessimistic (2-5% + // early, 1s floor; see doSasl), so the in-flight responses + // are on a still-valid session and the drain (bounded by + // their read timeouts) fits the margin. handleResps pushes + // a reauthDrainReq as it exits; handleReauthDrain then + // reauthenticates and replays the parked requests in + // order. Only this connection parks: the broker worker + // keeps serving its other connections. The Java client + // similarly holds the channel's queued send while + // reauthenticating, and it too only begins with no write + // in progress. + // + // Ordering of the pending store vs the empty check below + // matters: we store before checking, and handleResps reads + // the flag after its final dropPeek. empty() and dropPeek + // both take the ring mutex, so if we observe a non-empty + // ring, our store happens-before the drain's flag read and + // a parked request can never miss its drain signal. // + // * acks=0 produce connections run a discard goroutine that + // owns all reads forever (hasDiscard, checked above), so + // in-place reauth is never possible: loadConnection + // recreates expired discard connections instead, and a + // fresh connection authenticates in init. We can still get + // here if the connection's lifetime is shorter than our + // pessimism (the fresh connection is already "expired"); + // issuing the request on the just-authenticated connection + // is correct, and the next request picks up a new one. + cxn.reauthPending.Store(true) + if cxn.anyParked() || !cxn.resps.empty() { + cxn.park(pr) + return + } + cxn.reauthPending.Store(false) // Some implementations (AWS) occasionally fail for // unclear reasons (principals change, somehow). If // we receive SASL_AUTHENTICATION_FAILED, we retry // once on a new connection. See #249. - // - // For KIP-368. cxn.cl.cfg.logger.Log(LogLevelDebug, "sasl expiry limit reached, reauthenticating", "broker", logID(cxn.b.meta.NodeID)) if err := cxn.sasl(); err != nil { cxn.die() @@ -438,6 +517,20 @@ start: } if _, isForceOpen := req.(*forceOpenReq); isForceOpen { + // The connection is already fully open: loadConnection ran init + // (dial, ApiVersions, SASL). On an acks=0 produce connection the + // discard goroutine owns all reads (hasDiscard), so issuing a + // response-expecting request here would start a second reader + // (handleResps, via waitResp below) that races the discard read on + // the same socket -- the two io.ReadFulls split one byte stream, + // the same concurrent-reader hazard the expiry arm and + // loadConnection already avoid for reauthentication. The connection + // is warm; report success without probing it (init already proved + // the connection works end to end). + if cxn.hasDiscard { + pr.promise(nil, nil) + return + } // We issue ApiVersions with v0; we could try to bound the // version by going to the start above, but it really does // not matter much. @@ -565,12 +658,19 @@ func (b *broker) loadConnection(ctx context.Context, req kmsg.Request) (*brokerC pcxn = &b.cxnSlow } - // Do not reuse a connection that has been idle for longer than idle timeout. - // Kill it instead. - if *pcxn != nil && !(*pcxn).dead.Load() && (*pcxn).isIdleTimeout(b.cl.cfg.connIdleTimeout) { - // die() in a goroutine to avoid blocking - go (*pcxn).die() - reuse = false + // Do not reuse a connection that has been idle for longer than idle + // timeout; kill it instead. Same for an acks=0 produce connection + // whose sasl session expired: the discard goroutine owns all reads on + // it, so in-place reauthentication (which reads handshake responses) + // is impossible -- a fresh connection authenticates in init. + if *pcxn != nil && !(*pcxn).dead.Load() { + cxn := *pcxn + expired := cxn.hasDiscard && !cxn.expiry.IsZero() && time.Now().After(cxn.expiry) + if cxn.isIdleTimeout(b.cl.cfg.connIdleTimeout) || expired { + // die() in a goroutine to avoid blocking + go cxn.die() + reuse = false + } } if reuse && *pcxn != nil && !(*pcxn).dead.Load() { @@ -578,9 +678,13 @@ func (b *broker) loadConnection(ctx context.Context, req kmsg.Request) (*brokerC } var tries int - start := time.Now() doConnect: tries++ + // start, conn, and err are declared per attempt so that each attempt's + // deferred OnBrokerConnect hook reports that attempt's connection, + // error, and duration (a backward goto over := re-executes the + // declaration; prior attempts' defers keep their own variables). + start := time.Now() conn, err := b.connect(ctx) defer func() { since := time.Since(start) @@ -606,15 +710,13 @@ doConnect: // EventHubs does not handle v4 and resets the connection. We // retry twice. On the first and second attempt, we try our max // version possible (as should be allowed). On the third try, - // we downgrade to v0. - if er := (*errApiVersionsReset)(nil); errors.As(err, &er) { - if tries < 3 { - tries++ - goto doConnect - } + // we downgrade to v0 (see requestAPIVersions). + if er := (*errApiVersionsReset)(nil); errors.As(err, &er) && tries < 3 { + cxn.die() + goto doConnect } b.cl.cfg.logger.Log(LogLevelDebug, "connection initialization failed", "addr", b.addr, "broker", logID(b.meta.NodeID), "err", err) - cxn.closeConn() + cxn.die() return nil, err } b.cl.cfg.logger.Log(LogLevelDebug, "connection initialized successfully", "addr", b.addr, "broker", logID(b.meta.NodeID)) @@ -626,24 +728,33 @@ doConnect: } b.reapMu.Lock() - defer b.reapMu.Unlock() // If stopForever ran while we were connecting, the broker is - // dead and we must not store the connection. stopForever kills - // cxnProduce/etc under reapMu, but if the connection was nil at - // that time (we were mid-connect), stopForever's die() was a - // no-op. Without this check, the connection escapes destruction + // dead and we must not store the connection. stopForever reads + // cxnProduce/etc under reapMu before killing them, but if the + // connection was nil at that time (we were mid-connect), it was + // not seen. Without this check, the connection escapes destruction // and a produce request succeeds on a connection that will never // be reused, which -- combined with other connections from other // broker objects for the same nodeID -- breaks the single- // connection-per-broker ordering guarantee that Kafka requires // for idempotent produce. + // + // die runs the user's OnBrokerDisconnect hook, so it runs after the + // unlock (see stopForever for why). We die rather than just close the + // conn even though the connection was never stored: for an acks=0 + // produce connection, init above already spawned the discard goroutine, + // which owns all reads. Closing the conn wakes its read with an error, + // and it dies the connection as it exits -- die's dead swap is what + // keeps the two teardowns from both closing deadCh (see #1377). if b.dead.Load() { - cxn.closeConn() + b.reapMu.Unlock() + cxn.die() return nil, errChosenBrokerDead } *pcxn = cxn + b.reapMu.Unlock() return cxn, nil } @@ -687,16 +798,20 @@ func (cl *Client) reapConnections(idleTimeout time.Duration) (total int) { } func (b *broker) reapConnections(idleTimeout time.Duration) (total int) { + // Snapshot under reapMu, evaluate and die outside: die runs the + // user's OnBrokerDisconnect hook, which must not run under reapMu + // (see stopForever). b.reapMu.Lock() - defer b.reapMu.Unlock() - - for _, cxn := range []*brokerCxn{ + cxns := []*brokerCxn{ b.cxnNormal, b.cxnProduce, b.cxnFetch, b.cxnGroup, b.cxnSlow, - } { + } + b.reapMu.Unlock() + + for _, cxn := range cxns { if cxn == nil || cxn.dead.Load() { continue } @@ -766,8 +881,75 @@ type brokerCxn struct { resps ring[promisedResp] // dead is an atomic so that a backed up resps cannot block cxn death. dead atomic.Bool - // closed in cloneConn; allows throttle waiting to quit + // closed in die; allows throttle waiting to quit deadCh chan struct{} + // hasDiscard is set during init (before the connection is shared) if + // this is an acks=0 produce connection running the discard goroutine. + // The discard goroutine owns all reads on the connection, so sasl + // reauthentication can never happen in place; see handleReq and + // loadConnection. + hasDiscard bool + + // reauthPending is set by the broker worker when the sasl expiry has + // passed but responses are still in flight (handleResps owns reads, + // so reauthenticating would race it). While pending, requests for + // this connection park instead of being written, so the pipeline + // drains; handleResps pushes a reauthDrainReq as it exits to + // reauthenticate and replay them. See handleReq's expiry arm for the + // store/load ordering argument. + reauthPending atomic.Bool + + // parkMu guards parked/parkFailed. parked holds requests, in arrival + // order, that are waiting for a pending reauthentication; order + // matters for idempotent produce, whose sequence numbers were + // assigned at request build. die fails everything parked (and marks + // parkFailed) so a dead connection cannot strand requests. + parkMu xsync.Mutex + parked []promisedReq + parkFailed bool +} + +// park holds a request destined for this connection while a sasl +// reauthentication is pending; handleReauthDrain replays parked requests in +// order once the pipeline drains. If the connection already died (die fails +// everything parked), the request fails immediately with the same retryable +// error that ring-queued requests receive on broker death. +func (cxn *brokerCxn) park(pr promisedReq) { + cxn.parkMu.Lock() + if cxn.parkFailed { + cxn.parkMu.Unlock() + pr.promise(nil, errChosenBrokerDead) + return + } + cxn.parked = append(cxn.parked, pr) + n := len(cxn.parked) + cxn.parkMu.Unlock() + cxn.cl.cfg.logger.Log(LogLevelDebug, "sasl expiry limit reached but responses are in flight, parking request until the pipeline drains", "broker", logID(cxn.b.meta.NodeID), "parked_reqs", n) +} + +func (cxn *brokerCxn) anyParked() bool { + cxn.parkMu.Lock() + defer cxn.parkMu.Unlock() + return len(cxn.parked) > 0 +} + +func (cxn *brokerCxn) takeParked() []promisedReq { + cxn.parkMu.Lock() + defer cxn.parkMu.Unlock() + parked := cxn.parked + cxn.parked = nil + return parked +} + +func (cxn *brokerCxn) failParked() { + cxn.parkMu.Lock() + parked := cxn.parked + cxn.parked = nil + cxn.parkFailed = true + cxn.parkMu.Unlock() + for _, pr := range parked { + pr.promise(nil, errChosenBrokerDead) + } } func (cxn *brokerCxn) init(isProduceCxn bool, tries int) error { @@ -800,6 +982,7 @@ func (cxn *brokerCxn) init(isProduceCxn bool, tries int) error { } if isProduceCxn && cxn.cl.cfg.acks.val == 0 { + cxn.hasDiscard = true go cxn.discard() // see docs on discard for why we do this } return nil @@ -856,7 +1039,9 @@ start: // // Pre Kafka 2.4, we have to retry the request with version 0. // Post, Kafka replies with the version we should retry with (KIP-511). + var sawUnsupportedVersion bool if rawResp[1] == 35 { + sawUnsupportedVersion = true if maxVersion == 0 { return errors.New("broker replied with UNSUPPORTED_VERSION to an ApiVersions request of version 0") } @@ -871,11 +1056,21 @@ start: cxn.cl.cfg.logger.Log(LogLevelDebug, "broker does not know our ApiVersions version, downgrading to version 0 and retrying", "broker", logID(cxn.b.meta.NodeID)) goto start case len(resp.ApiKeys) == 1 && resp.ApiKeys[0].ApiKey == 18: - maxVersion = resp.ApiKeys[0].MaxVersion - cxn.cl.cfg.logger.Log(LogLevelDebug, fmt.Sprintf("broker does not know our ApiVersions version but replied version %[1]d, downgrading to version %[1]d and retrying", maxVersion), "broker", logID(cxn.b.meta.NodeID)) - goto start + // KIP-511: the broker replies with the version we should + // retry with. Only accept a strictly lower, non-negative + // version: a real broker advertises less than what it + // just rejected, and accepting anything else would let a + // buggy/hostile broker keep us in this downgrade loop + // forever (the init path runs on no request context, so + // only client close would stop it). + if v := resp.ApiKeys[0].MaxVersion; v >= 0 && v < maxVersion { + maxVersion = v + cxn.cl.cfg.logger.Log(LogLevelDebug, fmt.Sprintf("broker does not know our ApiVersions version but replied version %[1]d, downgrading to version %[1]d and retrying", maxVersion), "broker", logID(cxn.b.meta.NodeID)) + goto start + } + return fmt.Errorf("broker replied with UNSUPPORTED_VERSION to our v%d ApiVersions request but advertised non-downgrade version %d", maxVersion, resp.ApiKeys[0].MaxVersion) default: - // Should not hit this case, but we hope the broker replied with all keys + // The broker replied with all keys; nothing to downgrade to, we use them. } resp = req.ResponseKind().(*kmsg.ApiVersionsResponse) resp.Version = 0 @@ -884,6 +1079,12 @@ start: if err = resp.ReadFrom(rawResp); err != nil { return fmt.Errorf("unable to read ApiVersions response: %w", err) } + // Checked before ApiKeys below: an error can come with an empty key table. + if !sawUnsupportedVersion { + if err := kerr.ErrorForCode(resp.ErrorCode); err != nil { + return err + } + } if len(resp.ApiKeys) == 0 { return errors.New("ApiVersions response invalidly contained no ApiKeys") } @@ -1055,6 +1256,16 @@ func (cxn *brokerCxn) doSasl(authenticate bool) error { } if lifetimeMillis > 0 { + // A hostile/buggy broker can reply with a lifetime so large + // that converting it to a time.Duration overflows, wrapping + // the expiry into the past and forcing a reauth before every + // request. Anything beyond a year never matters for a real + // connection; clamp. + const maxLifetimeMillis = 365 * 24 * int64(time.Hour/time.Millisecond) + if lifetimeMillis > maxLifetimeMillis { + lifetimeMillis = maxLifetimeMillis + } + // Lifetime is problematic. We need to be a bit pessimistic. // // We want a lowerbound: we use 1s (arbitrary), but if 1.1x our @@ -1093,6 +1304,14 @@ func (cxn *brokerCxn) doSasl(authenticate bool) error { "lifetime_pessimism", time.Duration(usePessimismMillis)*time.Millisecond, "reauthenticate_in", cxn.expiry.Sub(now), ) + } else { + // No (or zero) lifetime means the broker does not require + // reauthentication, KIP-368. If a previous authenticate on + // this connection set an expiry (reauth was enabled then, e.g. + // before a dynamic broker config change), clear it: keeping + // the old, already-passed expiry would re-run the full sasl + // flow before every subsequent request on this connection. + cxn.expiry = time.Time{} } return nil } @@ -1365,6 +1584,14 @@ func (cxn *brokerCxn) readResponse( } if readErr != nil { + // A metadata update can retire this broker while a response read is + // blocked. stopForever calls die, which marks the connection dead + // before closing it; the read then wakes with a platform-specific + // socket error. Return the same retryable error as requests queued + // behind this read, unless the client or request itself was canceled. + if cxn.dead.Load() && cxn.cl.ctx.Err() == nil && !isContextErr(readErr) { + return nil, errChosenBrokerDead + } return nil, readErr } if len(buf) < 4 { @@ -1384,10 +1611,17 @@ func (cxn *brokerCxn) readResponse( return buf[4:], nil } -// closeConn is the one place we close broker connections. This is always done -// in either die, which is called when handleResps returns, or if init fails, -// which means we did not succeed enough to start handleResps. -func (cxn *brokerCxn) closeConn() { +// die is the one place we close broker connections, and it replies to all +// requests awaiting responses appropriately, including requests parked for a +// pending reauthentication. It is callable from anywhere and at any point in a +// connection's life: read/write errors, reaping, broker stoppage, init failure, +// and loadConnection's ApiVersions-reset retry and dead-broker arm. The dead +// swap is what makes every one of those safe -- deadCh can only be closed once, +// no matter how many goroutines race to tear the connection down. +func (cxn *brokerCxn) die() { + if cxn == nil || cxn.dead.Swap(true) { + return + } cxn.cl.cfg.hooks.each(func(h Hook) { if h, ok := h.(HookBrokerDisconnect); ok { h.OnBrokerDisconnect(cxn.b.meta, cxn.conn) @@ -1395,16 +1629,8 @@ func (cxn *brokerCxn) closeConn() { }) cxn.conn.Close() close(cxn.deadCh) -} - -// die kills a broker connection (which could be dead already) and replies to -// all requests awaiting responses appropriately. -func (cxn *brokerCxn) die() { - if cxn == nil || cxn.dead.Swap(true) { - return - } - cxn.closeConn() cxn.resps.die() + cxn.failParked() } // waitResp, called serially by a broker's handleReqs, manages handling a @@ -1529,7 +1755,7 @@ func (cxn *brokerCxn) discard() { } nread2, err = cxn.conn.Read(discard) nread += nread2 - size -= int32(nread2) // nread2 max is 128 + size -= int32(nread2) // nread2 max is len(discardBuf), 256 } }() @@ -1570,6 +1796,60 @@ start: if more { goto start } + + // The ring is empty and this worker is exiting: no read is in flight + // and none can start (only the broker worker pushes responses, and it + // parks requests for this connection while a reauth is pending). If a + // reauth is pending, signal the broker worker to perform it and + // replay the parked requests. If the broker is stopping, the failed + // push is fine: stopForever dies every connection, and die fails + // everything parked. + if cxn.reauthPending.Load() { + cxn.b.do(cxn.cl.ctx, &reauthDrainReq{cxn: cxn}, func(kmsg.Response, error) {}) + } +} + +// handleReauthDrain runs on the broker worker goroutine when a connection +// with a pending reauthentication has drained its in-flight responses (its +// handleResps worker pushed this sentinel as it exited). No reads can be in +// flight: handleResps exited, only this goroutine starts another (by writing +// a request), and every request for this connection since the expiry passed +// was parked. Reauthenticate and replay the parked requests in their +// original order -- order matters for idempotent produce, whose sequence +// numbers were assigned at request build. +func (b *broker) handleReauthDrain(cxn *brokerCxn) { + // A sentinel can be spurious: the quiet-connection reauth arm stores + // the pending flag and clears it just after, and a concurrently + // exiting handleResps can observe the transient true. That alone is + // a harmless no-op below -- but if the broker also hands out + // immediately-expiring lifetimes, a request queued behind this + // sentinel's push may have re-parked by now with a NEW response in + // flight (the inline arm's own request), so "drained" no longer + // holds. If anything is in flight, touch nothing: that response's + // handleResps exit re-signals (the parker stored the pending flag + // before observing the non-empty ring, so the exit cannot miss it) + // and the re-signal finds the connection actually quiet. + if !cxn.resps.empty() { + return + } + + // Take the parked requests before a possible die below: a failed + // reauth must not fail them, it replays them through the normal path, + // which builds a fresh connection with a fresh authentication -- the + // same recovery the in-place reauth arm provides via its + // retry-on-new-connection. (If the connection died earlier, die + // already failed everything parked and this take returns nil.) + parked := cxn.takeParked() + if cxn.reauthPending.Swap(false) && !cxn.dead.Load() { + cxn.cl.cfg.logger.Log(LogLevelDebug, "sasl expiry limit reached and responses have drained, reauthenticating", "broker", logID(cxn.b.meta.NodeID), "parked_reqs", len(parked)) + if err := cxn.sasl(); err != nil { + cxn.cl.cfg.logger.Log(LogLevelDebug, "sasl reauth failed, killing connection; any parked requests retry on a new connection", "broker", logID(cxn.b.meta.NodeID), "err", err) + cxn.die() + } + } + for _, pr := range parked { + b.handleReq(pr) + } } func (cxn *brokerCxn) handleResp(pr promisedResp) { @@ -1586,17 +1866,24 @@ func (cxn *brokerCxn) handleResp(pr promisedResp) { pr.readEnqueue, ) if err != nil { - if !errors.Is(err, ErrClientClosed) && !errors.Is(err, context.Canceled) { - if cxn.successes > 0 || len(cxn.b.cl.cfg.sasls) > 0 { - cxn.b.cl.cfg.logger.Log(LogLevelDebug, "read from broker errored, killing connection", "req", kmsg.Key(pr.resp.Key()).Name(), "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "successful_reads", cxn.successes, "err", err) - } else { - cxn.b.cl.cfg.logger.Log(LogLevelWarn, "read from broker errored, killing connection after 0 successful responses (is SASL missing?)", "req", kmsg.Key(pr.resp.Key()).Name(), "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "err", err) - if err == io.EOF { // specifically avoid checking errors.Is to ensure this is not already wrapped - err = &ErrFirstReadEOF{kind: firstReadSASL, err: err, retry: cxn.b.cl.cfg.alwaysRetryEOF} + if !errors.Is(err, errChosenBrokerDead) { + if !errors.Is(err, ErrClientClosed) && !errors.Is(err, context.Canceled) { + if cxn.successes > 0 || len(cxn.b.cl.cfg.sasls) > 0 { + cxn.b.cl.cfg.logger.Log(LogLevelDebug, "read from broker errored, killing connection", "req", kmsg.Key(pr.resp.Key()).Name(), "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "successful_reads", cxn.successes, "err", err) + } else { + cxn.b.cl.cfg.logger.Log(LogLevelWarn, "read from broker errored, killing connection after 0 successful responses (is SASL missing?)", "req", kmsg.Key(pr.resp.Key()).Name(), "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "err", err) + if err == io.EOF || err == io.ErrUnexpectedEOF { // specifically avoid checking errors.Is to ensure this is not already wrapped + // ErrUnexpectedEOF gets the same first-read + // pessimism: now that it is retryable in + // isRetryableBrokerErr, a mid-frame close on + // the very first read (bad SASL cutting us off + // mid-response) must not retry forever either. + err = &ErrFirstReadEOF{kind: firstReadSASL, err: err, retry: cxn.b.cl.cfg.alwaysRetryEOF} + } } + } else { + cxn.b.cl.cfg.logger.Log(LogLevelDebug, "read from broker canceled, closing connection and killing any other in-flight requests on this connection", "req", kmsg.Key(pr.resp.Key()).Name(), "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "err", err) } - } else { - cxn.b.cl.cfg.logger.Log(LogLevelDebug, "read from broker canceled, closing connection and killing any other in-flight requests on this connection", "req", kmsg.Key(pr.resp.Key()).Name(), "addr", cxn.b.addr, "broker", logID(cxn.b.meta.NodeID), "err", err) } pr.promise(nil, err) cxn.die() @@ -1618,6 +1905,14 @@ func (cxn *brokerCxn) handleResp(pr promisedResp) { if readErr == nil { if throttleResponse, ok := pr.resp.(kmsg.ThrottleResponse); ok { millis, throttlesAfterResp := throttleResponse.Throttle() + // A throttle is honored in full with NO upper cap (KIP-219), + // matching Java's NetworkClient. millis <= 0 is ignored; a + // positive value - even a hostile near-MaxInt32 (~24.8 days) - + // delays the next write on this connection (writeRequest), which + // selects on the request ctx and client Close, so the wait is + // always interruptible and holds no lock. Capping it would break + // the quota mechanism; an absurd throttle is equivalent to a slow + // broker, which is always possible. Do not add a cap. if millis > 0 { if pr.resp.Key() == 0 { cxn.b.cl.metrics.observeTime(&cxn.b.cl.metrics.pThrottle, int64(millis)) diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/client.go b/vendor/github.com/twmb/franz-go/pkg/kgo/client.go index f82e59838b4..0bcdd3d31a2 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/client.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/client.go @@ -100,7 +100,6 @@ type Client struct { topics map[string]cachedMetaTopic byID map[[16]byte]string // TopicID => topic name allAt time.Time // when last all-topics fetch completed - anyAt time.Time // when any cached metadata was last stored } } @@ -372,7 +371,7 @@ func (cl *Client) OptValues(opt any) []any { return []any{cfg.recordTimeout} case namefn(TransactionalID): if cfg.txnID != nil { - return []any{cfg.txnID, true} + return []any{*cfg.txnID, true} } return []any{"", false} case namefn(TransactionTimeout): @@ -462,6 +461,14 @@ func (cl *Client) OptValues(opt any) []any { return []any{true} case namefn(SessionTimeout): return []any{cfg.sessionTimeout} + case namefn(ShareGroup): + return []any{cfg.shareGroup} + case namefn(ShareAckCallback): + return []any{cfg.shareAckCallback} + case namefn(ShareMaxRecords): + return []any{cfg.shareMaxRecords} + case namefn(ShareMaxRecordsStrict): + return []any{cfg.shareMaxRecordsStrict} default: return nil @@ -681,7 +688,7 @@ func (cl *Client) Ping(ctx context.Context) error { // // For admin requests, this deletes the topic from the cached metadata map for // sharded requests. Metadata for sharded admin requests is only cached for -// MetadataMinAge anyway, but the map is not cleaned up one the metadata +// MetadataMinAge anyway, but the map is not cleaned up once the metadata // expires. This function ensures the map is purged. func (cl *Client) PurgeTopicsFromClient(topics ...string) { if len(topics) == 0 { @@ -935,7 +942,21 @@ func (cl *Client) supportsOffsetForLeaderEpoch() bool { // v1 introduces support for regex and requires the client to generate // the member ID, and fully stabilizes KIP-848. func (cl *Client) supportsKIP848v1() bool { - return cl.supportsKeyVersion(int16(kmsg.ConsumerGroupHeartbeat), 1) + if !cl.supportsKeyVersion(int16(kmsg.ConsumerGroupHeartbeat), 1) { + return false + } + // The 848 manage loop runs v1 semantics (client-generated member ID, + // regex subscriptions). If the user's MaxVersions caps the heartbeat + // below v1, the wire request would be v0 while we behave as v1: v0 + // has no SubscribedTopicRegex field at all, so a regex consumer's + // join would carry no subscription and silently consume nothing. + // Only opt in if the cap allows v1, mirroring supportsKIP890p2. + if mv := cl.cfg.maxVersions; mv != nil { + if v, ok := mv.LookupMaxKeyVersion(int16(kmsg.ConsumerGroupHeartbeat)); !ok || v < 1 { + return false + } + } + return true } // Called after the first metric observed, which is always after a response. @@ -964,7 +985,28 @@ func (cl *Client) supportsKeyVersion(key, version int16) bool { } func (cl *Client) supportsKIP890p2() bool { - return cl.supportsFeature("transaction.version", 2) + if !cl.supportsFeature("transaction.version", 2) { + return false + } + // The KIP-890 part 2 paths change what goes on the wire: produce v12+ + // skips AddPartitionsToTxn, TxnOffsetCommit v5+ skips AddOffsetsToTxn, + // and EndTxn v5+ bumps the producer epoch. A user MaxVersions cap + // below any of those keeps the OLD wire versions while skipping the + // explicit add requests, and the broker then rejects the produces + // with INVALID_TXN_STATE because the partitions were never added to + // the transaction. Only opt in if the cap allows the new versions. + if mv := cl.cfg.maxVersions; mv != nil { + if v, ok := mv.LookupMaxKeyVersion(int16(kmsg.Produce)); !ok || v < 12 { + return false + } + if v, ok := mv.LookupMaxKeyVersion(int16(kmsg.EndTxn)); !ok || v < 5 { + return false + } + if v, ok := mv.LookupMaxKeyVersion(int16(kmsg.TxnOffsetCommit)); !ok || v < 5 { + return false + } + } + return true } // Same as above. A cluster returns a max version for a feature only once the @@ -988,32 +1030,42 @@ func (cl *Client) supportsFeature(name string, version int16) bool { } // fetchBrokerMetadata issues a metadata request solely for broker information. +// +// Concurrent callers collapse onto one in-flight request. The request itself +// runs on the client context: if it ran on the initiating caller's context, +// that caller canceling would fail every collapsed waiter with the canceled +// error even though their own contexts are live (the same reasoning as +// doLoadCoordinators). Each caller's context governs only its own wait; an +// abandoned fetch still completes and updates broker state, which is fine. func (cl *Client) fetchBrokerMetadata(ctx context.Context) error { cl.fetchingBrokersMu.Lock() wait := cl.fetchingBrokers - if wait != nil { - cl.fetchingBrokersMu.Unlock() - <-wait.done - return wait.err + if wait == nil { + wait = &struct { + done chan struct{} + err error + }{done: make(chan struct{})} + cl.fetchingBrokers = wait + go func() { + defer func() { + cl.fetchingBrokersMu.Lock() + defer cl.fetchingBrokersMu.Unlock() + cl.fetchingBrokers = nil + close(wait.done) + }() + req := kmsg.NewPtrMetadataRequest() + req.Topics = []kmsg.MetadataRequestTopic{} + _, _, wait.err = cl.fetchMetadata(cl.ctx, req, true, nil) + }() } - wait = &struct { - done chan struct{} - err error - }{done: make(chan struct{})} - cl.fetchingBrokers = wait cl.fetchingBrokersMu.Unlock() - defer func() { - cl.fetchingBrokersMu.Lock() - defer cl.fetchingBrokersMu.Unlock() - cl.fetchingBrokers = nil - close(wait.done) - }() - - req := kmsg.NewPtrMetadataRequest() - req.Topics = []kmsg.MetadataRequestTopic{} - _, _, wait.err = cl.fetchMetadata(ctx, req, true, nil) - return wait.err + select { + case <-wait.done: + return wait.err + case <-ctx.Done(): + return ctx.Err() + } } func (cl *Client) fetchMetadataByName(ctx context.Context, all bool, topics []string, results map[string]cachedMetaTopic) (*broker, *kmsg.MetadataResponse, error) { @@ -1106,18 +1158,57 @@ func (cl *Client) updateMetadataBrokers(resp *kmsg.MetadataResponse) { if resp.ControllerID >= 0 { cl.controllerID = resp.ControllerID } - cl.clusterID = resp.ClusterID + // Clone ClusterID so cl.clusterID owns its own *string, independent + // of the broker response. Readers (dups in RequestCachedMetadata) + // would otherwise race a user mutating *resp.ClusterID on a + // previously-returned cl.Request(MetadataRequest) response. + cl.clusterID = nil + if resp.ClusterID != nil { + s := *resp.ClusterID + cl.clusterID = &s + } cl.controllerIDMu.Unlock() cl.updateBrokers(resp.Brokers) } // updateBrokers is called with the broker portion of every metadata response. -// All metadata responses contain all known live brokers, so we can always -// use the response. +// All metadata responses contain all known live brokers, so the response list +// is authoritative and we diff-merge it: brokers absent from it are stopped. +// +// An EMPTY list therefore wipes all discovered brokers and falls back to +// seeds. This is intentional and long-standing: if a broker ever answers +// metadata with no brokers, falling back to the seeds is safer than being +// left with none, and it re-covers every seed should the cluster have somehow +// split. KIP-1102's rebootstrap rides the same path, calling updateBrokers(nil) +// explicitly. A buggy broker sending a transient subset only kills those +// connections (in-flight requests fail with retriable errChosenBrokerDead) and +// the next good response heals. Do not special-case the empty list back into a +// no-op. func (cl *Client) updateBrokers(brokers []kmsg.MetadataResponseBroker) { sort.Slice(brokers, func(i, j int) bool { return brokers[i].NodeID < brokers[j].NodeID }) newBrokers := make([]*broker, 0, len(brokers)) + // Removed or replaced brokers are stopped AFTER brokersMu is released: + // stopForever dies each connection, which synchronously fires the + // user's OnBrokerDisconnect hook, and a hook that re-enters the client + // (issuing a request, DiscoveredBrokers, anything needing brokersMu) + // would deadlock this goroutine -- the metadata loop -- under the + // write lock, wedging every request path client-wide. Walkthrough: a + // rolling restart removes node 5 from metadata; we take brokersMu and + // stopForever(node 5) inline; the hook calls cl.Broker(5).Request; + // brokerOrErr blocks on brokersMu.RLock behind our write lock forever. + // Same hazard reapMu had (see stopForever), one lock up. Stopping + // late is safe: requests racing a removed broker already contend with + // stopForever via b.dead / errChosenBrokerDead, and the broker is out + // of cl.brokers the moment we unlock (UpdateSeedBrokers already stops + // its old seeds this way). + var stopped []*broker + defer func() { + for _, b := range stopped { + b.stopForever() + } + }() + cl.brokersMu.Lock() defer cl.brokersMu.Unlock() @@ -1131,12 +1222,12 @@ func (cl *Client) updateBrokers(brokers []kmsg.MetadataResponseBroker) { switch { case ob.meta.NodeID < nb.NodeID: - ob.stopForever() + stopped = append(stopped, ob) cl.brokers = cl.brokers[1:] case ob.meta.NodeID == nb.NodeID: if !ob.meta.equals(nb) { - ob.stopForever() + stopped = append(stopped, ob) ob = cl.newBroker(nb.NodeID, nb.Host, nb.Port, nb.Rack) } newBrokers = append(newBrokers, ob) @@ -1151,7 +1242,7 @@ func (cl *Client) updateBrokers(brokers []kmsg.MetadataResponseBroker) { for len(cl.brokers) > 0 { ob := cl.brokers[0] - ob.stopForever() + stopped = append(stopped, ob) cl.brokers = cl.brokers[1:] } @@ -1263,29 +1354,38 @@ func (cl *Client) close(ctx context.Context) (rerr error) { wg.Wait() sessCloseCancel() - // Now we kill the client context and all brokers, ensuring all - // requests fail. This will finish all producer callbacks and - // stop the metadata loop and metrics loop. - cl.ctxCancel() - - // Before killing brokers, give metrics 1s to push any final - // terminating message. The client context cancelation awakens - // the push-period-wait loop. + // Tell the metrics loop to send its final Terminating=true push and + // give it 1s to do so. This must happen BEFORE we cancel the client + // context: the entire request path (shardedRequest's cancel watchdog, + // Broker.request's select, and the broker connection write/read + // loops) aborts requests once cl.ctx is dead, so a terminating push + // started after cancelation could never be delivered. The metrics + // loop cancels metrics.ctx when it exits; clients with metrics + // disabled, unsupported, or never observed pass through instantly. + cl.metrics.quit() after := time.NewTimer(time.Second) select { case <-cl.metrics.ctx.Done(): + after.Stop() case <-after.C: cl.metrics.ctxCancel() - case <-ctx.Done(): - cl.metrics.ctxCancel() } + // Now we kill the client context and all brokers, ensuring all + // requests fail. This will finish all producer callbacks and + // stop the metadata loop and metrics loop. + cl.ctxCancel() + + // Stop brokers outside brokersMu: stopForever fires the user's + // OnBrokerDisconnect hook synchronously, and a hook re-entering the + // client would deadlock on the held write lock (see updateBrokers). cl.brokersMu.Lock() cl.stopBrokers = true - for _, broker := range cl.brokers { + stopBrokers := slices.Clone(cl.brokers) + cl.brokersMu.Unlock() + for _, broker := range stopBrokers { broker.stopForever() } - cl.brokersMu.Unlock() for _, broker := range cl.loadSeeds() { broker.stopForever() } @@ -1349,6 +1449,8 @@ func (cl *Client) close(ctx context.Context) (rerr error) { // ListGroups // DeleteRecords // OffsetForLeaderEpoch +// AddPartitionsToTxn +// WriteTxnMarkers // DescribeConfigs // AlterConfigs // AlterReplicaLogDirs @@ -1511,7 +1613,7 @@ func (cl *Client) RequestCachedMetadata(ctx context.Context, req *kmsg.MetadataR NodeID: b.meta.NodeID, Host: b.meta.Host, Port: b.meta.Port, - Rack: b.meta.Rack, + Rack: dups(b.meta.Rack), }) } cl.brokersMu.RUnlock() @@ -1657,7 +1759,7 @@ type ResponseShard struct { // unknown (node ID -1) metadata if the request could not be issued. // // Requests can fail to even be issued if an appropriate broker cannot - // be loaded of if the client cannot understand the request. + // be loaded or if the client cannot understand the request. Meta BrokerMetadata // Req is the request that was issued to this broker. @@ -1683,9 +1785,9 @@ type ResponseShard struct { // // If, in the process of splitting a request, some topics or partitions are // found to not exist, or Kafka replies that a request should go to a broker -// that does not exist, all those non-existent pieces are grouped into one -// request to the first seed broker. This will show up as a seed broker node ID -// (min int32) and the response will likely contain purely errors. +// that does not exist, all those non-existent pieces are not issued; they are +// returned as error shards with an unknown broker metadata (node ID -1) and +// the error that prevented the piece from being mapped to a broker. // // The response shards are ordered by broker metadata. func (cl *Client) RequestSharded(ctx context.Context, req kmsg.Request) []ResponseShard { @@ -1827,20 +1929,23 @@ func findBroker(candidates []*broker, node int32) *broker { // that error. func (cl *Client) brokerOrErr(ctx context.Context, id int32, err error) (*broker, error) { if id < 0 { + // Negative IDs are seed brokers (unknownSeedID), exposed to + // users via SeedBrokers(). Any other negative ID (-1 unknown + // controller / coordinator sentinels) never exists, and + // metadata responses cannot introduce negative IDs, so we + // look up seeds directly and never try a metadata load. + if b := findBroker(cl.loadSeeds(), id); b != nil { + return b, nil + } return nil, err } tryLoad := ctx != nil tries := 0 start: - var broker *broker - if id < 0 { - broker = findBroker(cl.loadSeeds(), id) - } else { - cl.brokersMu.RLock() - broker = findBroker(cl.brokers, id) - cl.brokersMu.RUnlock() - } + cl.brokersMu.RLock() + broker := findBroker(cl.brokers, id) + cl.brokersMu.RUnlock() if broker == nil { if tryLoad { @@ -1897,6 +2002,11 @@ func (cl *Client) forgetControllerID(id int32) { } } +// Coordinator types match Kafka's FindCoordinator key-type enum. +// coordinatorTypeShare (the share-state coordinator) is keyed by a +// groupId:topicId:partition SharePartitionKey and serves only the +// broker-internal persister RPCs (keys 83-87), which kgo never issues; share +// groups go entirely through the GROUP coordinator (see #1330). const ( coordinatorTypeGroup int8 = 0 coordinatorTypeTxn int8 = 1 @@ -1934,13 +2044,13 @@ func (cl *Client) loadCoordinators(ctx context.Context, typ int8, keys ...string } } -// doLoadCoordinators uses the caller context to cancel loading metadata -// (brokerOrErr), but we use the client context to actually issue the request. -// There should be only one direct call to doLoadCoordinators, just above in -// loadCoordinator. It is possible for two requests to be loading the same -// coordinator (in fact, that's the point of this function -- collapse these -// requests). We do not want the first request canceling it's context to cause -// errors for the second request. +// doLoadCoordinators issues the FindCoordinator request - and any broker +// metadata load needed to resolve the response - on the client context. It is +// possible for two requests to be loading the same coordinator (in fact, +// that's the point of this function -- collapse these requests). We do not +// want the first request canceling its context to cause errors for the +// second request. The caller context only cancels the caller's wait, via +// loadCoordinators above. // // It is ok to leave FindCoordinator running even if the caller quits. Worst // case, we just cache things for some time in the future; yay. @@ -2140,13 +2250,35 @@ func (cl *Client) deleteStaleCoordinatorsByNode(node int32) { cl.coordinatorsMu.Lock() defer cl.coordinatorsMu.Unlock() for k, v := range cl.coordinators { - if v == nil || v.node != node { + if v == nil { continue } + // v.node is written by doLoadCoordinators outside of + // coordinatorsMu; that write is published only by the + // close(loadWait) ending the load. We must observe the close + // before reading v.node, so the v.node check lives inside the + // loadWait arm -- not in the range filter above. + // + // Race walkthrough if we checked v.node before the select: + // 1) doLoadCoordinators inserts v with an open loadWait, then + // releases coordinatorsMu and issues FindCoordinator. + // 2) The response arrives and the loader writes v.node = + // rc.NodeID, lock-free (doLoadCoordinators, above). + // 3) Concurrently a broker disconnect calls us here. We hold + // coordinatorsMu, but the writer in step 2 never takes it, + // so the mutex does not order us against that write -- + // reading v.node now is a data race (go test -race flags + // it). close(loadWait) in step 2 has not happened yet, so + // the default arm is what we would take anyway. + // Reading inside the loadWait arm makes the read happen-after + // the publishing close, so v.node is safe to observe. select { case <-v.loadWait: - delete(cl.coordinators, k) + if v.node == node { + delete(cl.coordinators, k) + } default: + // Still loading: v.node is not yet published; skip. } } } @@ -2285,8 +2417,18 @@ func (cl *Client) handleCoordinatorReq(ctx context.Context, req kmsg.Request) Re case *kmsg.OffsetDeleteRequest: return cl.handleCoordinatorReqSimple(ctx, coordinatorTypeGroup, t.Group, req) - // ConsumerGroupHeartbeat cannot be retried at all + // ConsumerGroupHeartbeat carries reconciliation state and cannot be + // blindly retried; the 848 heartbeat loop owns retries with full + // state knowledge. The exception is leaving (MemberEpoch -1, or -2 + // for static members): a leave carries no reconcilable state and is + // idempotent, and the coordinator moving is precisely when leaves + // are issued against a stale cached coordinator - firing it once + // would lose the leave to a single NOT_COORDINATOR and ghost the + // member until the session timeout. case *kmsg.ConsumerGroupHeartbeatRequest: + if t.MemberEpoch < 0 { + return cl.handleCoordinatorReqSimple(ctx, coordinatorTypeGroup, t.Group, req) + } br, err := cl.loadCoordinator(ctx, coordinatorTypeGroup, t.Group) var resp kmsg.Response if err == nil { @@ -2298,10 +2440,14 @@ func (cl *Client) handleCoordinatorReq(ctx context.Context, req kmsg.Request) Re // SHARE // /////////// - // ShareGroupHeartbeat cannot be retried (like ConsumerGroupHeartbeat). - // Like ConsumerGroupHeartbeat, share membership is managed by the - // GROUP coordinator, not the share-state coordinator. + // ShareGroupHeartbeat cannot be retried (like ConsumerGroupHeartbeat), + // except for the leave, which is retried for the same reason as + // above. Share membership is managed by the GROUP coordinator, not + // the share-state coordinator. case *kmsg.ShareGroupHeartbeatRequest: + if t.MemberEpoch < 0 { + return cl.handleCoordinatorReqSimple(ctx, coordinatorTypeGroup, t.GroupID, req) + } br, err := cl.loadCoordinator(ctx, coordinatorTypeGroup, t.GroupID) var resp kmsg.Response if err == nil { @@ -2309,9 +2455,9 @@ func (cl *Client) handleCoordinatorReq(ctx context.Context, req kmsg.Request) Re } return shard(br, req, resp, err) case *kmsg.AlterShareGroupOffsetsRequest: - return cl.handleCoordinatorReqSimple(ctx, coordinatorTypeShare, t.GroupID, req) + return cl.handleCoordinatorReqSimple(ctx, coordinatorTypeGroup, t.GroupID, req) case *kmsg.DeleteShareGroupOffsetsRequest: - return cl.handleCoordinatorReqSimple(ctx, coordinatorTypeShare, t.GroupID, req) + return cl.handleCoordinatorReqSimple(ctx, coordinatorTypeGroup, t.GroupID, req) } } @@ -2376,6 +2522,8 @@ func (cl *Client) handleReqWithCoordinator( code = t.ErrorCode case *kmsg.ConsumerGroupHeartbeatResponse: code = t.ErrorCode + case *kmsg.ShareGroupHeartbeatResponse: + code = t.ErrorCode } // ListGroups, OffsetFetch, DeleteGroups, DescribeGroups, and @@ -2730,13 +2878,18 @@ func (cl *Client) handleShardedReq(ctx context.Context, req kmsg.Request) ([]Res start: tries++ - br := cl.broker() + var br *broker var err error if !myIssue.any { br, err = cl.brokerOrErr(ctx, myIssue.broker, errUnknownBroker) - } else if avoidBroker != -1 { - for i := 0; i < 3 && br.meta.NodeID == avoidBroker; i++ { - br = cl.broker() + } else { + // Only consume an any-broker rotation slot for + // shards that actually go to any broker. + br = cl.broker() + if avoidBroker != -1 { + for i := 0; i < 3 && br.meta.NodeID == avoidBroker; i++ { + br = cl.broker() + } } } if err != nil { @@ -3016,7 +3169,6 @@ func (cl *Client) storeCachedMeta(meta *kmsg.MetadataResponse, all bool, results cl.metaCache.byID = make(map[[16]byte]string) } when := time.Now() - cl.metaCache.anyAt = when var zeroID [16]byte var stored int for _, topic := range meta.Topics { @@ -3026,22 +3178,49 @@ func (cl *Client) storeCachedMeta(meta *kmsg.MetadataResponse, all bool, results continue } stored++ + // Deep-clone the topic name, Partitions, and each partition's + // inner slices so the cache owns fully independent state. The + // broker response is shared with whoever consumed it: + // fetchTopicMetadata sort.Slice's the outer Partitions slice + // in place to validate ordering (issue #1328), and + // cl.Request(MetadataRequest) hands the response back to user + // code that may mutate the inner slices or write through the + // Topic *string. Without these clones, readers via + // RequestCachedMetadata or sharded request paths (which read + // ps[part].Replicas) would race those writers. dupt on the + // GET side clones separately: that isolates returned responses + // from the cache, this isolates the cache from the response. + topicName := *topic.Topic + topic.Topic = &topicName + topic.Partitions = slices.Clone(topic.Partitions) + for i := range topic.Partitions { + p := &topic.Partitions[i] + p.Replicas = slices.Clone(p.Replicas) + p.ISR = slices.Clone(p.ISR) + p.OfflineReplicas = slices.Clone(p.OfflineReplicas) + } t := cachedMetaTopic{ id: topic.TopicID, t: topic, ps: make(map[int32]kmsg.MetadataResponseTopicPartition), when: when, } - cl.metaCache.topics[*topic.Topic] = t + // A recreated topic comes back under a new ID. Delete the old + // ID's mapping when overwriting the entry, else byID accumulates + // stale IDs forever and resolves IDs that no longer exist. + if old, ok := cl.metaCache.topics[topicName]; ok && old.id != topic.TopicID && old.id != zeroID { + delete(cl.metaCache.byID, old.id) + } + cl.metaCache.topics[topicName] = t for _, partition := range topic.Partitions { t.ps[partition.Partition] = partition } if topic.TopicID != zeroID { - cl.metaCache.byID[topic.TopicID] = *topic.Topic + cl.metaCache.byID[topic.TopicID] = topicName } if results != nil { - results[*t.t.Topic] = t + results[topicName] = t } } @@ -3366,6 +3545,15 @@ func (cl *offsetFetchSharder) shard(ctx context.Context, kreq kmsg.Request, last dup := *req req = &dup + // Deep-dup the groups: the struct copy above still shares the + // caller's Groups slice (and each group's Topics slice), and the + // Topic/TopicID resolution fill below would otherwise write into the + // caller's request structs in place. + req.Groups = slices.Clone(req.Groups) + for i := range req.Groups { + req.Groups[i].Topics = slices.Clone(req.Groups[i].Topics) + } + if len(req.Groups) == 0 { req.Groups = append(req.Groups, offsetFetchReqToGroup(req)) } @@ -3400,21 +3588,39 @@ func (cl *offsetFetchSharder) shard(ctx context.Context, kreq kmsg.Request, last nameMeta, _ = cl.resolveTopicMeta(ctx, unresolvedNames, true, 0) } if resolving { + // Fill from metaCache, which the resolve calls above populated: + // resolveTopicMetaByID stores into metaCache.byID (and returns + // nil when everything was already cached), while cl.id2t only + // ever holds topics this client produces or consumes -- an + // admin-style client fetching offsets by TopicID has the mapping + // ONLY in the cache. This mirrors the response-side resolution + // in the onResp below, which reads the cache for the same + // reason. id2t and the resolveTopicMeta return value remain as + // fallbacks. Names matter most below v10, where TopicID is + // structurally absent from the wire and an empty name is + // unmatchable by the broker (see #1312). id2t := cl.id2tMap() + cl.metaCache.mu.Lock() for i := range req.Groups { g := &req.Groups[i] for j := range g.Topics { t := &g.Topics[j] if t.Topic == "" && t.TopicID != ([16]byte{}) { - t.Topic = id2t[t.TopicID] + t.Topic = cl.metaCache.byID[t.TopicID] + if t.Topic == "" { + t.Topic = id2t[t.TopicID] + } } if t.TopicID == ([16]byte{}) && t.Topic != "" { - if ct, ok := nameMeta[t.Topic]; ok { + if ct, ok := cl.metaCache.topics[t.Topic]; ok { + t.TopicID = ct.id + } else if ct, ok := nameMeta[t.Topic]; ok { t.TopicID = ct.id } } } } + cl.metaCache.mu.Unlock() } groups := make([]string, 0, len(req.Groups)) @@ -3659,7 +3865,11 @@ func (*findCoordinatorSharder) shard(_ context.Context, kreq kmsg.Request, lastE uniq[key] = struct{}{} } } - req.CoordinatorKeys = req.CoordinatorKeys[:0] + // Build the deduplicated keys in a FRESH slice: the struct copy above + // still shares the caller's backing array, and appending into + // req.CoordinatorKeys[:0] would overwrite the caller's request slice + // with deduplicated, map-order-shuffled keys. + req.CoordinatorKeys = make([]string, 0, len(uniq)) for key := range uniq { req.CoordinatorKeys = append(req.CoordinatorKeys, key) } @@ -4202,15 +4412,26 @@ func (cl *addPartitionsToTxnSharder) shard(ctx context.Context, kreq kmsg.Reques var issues []issueShard for id, req := range brokerReqs { - if len(req.Transactions) <= 1 || len(req.Transactions) == 1 && !req.Transactions[0].VerifyOnly { + if len(req.Transactions) == 1 && !req.Transactions[0].VerifyOnly { + // Clients must use v3 and below; v4+ requires CLUSTER_ACTION + // authorization because it is the broker-to-broker side of + // KIP-890. issues = append(issues, issueShard{ req: req, pin: &pinReq{pinMax: true, max: 3}, broker: id, }) } else { + // Batched transactions and VerifyOnly only exist in v4+: + // the v3 body has no Transactions array and no VerifyOnly + // field, so serializing this request any lower silently + // drops everything that matters - VerifyOnly in particular + // would turn a verification into a real partition add. Pin + // min 4 so brokers that cannot express the request fail + // loudly with errBrokerTooOld instead. issues = append(issues, issueShard{ req: req, + pin: &pinReq{pinMin: true, min: 4}, broker: id, }) } @@ -4315,10 +4536,11 @@ func (cl *writeTxnMarkersSharder) shard(ctx context.Context, kreq kmsg.Request, } type pidEpochCommit struct { - pid int64 - epoch int16 - commit bool - txnVersion int8 + pid int64 + epoch int16 + commit bool + coordinatorEpoch int32 + txnVersion int8 } brokerReqs := make(map[int32]map[pidEpochCommit]map[string][]int32) @@ -4356,6 +4578,7 @@ func (cl *writeTxnMarkersSharder) shard(ctx context.Context, kreq kmsg.Request, marker.ProducerID, marker.ProducerEpoch, marker.Committed, + marker.CoordinatorEpoch, marker.TransactionVersion, } for _, topic := range marker.Topics { @@ -4392,6 +4615,7 @@ func (cl *writeTxnMarkersSharder) shard(ctx context.Context, kreq kmsg.Request, rm.ProducerID = pec.pid rm.ProducerEpoch = pec.epoch rm.Committed = pec.commit + rm.CoordinatorEpoch = pec.coordinatorEpoch rm.TransactionVersion = pec.txnVersion for topic, parts := range topics { rt := kmsg.NewWriteTxnMarkersRequestMarkerTopic() @@ -4414,6 +4638,7 @@ func (cl *writeTxnMarkersSharder) shard(ctx context.Context, kreq kmsg.Request, rm.ProducerID = pec.pid rm.ProducerEpoch = pec.epoch rm.Committed = pec.commit + rm.CoordinatorEpoch = pec.coordinatorEpoch rm.TransactionVersion = pec.txnVersion for topic, parts := range topics { rt := kmsg.NewWriteTxnMarkersRequestMarkerTopic() @@ -5450,7 +5675,7 @@ func (cl *describeShareGroupOffsetsSharder) shard(ctx context.Context, kreq kmsg for _, g := range req.Groups { groupIDs = append(groupIDs, g.GroupID) } - coordinators := cl.loadCoordinators(ctx, coordinatorTypeShare, groupIDs...) + coordinators := cl.loadCoordinators(ctx, coordinatorTypeGroup, groupIDs...) type unkerr struct { err error groupID string @@ -5510,7 +5735,7 @@ func (cl *describeShareGroupOffsetsSharder) onResp(_ kmsg.Request, kresp kmsg.Re for i := range resp.Groups { group := &resp.Groups[i] err := kerr.ErrorForCode(group.ErrorCode) - cl.maybeDeleteStaleCoordinator(group.GroupID, coordinatorTypeShare, err) + cl.maybeDeleteStaleCoordinator(group.GroupID, coordinatorTypeGroup, err) onRespShardErr(&retErr, err) } return retErr diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/compression.go b/vendor/github.com/twmb/franz-go/pkg/kgo/compression.go index ff114664a9b..216939bd8c7 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/compression.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/compression.go @@ -6,6 +6,7 @@ import ( "encoding/binary" "errors" "io" + "math" "runtime" "slices" "sync" @@ -17,6 +18,24 @@ import ( var byteBuffers = sync.Pool{New: func() any { return bytes.NewBuffer(make([]byte, 8<<10)) }} +// maxDecompressedSize caps how much one batch may decompress to. Fetch +// limits bound only the COMPRESSED bytes on the wire; nothing in the +// protocol bounds the decompressed size, and the whole batch is +// materialized contiguously while decompressing. Without a cap, a few-KB +// malicious or corrupt batch can demand tens of GiB: zstd frames declare a +// content size that is honored up to the decoder's configured limit (the +// library default is 64 GiB), gzip expands up to ~1032x, lz4 up to ~255x, +// and snappy headers claim up to 4 GiB. No legitimate batch can exceed +// math.MaxInt32 decompressed: every known producer serializes a batch's +// records into an int32-indexed buffer before compressing (this client's +// own appendTo, Java's MemoryRecordsBuilder over a ByteBuffer, librdkafka), +// so a batch claiming more is corrupt or hostile and is rejected like any +// other corrupt batch: a loud, repeated fetch error with no offset advance. +// A var only so tests can shrink it. +var maxDecompressedSize = int64(math.MaxInt32) + +var errDecompressedTooLarge = errors.New("decompressed data exceeds the maximum allowed decompressed batch size (corrupt or malicious batch)") + // CompressionCodecType is a bitfield specifying a Kafka-defined compression // codec. Per spec, only four compression codecs are supported. However, if // you control both the producer and consumer, you can technically override the @@ -35,8 +54,9 @@ const ( // CodecZstd is a compression codec signifying zstd compression. CodecZstd - // CodecError is returned from compressing or decompressing if an error - // occurred. + // CodecError is returned as the used-codec from Compress if an error + // occurred while compressing (Decompress reports errors via its error + // return instead). CodecError = -1 ) @@ -176,7 +196,7 @@ out: case CodecGzip: level := gzip.DefaultCompression if codec.level != 0 { - if _, err := gzip.NewWriterLevel(nil, codec.level); err != nil { + if _, err := gzip.NewWriterLevel(nil, codec.level); err == nil { level = codec.level } } @@ -322,6 +342,7 @@ func DefaultDecompressor(pools ...Pool) Decompressor { zstdDec, _ := zstd.NewReader(nil, zstd.WithDecoderLowmem(true), zstd.WithDecoderConcurrency(1), + zstd.WithDecoderMaxMemory(uint64(maxDecompressedSize)), ) r := &zstdDecoder{zstdDec} runtime.SetFinalizer(r, func(r *zstdDecoder) { @@ -352,7 +373,12 @@ func (d *decompressor) Decompress(src []byte, codecType CompressionCodecType) ([ d.pools.each(func(p Pool) bool { if pdecompressBytes, ok := p.(PoolDecompressBytes); ok { s := pdecompressBytes.GetDecompressBytes(src, codecType) - out = bytes.NewBuffer(s) + // Only the slice's capacity is used: decompressed data + // must start at index 0, while a buffer initialized with + // len(s) > 0 (a pool returning make([]byte, sizeGuess)) + // would have the copy/append based codecs write AFTER the + // existing length, prefixing the output with stale bytes. + out = bytes.NewBuffer(s[:0]) rfn = out.Bytes userPooled = true return true @@ -382,13 +408,30 @@ func (d *decompressor) Decompress(src []byte, codecType CompressionCodecType) ([ if err := ungz.Reset(bytes.NewReader(src)); err != nil { return nil, err } - if _, err := io.Copy(out, ungz); err != nil { + if n, err := io.Copy(out, io.LimitReader(ungz, maxDecompressedSize+1)); err != nil { return nil, err + } else if n > maxDecompressedSize { + return nil, errDecompressedTooLarge } return rfn(), nil case CodecSnappy: if len(src) > 16 && bytes.HasPrefix(src, xerialPfx) { - return xerialDecode(src) + // Decode into the pooled destination when one exists; + // this path previously ignored the pool's Get entirely + // (fresh allocation every batch, and the Get'd slice was + // orphaned: never used, never put back). + var xdst []byte + if userPooled { + xdst = out.Bytes() + } + return xerialDecode(xdst, src) + } + // The decoded length is read from the header and allocated up + // front; check the claim before decoding. + if l, err := s2.DecodedLen(src); err != nil { + return nil, err + } else if int64(l) > maxDecompressedSize { + return nil, errDecompressedTooLarge } decoded, err := s2.Decode(out.Bytes(), src) if err != nil { @@ -402,8 +445,10 @@ func (d *decompressor) Decompress(src []byte, codecType CompressionCodecType) ([ unlz4 := d.unlz4Pool.Get().(*lz4.Reader) defer d.unlz4Pool.Put(unlz4) unlz4.Reset(bytes.NewReader(src)) - if _, err := io.Copy(out, unlz4); err != nil { + if n, err := io.Copy(out, io.LimitReader(unlz4, maxDecompressedSize+1)); err != nil { return nil, err + } else if n > maxDecompressedSize { + return nil, errDecompressedTooLarge } return rfn(), nil case CodecZstd: @@ -426,13 +471,15 @@ var xerialPfx = []byte{130, 83, 78, 65, 80, 80, 89, 0} var errMalformedXerial = errors.New("malformed xerial framing") -func xerialDecode(src []byte) ([]byte, error) { +// xerialDecode appends the decoded chunks to dst (commonly a len-0 pooled +// slice, or nil) and returns the result. +func xerialDecode(dst, src []byte) ([]byte, error) { // bytes 0-8: xerial header // bytes 8-16: xerial version // everything after: uint32 chunk size, snappy chunk // we come into this function knowing src is at least 16 src = src[16:] - var dst, chunk []byte + var chunk []byte var err error for len(src) > 0 { if len(src) < 4 { @@ -443,6 +490,13 @@ func xerialDecode(src []byte) ([]byte, error) { if size < 0 || len(src) < int(size) { return nil, errMalformedXerial } + // Chunks accumulate; bound the cumulative claimed output before + // decoding each chunk. + if l, err := s2.DecodedLen(src[:size]); err != nil { + return nil, err + } else if int64(l) > maxDecompressedSize-int64(len(dst)) { + return nil, errDecompressedTooLarge + } if chunk, err = s2.Decode(chunk[:cap(chunk)], src[:size]); err != nil { return nil, err } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/config.go b/vendor/github.com/twmb/franz-go/pkg/kgo/config.go index ee361a1c05f..36d4bc760cb 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/config.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/config.go @@ -284,8 +284,26 @@ func (cfg *cfg) validate() error { } } + // Brokers reject an empty transactional id with INVALID_REQUEST at + // InitProducerID; catch it here where the error can say why. + if cfg.txnID != nil && *cfg.txnID == "" { + return errors.New("invalid empty transactional id") + } + i64lt := func(l, r int64) (bool, string) { return l < r, "less" } i64gt := func(l, r int64) (bool, string) { return l > r, "larger" } + + // Several Durations are serialized to int32-millisecond wire fields + // (JoinGroup SessionTimeoutMs / RebalanceTimeoutMs, ProduceRequest + // TimeoutMs, InitProducerId TransactionTimeoutMs). A Duration whose + // millisecond value exceeds an int32 silently overflows that field when + // cast - e.g. a 30 day session timeout wraps to a negative wire value, + // and a ~50 day one wraps to a small positive value the broker quietly + // accepts as a completely different timeout. Java cannot hit this because + // its equivalent configs are int32-millisecond typed at the source; kgo + // takes a Duration, so the bound must be enforced here. The wire field's + // capacity is the only principled cap. + const maxWireTimeout = time.Duration(math.MaxInt32) * time.Millisecond for _, limit := range []struct { name string v int64 @@ -343,6 +361,11 @@ func (cfg *cfg) validate() error { {name: "max buffered bytes", v: cfg.maxBufferedBytes, allowed: 0, badcmp: i64lt}, {name: "linger", v: int64(cfg.linger), allowed: int64(time.Minute), badcmp: i64gt, durs: true}, {name: "produce timeout", v: int64(cfg.produceTimeout), allowed: int64(100 * time.Millisecond), badcmp: i64lt, durs: true}, + {name: "produce timeout", v: int64(cfg.produceTimeout), allowed: int64(maxWireTimeout), badcmp: i64gt, durs: true}, + + // The transaction timeout is serialized to an int32-millisecond wire + // field and is otherwise unvalidated; bound it so it cannot overflow. + {name: "transaction timeout", v: int64(cfg.txnTimeout), allowed: int64(maxWireTimeout), badcmp: i64gt, durs: true}, {name: "record timeout", v: int64(cfg.recordTimeout), allowed: int64(time.Second), badcmp: func(l, r int64) (bool, string) { if l == 0 { return false, "" // we print nothing when things are good @@ -360,10 +383,12 @@ func (cfg *cfg) validate() error { {name: "consumer protocol length", v: int64(len(cfg.protocol)), allowed: 1, badcmp: i64lt}, {name: "session timeout", v: int64(cfg.sessionTimeout), allowed: int64(100 * time.Millisecond), badcmp: i64lt, durs: true}, + {name: "session timeout", v: int64(cfg.sessionTimeout), allowed: int64(maxWireTimeout), badcmp: i64gt, durs: true}, {name: "rebalance timeout", v: int64(cfg.rebalanceTimeout), allowed: int64(100 * time.Millisecond), badcmp: i64lt, durs: true}, + {name: "rebalance timeout", v: int64(cfg.rebalanceTimeout), allowed: int64(maxWireTimeout), badcmp: i64gt, durs: true}, {name: "autocommit interval", v: int64(cfg.autocommitInterval), allowed: int64(100 * time.Millisecond), badcmp: i64lt, durs: true}, - {v: int64(cfg.heartbeatInterval), allowed: int64(cfg.rebalanceTimeout) * int64(time.Millisecond), badcmp: i64gt, durs: true, fmt: "heartbeat interval %v is erroneously larger than the session timeout %v"}, + {v: int64(cfg.heartbeatInterval), allowed: int64(cfg.sessionTimeout), badcmp: i64gt, durs: true, fmt: "heartbeat interval %v is erroneously larger than the session timeout %v"}, } { bad, cmp := limit.badcmp(limit.v, limit.allowed) if bad { @@ -443,6 +468,40 @@ func (cfg *cfg) validate() error { return errors.New("invalid use of ConsumeExcludeTopics when not using ConsumeRegex") } + // A topic literally named "" cannot exist; consuming it would spin on + // UNKNOWN_TOPIC metadata forever with no surfaced error. In regex mode the + // ConsumeTopics values are patterns ("" is a valid match-all regex), so we + // only reject empty names when not consuming via regex. + if !cfg.regex { + for topic := range cfg.topics { + if topic == "" { + return errors.New("invalid empty topic name in ConsumeTopics") + } + } + } + for topic, partitions := range cfg.partitions { + if topic == "" { + return errors.New("invalid empty topic name in ConsumePartitions") + } + for p := range partitions { + if p < 0 { + return fmt.Errorf("invalid negative partition %d for topic %q in ConsumePartitions", p, topic) + } + } + } + + // These options take a value; if explicitly set to "" it is a mistake (an + // empty transactional or instance ID is not valid). Both are *string so an + // explicit "" is distinguishable from unset (nil). ConsumerGroup and + // ShareGroup are plain strings, indistinguishable from unset, so they are + // not checked here. + if cfg.txnID != nil && *cfg.txnID == "" { + return errors.New("invalid empty TransactionalID") + } + if cfg.instanceID != nil && *cfg.instanceID == "" { + return errors.New("invalid empty InstanceID") + } + if cfg.topics != nil && cfg.partitions != nil { for topic := range cfg.partitions { if _, exists := cfg.topics[topic]; exists { @@ -686,6 +745,12 @@ func WithLogger(l Logger) Opt { // WithContext sets the client to use a custom context. // // By default, the client uses context.Background. +// +// Canceling this context stops the client's background goroutines and fails +// in-flight requests with ErrClientClosed, but it does not replace Close: +// records still buffered for producing are reliably failed only by Close, and +// a group leave is sent only by Close. Always call Close for a clean shutdown; +// canceling this context first (to interrupt blocking calls) is fine. func WithContext(ctx context.Context) Opt { return clientOpt{func(cfg *cfg) { cfg.ctx = ctx }} } @@ -813,7 +878,7 @@ func MinVersions(versions *kversion.Versions) Opt { // RetryBackoffFn sets the backoff strategy for how long to backoff for a given // amount of retries, overriding the default jittery exponential backoff that -// ranges from 250ms min to 2.5s max. +// ranges from 250ms min to 5s max. // // This (roughly) corresponds to Kafka's retry.backoff.ms setting and // retry.backoff.max.ms (which is being introduced with KIP-500). @@ -1296,16 +1361,18 @@ func RecordRetries(n int) ProducerOpt { } // UnknownTopicRetries sets the number of times a record can fail with -// UNKNOWN_TOPIC_OR_PARTITION, overriding the default 4. +// UNKNOWN_TOPIC_OR_PARTITION or UNKNOWN_TOPIC_ID, overriding the default 4. // // This is a separate limit from RecordRetries because unknown topic or // partition errors should only happen if the topic does not exist. It is // pointless for the client to continue producing to a topic that does not // exist, and if we repeatedly see that the topic does not exist across // multiple metadata queries (which are going to different brokers), then we -// may as well stop trying and fail the records. +// may as well stop trying and fail the records. The count is reset whenever +// a produce to the partition succeeds; errors other than the two unknown +// topic errors leave it unchanged. // -// If this is -1, the client never fails records with this error. +// If this is -1, the client never fails records with these errors. func UnknownTopicRetries(n int) ProducerOpt { return producerOpt{func(cfg *cfg) { cfg.maxUnknownFailures = int64(n) }} } @@ -1409,9 +1476,9 @@ func TransactionalID(id string) ProducerOpt { // default 40s. It is a good idea to keep this less than a group's session // timeout, so that a group member will always be alive for the duration of a // transaction even if connectivity dies. This helps prevent a transaction -// finishing after a rebalance, which is problematic pre-Kafka 2.5. If you -// are on Kafka 2.5+, then you can use the RequireStableFetchOffsets option -// when assigning the group, and you can set this to whatever you would like. +// finishing after a rebalance, which is problematic pre-Kafka 2.5. On Kafka +// 2.5+, the client always requires stable fetch offsets (KIP-447), so you +// can set this to whatever you would like. // // Transaction timeouts begin when the first record is produced within a // transaction, not when a transaction begins. @@ -1865,6 +1932,13 @@ func ShareAckCallback(fn func(*Client, ShareAckResults)) GroupOpt { // Note that if you opt into cooperative-sticky rebalancing, cooperative group // balancing is incompatible with eager (classical) rebalancing and requires a // careful rollout strategy (see KIP-429). +// +// If you use both cooperative and eager balancers, the group runs +// cooperatively only if all members support cooperative balancing: an +// eager-only member joining downgrades the whole group to eager. On +// downgrade, the client revokes all partitions and re-consumes from +// committed offsets, which can result in duplicates. It is not recommended +// to downgrade once a group is cooperative. func Balancers(balancers ...GroupBalancer) GroupOpt { return groupOpt{func(cfg *cfg) { cfg.balancers = balancers }} } @@ -1877,9 +1951,9 @@ func Balancers(balancers ...GroupBalancer) GroupOpt { // If you are using a [GroupTransactSession] for EOS, wish to lower this, and are // talking to a Kafka cluster pre 2.5, consider lowering the // TransactionTimeout. If you do not, you risk a transaction finishing after a -// group has rebalanced, which could lead to duplicate processing. If you are -// talking to a Kafka 2.5+ cluster, you can safely use the -// RequireStableFetchOffsets group option and prevent any problems. +// group has rebalanced, which could lead to duplicate processing. On a Kafka +// 2.5+ cluster there is no problem: the client always requires stable fetch +// offsets (KIP-447). // // This option corresponds to Kafka's session.timeout.ms setting and must be // within the broker's group.min.session.timeout.ms and @@ -2002,6 +2076,13 @@ func AdjustFetchOffsetsFn(adjustOffsetsBeforeAssign func(context.Context, map[st // This function can be called at any time you are polling or processing // records. If you want to ensure this function is called serially with // processing, consider the BlockRebalanceOnPoll option. +// +// Do not call Close or LeaveGroup synchronously from within this callback +// (nor from OnPartitionsRevoked or OnPartitionsLost): leaving the group +// waits for the group management loop to finish, and the loop is waiting +// for your callback to return - a permanent deadlock. To leave from within +// a callback, use LeaveGroupContext with a nil context (it triggers the +// leave without waiting), or call LeaveGroup from a separate goroutine. func OnPartitionsAssigned(onAssigned func(context.Context, *Client, map[string][]int32)) GroupOpt { return groupOpt{func(cfg *cfg) { cfg.onAssigned = onAssigned }} } @@ -2034,6 +2115,9 @@ func OnPartitionsAssigned(onAssigned func(context.Context, *Client, map[string][ // // This function is called if a "fatal" group error is encountered and you have // not set [OnPartitionsLost]. See OnPartitionsLost for more details. +// +// Do not call Close or LeaveGroup synchronously from within this callback; +// see the warning on [OnPartitionsAssigned]. func OnPartitionsRevoked(onRevoked func(context.Context, *Client, map[string][]int32)) GroupOpt { return groupOpt{func(cfg *cfg) { cfg.onRevoked = onRevoked }} } @@ -2053,6 +2137,9 @@ func OnPartitionsRevoked(onRevoked func(context.Context, *Client, map[string][]i // This function can be called at any time you are polling or processing // records. If you want to ensure this function is called serially with // processing, consider the BlockRebalanceOnPoll option. +// +// Do not call Close or LeaveGroup synchronously from within this callback; +// see the warning on [OnPartitionsAssigned]. func OnPartitionsLost(onLost func(context.Context, *Client, map[string][]int32)) GroupOpt { return groupOpt{func(cfg *cfg) { cfg.onLost = onLost }} } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/consumer.go b/vendor/github.com/twmb/franz-go/pkg/kgo/consumer.go index b5e5443123e..dddc476707c 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/consumer.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/consumer.go @@ -232,6 +232,14 @@ type consumer struct { sourcesReadyForDraining []*source fakeReadyForDraining []Fetch + // deferredFetchHooks collects unbuffered fetch-record hook + // dispatches captured while c.mu/sourcesReadyMu are held (see + // source.hookDeferUnbuffered for the deadlock walkthrough). Guarded + // by sourcesReadyMu. Pollers drain it synchronously after their fill + // critical section releases the locks; stopSession's discard path + // drains it asynchronously because its callers still hold c.mu. + deferredFetchHooks []func() + pollWaitMu xsync.Mutex pollWaitC *sync.Cond pollWaitState uint64 // 0 == nothing, low 32 bits: # pollers, high 32: # waiting rebalances @@ -263,7 +271,16 @@ func (c *consumer) unaddPoller() { } c.pollWaitMu.Lock() defer c.pollWaitMu.Unlock() - c.pollWaitState-- + // AllowRebalance zeroes the poller count outright. If the user calls it + // while another goroutine's poll is still in flight (a contract + // violation: AllowRebalance means "all pollers are done"), that poll's + // release lands here after the mask and must not decrement: the low 32 + // bits would underflow and borrow into the rebalance count, permanently + // blocking both polls and rebalances. A poller whose accounting was + // force-cleared simply no-ops its release. + if c.pollWaitState&math.MaxUint32 > 0 { + c.pollWaitState-- + } c.pollWaitC.Broadcast() } @@ -375,6 +392,23 @@ func (c *consumer) consuming() bool { return c.g != nil || c.d != nil || c.s != nil } +// runDeferredFetchHooks dispatches unbuffered fetch-record hooks that were +// captured under the consumer locks. Called by pollers with no locks held, +// after their fill critical section; each queued dispatch runs exactly once +// (the swap under sourcesReadyMu is the ownership handoff). A concurrent +// poller or invalidation may have queued more dispatches since ours were +// captured; running them here too is fine -- ordering across concurrent +// pollers is inherently unordered. +func (c *consumer) runDeferredFetchHooks() { + c.sourcesReadyMu.Lock() + fns := c.deferredFetchHooks + c.deferredFetchHooks = nil + c.sourcesReadyMu.Unlock() + for _, fn := range fns { + fn() + } +} + // addSourceReadyForDraining tracks that a source needs its buffered fetch // consumed. func (c *consumer) addSourceReadyForDraining(source *source) { @@ -401,7 +435,7 @@ func (c *consumer) addFakeReadyForDraining(topic string, partition int32, err er } // NewErrFetch returns a fake fetch containing a single empty topic with a -// single zero partition with the given error. +// single partition of -1 with the given error. func NewErrFetch(err error) Fetches { return []Fetch{{ Topics: []FetchTopic{{ @@ -420,7 +454,7 @@ func NewErrFetch(err error) Fetches { // equivalent to calling PollRecords(ctx, 0). // // If the client is closed, a fake fetch will be injected that has no topic, a -// partition of 0, and a partition error of ErrClientClosed. If the context is +// partition of -1, and a partition error of ErrClientClosed. If the context is // canceled, a fake fetch will be injected with ctx.Err. These injected errors // can be used to break out of a poll loop. // @@ -582,6 +616,7 @@ func (cl *Client) PollRecords(ctx context.Context, maxPollRecords int) Fetches { // We try filling fetches once before waiting. If we have no context, // we guarantee that we just drain anything available and return. fill() + c.runDeferredFetchHooks() if len(fetches) > 0 || ctx == nil { return fetches } @@ -618,6 +653,7 @@ func (cl *Client) PollRecords(ctx context.Context, maxPollRecords int) Fetches { } fill() + c.runDeferredFetchHooks() return fetches } @@ -816,7 +852,12 @@ func (c *consumer) purgeTopics(topics []string) { delete(c.g.using, topic) delete(c.g.reSeen, topic) } - c.g.rejoin("rejoin from PurgeFetchTopics") + // Our subscription shrank; reconcile per protocol. This MUST NOT + // feed rejoinCh in 848 mode (signalSubscriptionChange forces a + // heartbeat instead): a rejoinCh bounce there runs the session-end + // revoke's nowAssigned read-modify-write concurrently with live + // heartbeats, losing a heartbeat's nowAssigned store. + c.g.signalSubscriptionChange("topics purged from consuming") } else { c.assignPartitions(purgeAssignments, assignPurgeMatching, c.d.tps, fmt.Sprintf("purge of %v requested", topics)) for _, topic := range topics { @@ -838,7 +879,7 @@ func (c *consumer) purgeTopics(topics []string) { // entire topic is purged. func (cl *Client) AddConsumeTopics(topics ...string) { c := &cl.consumer - if len(topics) == 0 || c.g == nil && c.d == nil || cl.cfg.regex { + if len(topics) == 0 || !c.consuming() || cl.cfg.regex { return } @@ -863,7 +904,7 @@ func (cl *Client) AddConsumeTopics(topics ...string) { // GetConsumeTopics retrieves a list of current topics being consumed. func (cl *Client) GetConsumeTopics() []string { c := &cl.consumer - if c.g == nil && c.d == nil { + if !c.consuming() { return nil } var m map[string]*topicPartitions @@ -1045,10 +1086,9 @@ func (f fmtAssignment) String() string { // assignPartitions, called under the consumer's mu, is used to set new cursors // or add to the existing cursors. // -// We do not need to pass tps when we are bumping the session or when we are -// invalidating all. All other cases, we want the tps -- the logic below does -// not fully differentiate needing to start a new session vs. just reusing the -// old (third if case below) +// We do not need to pass tps when we are invalidating all. All other cases, +// we want the tps: guarding the session may create a new session needing it, +// and stopping the session needs it for the restart. func (c *consumer) assignPartitions(assignments map[string]map[int32]Offset, how assignHow, tps *topicsPartitions, why string) { if c.mu.TryLock() { c.mu.Unlock() @@ -1115,6 +1155,23 @@ func (c *consumer) assignPartitions(assignments map[string]map[int32]Offset, how offset: assignPart.at, lastConsumedEpoch: assignPart.epoch, }) + // This partition can have a pending list or epoch + // load: an OffsetOutOfRange reload, or an epoch + // validation from a leader move. The cursor is then + // unusable and the load's completion is its only + // re-enabler -- and that completion would also + // overwrite the offset we just set with the load's + // now-stale result. A transact session resetting to + // committed offsets after an abort would be undone: + // consumption would resume at the pre-abort position, + // never re-consuming the aborted records. The set + // offset is the new truth: drop the load and + // re-enable the cursor ourselves. Safe here because + // the session is stopped (no source can use the + // cursor until the new session starts). + if loadOffsets.removeLoad(usedCursor.topic, usedCursor.partition) { + usedCursor.allowUsable() + } } } } @@ -1140,8 +1197,21 @@ func (c *consumer) assignPartitions(assignments map[string]map[int32]Offset, how case assignInvalidateAll: loadOffsets = listOrEpochLoads{} case assignSetMatching: - // We had not yet loaded this partition, so there is - // nothing to set, and we keep everything. + // Loads for partitions that were being consumed were + // handled in the cursor walk above (offset set directly, + // pending load dropped). Anything remaining is a load for + // a partition that never finished loading; SetOffsets + // documents those are skipped, so we keep their loads + // untouched. + // + // NOTE: the direct consumer's applySetOffsets translates + // ALL user input blindly (unlike the group path, which + // filters to g.uncommitted); the "extra partitions are + // skipped" contract holds only because this arm touches + // nothing beyond usingCursors and returns before the + // offset-loading section below. If setMatching ever gains + // load handling, filter never-consumed direct partitions + // first or they will silently start loading. case assignInvalidateMatching: loadOffsets.keepFilter(func(t string, p int32) bool { if assignTopic, ok := assignments[t]; ok { @@ -1466,7 +1536,7 @@ func (l *listOrEpochLoads) addLoad(t string, p int32, loadType listOrEpochLoadTy ps[p] = load } -func (l *listOrEpochLoads) removeLoad(t string, p int32) { +func (l *listOrEpochLoads) removeLoad(t string, p int32) (removed bool) { for _, m := range []offsetLoadMap{ l.List, l.Epoch, @@ -1478,11 +1548,16 @@ func (l *listOrEpochLoads) removeLoad(t string, p int32) { if ps == nil { continue } + if _, exists := ps[p]; !exists { + continue + } delete(ps, p) + removed = true if len(ps) == 0 { delete(m, t) } } + return removed } func (l listOrEpochLoads) each(fn func(string, int32)) { @@ -1679,7 +1754,14 @@ func (fm *fetchManager) manageFetchConcurrency() { continue } - if wantQuit && activeFetches == 0 { + // We cannot return while sources are still registered in + // wantFetch: each of them is (or is about to be) blocked + // sending on cancelFetchCh, which only we drain. Returning + // early orphans those sends once the channel's small buffer + // fills; the sources then hold session workers forever and + // stopSession never finishes (consumer deadlock). Keep + // looping until every registered source has canceled. + if wantQuit && activeFetches == 0 && len(wantFetch) == 0 { return } } @@ -1838,6 +1920,20 @@ func (c *consumer) stopSession() (listOrEpochLoads, *topicsPartitions) { } c.sourcesReadyForDraining = nil + // The discards above deferred their unbuffered-hook dispatches, and + // they cannot run synchronously here: our callers hold c.mu (and + // sessionChangeMu), the very locks a re-entrant hook needs. The + // discarded records were never polled, so there is no user-visible + // ordering to preserve; dispatch async. + if fns := c.deferredFetchHooks; len(fns) > 0 { + c.deferredFetchHooks = nil + go func() { + for _, fn := range fns { + fn() + } + }() + } + // At this point, we have invalidated any buffered data from the prior // session. We deliberately leave c.fakeReadyForDraining so the user can // still observe errors that happened in the dying session (data loss, @@ -1937,6 +2033,19 @@ func (s *consumerSession) listOrEpoch(waiting listOrEpochLoads, immediate bool, } } + // If the session is dying, park: the loads were stored in waiting above, + // and stopSession returns waiting loads to the caller for the next + // session. Without this check, a dying session whose metadata is fresh + // busy-loops until metadataMinAge elapses: wait is false above, so we + // would issue requests on the dead context, every one fails instantly, + // the reload timer below is canceled by the same dead context, and its + // loadWithSession re-enters this function - burning CPU and holding the + // session-stop (every revoke, leave, close, or seek) for the full + // metadataMinAge. + if s.ctx.Err() != nil { + return + } + s.listOrEpochMu.Lock() loading := s.listOrEpochLoadsWaiting s.listOrEpochLoadsLoading.mergeFrom(loading) @@ -2395,8 +2504,23 @@ func (cl *Client) listOffsetsForBrokerLoad(ctx context.Context, broker *broker, offset = start } } + // Every arm above yields a non-negative offset from a + // well-behaved broker: by-time listings exist only for + // afterMilli, whose -1 is replaced by the end listing, + // and the start/end/exact arms bound within the + // responses. A negative offset here means the broker + // violated the protocol; clamping to 0 (the old + // behavior) would silently re-consume the partition + // from the start. Surface the misbehavior and retry + // the load instead. if offset < 0 { - offset = 0 // sanity + loaded.add(loadedOffset{ + topic: topic, + partition: partition, + err: errNegativeListedOffset, + request: loadPart, + }) + continue } loaded.add(loadedOffset{ @@ -2422,10 +2546,14 @@ func (*Client) loadEpochsForBrokerLoad(ctx context.Context, broker *broker, load return } - // If the version is < 2, we are speaking to an old broker. We should - // not have an old version, but we could have spoken to a new broker - // first then an old broker in the middle of a broker roll. For now, we - // will just loop retrying until the broker is upgraded. + // If the negotiated version is < 2, we are speaking to an old broker: + // possible mid-roll when metadata (with leader epochs) came from an + // upgraded broker while the partition leader is not yet upgraded. The + // request then goes out without CurrentLeaderEpoch fencing, and a v0 + // response carries no LeaderEpoch (kmsg defaults it to -1). Validation + // still compares EndOffset and completes, just unfenced and without + // epoch information - a degraded but correct fallback for a window + // that only exists rolling from pre-KIP-320 brokers. topics := tps.load() resp := kresp.(*kmsg.OffsetForLeaderEpochResponse) @@ -2469,7 +2597,27 @@ func (*Client) loadEpochsForBrokerLoad(ctx context.Context, broker *broker, load // validating. offset := loadPart.at var err error - if rPartition.EndOffset < offset { + switch { + case rPartition.EndOffset < 0: + // KIP-320 UNDEFINED_EPOCH_OFFSET: a conformant broker + // answers endOffset -1 (and leaderEpoch -1) when its + // leader-epoch cache holds no record of the requested + // epoch - an empty or freshly-truncated cache, an unclean + // election to a replica with no epoch history, or an epoch + // newer than anything in the log. This is NOT data loss; the + // broker simply cannot tell us a truncation point. The old + // `EndOffset < offset` arm treated the -1 sentinel as + // "truncated to offset -1", surfacing a spurious ErrDataLoss + // and pinning the cursor at -1. Instead carry the sentinel + // through so the next fetch hits OFFSET_OUT_OF_RANGE and + // resets via the configured ConsumeResetOffset (or, under + // NoResetOffset, surfaces OOOR rather than a bogus data-loss + // error) - the same reset path the cursor already took, + // minus the false alarm. Matches the Java client, which + // resets per policy on this sentinel rather than comparing + // -1 against the validating position. + offset = rPartition.EndOffset + case rPartition.EndOffset < offset: err = &ErrDataLoss{topic, partition, offset, loadPart.epoch, rPartition.EndOffset, rPartition.LeaderEpoch} offset = rPartition.EndOffset } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_group.go b/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_group.go index 7ccc5d195e6..5f84af6bd2d 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_group.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_group.go @@ -65,6 +65,10 @@ type groupConsumer struct { lastAssigned map[string][]int32 nowAssigned amtps + // Set when a join downgrades the group from cooperative to eager; + // the next session revokes everything before consuming. + protocolDowngraded bool + // Fetching ensures we continue fetching offsets across cooperative // rebalance if an offset fetch returns early due to an immediate // rebalance. See the large comment on adjustCooperativeFetchOffsets @@ -153,10 +157,17 @@ type groupConsumer struct { // done, and then starts its own. commitDone chan struct{} - // blockAuto is set and cleared in CommitOffsets{,Sync} to block - // autocommitting if autocommitting is active. This ensures that an - // autocommit does not cancel the user's manual commit. - blockAuto bool + // blockAuto counts outstanding CommitOffsets{,Sync} commits and + // blocks autocommitting while any are in flight. This ensures that + // an autocommit does not trample a user's manual commit: the + // autocommit snapshot is taken when the commit is enqueued, but the + // request is issued only after all prior commits complete, so a + // snapshot taken while a higher manual commit is in flight would be + // committed after it and rewind the broker's offset. This must be a + // count, not a bool: with two overlapping async commits, the first + // completion would otherwise re-enable autocommit while the second + // is still in flight, reopening exactly that window. + blockAuto int // We set this once to manage the group lifecycle once. // If we detect we should run in 848 mode, we set is848 true. @@ -237,6 +248,12 @@ func (cl *Client) LeaveGroup() { // group. If you have configured the group with an InstanceID, this // does not leave the group. // +// For next-gen (KIP-848) consumer groups, the leave is a final +// heartbeat with MemberEpoch -1; with an InstanceID configured the +// epoch is -2 instead, a temporary "static" departure where the +// member's partitions stay reserved until the session timeout or +// until a replacement with the same InstanceID rejoins. +// // For share groups: this drains any pending acks, releases records that // were acquired but never finalized, closes each per-broker share // session, and sends the final ShareGroupHeartbeat with MemberEpoch=-1 @@ -250,6 +267,18 @@ func (cl *Client) LeaveGroup() { // failed with an internal "consumer left" error). // // LeaveGroupContext is a no-op for direct (non-group) consumers. +// +// Leaving does not wake a concurrent PollFetches or PollRecords parked on +// another goroutine: a parked poll returns only for buffered data, its own +// context, or client close. To unblock a poll loop when leaving, cancel the +// context you poll with (or Close the client). +// +// Do not call this function with a non-nil context synchronously from +// within an OnPartitions callback: the leave waits for the group +// management loop to finish, and the loop is waiting for your callback to +// return. With the client's own context (LeaveGroup), that is a permanent +// deadlock. A nil context is safe anywhere: it triggers the leave and +// returns immediately. func (cl *Client) LeaveGroupContext(ctx context.Context) error { c := &cl.consumer if c.g == nil && c.s == nil { @@ -374,9 +403,9 @@ func (c *consumer) initGroup() { default: } if ctxExpired { - cl.cfg.logger.Log(LogLevelDebug, "entering "+name, "with", m, "context_expired", ctxExpired) + cl.cfg.logger.Log(LogLevelDebug, "entering "+name, "with", mtps(m), "context_expired", ctxExpired) } else { - cl.cfg.logger.Log(LogLevelDebug, "entering "+name, "with", m) + cl.cfg.logger.Log(LogLevelDebug, "entering "+name, "with", mtps(m)) } if user != nil { dup := make(map[string][]int32) @@ -465,7 +494,7 @@ func (g *groupConsumer) manageFailWait(consecutiveErrors int, err error) (ctxCan g.resetExternal() } - // Unblock bolling now that we have called onLost and + // Unblock polling now that we have called onLost and // re-assigned. g.c.unaddRebalance() @@ -722,9 +751,9 @@ func (g *groupConsumer) revoke(stage revokeStage, lost map[string][]int32, leavi g.c.mu.Unlock() if !g.cooperative.Load() { - g.cfg.logger.Log(LogLevelInfo, "eager consumer revoking prior assigned partitions", "group", g.cfg.group, "revoking", g.nowAssigned.read()) + g.cfg.logger.Log(LogLevelInfo, "eager consumer revoking prior assigned partitions", "group", g.cfg.group, "revoking", mtps(g.nowAssigned.read())) } else { - g.cfg.logger.Log(LogLevelInfo, "cooperative consumer revoking prior assigned partitions because leaving group", "group", g.cfg.group, "revoking", g.nowAssigned.read()) + g.cfg.logger.Log(LogLevelInfo, "cooperative consumer revoking prior assigned partitions because leaving group", "group", g.cfg.group, "revoking", mtps(g.nowAssigned.read())) } g.cfg.onRevoked(g.cl.ctx, g.cl, g.nowAssigned.read()) g.nowAssigned.store(nil) @@ -755,8 +784,26 @@ func (g *groupConsumer) revoke(stage revokeStage, lost map[string][]int32, leavi // which causes a new metadata request -- in short, this could // be concurrent with a metadata findNewAssignments, so we // lock. + // + // For 848 the server owns assignment: nowAssigned only holds + // what the server currently wants us to own (handleResp already + // dropped anything the server revoked), while g.using is filled + // asynchronously by the metadata regex evaluation. When a new + // regex-matched topic is created, the server can assign it via + // heartbeat before our metadata loop has added it to g.using: + // the heartbeat exits this session with the topic in nowAssigned + // but the metadata goroutine has not yet run findNewAssignments. + // Self-revoking on (nowAssigned - g.using) here would then drop + // that just-assigned topic, and because the server still + // believes we own it (we echoed its topic id), it never re-sends + // -- stranding the topic permanently. Skip the self-revoke for + // 848 and let the server drive all revocation through heartbeats. g.nowAssigned.write(func(nowAssigned map[string][]int32) { g.mu.Lock() + defer g.mu.Unlock() + if g.is848 { + return + } for topic, partitions := range nowAssigned { if _, exists := g.using[topic]; !exists { if lost == nil { @@ -766,7 +813,6 @@ func (g *groupConsumer) revoke(stage revokeStage, lost map[string][]int32, leavi delete(nowAssigned, topic) } } - g.mu.Unlock() }) } @@ -801,7 +847,7 @@ func (g *groupConsumer) revoke(stage revokeStage, lost map[string][]int32, leavi if len(lost) == 0 { g.cfg.logger.Log(LogLevelInfo, "consumer calling onRevoke at the end of a session; consumer did not change any client-side subscription", "group", g.cfg.group) } else { - g.cfg.logger.Log(LogLevelInfo, "calling onRevoke at the end of a session", "group", g.cfg.group, "lost", lost, "stage", stage) + g.cfg.logger.Log(LogLevelInfo, "calling onRevoke at the end of a session", "group", g.cfg.group, "lost", mtps(lost), "stage", stage) } g.cfg.onRevoked(g.cl.ctx, g.cl, lost) } @@ -811,7 +857,25 @@ func (g *groupConsumer) revoke(stage revokeStage, lost map[string][]int32, leavi } if stage != revokeThisSession { // cooperative consumers rejoin after revoking what they lost - defer g.rejoin("after revoking what we lost from a rebalance") + // The rejoin triggers the second join of the classic + // cooperative two-phase rebalance: after giving up lost + // partitions, the member rejoins so the group can reassign + // them. 848 has no second join, the server reconciles + // through heartbeats. There, this signal would only tear + // down and rebuild the heartbeat session: the session that + // called us already handled both our lost and added + // partitions, so the rebuilt session re-enters with an empty + // diff, and because rebuilding re-arms the heartbeat timer + // at a full interval, the bounce also DELAYS the heartbeat + // that acks our revocation to the server. For 848, prerevoke + // instead forces an immediate heartbeat to ack the + // revocation. + g.mu.Lock() + is848 := g.is848 + g.mu.Unlock() + if !is848 { + defer g.rejoin("after revoking what we lost from a rebalance") + } } // The block below deletes everything lost from our uncommitted map. @@ -863,6 +927,7 @@ func (s *assignRevokeSession) prerevoke(g *groupConsumer, lost map[string][]int3 // very first concurrent heartbeat sends keepalive. g.mu.Lock() g848 := g.g848 + is848 := g.is848 // g848 stays non-nil after a fallback to classic; is848 is what tracks the protocol g.mu.Unlock() if g848 != nil { g848.prerevoking.Store(true) @@ -877,6 +942,40 @@ func (s *assignRevokeSession) prerevoke(g *groupConsumer, lost map[string][]int3 if g848 != nil { g848.prerevoking.Store(false) } + // If we revoked, ack the revocation to the server right away + // rather than waiting out the heartbeat timer: the server + // cannot give the revoked partitions to other members until + // it sees a heartbeat without them, so an immediate full + // heartbeat (prerevoking was cleared above, so it will not + // be a keepalive) directly speeds group-wide reconciliation. + // The Java client acks the same way the moment revocation + // callbacks complete. + // + // The send must be best effort, NOT blocking. If the + // heartbeat loop exits on a fatal error before consuming our + // send (its first heartbeat can fail while we are still + // revoking), nothing reads heartbeatForceCh again until the + // next session begins, but the next session cannot begin + // until we return: setupAssignedAndHeartbeat waits on + // assignDone, which waits on prerevokeDone, which closes + // only when this goroutine exits. A blocking send would + // deadlock the manage loop. If the send is missed (loop + // mid-heartbeat or already gone), the regular heartbeat + // timer acks within one interval, which is no worse than + // what the session bounce this replaced provided. + // + // We force even when nothing was lost: a session (re)entry + // with only added partitions also owes the server an ack - + // the next full heartbeat's Topics is what reports the new + // assignment as owned. The Java client likewise heartbeats + // the moment reconciliation completes rather than waiting + // out the interval. + if is848 { + select { + case g.heartbeatForceCh <- func(error) {}: + default: + } + } }() return s.prerevokeDone } @@ -936,6 +1035,33 @@ func (s *assignRevokeSession) revoke(g *groupConsumer, leaving bool) <-chan stru // - fetching is complete // - heartbeating is complete func (g *groupConsumer) setupAssignedAndHeartbeat(initialHb time.Duration, hbfn func() (time.Duration, error)) (string, error) { + if g.protocolDowngraded { + g.protocolDowngraded = false + // Our prior cooperative session ended without revoking + // anything, but diffAssigned below short-circuits for eager + // consumers and returns the entire assignment as newly added. + // fetchOffsets would then set offsets on cursors that are + // still actively fetching, and the offset load's completion + // races any concurrent poll's cursor update (#1365). Instead, + // first revoke everything, as an eager session would have + // before rejoining: stop fetching everything, let the user + // commit final work in onRevoked, and clear commit state + // before everything is re-fetched from committed offsets. + g.c.waitAndAddRebalance() + prior := g.lastAssigned + g.c.mu.Lock() + g.c.assignPartitions(nil, assignInvalidateAll, nil, "revoking all assignments; group protocol downgraded from cooperative to eager") + g.c.mu.Unlock() + if len(prior) > 0 { + g.cfg.onRevoked(g.cl.ctx, g.cl, prior) + } + g.mu.Lock() + g.uncommitted = nil + g.mu.Unlock() + g.fetching = nil + g.c.unaddRebalance() + } + type hbquit struct { rejoinWhy string err error @@ -1076,6 +1202,7 @@ func (g *groupConsumer) heartbeat(initialHb time.Duration, fetchErrCh <-chan err for { var err error var force func(error) + var fetchErr bool heartbeat = false select { case <-cooperativeFastCheck: @@ -1091,6 +1218,7 @@ func (g *groupConsumer) heartbeat(initialHb time.Duration, fetchErrCh <-chan err err = kerr.RebalanceInProgress case err = <-fetchErrCh: fetchErrCh = nil + fetchErr = true case <-revoked: revoked = nil didRevoke = true @@ -1147,7 +1275,22 @@ func (g *groupConsumer) heartbeat(initialHb time.Duration, fetchErrCh <-chan err // If cfg.retries consecutive failures occur without any // success, the error propagates to manage848 which // rebuilds the session. - if is848 && (isRetryableBrokerErr(err) || isAnyDialErr(err) || g.cl.maybeDeleteStaleCoordinator(g.cfg.group, coordinatorTypeGroup, err)) { + // + // This arm must only see errors from the heartbeat itself, + // never from fetchErrCh, even though both feed the same err + // variable. Walkthrough of what would go wrong: the + // coordinator moves, OffsetFetch exhausts its internal + // retries, fetchOffsets returns the retryable error here, we + // "retry" by heartbeating in place, the next heartbeat + // succeeds and resets the counter - and the session lives on + // with partitions that were never handed to assignPartitions + // (that only happens after a successful fetch). The fetch + // goroutine is already gone and nothing inside a live session + // re-runs it, so those partitions silently never consume. + // Only re-entering setupAssignedAndHeartbeat re-fetches (via + // g.fetching), so a fetch error must propagate to manage848, + // whose transient arm restarts the session. + if is848 && !fetchErr && (isRetryableBrokerErr(err) || isAnyDialErr(err) || g.cl.maybeDeleteStaleCoordinator(g.cfg.group, coordinatorTypeGroup, err)) { if int64(hbBrokerRetries) < g.cfg.retries { hbBrokerRetries++ backoff := g.cfg.retryBackoff(hbBrokerRetries) @@ -1234,9 +1377,23 @@ func (g *groupConsumer) heartbeat(initialHb time.Duration, fetchErrCh <-chan err // If neither of the cases above are true (this member is not a leader, and the // join group metadata has not changed), then Kafka will not actually trigger a // rebalance and will instead reply to the member with its current assignment. +// +// For next-gen (KIP-848) consumer groups, assignment is entirely server +// driven and there is no client-side join to redo: this instead forces an +// immediate full heartbeat (best effort), which re-syncs the subscription +// and assignment with the broker. func (cl *Client) ForceRebalance() { if g := cl.consumer.g; g != nil { - g.rejoin("from ForceRebalance") + // Classic rejoins; 848 forces a heartbeat (848 must never feed + // rejoinCh - see signalSubscriptionChange). Routing every + // rejoinCh feeder through the one helper is what keeps "nothing + // feeds rejoinCh in 848 mode" true: every remaining session-end + // path stops heartbeating (or has a dead context) before revoke + // runs, so revoke's nowAssigned read-modify-write never races a + // live heartbeat's store. + g.mu.Lock() + g.signalSubscriptionChange("from ForceRebalance") + g.mu.Unlock() } } @@ -1250,6 +1407,36 @@ func (g *groupConsumer) rejoin(why string) { } } +// signalSubscriptionChange tells the manage loop that our local set of +// subscribed topics changed (AddConsumeTopics growth, PurgeConsumeTopics +// shrink) and a reconcile is owed. The caller must hold g.mu (we read +// g.is848). +// +// Classic and 848 reconcile differently, and routing every caller through +// here is what keeps the difference from being re-derived (and forgotten) +// at each site: +// +// - Classic: bounce the heartbeat session via rejoinCh so the member +// re-joins and the group re-balances with the new subscription. +// - 848: the server reconciles through heartbeats, so feeding rejoinCh +// would only bounce the session pointlessly - AND that bounce runs the +// session-end revoke concurrently with live heartbeats, the one +// interleaving where a completing heartbeat's nowAssigned store is lost +// to revoke's read-modify-write. Instead force an immediate heartbeat +// (best effort, must not block; see the walkthrough in prerevoke): the +// next request rebuilds the subscription from live state, and if the +// force is missed the heartbeat timer sends within one interval. +func (g *groupConsumer) signalSubscriptionChange(why string) { + if g.is848 { + select { + case g.heartbeatForceCh <- func(error) {}: + default: + } + return + } + g.rejoin(why) +} + // Joins and then syncs, issuing the two slow requests in goroutines to allow // for group cancelation to return early. func (g *groupConsumer) joinAndSync(joinWhy string) error { @@ -1411,7 +1598,14 @@ func (g *groupConsumer) handleJoinResp(resp *kmsg.JoinGroupResponse) (restart bo if protocol == balancer.ProtocolName() { cooperative := balancer.IsCooperative() if !cooperative && g.cooperative.Load() { - g.cfg.logger.Log(LogLevelWarn, "downgrading from cooperative group to eager group, this is not supported per KIP-429!") + g.cfg.logger.Log(LogLevelInfo, "group protocol downgraded from cooperative to eager; all partitions will be revoked before consuming resumes from committed offsets") + g.protocolDowngraded = true + } else if cooperative { + // A join can restart (e.g. MemberIDRequired) or an + // earlier downgrade join's sync can fail; if the + // group is (back) on cooperative by the time a join + // succeeds, no downgrade materialized. + g.protocolDowngraded = false } g.cooperative.Store(cooperative) break @@ -1571,6 +1765,13 @@ func (g *groupExternal) eachTopic(fn func(string)) { } func (g *groupExternal) updateLatest(meta map[string]*metadataTopic) { + // These are topics the leader balances but does not itself consume, so + // there is no kept-partition floor like the leader's own topics have + // (metadata.go). We rewrite the cached count and trigger a rejoin on + // ANY change, INCLUDING a one-response stale shrink - that is one churn + // cycle (revoke + re-assign) that self-heals on the next refresh. This + // is the same stale-snapshot exposure Java's leader carries; it is + // intentional, not a bug to silence with a shrink filter. g.cloned(func(tps map[string]int32) { var rejoin bool for t, ps := range tps { @@ -1744,6 +1945,16 @@ func (g *groupConsumer) fetchOffsets(ctx context.Context, added map[string][]int // Groups format, and resp.Topics is a copy that may lose TopicID. var staleRetries int var unknownTopicIDRetries int + var omittedRetries int + // injected tracks partitions whose non-retryable error we have already + // surfaced via a fake fetch. It is declared BEFORE the start label so it + // survives the goto-start retries below. addFakeReadyForDraining is not + // idempotent: a non-conformant broker that omits a requested partition + // (driving the omitted retry) or returns a non-retryable partition error + // ordered ahead of an UNSTABLE_OFFSET_COMMIT partition (driving the + // retryable goto-start) would otherwise re-run the injection arm every + // pass and emit a duplicate fake fetch for the same partition each retry. + var injected mtmps start: member, gen := g.memberGen.load() req := kmsg.NewPtrOffsetFetchRequest() @@ -1757,9 +1968,28 @@ start: groupTopics := g.tps.load() pinV9 := false for topic, partitions := range added { + // Skip partitions we have already surfaced a non-retryable error + // for and dropped (injected, below). On the first pass injected is + // nil and nothing is filtered; on a goto-start retry (driven by an + // UNSTABLE_OFFSET_COMMIT or UNKNOWN_TOPIC_ID partition) this avoids + // re-fetching partitions we will never re-add to the assignment. + if inj := injected[topic]; inj != nil { + kept := partitions[:0:0] // fresh backing array; do not mutate added + for _, p := range partitions { + if _, ok := inj[p]; !ok { + kept = append(kept, p) + } + } + partitions = kept + } + if len(partitions) == 0 { + continue + } reqTopic := kmsg.NewOffsetFetchRequestGroupTopic() reqTopic.Topic = topic - reqTopic.TopicID = groupTopics.loadTopic(topic).id + if td := groupTopics.loadTopic(topic); td != nil { + reqTopic.TopicID = td.id + } if reqTopic.TopicID == ([16]byte{}) { pinV9 = true } @@ -1872,7 +2102,18 @@ start: // Some partition errors are retryable: // // - UnstableOffsetCommit (KIP-447): a pending - // transaction should be committing soon. + // transaction should be committing soon. This + // 1s retry is deliberately UNBOUNDED and has no + // counter - the block is protocol-mandated: + // require_stable hides pending txnal offsets + // until the commit marker lands, so a bound + // would convert a mandated wait into a spurious + // error. The worst legal wait is the blocking + // producer's transaction timeout; an adversarial + // producer extending its txn extends the block + // server-side, exactly as it does for Java. Only + // session teardown (ctx below) interrupts it. + // Do not add a retry cap. // // - UnknownTopicID: the broker has not yet // propagated the topic ID for a newly created @@ -1915,6 +2156,15 @@ start: // Instead we surface the error to the user via a // fake fetch and drop the partition from this // assignment; the rest of the session proceeds. + // + // Surface each partition's error exactly once across + // the goto-start retries: injected persists (declared + // before the start label), so a partition already + // surfaced on an earlier pass is skipped here rather + // than re-injected. + if _, ok := injected[topic][rPartition.Partition]; ok { + continue + } g.cfg.logger.Log(LogLevelError, "fetch offsets failed for partition; injecting error and continuing with remaining partitions", "group", g.cfg.group, "topic", topic, @@ -1922,6 +2172,7 @@ start: "err", err, ) g.c.addFakeReadyForDraining(topic, rPartition.Partition, err, "fetch offsets returned a non-retryable partition error") + injected.add(topic, rPartition.Partition) continue } offset := Offset{ @@ -1931,7 +2182,12 @@ start: if resp.Version >= 5 && kip320 { // KIP-320 offset.epoch = rPartition.LeaderEpoch } - if rPartition.Offset == -1 { + // The coordinator's "no committed offset" sentinel is -1. + // We treat ANY negative offset as no-commit, matching the + // Java client's `offset >= 0` test: a buggy broker's -5 + // must not flow into partition assignment as a literal + // negative offset. + if rPartition.Offset < 0 { offset = g.cfg.startOffset } topicOffsets[rPartition.Partition] = offset @@ -1945,8 +2201,48 @@ start: // groupTopics was already loaded above to populate reqTopic.TopicID; // reuse that snapshot so we validate against the same view that // built the request. + // + // wanted reports whether a topic in the response is one we actually + // want to assign. Normally this is our subscription snapshot + // (groupTopics). `added` (what we built the request from) can diverge + // from that snapshot, but the meaning of the divergence differs by + // protocol, so we only trust `added` for 848: + // + // - Classic: the client drives its own subscription (g.using feeds + // JoinGroup, and g.using never leads g.tps because g.tps is stored + // before findNewAssignments runs), so an assigned topic stays in + // g.tps -- unless it is purged after assignment. That purge is + // either an explicit PurgeTopicsFromConsuming/PurgeTopicsFromClient + // call (e.g. #1355, where it overlapped AddConsumeTopics) or the + // automatic regex missing-topic purge. In every case the topic is + // being removed, so dropping it is correct; the nil guard above + // just stops #1355's crash, and the drop here is the right result. + // + // - 848: the server resolves the regex itself and can assign a live, + // newly-created topic via heartbeat before our metadata loop has + // added it to g.tps. Dropping it leaves the partition without a + // cursor while the server believes we own it (we echoed its id + // back), so it never re-sends -- stranding the topic. It is in + // `added` (we requested it), so we keep it. + // + // `added` is precisely "what we requested", so a topic a buggy broker + // invents (neither subscribed nor requested) is still dropped -- the + // #1271 protection. + g.mu.Lock() + is848 := g.is848 + g.mu.Unlock() + wanted := func(topic string) bool { + if groupTopics.hasTopic(topic) { + return true + } + if is848 { + _, ok := added[topic] + return ok + } + return false + } for fetchedTopic, topicOffsets := range offsets { - if !groupTopics.hasTopic(fetchedTopic) { + if !wanted(fetchedTopic) { delete(offsets, fetchedTopic) g.cfg.logger.Log(LogLevelWarn, "member was assigned topic that we did not ask for in ConsumeTopics! skipping assigning this topic!", "group", g.cfg.group, "topic", fetchedTopic) continue @@ -1969,6 +2265,64 @@ start: } } + // The dual of the validation above: every partition we requested must + // be present in the response. The group coordinator answers every + // requested partition (filling -1 for those with no commit), so an + // omission is a buggy/hostile broker - as is a duplicated topic entry, + // which overwrites and discards the earlier entry's partitions in the + // response loop above. A partition silently absent from `offsets` is + // never assigned a cursor, and a successful return here clears + // g.fetching: nothing inside a live session ever re-fetches it, so for + // cooperative and 848 sessions (whose unchanged assignment diffs to an + // empty "added" on the next session) the partition would silently + // never consume. Retry a few times in case the omission is transient, + // then surface a loud error fetch and drop the partition from this + // assignment, exactly like the non-retryable partition error path + // above. + var omitted mtmps + for topic, partitions := range added { + if !wanted(topic) { + continue // already warned and skipped above + } + topicOffsets := offsets[topic] + for _, partition := range partitions { + if injected != nil { + if _, ok := injected[topic][partition]; ok { + continue // deliberately dropped, not omitted + } + } + if _, ok := topicOffsets[partition]; !ok { + omitted.add(topic, partition) + } + } + } + if len(omitted) > 0 { + if omittedRetries < 3 { + omittedRetries++ + g.cfg.logger.Log(LogLevelError, "fetch offsets response omitted requested partitions, waiting 1s and retrying", + "group", g.cfg.group, + "omitted", omitted, + "attempt", omittedRetries, + ) + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(time.Second): + goto start + } + } + for topic, partitions := range omitted { + for partition := range partitions { + g.cfg.logger.Log(LogLevelError, "fetch offsets response repeatedly omitted a requested partition; injecting error and continuing with remaining partitions", + "group", g.cfg.group, + "topic", topic, + "partition", partition, + ) + g.c.addFakeReadyForDraining(topic, partition, errOffsetFetchOmitted, "fetch offsets response omitted the partition") + } + } + } + if g.cfg.onFetched != nil { g.onFetchedMu.Lock() err = g.cfg.onFetched(ctx, g.cl, resp) @@ -2112,7 +2466,9 @@ func (g *groupConsumer) findNewAssignments() { } if numNewTopics > 0 { - g.rejoin("rejoining because there are more topics to consume, our interests have changed") + // Our subscription grew; reconcile per protocol (848 forces a + // heartbeat, classic rejoins). See signalSubscriptionChange. + g.signalSubscriptionChange("rejoining because there are more topics to consume, our interests have changed") } else if g.leader.Load() { if len(toChange) > 0 { g.rejoin("rejoining because we are the leader and noticed some topics have new partitions") @@ -2165,6 +2521,18 @@ func (g *groupConsumer) updateUncommitted(fetches Fetches) { // We set the head offset if autocommitting is disabled (because we // only use head / committed in that case), or if we are greedily // autocommitting (so that the latest head is available to autocommit). + // + // Under DEFAULT autocommit (neither disabled nor greedy) we set only + // dirty here, and undirtyUncommitted promotes dirty->head at the START + // of the next poll. This one-poll lag is INTENTIONAL and is what makes + // default autocommit at-least-once: defaultRevoke commits head, so a + // revoke between poll N and N+1 commits none of poll N's records and + // the new owner re-reads them. Committing dirty at revoke instead would + // mark records consumed while the app may still be mid-processing them - + // a loss window. Do not "fix" the duplicate re-read by committing dirty + // on revoke; users wanting eager semantics use AutoCommitGreedy or their + // own OnPartitionsRevoked -> CommitUncommittedOffsets (user decision + // 2026-04-24). setHead := g.cfg.autocommitDisable || g.cfg.autocommitGreedy g.mu.Lock() @@ -2476,7 +2844,7 @@ func (g *groupConsumer) loopCommit() { // offsets. g.noCommitDuringJoinAndSync.RLock() g.mu.Lock() - if !g.blockAuto { + if g.blockAuto == 0 { uncommitted := g.getUncommittedLocked(true, false) if len(uncommitted) == 0 { g.cfg.logger.Log(LogLevelDebug, "skipping autocommit due to no offsets to commit", "group", g.cfg.group) @@ -2652,6 +3020,10 @@ var txnCommitContextFn = func() *string { s := "txn_commit_ctx"; return &s }() // default internal metadata is the client's current member ID). If fn returns // an error, the commit is not attempted. This context can be used in either // GroupTransactSession.End or in Client.EndTransaction. +// +// fn runs while the client's internal transaction lock is held: it must not +// block and must not re-enter transaction functions (Begin/End/Abort), which +// would self-deadlock. Its purpose is pure request mutation. func PreTxnCommitFnContext(ctx context.Context, fn func(*kmsg.TxnOffsetCommitRequest) error) context.Context { return context.WithValue(ctx, txnCommitContextFn, fn) } @@ -2878,10 +3250,11 @@ func (cl *Client) commitOffsets(ctx context.Context, offsets map[string]map[int3 return rerr } -// CommitOffsetsSync cancels any active CommitOffsets, begins a commit that -// cannot be canceled, and waits for that commit to complete. This function -// will not return until the commit is done and the onDone callback is -// complete. +// CommitOffsetsSync waits for any active CommitOffsets to complete, begins a +// commit that cannot be canceled by other commits or by rebalancing, and +// waits for that commit to complete. The commit is canceled only if the +// passed context is canceled. This function will not return until the commit +// is done and the onDone callback is complete. // // The purpose of this function is for use in OnPartitionsRevoked or committing // before leaving a group, because you do not want to have a commit issued in @@ -2984,12 +3357,12 @@ func (g *groupConsumer) commitOffsetsSync( g.mu.Lock() defer g.mu.Unlock() - g.blockAuto = true + g.blockAuto++ unblockAuto := func(cl *Client, req *kmsg.OffsetCommitRequest, resp *kmsg.OffsetCommitResponse, err error) { unblockCommits(cl, req, resp, err) g.mu.Lock() defer g.mu.Unlock() - g.blockAuto = false + g.blockAuto-- } g.commit(ctx, uncommitted, unblockAuto) @@ -3013,12 +3386,14 @@ func (g *groupConsumer) commitOffsetsSync( // It is invalid to use this function to commit offsets for a transaction. // // Note that this function ensures absolute ordering of commit requests by -// canceling prior requests and ensuring they are done before executing a new -// one. This means, for absolute control, you can use this function to -// periodically commit async and then issue a final sync commit before quitting -// (this is the behavior of autocommiting and using the default revoke). This -// differs from the Java async commit, which does not retry requests to avoid -// trampling on future commits. +// waiting for any prior in-flight commit to complete before issuing a new +// one. Prior commits are never canceled: canceling kills the connection, +// and the broker could then process a replacement commit issued on a new +// connection before the original. This means, for absolute control, you can +// use this function to periodically commit async and then issue a final sync +// commit before quitting (this is the behavior of autocommiting and using +// the default revoke). This differs from the Java async commit, which does +// not retry requests to avoid trampling on future commits. // // It is highly recommended to check the response's partition's error codes if // the response is non-nil. While unlikely, individual partitions can error. @@ -3029,6 +3404,11 @@ func (g *groupConsumer) commitOffsetsSync( // CommitOffsetsSync. If you commit async, the rebalance will proceed before // this function executes, and you will commit offsets for partitions that have // moved to a different consumer. +// +// Do not commit from within onDone: onDone runs while this commit is still +// ordered against all other commits, so a commit issued inside onDone can +// deadlock permanently (it always does if any sync commit is waiting). To +// retry a failed commit, signal out of onDone and commit after it returns. func (cl *Client) CommitOffsets( ctx context.Context, uncommitted map[string]map[int32]EpochOffset, @@ -3065,12 +3445,12 @@ func (cl *Client) CommitOffsets( g.mu.Lock() defer g.mu.Unlock() - g.blockAuto = true + g.blockAuto++ unblockAuto := func(cl *Client, req *kmsg.OffsetCommitRequest, resp *kmsg.OffsetCommitResponse, err error) { unblockJoinSync(cl, req, resp, err) g.mu.Lock() defer g.mu.Unlock() - g.blockAuto = false + g.blockAuto-- } g.commit(ctx, uncommitted, unblockAuto) @@ -3159,16 +3539,7 @@ func (g *groupConsumer) commit( req.Generation = generation req.MemberID = memberID req.InstanceID = g.cfg.instanceID - - if ctx.Done() != nil { - go func() { - select { - case <-ctx.Done(): - commitCancel() - case <-commitCtx.Done(): - } - }() - } + is848 := g.is848 // g.mu is held, per the function comment above go func() { defer close(commitDone) // allow future commits to continue when we are done @@ -3377,8 +3748,18 @@ func (g *groupConsumer) commit( for _, d := range dropped { var rt *kmsg.OffsetCommitResponseTopic for i := range resp.Topics { - if resp.Topics[i].Topic == d.name && resp.Topics[i].TopicID == d.id { - rt = &resp.Topics[i] + // v10+ responses carry only the TopicID (Topic is + // v0-v9 on the wire, so kept topics arrive with an + // empty name); v9 and below carry only the name (and + // pinV9 above guarantees an id-less topic never goes + // out v10+, so a zero d.id implies a v9 response). + // Match whichever side the wire carried; requiring + // both duplicated the topic on v10 and the length + // mismatch then made updateCommitted skip the whole + // response. + t := &resp.Topics[i] + if d.id != ([16]byte{}) && t.TopicID == d.id || t.Topic != "" && t.Topic == d.name { + rt = t break } } @@ -3401,11 +3782,67 @@ func (g *groupConsumer) commit( // original request, not the wire-filtered one. req.Topics = origReqTopics + // If the broker no longer recognizes our member (the session + // expired during a network blip, or the group rebalanced + // without us), every commit from here on fails identically + // while we keep consuming as a zombie, until the heartbeat + // loop sees the same error up to a full heartbeat interval + // later. Rejoin immediately instead; the join itself repairs + // the session (joinAndSync clears the member id and retries + // if the broker rejects the join with UnknownMemberID). + // + // Classic protocol only: in 848 mode, a forced "rejoin" does + // not actually rejoin. The heartbeat loop treats the signal + // as RebalanceInProgress and the manage loop restarts the + // session with the same member id and epoch; only a + // heartbeat error resets the member to epoch 0. Worse, with + // autocommit the restart livelocks: ending a session runs + // the default revoke, which sync-commits uncommitted + // offsets; that commit fails with the same fatal error and + // re-queues the rejoin signal; the restarted session then + // consumes the queued signal before its first heartbeat + // timer can fire, and the cycle repeats forever without a + // single heartbeat reaching the broker. Classic does not + // loop because joinAndSync drains rejoinCh before joining + // and the join re-registers us. For 848 we leave fatal + // member errors to the heartbeat loop, matching the Java + // clients: the classic Java consumer rejoins from the commit + // path, while the next-gen one leaves fencing detection to + // the heartbeat. + if !is848 { + if fatalErr := commitHasFatalMemberError(resp); fatalErr != nil { + g.cfg.logger.Log(LogLevelInfo, "offset commit returned a fatal group member error, triggering rejoin", + "group", g.cfg.group, + "err", fatalErr, + ) + g.rejoin(fmt.Sprintf("offset commit error: %s", fatalErr)) + } + } + g.updateCommitted(req, resp) onDone(g.cl, req, resp, nil) }() } +// commitHasFatalMemberError returns the first per-partition error that +// means the broker no longer recognizes this member's session. The +// broker validates membership before any per-partition handling, so +// these errors arrive on every partition or none. FencedInstanceID is +// deliberately not included: it means another instance with our +// instance id has taken over, and rejoining would fight that instance +// for the group slot rather than repair anything. +func commitHasFatalMemberError(resp *kmsg.OffsetCommitResponse) error { + for i := range resp.Topics { + for _, p := range resp.Topics[i].Partitions { + switch p.ErrorCode { + case kerr.UnknownMemberID.Code, kerr.IllegalGeneration.Code: + return kerr.ErrorForCode(p.ErrorCode) + } + } + } + return nil +} + type reNews struct { added map[string][]string skipped []string diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_group_848.go b/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_group_848.go index 756d45122e7..a6c34f1cc64 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_group_848.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_group_848.go @@ -38,6 +38,27 @@ func (g *groupConsumer) should848() bool { return true } +// manage848 drives the KIP-848 heartbeat session: it restarts the session on +// transient errors and re-fetches outstanding partitions via g.fetching. +// +// Constraints any change to coordinator/leader-churn recovery (here, in +// heartbeat, and in fetchOffsets) must preserve — established by the +// rebalance-churn audit: +// +// 1. Heartbeat-originated transport and coordinator errors retry in place +// (the stale-connection cycle 90bcc2bb fixed is real). Fetch errors do +// NOT take that arm — they propagate here so the session restarts and +// re-fetches; do not collapse the two error sources back together. +// 2. Session restart is the designed heal for fetch failures: the g.fetching +// carryover exists precisely so a torn-down session re-fetches. Route +// fixes through it rather than inventing a second retry inside fetchOffsets. +// 3. Member-identity resets are the minimum the error implies: a fresh UUID +// for UnknownMemberID, the SAME UUID for epoch problems (FENCED and STALE +// both keep it). Anything stronger strands server-side state for a full +// session timeout. +// 4. Leaves (MemberEpoch -1/-2) are idempotent and stateless — safe to retry +// anywhere. The CGHB no-retry rule applies only to reconciliation-carrying +// heartbeats, never to leaves. func (g *groupConsumer) manage848() { var serverAssignor string switch g.cfg.balancers[0].(type) { @@ -91,19 +112,28 @@ outer: // Even if Kafka replies that the API is available, if we use it // and the broker is not configured to support it, we receive - // UnsupportedVersion. On the first loop + // UnsupportedVersion. Until a join attempt settles the question + // (any other kerr, or success, means the API is really served), + // an UnsupportedVersion error falls back to classic group + // management. if !known848Support { if err != nil { var ke *kerr.Error if errors.As(err, &ke) { if ke.Code == kerr.UnsupportedVersion.Code { // It's okay to update is848 here. This is used while leaving - // and while heartbeating. We have not yet entered heartbeating, - // and if the user is concurrently leaving, the lack of a memberID - // means both 848 and old group mgmt leaves return early. + // and while heartbeating. We have not yet entered heartbeating. g.mu.Lock() g.is848 = false g.mu.Unlock() + // We pre-stored a self-generated member id (v1 semantics) + // that the server never admitted - the join just failed. + // Clear it so a concurrent leave returns early (there is + // no member to remove; both the 848 and classic leave + // paths check for an empty member id) and so the classic + // join below starts with an empty member id rather than + // burning an UNKNOWN_MEMBER_ID round trip on our UUID. + g.memberGen.store("", -1) g.cfg.logger.Log(LogLevelInfo, "falling back to standard consumer group management due to lack of broker support", "group", g.cfg.group) fallbackToClassic = true go g.manage() @@ -231,7 +261,12 @@ outer: sleep := g.cfg.heartbeatInterval if err == nil { err = errCodeMessage(resp.ErrorCode, resp.ErrorMessage) - sleep = time.Duration(resp.HeartbeatIntervalMillis) * time.Millisecond + // A zero or negative server interval (buggy or + // hostile broker) would hot-loop heartbeats at + // round-trip pace; keep the configured cadence. + if hb := time.Duration(resp.HeartbeatIntervalMillis) * time.Millisecond; hb > 0 { + sleep = hb + } } if err != nil { // Reset last-sent state so the next attempt @@ -268,21 +303,27 @@ outer: isAnyDialErr(err), g.cl.maybeDeleteStaleCoordinator(g.cfg.group, coordinatorTypeGroup, err): consecutiveTransientRestarts++ - if int64(consecutiveTransientRestarts) >= g.cfg.retries && int64(consecutiveTransientRestarts)%g.cfg.retries == 0 { + if shouldNotify848Restart(int64(consecutiveTransientRestarts), g.cfg.retries) { g.c.addFakeReadyForDraining("", 0, &ErrGroupSession{ Err: fmt.Errorf("consumer group %s heartbeat has been failing for %d consecutive attempts, still retrying: %w", g.cfg.group, consecutiveTransientRestarts, err), }, "consumer group heartbeat persistently failing") } err = nil + // Continue directly: we nil err only to keep the + // session loop going, not because anything + // succeeded. Falling into the err == nil reset + // below would zero the counter we just + // incremented, capping it at 1 forever and making + // the every-cfg.retries notification above + // unreachable. The reset is for the other arms, + // whose nil means a processed response. + continue - case errors.Is(err, kerr.UnknownMemberID), - errors.Is(err, kerr.StaleMemberEpoch): - // UnknownMemberID: server forgot us. - // StaleMemberEpoch: our epoch drifted (e.g. a - // heartbeat response was lost). Either way, the - // fix is identical: abandon the assignment and - // re-initialJoin with a fresh member id so the - // server hands us back a current epoch. + case errors.Is(err, kerr.UnknownMemberID): + // The server forgot us (session expired during an + // outage, or we were administratively removed). + // Abandon the assignment and re-initialJoin with a + // fresh member id. member, gen := g.memberGen.load() g.cfg.logger.Log(LogLevelInfo, "consumer group heartbeat error, abandoning assignment and rejoining with new member id", "group", g.cfg.group, @@ -294,7 +335,17 @@ outer: g.memberGen.store(newStringUUID(), 0) continue outer + // StaleMemberEpoch means our epoch drifted from the + // server's; it reaches us via OffsetFetch (the heartbeat + // itself fences with FencedMemberEpoch), so the server + // still has this member. We must KEEP our member id: + // rejoining at epoch 0 with the same id is the protocol's + // lost-response recovery - the server re-admits the member + // in place and re-delivers its assignment. Rejoining with + // a fresh id would strand the old member server-side, + // parking its partitions until the session timeout. case errors.Is(err, kerr.FencedMemberEpoch), + errors.Is(err, kerr.StaleMemberEpoch), errors.Is(err, kerr.GroupMaxSizeReached), errors.Is(err, kerr.UnsupportedAssignor): lvl := LogLevelInfo @@ -332,8 +383,9 @@ outer: } // The errors we have to handle are: - // * UnknownMemberID: abandon partitions, rejoin - // * FencedMemberEpoch: abandon partitions, rejoin + // * UnknownMemberID: abandon partitions, rejoin w/ new member id + // * FencedMemberEpoch / StaleMemberEpoch: abandon partitions, + // rejoin with the SAME member id // * UnreleasedInstanceID: fatal error, do not rejoin // * General error: fatal error, do not rejoin // @@ -353,6 +405,25 @@ outer: } } +// shouldNotify848Restart reports whether a transient-restart count warrants +// surfacing the "heartbeat persistently failing" notification - the only +// user-visible signal that an 848 group is unreachable: once we have +// restarted at least `retries` times, on every `retries`-th restart. +// +// retries <= 0 means the user disabled retries (RequestRetries(0)). That also +// disables in-session heartbeat retries - heartbeat() propagates the first +// transient error immediately rather than retrying in place - so every +// transient error is its own restart and each one warrants the notification. +// We must therefore notify on every restart, NOT divide restarts by zero +// (an integer divide-by-zero panic that would crash the manage goroutine on +// the first transient heartbeat error). +func shouldNotify848Restart(restarts, retries int64) bool { + if retries < 1 { + return true + } + return restarts >= retries && restarts%retries == 0 +} + func (g *groupConsumer) leave848(ctx context.Context) { memberID := g.memberGen.memberID() g.cfg.logger.Log(LogLevelInfo, "leaving next-gen group", @@ -375,7 +446,16 @@ func (g *groupConsumer) leave848(ctx context.Context) { g.leaveErr = err return } - g.leaveErr = errCodeMessage(resp.ErrorCode, resp.ErrorMessage) + err = errCodeMessage(resp.ErrorCode, resp.ErrorMessage) + // The leave rides the coordinator retry wrapper: if a prior attempt + // succeeded but its response was lost (the connection died), the + // retry finds the member already gone. Same if the session expired + // before we could leave. Either way the member is out of the group, + // which is the goal state of leaving, not an error. + if errors.Is(err, kerr.UnknownMemberID) { + err = nil + } + g.leaveErr = err } type g848 struct { @@ -402,6 +482,23 @@ type g848 struct { prerevoking atomic.Bool } +// sanitizePartitions returns the broker-provided partitions sorted, with +// duplicates and negatives dropped. A duplicated partition is not just +// redundant: it survives into nowAssigned, makes the assignment compare as +// changed, and diffAssigned then re-"adds" the partition we already own - +// re-fetching its committed offset and rewinding the live cursor into +// duplicate consumption. Negative numbers can only come from a buggy or +// hostile broker and would otherwise flow into the offset-load machinery. +func sanitizePartitions(ps []int32) []int32 { + ps = slices.Clone(ps) + slices.Sort(ps) + ps = slices.Compact(ps) + for len(ps) > 0 && ps[0] < 0 { + ps = ps[1:] + } + return ps +} + // v1+ requires the end user to generate their own MemberID, with the // recommendation being v4 uuid base64 encoded so it can be put in URLs. We // roughly do that (no version nor variant bits). crypto/rand does not fail @@ -424,7 +521,32 @@ func (g *g848) initialJoin() (time.Duration, error) { g.g.memberGen.storeGeneration(0) g.lastSubscribedTopics = nil g.lastTopics = nil + // A (re)join must carry an EMPTY owned-partitions list: the broker + // rejects any epoch-0 heartbeat whose Topics is non-empty (or null) + // with INVALID_REQUEST, "TopicPartitions must be empty when + // (re-)joining." unresolvedAssigned holds the OLD member's + // server-side assignment, and mkreq folds it into Topics - so + // carrying it across a member reset would poison every join, and + // permanently: the only other thing that clears unresolvedAssigned + // is a successful assignment-carrying response, which a rejected + // join never produces. Dropping it loses nothing - the join + // response always re-delivers the member's full assignment. The + // Java client likewise clears its unresolved-IDs cache on every + // transition to joining. + g.unresolvedAssigned = nil g.prerevoking.Store(false) + // Drain any stale rejoin signal, mirroring joinAndSync. Nothing + // else on the 848 path consumes the channel across a member reset: + // if a signal was queued (e.g. metadata found new matching topics) + // and the heartbeat loop then exited on a fatal error without + // reading it, the signal would survive into the session we are + // about to build and immediately bounce it. The join below already + // carries our current subscription (mkreq reads live state), which + // is everything a queued signal could ask for. + select { + case <-g.g.rejoinCh: + default: + } req := g.mkreq() resp, err := req.RequestWith(g.g.ctx, g.g.cl) if err == nil { @@ -442,10 +564,30 @@ func (g *g848) initialJoin() (time.Duration, error) { "now_assigned", nowAssigned, ) - return time.Duration(resp.HeartbeatIntervalMillis) * time.Millisecond, nil + // As in the heartbeat closure: never adopt a zero/negative server + // interval, it would hot-loop the heartbeat timer. + if hb := time.Duration(resp.HeartbeatIntervalMillis) * time.Millisecond; hb > 0 { + return hb, nil + } + return g.g.cfg.heartbeatInterval, nil } func (g *g848) handleResp(req *kmsg.ConsumerGroupHeartbeatRequest, resp *kmsg.ConsumerGroupHeartbeatResponse) map[string][]int32 { + // A success response can only legitimately carry a negative member + // epoch as the echo of a leave (-1, or -2 static), which this loop + // never sends; the broker rejects requests below -2 outright. If a + // buggy or hostile broker hands us a negative epoch here and we + // store it, our next heartbeat would BE a leave: the member silently + // exits the group while fetches continue. Ignore the response + // entirely, like the Java client does. + if resp.MemberEpoch < 0 { + g.g.cfg.logger.Log(LogLevelWarn, "ignoring consumer group heartbeat response with an invalid negative member epoch", + "group", g.g.cfg.group, + "epoch", resp.MemberEpoch, + ) + return nil + } + id2t := g.g.cl.id2tMap() newAssigned := make(map[string][]int32) @@ -469,16 +611,16 @@ func (g *g848) handleResp(req *kmsg.ConsumerGroupHeartbeatRequest, resp *kmsg.Co // Fresh assignment from server - replace unresolved state. g.unresolvedAssigned = nil for _, t := range resp.Assignment.Topics { + ps := sanitizePartitions(t.Partitions) name := id2t[t.TopicID] if name == "" { if g.unresolvedAssigned == nil { g.unresolvedAssigned = make(map[topicID][]int32) } - g.unresolvedAssigned[topicID(t.TopicID)] = slices.Clone(t.Partitions) + g.unresolvedAssigned[topicID(t.TopicID)] = ps continue } - slices.Sort(t.Partitions) - newAssigned[name] = t.Partitions + newAssigned[name] = ps } } @@ -489,7 +631,6 @@ func (g *g848) handleResp(req *kmsg.ConsumerGroupHeartbeatRequest, resp *kmsg.Co // simpler and only costs one heartbeat interval (~5s). for id, ps := range g.unresolvedAssigned { if name := id2t[[16]byte(id)]; name != "" { - slices.Sort(ps) newAssigned[name] = ps delete(g.unresolvedAssigned, id) } @@ -590,8 +731,17 @@ func (g *g848) mkreq() *kmsg.ConsumerGroupHeartbeatRequest { // the already-resolved topic names from g.tps (which // filterMetadataAllTopics populates with excludes applied). // New topics are picked up on the next metadata refresh. + // + // Skip internal topics: classic regex consuming never uses them + // (findNewAssignments skips isInternal), and the broker honors + // explicit name subscriptions to internal topics, so emulating + // the regex with names would otherwise consume e.g. + // __consumer_offsets whenever the regex matches it. subscribedTopics := make([]string, 0, len(tps)) - for t := range tps { + for t, tp := range tps { + if tp.load().isInternal { + continue + } subscribedTopics = append(subscribedTopics, t) } slices.Sort(subscribedTopics) diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_share.go b/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_share.go index f97bf9797a6..ba90d5d729d 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_share.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/consumer_share.go @@ -43,6 +43,15 @@ type ( // names. Owned by the manage goroutine. unresolvedAssigns map[topicID][]int32 + // Whether the last assignPartitions pass skipped an assigned + // partition our metadata does not know yet (the broker assigned + // newly added partitions before our metadata refreshed). We ack + // the member epoch regardless, so the broker never re-sends the + // assignment; while true, handleHeartbeatResp re-returns the + // current assignment so we retry once metadata catches up. Owned + // by the manage goroutine. + pendingAssigns bool + lastSentSubscribedTopics []string lastSentRack bool @@ -80,7 +89,7 @@ type ( mu xsync.Mutex cond *sync.Cond dying bool // single-shot leave guard + incWorker gate - workers int // active goroutines (manage + source loops) + workers int // active goroutines (manage + source loops + in-flight cursor migrations) left chan struct{} leaveErr error @@ -96,6 +105,13 @@ type ( // sources concurrent with user acking. source atomic.Pointer[source] + // unknownIDFails counts consecutive UnknownTopicID fetch + // errors, mirroring cursor.unknownIDFails: the error is + // transient on a just-created topic while brokers sync, so we + // strip it for a few fetches, but persistent means the topic + // was recreated and we surface it forever (stall loudly). + unknownIDFails atomic.Int32 + cursorsIdx int // assigned is true when the cursor's partition is currently @@ -110,6 +126,19 @@ type ( // a similar flow actually makes the code worse. assigned atomic.Bool + // moving is true while a leader-move (applyMoves) is queued and + // in flight for this cursor. createShareReq skips a moving cursor + // (it then falls into the forget set, dropping it from the old + // broker's session like the classic strip), so the old source does + // not keep re-fetching the partition - getting NOT_LEADER and + // re-queuing the move - until the async migration lands. This is + // the share analog of the classic cursor going unusable for the + // duration of a move (source.go use() + strip, never re-enabled + // until the move replaces the cursor). applyMoves sets it before + // spawning the migration; applyMovesBlocking clears it and + // re-signals the cursor's source once the move has run. + moving atomic.Bool + ackMu xsync.Mutex pendingAcks []*shareAckState // user acks (r.Ack, finalizePreviousPoll, batchAckRecords) pendingGaps []shareAckRange // internal acks (gap acks, release-undeliverable) @@ -145,6 +174,7 @@ type ( topicID [16]byte partition int32 leaderID int32 + cursor *shareCursor // cursor to re-enable (clear moving) after the migration runs; see shareCursor.moving } // shareAckRange is a contiguous offset range with a fixed ack @@ -180,6 +210,21 @@ type ( // offset; duplicates would be rejected with INVALID_RECORD_STATE. // The sc.pendingAcks counter still increments once per appended // entry; subtraction at callback time uses the entry count. + // + // KNOWN WINDOW (2026-07 audit, deliberately unfixed): the + // offset-dedupe only covers duplicates within one build. If a + // drain snapshots a renew entry and the user's terminal ack + // lands between the drain and the build's status read, the CAS + // re-appends the pointer to the (new) pending list while the + // drained copy also reads the terminal status: two requests + // carry the same terminal ack, and the broker rejects the + // second with INVALID_RECORD_STATE at partition granularity, + // erroring innocent co-batched acks (they redeliver via the + // acquisition-lock timeout; at-least-once holds and the error + // is surfaced via the ack callback). Closing this needs + // per-state sent tracking (+8 bytes per acquired record) or a + // synchronized consume point; the microsecond window and + // loud+recoverable outcome did not justify either. shareAckState struct { status atomic.Int32 // CAS target for ack transitions deliveryCount int32 // broker's delivery count for this record (>= 1) @@ -403,6 +448,7 @@ func (sc *shareConsumer) poll(ctx context.Context, maxPollRecords int) Fetches { fill() sc.c.mu.Unlock() + sc.c.runDeferredFetchHooks() if len(fetches) > 0 || ctx == nil { return fetches } @@ -436,6 +482,7 @@ func (sc *shareConsumer) poll(ctx context.Context, maxPollRecords int) Fetches { sc.c.mu.Lock() fill() sc.c.mu.Unlock() + sc.c.runDeferredFetchHooks() } return fetches @@ -620,7 +667,15 @@ func (sc *shareConsumer) leave(ctx context.Context) { sc.leaveErr = err return } - sc.leaveErr = errCodeMessage(resp.ErrorCode, resp.ErrorMessage) + err = errCodeMessage(resp.ErrorCode, resp.ErrorMessage) + // As with the 848 leave: the leave is retried, so a retry can find + // the member already gone (prior attempt's response lost, or the + // session expired first). The member being out of the group is the + // goal state of leaving, not an error. + if errors.Is(err, kerr.UnknownMemberID) { + err = nil + } + sc.leaveErr = err } // closeShareSession releases any buffered records on this source, @@ -948,9 +1003,18 @@ func (sc *shareConsumer) manage() { return case errors.Is(err, kerr.UnknownMemberID), - errors.Is(err, kerr.FencedMemberEpoch): + errors.Is(err, kerr.FencedMemberEpoch), + errors.Is(err, kerr.GroupIDNotFound): // Keep the same UUID (matches the Java client) and reset // to epoch 0 so the next heartbeat re-joins. + // + // GroupIDNotFound resets for liveness: the broker creates a + // share group only on a memberEpoch 0 heartbeat, so if group + // state vanished under a live member (coordinator state + // loss), retrying at our current epoch returns + // GROUP_ID_NOT_FOUND forever; only rejoining at epoch 0 + // recreates the group. Classic and 848 groups self-heal the + // same way via their rejoin paths. member, gen := sc.memberGen.load() sc.memberGen.storeGeneration(0) sc.cfg.logger.Log(LogLevelInfo, "share group heartbeat lost membership, resetting epoch", @@ -969,9 +1033,12 @@ func (sc *shareConsumer) manage() { consecutiveErrors = 0 continue + // Evict with coordinatorTypeGroup to match how the heartbeat loads it: + // the cache is keyed by {name, type}, so a share-typed evict never + // matches and we would retry the stale coordinator forever (#1330). case isRetryableBrokerErr(err), isAnyDialErr(err), - sc.cl.maybeDeleteStaleCoordinator(sc.cfg.shareGroup, coordinatorTypeShare, err): + sc.cl.maybeDeleteStaleCoordinator(sc.cfg.shareGroup, coordinatorTypeGroup, err): // Retryable -- fall through to shared backoff below. default: @@ -1084,14 +1151,17 @@ func (sc *shareConsumer) handleHeartbeatResp(resp *kmsg.ShareGroupHeartbeatRespo sc.memberGen.storeGeneration(resp.MemberEpoch) if resp.Assignment == nil { - if len(sc.unresolvedAssigns) == 0 { + if len(sc.unresolvedAssigns) == 0 && !sc.pendingAssigns { return nil } - // No assignment: try to resolve prior un-resolvable - // topics. If we can, that updates our current assignment - // and we return the new update. + // No assignment: try to resolve prior un-resolvable topics, + // and if a prior assignPartitions could not activate some + // partitions (pendingAssigns), re-return the current + // assignment so activation is retried: the broker considers + // the assignment delivered (we acked the epoch) and will not + // re-send it on its own. resolved := sc.resolveUnresolvedTopicIDs() - if len(resolved) == 0 { + if len(resolved) == 0 && !sc.pendingAssigns { return nil } current := sc.nowAssigned.read() @@ -1176,7 +1246,7 @@ func (sc *shareConsumer) assignPartitions(assignments map[string][]int32) { if slices.Contains(newPs, p) { // linear, *usually* fast... continue } - if int(p) >= len(td.partitions) { + if p < 0 || int(p) >= len(td.partitions) { continue } cursor := td.partitions[p].shareCursor @@ -1185,26 +1255,52 @@ func (sc *shareConsumer) assignPartitions(assignments map[string][]int32) { } } - // Add what is new. + // Add what is new. We skip based on the cursor's own activation + // state, not on what nowAssigned previously contained: a partition + // can be in nowAssigned but never activated (skipped below because + // our metadata did not know it yet), and it must be re-attempted on + // a later pass. var needsMetaUpdate bool + sc.pendingAssigns = false for t, newPs := range assignments { - oldPs := old[t] tp, ok := tps[t] if !ok { + // Not subscribed (e.g. purged): the broker revokes once + // our next heartbeat updates SubscribedTopicNames. We + // deliberately do not set pendingAssigns: the topic will + // never appear in tps, and the broker is guaranteed to + // send a new assignment in response to the subscription + // change. needsMetaUpdate = true - continue // if we don't know the tps data, we can't assign it; force a meta refresh + continue } td := tp.load() for _, p := range newPs { - if slices.Contains(oldPs, p) { - continue // already was assigned, no-op + if p < 0 { + // A sane broker never assigns a negative partition; + // guard a buggy/hostile one. Unlike the too-large + // case below, a negative index can never become + // valid, so do not set pendingAssigns for it. + sc.cfg.logger.Log(LogLevelWarn, "share assignment contains a negative partition, ignoring it", + "topic", t, + "partition", p, + ) + continue } if int(p) >= len(td.partitions) { + // Assigned a partition our metadata does not know + // yet (partitions were just added and the + // coordinator is ahead of our metadata). We cannot + // activate it now; retry after the metadata + // refresh below. + sc.pendingAssigns = true needsMetaUpdate = true continue } cursor := td.partitions[p].shareCursor - cursor.assigned.Store(true) + if cursor.assigned.Swap(true) { + continue // already active from a prior pass + } sourcesToWake[cursor.source.Load()] = struct{}{} } } @@ -1226,7 +1322,37 @@ func (sc *shareConsumer) applyMoves(moves []shareMove, endpoints []BrokerMetadat if len(moves) == 0 { return } - go sc.cl.blockingMetadataFn(func() { + // Mark each migrating cursor unusable BEFORE spawning, on this (the + // fetch) goroutine, so the very next createShareReq already skips it. + // Setting it inside the spawned goroutine would race the next fetch, + // which could rebuild a request that re-fetches the partition (getting + // NOT_LEADER again) before the goroutine runs. applyMovesBlocking clears + // the flag once the migration has run. See shareCursor.moving. + for i := range moves { + moves[i].cursor.moving.Store(true) + } + go sc.applyMovesBlocking(moves, endpoints) +} + +// applyMovesBlocking performs the cursor migration on the metadata loop. +// It registers as a share-consumer worker (incWorker/decWorker) so leave's +// barrier waits for an in-flight migration before it drains and closes the +// per-source sessions: the move runs via blockingMetadataFn and can relocate +// a cursor (or create a brand-new source) concurrently with leave. Without +// the worker registration, a CurrentLeader-hint move racing LeaveGroup/Close +// can land a cursor on a source whose closeShareSession already drained (or +// on a source created after leave snapshotted the source list), stranding +// that cursor's pending acks: sc.pendingAcks never returns to 0 (FlushAcks +// hangs) and the held records release only via the broker's acquisition-lock +// timeout. If the consumer is already dying, incWorker returns false and the +// move is skipped; the cursor stays on its current source, which the leave's +// closeShareSession drains. +func (sc *shareConsumer) applyMovesBlocking(moves []shareMove, endpoints []BrokerMetadata) { + if !sc.incWorker() { + return + } + defer sc.decWorker() + sc.cl.blockingMetadataFn(func() { // Seed any brokers from the response's NodeEndpoints that we // do not yet know about. Same merge-without-remove invariant // as kip951move.ensureBrokers. @@ -1286,7 +1412,7 @@ func (sc *shareConsumer) applyMoves(moves []shareMove, endpoints []BrokerMetadat continue } td := tp.load() - if int(m.partition) >= len(td.partitions) { + if m.partition < 0 || int(m.partition) >= len(td.partitions) { continue } cursor := td.partitions[m.partition].shareCursor @@ -1306,6 +1432,22 @@ func (sc *shareConsumer) applyMoves(moves []shareMove, endpoints []BrokerMetadat "applied", moved, ) } + + // Re-enable each cursor for fetching now that its move has run, and + // re-signal its (current) source. addShareCursor above woke the new + // source's loop while moving was still set, so that loop may have + // skipped this cursor and exited via maybeFinish before we got here; + // maybeShareConsume re-fetches it. Cursors whose move was skipped + // (topic unresolved, out of range, already on the leader) are + // re-enabled on their current source so they retry. This clear runs + // before decWorker, so it cannot race leave's barrier; the dying + // bail and the cl.ctx escape skip it, but those are shutdown paths + // where closeShareSession drains the cursor regardless of moving. + for i := range moves { + c := moves[i].cursor + c.moving.Store(false) + c.source.Load().maybeShareConsume() + } }) } @@ -1476,7 +1618,7 @@ func (s *sourceShare) takeBuffered(paused pausedTopics) Fetch { close(s.s.sem) f := b.fetch - s.s.hook(&f, false, true) // unbuffered, polled + s.s.hookDeferUnbuffered(&f, true) // unbuffered, polled; capture precedes the strip below // Strip paused partitions from the returned fetch and release // their records back to the broker for redelivery. @@ -1582,9 +1724,9 @@ func (s *sourceShare) takeNBuffered(paused pausedTopics, n int) (Fetch, int, boo } if len(rstrip.Topics) > 0 { - s.s.hook(&rstrip, false, true) + s.s.hookDeferUnbuffered(&rstrip, true) } - s.s.hook(&r, false, true) // unbuffered, polled + s.s.hookDeferUnbuffered(&r, true) // unbuffered, polled drained := len(bf.Topics) == 0 if drained { @@ -1622,8 +1764,27 @@ func (s *source) shareAck(predrained []cursorAckDrain) { nAcks, nStaleAcks, staleResults := filterStaleEntries(s, epoch, drains) sc.enqueueCallback(staleResults, nStaleAcks) + // nAcks counts only user ack entries; gap/release ranges are filtered + // separately and can survive as live with zero live user entries (a + // partition whose acquired ranges covered only compaction holes, or + // whose batch failed decode and was released, buffers no records for + // the user to ack). The drain above already removed those gaps from + // the cursors, so returning here would drop them permanently: never + // sent, never requeued, no callback -- the broker's acquisition locks + // for those offsets then sit occupied until the lock timeout, which + // is exactly what immediate gap acking exists to avoid. Return only + // when nothing live at all survived the stale filter. if nAcks == 0 { - return // everything was stale + var liveGaps bool + for i := range drains { + if len(drains[i].gaps) > 0 { + liveGaps = true + break + } + } + if !liveGaps { + return // everything was stale + } } if epoch == 0 { @@ -1737,6 +1898,7 @@ func (s *source) shareAck(predrained []cursorAckDrain) { topicID: rt.TopicID, partition: rp.Partition, leaderID: rp.CurrentLeader.LeaderID, + cursor: drained.cursor, }) } if isShareAckRetryable(partErr) { @@ -2328,12 +2490,18 @@ func (s *source) shareFetch(doneFetch chan<- bool) (fetched bool) { } var didBackoff bool - backoff := func() { + backoff := func(why any) { // Release fetch slot before sleeping so other sources // can fetch during our backoff. doneFetch <- false alreadySentToDoneFetch = true didBackoff = true + + // Like the classic source backoff: a fetch failure is the + // only signal we get when a broker dies (no response means no + // CurrentLeader hint), so opportunistically refresh metadata + // to migrate our cursors to the new leader. + s.cl.triggerUpdateMetadata(false, fmt.Sprintf("opportunistic load during share source backoff: %v", why)) s.consecutiveFailures++ after := time.NewTimer(sc.cfg.retryBackoff(s.consecutiveFailures)) defer after.Stop() @@ -2350,7 +2518,7 @@ func (s *source) shareFetch(doneFetch chan<- bool) (fetched bool) { if err != nil { s.resetShareSession() - backoff() + backoff(err) sc.enqueueAckErrors(piggybackAcks, err, nAcks) return fetched } @@ -2360,7 +2528,13 @@ func (s *source) shareFetch(doneFetch chan<- bool) (fetched bool) { res := s.handleShareReqResp(req, resp, usable, piggybackAcks, sentPiggyback) if res.discardErr != nil { + // Top-level errors are not necessarily transient (e.g. group + // auth revoked mid-run answers GROUP_AUTHORIZATION_FAILED + // top-level on every fetch); without a backoff this loops at + // round-trip pace. Transport errors and all-errors-stripped + // responses already back off; treat top-level errors the same. sc.enqueueAckErrors(piggybackAcks, res.discardErr, nAcks) + backoff(res.discardErr) return fetched } @@ -2377,10 +2551,10 @@ func (s *source) shareFetch(doneFetch chan<- bool) (fetched bool) { doneFetch: doneFetch, } s.sem = make(chan struct{}) - s.hook(&res.fetch, true, false) + s.hookBuffered(&res.fetch) sc.c.addSourceReadyForDraining(s) } else if res.allErrsStripped { - backoff() + backoff("empty share fetch response due to all partitions having retryable errors") } return fetched } @@ -2410,14 +2584,17 @@ func (s *source) handleShareReqResp(req *kmsg.ShareFetchRequest, resp *kmsg.Shar sessionStale := s.share.sessionEpoch != epoch if !sessionStale { s.share.sessionEpoch++ - // Only add cursors that were in the WANT set (usable) to - // sessionParts. req.Topics may also contain piggyback-only - // partitions for cursors that got revoked after we drained - // their acks: adding those to sessionParts would force us - // to forget them on the next request, generating an extra - // round trip of ForgottenTopicsData. - for _, c := range usable { - s.share.sessionParts[tidp{c.topicID, c.partition}] = struct{}{} + // Mirror the broker's session bookkeeping exactly: the broker + // adds EVERY partition we list in the request topics to its + // share session, whether the partition carries a fetch or only + // piggybacked acks (a cursor that was revoked, paused, or + // migrated after we drained its acks). It removes a partition + // from the session only when we forget it. + for i := range req.Topics { + t := &req.Topics[i] + for j := range t.Partitions { + s.share.sessionParts[tidp{t.TopicID, t.Partitions[j].Partition}] = struct{}{} + } } for _, ft := range req.ForgottenTopicsData { for _, p := range ft.Partitions { @@ -2464,6 +2641,7 @@ func (s *source) handleShareReqResp(req *kmsg.ShareFetchRequest, resp *kmsg.Shar ackRequeued int64 partitionsWithErrs int seen = make(map[tidp]struct{}, len(usable)+len(piggybackAcks)) + updateWhy multiUpdateWhy ) for i := range resp.Topics { @@ -2529,16 +2707,48 @@ func (s *source) handleShareReqResp(req *kmsg.ShareFetchRequest, resp *kmsg.Shar topicID: rt.TopicID, partition: rp.Partition, leaderID: rp.CurrentLeader.LeaderID, + cursor: cursor, }) continue } + // No leader hint: classify like the classic fetch + // path (source.go handleReqResp). Retriable errors + // are stripped and heal via the metadata update + // triggered below (the broker only fills + // CurrentLeader for NotLeader/FencedLeaderEpoch and + // only when it knows the new leader, so hint-less + // errors are common: leaderless windows, storage + // errors, topic ID propagation). Non-retriable + // errors surface: share sessions give the user no + // other signal. partErr := kerr.ErrorForCode(rp.ErrorCode) - partitions = append(partitions, FetchPartition{ - Partition: rp.Partition, - Err: partErr, - }) + updateWhy.add(topicName, rp.Partition, partErr) + keep := true + switch { + case errors.Is(partErr, kerr.UnknownTopicID): + // Transient on just-created topics while + // brokers sync; persistent means recreation. + // Strip a few, then surface forever, exactly + // like the classic cursor's grace counter. + if fails := cursor.unknownIDFails.Add(1); fails > 5 { + cursor.unknownIDFails.Add(-1) + } else if !sc.cfg.keepRetryableFetchErrors { + keep = false + } + default: + if kerr.IsRetriable(partErr) && !sc.cfg.keepRetryableFetchErrors { + keep = false + } + } + if keep { + partitions = append(partitions, FetchPartition{ + Partition: rp.Partition, + Err: partErr, + }) + } continue } + cursor.unknownIDFails.Store(0) if len(rp.Records) == 0 && len(rp.AcquiredRecords) == 0 { continue @@ -2591,6 +2801,22 @@ func (s *source) handleShareReqResp(req *kmsg.ShareFetchRequest, resp *kmsg.Shar } } + // Like the classic fetch path: per-partition errors trigger an + // immediate metadata update so the cursor can migrate (this is the + // only heal when the response carries no CurrentLeader hint), except + // pure unknown-topic reasons, which likely mean the topic does not + // exist yet and reloading is wasteful - those ride the debounced + // trigger. Hinted moves are handled via applyMoves and do not land + // in updateWhy. + if updateWhy != nil { + why := updateWhy.reason(fmt.Sprintf("share fetch had inner topic errors from broker %d", s.nodeID)) + if updateWhy.isOnly(kerr.UnknownTopicOrPartition) || updateWhy.isOnly(kerr.UnknownTopicID) { + s.cl.triggerUpdateMetadata(false, why) + } else { + s.cl.triggerUpdateMetadataNow(why) + } + } + var moveBrokers []BrokerMetadata if len(moves) > 0 && len(resp.NodeEndpoints) > 0 { moveBrokers = make([]BrokerMetadata, 0, len(resp.NodeEndpoints)) @@ -2834,7 +3060,13 @@ func (s *source) createShareReq(skipAckDrain bool) ( for range s.share.cursors { c := s.share.cursors[ci] ci = (ci + 1) % nShareCursors - if !c.assigned.Load() || paused.has(c.topic, c.partition) { + // Skip a cursor whose leader move is in flight (moving): leaving it + // in the want-set would re-fetch the partition on the old leader, + // getting NOT_LEADER and re-queuing the move until the migration + // lands. Skipping drops it into the forget set below, releasing it + // from the old broker's session (the share analog of the classic + // strip). applyMovesBlocking re-enables it once the move has run. + if !c.assigned.Load() || c.moving.Load() || paused.has(c.topic, c.partition) { continue } wantSet[tidp{c.topicID, c.partition}] = struct{}{} diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/errors.go b/vendor/github.com/twmb/franz-go/pkg/kgo/errors.go index 131c47485b6..203ffc97e51 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/errors.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/errors.go @@ -13,13 +13,13 @@ import ( ) // IsRetryableBrokerErr returns whether the client considers an error from a -// broker retrayble. This returns true specifically if the client thinks it can +// broker retryable. This returns true specifically if the client thinks it can // retry whatever it was just trying to do with a broker. It returns false in // all other cases. // -// This can used external to the library to help filter errors if use kgo -// hooks: errors may be sent to hooks before the client retries whatever it was -// just attempting. +// This can be used external to the library to help filter errors when using +// kgo hooks: errors may be sent to hooks before the client retries whatever it +// was just attempting. func IsRetryableBrokerErr(err error) bool { return isRetryableBrokerErr(err) } @@ -80,7 +80,18 @@ func isRetryableBrokerErr(err error) bool { } // EOF can be returned if a broker kills a connection unexpectedly, and // we can retry that. Same for ErrClosed. - if errors.Is(err, net.ErrClosed) || errors.Is(err, io.EOF) { + // + // ErrUnexpectedEOF is EOF's mid-frame sibling and does NOT satisfy + // errors.Is(err, io.EOF): a graceful FIN landing inside a + // length-prefixed frame (broker shutting down mid-write, an LB or + // proxy draining) makes io.ReadFull return it. Without matching it + // here, this one disconnect shape -- alone among all of them (RST is + // a SyscallError, boundary FIN is io.EOF, refused is a dial error) -- + // surfaced after zero retries: group sessions tore down, and a + // metadata request dying mid-read reached bumpRepeatedLoadErr with + // netErr=false, insta-failing buffered records on a transient + // network event. + if errors.Is(err, net.ErrClosed) || errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) { // If the FIRST read is EOF, that is usually not a good sign, // often it's from bad SASL. We err on the side of pessimism // and do not retry. @@ -99,11 +110,6 @@ func isRetryableBrokerErr(err error) bool { if errors.Is(err, errChosenBrokerDead) { return true } - // A broker kept giving us short sasl lifetimes, so we killed the - // connection ourselves. We can retry on a new connection. - if errors.Is(err, errSaslReauthLoop) { - return true - } // We really should not get correlation mismatch, but if we do, we can // retry. if errors.Is(err, errCorrelationIDMismatch) { @@ -199,11 +205,6 @@ var ( // while a request was in-flight. errChosenBrokerDead = errors.New("the broker connection has died and the request will be retried on a new connection") - // If a broker repeatedly gives us tiny sasl lifetimes, we fail a - // request after a few tries to forcefully kill the connection and - // restart a new connection ourselves. - errSaslReauthLoop = errors.New("the broker is repeatedly giving us sasl lifetimes that are too short to write a request") - // A temporary error returned when Kafka replies with a different // correlation ID than we were expecting for the request the client // issued. @@ -238,6 +239,20 @@ var ( errNoCommittedOffset = errors.New("partition has no prior committed offset") + // Returned when a ListOffsets success response carries a negative + // offset, which no legitimate listing produces. Non-retryable so the + // broker misbehavior surfaces in polls; the load is still retried. + errNegativeListedOffset = errors.New("broker replied to a ListOffsets request with an invalid negative offset") + + errFetchNoProgress = errors.New("fetch response contained record batches but none contained or exceeded the requested offset") + + // Injected as a fake errored fetch when an OffsetFetch response + // repeatedly omits a partition we requested; the group coordinator + // answers every requested partition, so an omission is a broker bug + // that would otherwise leave the partition silently unconsumed for + // the rest of the group session. + errOffsetFetchOmitted = errors.New("broker repeatedly omitted a requested partition from an OffsetFetch response") + // Returned by the 848 heartbeat closure when it detects an assignment // change. The heartbeat loop treats this like RebalanceInProgress but // suppresses further heartbeat requests so that a second heartbeat diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/group_balancer.go b/vendor/github.com/twmb/franz-go/pkg/kgo/group_balancer.go index a754ee67972..1b9d5abba69 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/group_balancer.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/group_balancer.go @@ -205,6 +205,28 @@ func ParseConsumerSyncAssignment(assignment []byte) (map[string][]int32, error) // // If any metadata parsing fails, this returns an error. func NewConsumerBalancer(balance ConsumerBalancerBalance, members []kmsg.JoinGroupResponseMember) (*ConsumerBalancer, error) { + // A buggy or hostile broker can list the same member ID twice in one + // JoinGroup response. Balancers key plans by member ID, so a duplicate + // either merges (range, roundrobin) or, worse, overwrites: the sticky + // engine balances the duplicates as two members and then loses one + // side's partitions when keying its returned plan -- partitions + // assigned to nobody. Keep the first occurrence. + seen := make(map[string]struct{}, len(members)) + for _, member := range members { + seen[member.MemberID] = struct{}{} + } + if len(seen) != len(members) { + dedup := make([]kmsg.JoinGroupResponseMember, 0, len(seen)) + clear(seen) + for _, member := range members { + if _, exists := seen[member.MemberID]; !exists { + seen[member.MemberID] = struct{}{} + dedup = append(dedup, member) + } + } + members = dedup + } + b := &ConsumerBalancer{ b: balance, members: members, @@ -225,12 +247,13 @@ func NewConsumerBalancer(balance ConsumerBalancerBalance, members []kmsg.JoinGro // claiming higher and higher version support and not // actually supporting them. Sarama has a similarish // workaround. See #493. - if bytes.HasPrefix(memberMeta, []byte{0, 1}) { - memberMeta[0] = 0 - memberMeta[1] = 0 - if err = meta.ReadFrom(memberMeta); err != nil { - return nil, fmt.Errorf("unable to read member metadata: %v", err) - } + if !bytes.HasPrefix(memberMeta, []byte{0, 1}) { + return nil, fmt.Errorf("unable to read member metadata: %v", err) + } + memberMeta[0] = 0 + memberMeta[1] = 0 + if err = meta.ReadFrom(memberMeta); err != nil { + return nil, fmt.Errorf("unable to read member metadata: %v", err) } } for _, topic := range meta.Topics { @@ -495,6 +518,13 @@ func (g *groupConsumer) balanceGroup(proto string, members []kmsg.JoinGroupRespo into = memberBalancer.Balance(topicPartitionCount) } + // A custom balancer that fails is documented to SetError and return + // nil; if it returns nil without setting an error, fail loudly rather + // than dereferencing the nil interface below. + if into == nil { + return nil, fmt.Errorf("balancer %s returned a nil plan with no error", proto) + } + if p, ok := into.(*BalancePlan); ok { g.cl.cfg.logger.Log(LogLevelInfo, "balanced", "plan", p.String()) } else { @@ -767,13 +797,13 @@ func (*rangeBalancer) Balance(b *ConsumerBalancer, topics map[string]int32) Into // StickyBalancer returns a group balancer that ensures minimal partition // movement on group changes while also ensuring optimal balancing. // -// Suppose there are three members M0, M1, and M2, and two topics t0 and t1 -// each with three partitions p0, p1, and p2. If the initial balance plan looks -// like +// Suppose there are three members M0, M1, and M2, and three topics t0, t1, +// and t2 each with three partitions p0, p1, and p2. If the initial balance +// plan looks like // // M0: [t0p0, t0p1, t0p2] // M1: [t1p0, t1p1, t1p2] -// M2: [t2p0, t2p2, t2p2] +// M2: [t2p0, t2p1, t2p2] // // If M2 disappears, both roundrobin and range would have mostly destructive // reassignments. @@ -972,6 +1002,37 @@ func (p *BalancePlan) AdjustCooperative(b *ConsumerBalancer) { tmap := make(map[string]struct{}) // reusable topic existence map pmap := make(map[int32]struct{}) // reusable partitions existence map + // KIP-792 / KAFKA-12983: an OwnedPartitions claim only proves current + // ownership when no other member claims the same partition at a + // strictly higher generation. A member that missed rebalances can + // rejoin still claiming a partition that has since been assigned to + // (and is actively consumed by) another member. The balance plan may + // deliberately move the partition back to that stale claimant (sticky + // re-sticking); if the claimant's own stale claim then masks the move + // as "already owned", we skip the revoke round and two members consume + // the partition until the current owner's next sync. We track the + // highest claimed generation per partition and ignore strictly lower + // claims when computing what was added. Same-generation claims all + // count: each claimant keeps what the plan gave it and revokes the + // rest at its own sync, which creates no new overlap. The revoked side + // below stays unfiltered on purpose -- any claimant might still be + // consuming, and revoking more is always safe. + maxClaim := make(map[string]map[int32]int32, 8) + b.EachMember(func(_ *kmsg.JoinGroupResponseMember, meta *kmsg.ConsumerMemberMetadata) { + for _, otopic := range meta.OwnedPartitions { + claimT := maxClaim[otopic.Topic] + if claimT == nil { + claimT = make(map[int32]int32, 20) + maxClaim[otopic.Topic] = claimT + } + for _, opartition := range otopic.Partitions { + if gen, ok := claimT[opartition]; !ok || meta.Generation > gen { + claimT[opartition] = meta.Generation + } + } + } + }) + plan := p.plan // First, on all members, we find what was added and what was removed @@ -997,12 +1058,17 @@ func (p *BalancePlan) AdjustCooperative(b *ConsumerBalancer) { continue } // calculate what was added by creating a planned existence map, - // then removing what was owned, and anything that remains is new, + // then removing what was owned, and anything that remains is new. + // A claim beaten by a strictly higher-generation claim elsewhere + // is stale and does not count as owned: the planned partition is + // then a real transfer that must wait for the owner's revoke. for _, ppartition := range ppartitions { pmap[ppartition] = struct{}{} } for _, opartition := range otopic.Partitions { - delete(pmap, opartition) + if meta.Generation >= maxClaim[topic][opartition] { + delete(pmap, opartition) + } } if len(pmap) > 0 { allAddedT := addT(topic) diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/hooks.go b/vendor/github.com/twmb/franz-go/pkg/kgo/hooks.go index 3ba13db0eab..96680b81176 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/hooks.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/hooks.go @@ -42,7 +42,7 @@ type HookNewClient interface { OnNewClient(*Client) } -// HookClientClosed is called in Close or CloseAfterRebalance after a client +// HookClientClosed is called in Close or CloseAllowingRebalance after a client // has been closed. This hook can be used to perform final cleanup work. type HookClientClosed interface { // OnClientClosed is passed the client that has been closed, after @@ -55,6 +55,9 @@ type HookClientClosed interface { ////////////////// // HookBrokerConnect is called after a connection to a broker is opened. +// This fires once per connection ATTEMPT, including internal retries: a +// broker that refuses connections produces repeated calls (with err set), +// not one. type HookBrokerConnect interface { // OnBrokerConnect is passed the broker metadata, how long it took to // dial and initialize the connection (issue ApiVersions and run through @@ -176,7 +179,7 @@ type HookBrokerE2E interface { type HookBrokerThrottle interface { // OnBrokerThrottle is passed the broker metadata, the imposed // throttling interval, and whether the throttle was applied before - // Kafka responded to them request or after. + // Kafka responded to the request or after. // // For Kafka < 2.0, the throttle is applied before issuing a response. // For Kafka >= 2.0, the throttle is applied after issuing a response. @@ -380,8 +383,8 @@ type HookFetchRecordBuffered interface { // HookFetchRecordUnbuffered is called when a fetched record is unbuffered. // -// A record can be internally discarded after being in some scenarios without -// being polled, such as when the internal assignment changes. +// A record can be internally discarded in some scenarios without being +// polled, such as when the internal assignment changes. // // As an example, if using HookFetchRecordBuffered for a gauge of how many // record bytes are buffered ready to be polled, this hook can be used to @@ -392,6 +395,11 @@ type HookFetchRecordUnbuffered interface { // OnFetchRecordUnbuffered is passed a record that is being // "unbuffered" within the client, and whether the record is being // returned from polling. + // + // For polled records, this fires on the polling goroutine before the + // poll returns. For records discarded internally (an assignment + // invalidation dropping a buffered fetch), this fires asynchronously + // on a separate goroutine. OnFetchRecordUnbuffered(r *Record, polled bool) } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/internal/sticky/graph.go b/vendor/github.com/twmb/franz-go/pkg/kgo/internal/sticky/graph.go index d6bbb587ed2..947b55d57d6 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/internal/sticky/graph.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/internal/sticky/graph.go @@ -42,9 +42,10 @@ func (b *balancer) newGraph( for memberNum := range b.plan { out := outBufs[:0:len(topicPotentials)] outBufs = outBufs[len(topicPotentials):] - // In the worst case, if every node is linked to each other, - // each node will have nparts edges. We preallocate the worst - // case. It is common for the graph to be highly connected. + // Out edges are per topic, not per partition: in the worst + // case a member subscribes to every topic, so we preallocate + // one topic slot per member. The partition edges themselves + // are enumerated from topicInfos during findSteal. g.out[memberNum] = out } for topicNum, potentials := range topicPotentials { diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/internal/sticky/sticky.go b/vendor/github.com/twmb/franz-go/pkg/kgo/internal/sticky/sticky.go index 06ac816937a..351636005fb 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/internal/sticky/sticky.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/internal/sticky/sticky.go @@ -17,7 +17,8 @@ import ( // bug. The second version introduced generations with the default generation // from the first generation's consumers defaulting to -1. -// We can support up to 65533 members; two slots are reserved. +// We can support up to 65533 members; the unassignedPart sentinel and one +// spare slot are reserved. // We can support up to 2,147,483,647 partitions. // I expect a server to fall over before reaching either of these numbers. @@ -246,7 +247,10 @@ func (b *balancer) partNumByTopic(topic string, partition int32) (int32, bool) { return 0, false } topicInfo := b.topicInfos[topicNum] - if partition >= topicInfo.partitions { + // Claimed partitions are arbitrary input from other group members; a + // negative partition would index our flat partition state at a + // negative offset (or alias into the preceding topic's range). + if partition < 0 || partition >= topicInfo.partitions { return 0, false } return topicInfo.partNum + partition, true @@ -671,22 +675,36 @@ func (b *balancer) tryRestickyStales( } } if !canTake { - return + continue } - // The part cannot be unassigned here; a stale member - // would just have it. The part also cannot be deleted; - // if it is, there are no potential consumers and the - // logic above continues before getting here. The part - // must be on a different owner (cannot be lastOwner), - // otherwise it would not be a lastOwner in the stales - // map; it would just be the current owner. + // The part cannot be deleted; if it is, there are no + // potential consumers and canTake is false above. The part + // CAN be unassigned: the member that won the claim (the + // higher generation) may have dropped its subscription to + // the topic, in which case our caller un-mapped the + // partition from the winner's plan and left it unassigned. + // We give the partition straight back to the stale member. currentOwner := partitionConsumers[staleNum].memberNum + if currentOwner == unassignedPart { + b.plan[lastOwnerNum].add(staleNum) + partitionConsumers[staleNum] = partitionConsumer{lastOwnerNum, lastOwnerNum} + continue + } lastOwnerPartitions := &b.plan[lastOwnerNum] currentOwnerPartitions := &b.plan[currentOwner] if len(*lastOwnerPartitions)+1 < len(*currentOwnerPartitions) { currentOwnerPartitions.remove(staleNum) lastOwnerPartitions.add(staleNum) + // partitionConsumers seeds the steal graph's edge + // ownership (cxns) on the complex path. If we move the + // partition in the plan but not here, a later steal of + // this partition resolves to the old owner and remove() + // runs against a plan that does not contain the + // partition -- which swap-removes an unrelated + // partition: the final plan then has this partition on + // two members and the wrongly removed one on none. + partitionConsumers[staleNum] = partitionConsumer{lastOwnerNum, lastOwnerNum} } } } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/logger.go b/vendor/github.com/twmb/franz-go/pkg/kgo/logger.go index b9f1cd2465f..8d8fa61c8c0 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/logger.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/logger.go @@ -125,16 +125,14 @@ func (w *wrappedLogger) Log(level LogLevel, msg string, keyvals ...any) { w.inner.Log(level, msg, keyvals...) } -// LoggerFn returns an anonymous function that can be used in other packages -// that support their own anonymous logger functions. +// The following is a small helper you can copy into your own code to bridge a +// kgo.Logger to packages that accept an anonymous logger function of the form +// func(int8, string, ...any) - notably the sister 'sr' and 'kfake' packages, +// which are initialized with a 'LogFn' option. It is intentionally not +// exported (it would force a dependency edge); copy it where you need it: // -// Notably, this was added so that you can easily use a kgo.Logger in the -// sister 'sr' and 'kfake' packages. Both clients can be initialized with a -// 'LogFn' option. This function makes it easy to use the same kgo.Logger -// across the other packages. -// -// func LoggerFn(l Logger) func(int8, string, ...any) { +// func loggerFn(l kgo.Logger) func(int8, string, ...any) { // return func(lvl int8, msg string, keyvals ...any) { -// l.Log(LogLevel(lvl), msg, keyvals...) +// l.Log(kgo.LogLevel(lvl), msg, keyvals...) // } // } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/metadata.go b/vendor/github.com/twmb/franz-go/pkg/kgo/metadata.go index c5615c1ff72..4acd4eb2c58 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/metadata.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/metadata.go @@ -781,6 +781,12 @@ func (cl *Client) mergeTopicPartitions( ) { isProduce := kind == partitionKindProduce isShare := kind == partitionKindShare + // The logger is an interface, so the variadic slice and the interface + // boxes for every argument are built at the call site even when the + // logger drops the line. The logs below fire once per partition per + // metadata refresh, so for a client with many partitions that is + // continuous garbage forever; we only pay it if debug is on. + debug := cl.cfg.logger.Level() >= LogLevelDebug lv := *l.load() // copy so our field writes do not collide with reads r := mt.newPartitions(cl, kind) @@ -835,8 +841,11 @@ func (cl *Client) mergeTopicPartitions( // // 2) a topic was deleted and recreated with fewer partitions // - // Both of these scenarios should be rare to non-existent, and we do - // nothing if we encounter them. + // Case 1 is temporary and heals on a later refresh; case 2 is + // permanent. Below, we keep the missing partition around either way. + // For producers we bump its load error, which fails buffered records + // only once the unknown fail limit trips (so case 1 does not fail + // records); consumers keep consuming through the existing cursor. // Migrating topicPartitions is a little tricky because we have to // worry about underlying pointers that may currently be loaded. @@ -851,9 +860,11 @@ func (cl *Client) mergeTopicPartitions( // consuming, the partition is part of a group or part // of what was loaded for direct consuming. // - // We only clear a partition if it is purged from the - // client (which can happen automatically for consumers - // if the user opted into ConsumeRecreatedTopics). + // We only clear a partition if the topic is purged from + // the client, either manually via PurgeTopicsFromClient + // or automatically for regex consumers when the topic + // has been missing from metadata for longer than + // ConsiderMissingTopicDeletedAfter. dup := *oldTP newTP := &dup newTP.loadErr = errMissingMetadataPartition @@ -895,11 +906,47 @@ func (cl *Client) mergeTopicPartitions( // fetched from an out of date broker. We just keep the old // information. if newTP.leaderEpoch < oldTP.leaderEpoch { - // If we repeatedly rewind, then perhaps the cluster - // entered some bad state and lost forward progress. - // We will log & allow the rewind to allow the client - // to continue; other requests may encounter fenced - // epoch errors (and respectively recover). + // A negative leader epoch is the "no leader" sentinel + // (Kafka uses -1): the partition is momentarily + // leaderless, e.g. mid-election after every replica + // restarted in a full cluster bounce. This is not a + // genuinely older epoch, so we must not treat it as a + // rewind. If we counted it toward maxEpochRewinds, then + // after enough leaderless refreshes we would fall through + // below and accept -1 as the partition's leader epoch -- + // which is unsafe. A cursor at leader epoch -1 opts out of + // KIP-320 fencing: migrateCursorTo skips + // OffsetForLeaderEpoch validation for a negative new epoch, + // so a genuine log truncation during the leaderless window + // would go undetected (no ErrDataLoss), and the consumer + // would then fetch at a stale offset with currentLeaderEpoch + // -1 (which brokers never fence) and stall at the high + // watermark. Instead we keep our last known real leader and + // epoch and signal a retry; once a real epoch (>= old) + // reappears, normal validation runs and detects any + // truncation. + if newTP.leaderEpoch < 0 { + cl.cfg.logger.Log(LogLevelDebug, "metadata has a leader epoch of -1 (no leader); keeping our last known leader and epoch until a leader is elected", + "topic", topic, + "partition", part, + "old_leader_epoch", oldTP.leaderEpoch, + ) + *newTP = *oldTP + retryWhy.add(topic, int32(part), errNoLeaderEpoch) + continue + } + + // Otherwise newTP.leaderEpoch is a real (>= 0) epoch that + // is merely lower than ours. That can be the current + // reality: issue #119 saw an unclean leader election + // briefly surface a higher epoch from a broker that then + // died, leaving the surviving cluster on a real, lower + // epoch. Permanently refusing it stranded the client in an + // unrecoverable metadata loop, so if we repeatedly rewind we + // accept it to allow the client to continue. Unlike the -1 + // sentinel handled above, a real lower epoch self-corrects + // downstream: consume sees FENCED_LEADER_EPOCH (and reports + // data loss) and produce sees NOT_LEADER_FOR_PARTITION. // // Five is a pretty low amount of retries, but since // we iterate through known brokers, this basically @@ -955,12 +1002,14 @@ func (cl *Client) mergeTopicPartitions( // If the tp data equals the old, then the sink / source is the // same, because the sink/source is from the tp leader. if newTP.topicPartitionData == oldTP.topicPartitionData { - cl.cfg.logger.Log(LogLevelDebug, "metadata refresh has identical topic partition data", - "topic", topic, - "partition", part, - "leader", newTP.leader, - "leader_epoch", newTP.leaderEpoch, - ) + if debug { + cl.cfg.logger.Log(LogLevelDebug, "metadata refresh has identical topic partition data", + "topic", topic, + "partition", part, + "leader", newTP.leader, + "leader_epoch", newTP.leaderEpoch, + ) + } switch kind { case partitionKindProduce: newTP.records = oldTP.records @@ -971,14 +1020,16 @@ func (cl *Client) mergeTopicPartitions( newTP.cursor = oldTP.cursor // unlike records, there is no failing state for a cursor } } else { - cl.cfg.logger.Log(LogLevelDebug, "metadata refresh topic partition data changed", - "topic", topic, - "partition", part, - "new_leader", newTP.leader, - "new_leader_epoch", newTP.leaderEpoch, - "old_leader", oldTP.leader, - "old_leader_epoch", oldTP.leaderEpoch, - ) + if debug { + cl.cfg.logger.Log(LogLevelDebug, "metadata refresh topic partition data changed", + "topic", topic, + "partition", part, + "new_leader", newTP.leader, + "new_leader_epoch", newTP.leaderEpoch, + "old_leader", oldTP.leader, + "old_leader_epoch", oldTP.leaderEpoch, + ) + } switch kind { case partitionKindProduce: oldTP.migrateProductionTo(newTP) // migration clears failing state @@ -1014,32 +1065,38 @@ func (cl *Client) mergeTopicPartitions( case partitionKindProduce: if newTP.records.recBufsIdx == -1 { newTP.records.sink.addRecBuf(newTP.records) - cl.cfg.logger.Log(LogLevelDebug, "metadata refresh new produce partition", - "topic", topic, - "partition", newTP.partition(), - "leader", newTP.leader, - "leader_epoch", newTP.leaderEpoch, - ) + if debug { + cl.cfg.logger.Log(LogLevelDebug, "metadata refresh new produce partition", + "topic", topic, + "partition", newTP.partition(), + "leader", newTP.leader, + "leader_epoch", newTP.leaderEpoch, + ) + } } case partitionKindShare: if newTP.shareCursor.cursorsIdx == -1 { newTP.shareCursor.source.Load().addShareCursor(newTP.shareCursor) - cl.cfg.logger.Log(LogLevelDebug, "metadata refresh new share consume partition", - "topic", topic, - "partition", newTP.partition(), - "leader", newTP.leader, - "leader_epoch", newTP.leaderEpoch, - ) + if debug { + cl.cfg.logger.Log(LogLevelDebug, "metadata refresh new share consume partition", + "topic", topic, + "partition", newTP.partition(), + "leader", newTP.leader, + "leader_epoch", newTP.leaderEpoch, + ) + } } default: if newTP.cursor.cursorsIdx == -1 { newTP.cursor.source.addCursor(newTP.cursor) - cl.cfg.logger.Log(LogLevelDebug, "metadata refresh new consume partition", - "topic", topic, - "partition", newTP.partition(), - "leader", newTP.leader, - "leader_epoch", newTP.leaderEpoch, - ) + if debug { + cl.cfg.logger.Log(LogLevelDebug, "metadata refresh new consume partition", + "topic", topic, + "partition", newTP.partition(), + "leader", newTP.leader, + "leader_epoch", newTP.leaderEpoch, + ) + } } } } @@ -1048,6 +1105,7 @@ func (cl *Client) mergeTopicPartitions( var ( errEpochRewind = errors.New("epoch rewind") errMissingTopicID = errors.New("missing topic ID") + errNoLeaderEpoch = errors.New("no leader epoch") ) type multiUpdateWhy map[kerrOrString]map[string]map[int32]struct{} diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/metrics_714.go b/vendor/github.com/twmb/franz-go/pkg/kgo/metrics_714.go index 927f0f9fdbe..7d7220b977f 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/metrics_714.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/metrics_714.go @@ -29,6 +29,8 @@ func (cl *Client) pushMetrics() { select { case <-cl.ctx.Done(): return + case <-m.quitting: + return case <-m.firstObserve: } @@ -58,6 +60,9 @@ func (cl *Client) pushMetrics() { case <-cl.ctx.Done(): after.Stop() return + case <-m.quitting: + after.Stop() + return case <-after.C: } continue @@ -65,6 +70,21 @@ func (cl *Client) pushMetrics() { clientInstanceID = gresp.ClientInstanceID + // A broker must advertise a positive push interval; a <=0 value is + // invalid. We substitute Kafka's documented default rather than honor + // it, matching the Java client's validateIntervalMs. Without this, the + // no-requested-metrics arm below times on the raw interval (no floor, + // unlike the push loop's max(..., time.Second)), so a broker returning + // an empty RequestedMetrics list with a non-positive interval would + // re-issue GetTelemetrySubscriptions at round-trip pace forever. + if v := validatePushIntervalMillis(gresp.PushIntervalMillis); v != gresp.PushIntervalMillis { + cl.cfg.logger.Log(LogLevelWarn, "broker advertised a non-positive telemetry push interval, substituting the default", + "advertised", gresp.PushIntervalMillis, + "substituted", v, + ) + gresp.PushIntervalMillis = v + } + // If there are no requested metrics, we wait the push interval // and re-get. if len(gresp.RequestedMetrics) == 0 { @@ -74,6 +94,10 @@ func (cl *Client) pushMetrics() { select { case <-cl.ctx.Done(): terminating = true + after.Stop() + case <-m.quitting: + terminating = true + after.Stop() case <-after.C: } continue @@ -120,12 +144,24 @@ func (cl *Client) pushMetrics() { } // Wait until our push interval; if the client is quitting, - // we immediately send a push with Terminating=true. + // we immediately send a push with Terminating=true. The + // quitting signal fires during Close BEFORE the client + // context is canceled - once cl.ctx is dead, the request + // path aborts everything and the push could not be + // delivered. This assigns the outer terminating so that + // after the terminating push is handled, both loops exit + // and our deferred ctxCancel releases Close's bounded + // wait; a shadowing variable here would re-enter the loop + // and send a second terminating push (which brokers + // reject). after := time.NewTimer(wait) - var terminating bool select { case <-cl.ctx.Done(): terminating = true + after.Stop() + case <-m.quitting: + terminating = true + after.Stop() case <-after.C: } @@ -199,6 +235,22 @@ func (cl *Client) pushMetrics() { } } +// defaultPushIntervalMillis is Kafka's documented telemetry push interval +// default (5m), substituted when a broker advertises a non-positive interval +// (Java's ClientTelemetryReporter.DEFAULT_PUSH_INTERVAL_MS). +const defaultPushIntervalMillis = 5 * 60 * 1000 + +// validatePushIntervalMillis returns the broker-advertised telemetry push +// interval, substituting the default for a non-positive (invalid) value so the +// re-get / push loops always pace on a sane interval. Mirrors the Java client's +// ClientTelemetryUtils.validateIntervalMs. +func validatePushIntervalMillis(advertised int32) int32 { + if advertised <= 0 { + return defaultPushIntervalMillis + } + return advertised +} + func buildNameFilter(requested []string) func(string) bool { if len(requested) == 0 { return func(string) bool { return false } @@ -289,16 +341,17 @@ type ( // metricRate is a count per second and a total. metricRate struct { - count atomic.Int64 // Sum of events this period; rate == float64(count/time) at rollup + count atomic.Int64 // Events this period; rate == count/elapsed-seconds at rollup. tot atomic.Int64 // Total events over all time. lastTot int64 // Updated when encoding; the last value for tot in case broker requests DELTA. } - // metricTime reports average latency, max latency, and total latency. - // The unit is in milliseconds. + // metricTime reports average latency and max latency. The unit is in + // milliseconds. metricTime struct { - sum atomic.Int64 // With separate aggDur field, avg = sum/aggDur at rollup. - max atomic.Int64 // Max latency seen during this window. + sum atomic.Int64 // Sum of all observations this period; avg = sum/count at rollup. + count atomic.Int64 // Number of observations this period; the avg denominator. + max atomic.Int64 // Max latency seen during this window. } // We skip: @@ -331,6 +384,12 @@ type ( firstObserve chan struct{} + // quitting is closed by Close before the client context is + // canceled, asking pushMetrics to send its final terminating + // push while requests can still complete. + quitting chan struct{} + closedQuitting atomic.Bool + ctx context.Context ctxCancel func() } @@ -340,9 +399,18 @@ func (m *metrics) init(cl *Client) { m.cl = cl m.initNano = time.Now().UnixNano() m.firstObserve = make(chan struct{}) + m.quitting = make(chan struct{}) m.ctx, m.ctxCancel = context.WithCancel(context.Background()) // for graceful shutdown } +// quit asks pushMetrics to send its final terminating push and exit; it is +// safe to call multiple times (Close can run more than once). +func (m *metrics) quit() { + if !m.closedQuitting.Swap(true) { + close(m.quitting) + } +} + func safeDiv[T ~int64 | ~float64](num, denom T) T { if denom == 0 { return 0 @@ -357,13 +425,17 @@ func (t *metricRate) observe() { t.tot.Add(1) } -func (t *metricRate) rollNums() (rate float64, tot, lastTot int64) { +func (t *metricRate) rollNums(aggDur time.Duration) (rate float64, tot, lastTot int64) { count := t.count.Swap(0) lastTot = t.lastTot tot = t.tot.Load() t.lastTot = tot - rate = safeDiv(float64(count), float64(tot-lastTot)) + // A rate is events-per-second over the aggregation window, matching + // Kafka's Rate stat (value / elapsed-time). The previous divisor was + // tot-lastTot, which equals count by construction (observe increments + // both count and tot), so the rate was a constant ~1.0. + rate = safeDiv(float64(count), aggDur.Seconds()) return rate, tot, lastTot } @@ -371,6 +443,7 @@ func (t *metricRate) rollNums() (rate float64, tot, lastTot int64) { // triggerFirstObserve is always called. func (t *metricTime) observe(millis int64) { t.sum.Add(millis) + t.count.Add(1) for { max := t.max.Load() if millis < max { @@ -382,10 +455,14 @@ func (t *metricTime) observe(millis int64) { } } -func (t *metricTime) rollNums(aggDur time.Duration) (avg float64, max int64) { +func (t *metricTime) rollNums() (avg float64, max int64) { sum := t.sum.Swap(0) + count := t.count.Swap(0) max = t.max.Swap(0) - avg = safeDiv(float64(sum), float64(aggDur.Milliseconds())) + // An avg is the mean observation, matching Kafka's Avg stat + // (total / count). The previous divisor was the aggregation window + // duration in millis, which is not the number of observations. + avg = safeDiv(float64(sum), float64(count)) return avg, max } @@ -512,6 +589,7 @@ func (m *metrics) appendTo(b []byte, useDeltaSums bool, maxBytes int32, allowedN timeNano: nowNano, }, aggregationTemporality: otelTempDelta, + isMonotonic: true, }, }) } else { @@ -525,6 +603,7 @@ func (m *metrics) appendTo(b []byte, useDeltaSums bool, maxBytes int32, allowedN timeNano: nowNano, }, aggregationTemporality: otelTempCumulative, + isMonotonic: true, }, }) } @@ -548,18 +627,18 @@ func (m *metrics) appendTo(b []byte, useDeltaSums bool, maxBytes int32, allowedN } { switch t := s.v.(type) { case *metricRate: - rate, tot, lastTot := t.rollNums() + rate, tot, lastTot := t.rollNums(aggDur) appendGauge(s.name+".rate", 0, rate, nil) appendSum(s.name+".total", tot, lastTot, nil) case *metricTime: - avg, max := t.rollNums(aggDur) + avg, max := t.rollNums() appendGauge(s.name+".avg", 0, avg, nil) appendGauge(s.name+".max", max, 0, nil) case *map[int32]*metricTime: for broker, m := range *t { - avg, max := m.rollNums(aggDur) + avg, max := m.rollNums() attrs := map[string]any{"node_id": broker} appendGauge(s.name+".avg", 0, avg, attrs) appendGauge(s.name+".max", max, 0, attrs) @@ -897,18 +976,13 @@ func (d *otelNumDataPoint) appendTo(b []byte) []byte { } func appendOtelAttributesTo(b []byte, fieldNumber int, attrs map[string]any) []byte { -outer: for key, value := range attrs { - b = appendProtoTag(b, fieldNumber, protoTypeLength) - - kvBytes := []byte{} - // Field 1: key (string) - kvBytes = appendProtoTag(kvBytes, 1, protoTypeLength) - kvBytes = appendProtoString(kvBytes, key) - - // Field 2: value (AnyValue) - kvBytes = appendProtoTag(kvBytes, 2, protoTypeLength) - + // We must determine that the value is serializable BEFORE we + // write anything to b: an unsupported type continues the loop, + // and if we had already appended the field tag we would leave a + // dangling tag with no length+payload, corrupting the whole + // protobuf (the documented Attrs contract is to silently skip + // unsupported types). var anyValueBytes []byte switch t := value.(type) { case *string, string: @@ -973,9 +1047,18 @@ outer: anyValueBytes = binary.AppendUvarint(anyValueBytes, uint64(len(t))) anyValueBytes = append(anyValueBytes, t...) default: - continue outer + continue } + b = appendProtoTag(b, fieldNumber, protoTypeLength) + + kvBytes := []byte{} + // Field 1: key (string) + kvBytes = appendProtoTag(kvBytes, 1, protoTypeLength) + kvBytes = appendProtoString(kvBytes, key) + + // Field 2: value (AnyValue) + kvBytes = appendProtoTag(kvBytes, 2, protoTypeLength) kvBytes = binary.AppendUvarint(kvBytes, uint64(len(anyValueBytes))) kvBytes = append(kvBytes, anyValueBytes...) diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/partitioner.go b/vendor/github.com/twmb/franz-go/pkg/kgo/partitioner.go index 46e7d11d124..da463b378e2 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/partitioner.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/partitioner.go @@ -15,8 +15,8 @@ import ( // from producing through partitioning, so you can set fields in the record // struct before producing to aid in partitioning with a custom partitioner. type Partitioner interface { - // forTopic returns a partitioner for an individual topic. It is - // guaranteed that only one record will use the an individual topic's + // ForTopic returns a partitioner for an individual topic. It is + // guaranteed that only one record will use an individual topic's // topicPartitioner at a time, meaning partitioning within a topic does // not require locks. ForTopic(string) TopicPartitioner @@ -229,7 +229,7 @@ func (p *leastBackupTopicPartitioner) PartitionByBackup(_ *Record, n int, backup leastBackup = backup p.onPart = pick npicked = 1 - } else { + } else if backup == leastBackup { npicked++ // reservoir sampling with k = 1 if p.rng.Intn(npicked) == 0 { p.onPart = pick @@ -245,11 +245,11 @@ func (p *leastBackupTopicPartitioner) PartitionByBackup(_ *Record, n int, backup /////////////////// // UniformBytesPartitioner is a redux of the StickyPartitioner, proposed in -// KIP-794 and release with the Java client in Kafka 3.3. This partitioner +// KIP-794 and released with the Java client in Kafka 3.3. This partitioner // returns the same partition until 'bytes' is hit. At that point, a // re-partitioning happens. If adaptive is false, this chooses a new random -// partition, otherwise this chooses a broker based on the inverse of the -// backlog currently buffered for that broker. If keys is true, this uses +// partition, otherwise this chooses a partition based on the inverse of the +// backlog currently buffered for that partition. If keys is true, this uses // standard hashing based on record key for records with non-nil keys. hasher // is optional; if nil, the default hasher murmur2 (Kafka's default). // @@ -355,8 +355,8 @@ func (p *uniformBytesTopicPartitioner) PartitionByBackup(r *Record, n int, backu } else { p.calc = p.calc[:0] - // For adaptive, the logic is that we pick by broker according - // to the inverse of the queue size. Presumably this means + // For adaptive, the logic is that we pick a partition according + // to the inverse of its queue size. Presumably this means // bytes, but we use records for simplicity. // // We calculate 1/recs for all brokers and choose the first one @@ -382,14 +382,28 @@ func (p *uniformBytesTopicPartitioner) PartitionByBackup(r *Record, n int, backu } r := p.rng.Float64() pick := r * t + // The loop below selects nothing in two cases: floating rounding + // can leave pick just above 0 after subtracting every weight (the + // guarded case the original code handled), and we may have entered + // this re-pick with a stale p.onPart that is not the -1 byte-reset + // sentinel but rather a previously-pinned index that is now >= n + // because the writable partition count shrank under us (e.g. a + // leader election dropped partitions from writablePartitions). In + // both cases p.onPart is unchanged by the loop, so we must fall + // back to a valid index rather than return the stale value, which + // the caller would reject as an out-of-range partitioning choice + // (failing the record). The non-adaptive branch above re-picks + // unconditionally via Intn(n) and so has never had this hole. + picked := false for _, c := range p.calc { pick -= c.f if pick <= 0 { p.onPart = c.n + picked = true break } } - if p.onPart == -1 { + if !picked { p.onPart = p.calc[len(p.calc)-1].n } } @@ -475,7 +489,7 @@ type PartitionerHasher func([]byte, int) int // KafkaHasher returns a PartitionerHasher using hashFn that mirrors how Kafka // partitions after hashing data. In Kafka, after hashing into a uint32, the // hash is converted to an int32 and the high bit is stripped. Kafka by default -// uses murmur2 hashing, and the StickyKeyPartiitoner uses this by default. +// uses murmur2 hashing, and the StickyKeyPartitioner uses this by default. // Using this KafkaHasher function is only necessary if you want to change the // underlying hashing algorithm. func KafkaHasher(hashFn func([]byte) uint32) PartitionerHasher { @@ -497,8 +511,25 @@ func KafkaHasher(hashFn func([]byte) uint32) PartitionerHasher { // In particular, using this function with a crc32.ChecksumIEEE hasher makes // this partitioner match librdkafka's consistent partitioner, or the // zendesk/ruby-kafka partitioner. +// +// Note that the arithmetic depends on Go's int width: on 32-bit platforms, +// hashes with the high bit set choose a different partition than on 64-bit +// platforms (only the 64-bit behavior matches librdkafka). This is +// deliberately left alone: the function exists to preserve a historical +// placement, and changing either platform's placement would remap keys for +// deployments relying on it. func SaramaHasher(hashFn func([]byte) uint32) PartitionerHasher { return func(key []byte, n int) int { + // The int conversion makes this arithmetic int-width + // dependent: on 64-bit platforms int(uint32) is always + // non-negative (the negation below is dead and the result + // matches librdkafka's unsigned modulo), while on 32-bit + // platforms a hash with the high bit set wraps negative and + // is negated, choosing a different partition. This stays + // as-is deliberately: this function's entire purpose is + // preserving a historical placement (see the doc above), and + // existing deployments on either width depend on the + // placement they have been writing with. p := int(hashFn(key)) % n if p < 0 { p = -p diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/pools.go b/vendor/github.com/twmb/franz-go/pkg/kgo/pools.go index f4449c3db45..6db6d285f0f 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/pools.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/pools.go @@ -11,7 +11,7 @@ import ( //////////////////////////////////////////////////////////////// // NOTE: // -// NOTE: Make sure new hooks are checked in implementsAnyPool // +// NOTE: Make sure new pools are checked in implementsAnyPool // // NOTE: // //////////////////////////////////////////////////////////////// @@ -42,7 +42,9 @@ func (ps pools) each(fn func(Pool) bool) { type PoolDecompressBytes interface { // GetDecompressBytes returns a slice to decompress into. This // interface is given the compressed data and the codec that will be - // used for decompressing. + // used for decompressing. Only the returned slice's capacity is used; + // data is written starting at index 0 regardless of the slice's + // length. // // For many decompression algorithms, it is not possible to accurately // know the size that data will be once decompressed. You can guess a @@ -69,7 +71,9 @@ type PoolDecompressBytes interface { type PoolKRecords interface { // GetKRecords returns a slice with capacity n. GetKRecords(n int) []kmsg.Record - // PutKRecords puts a slice back into the pool. + // PutKRecords puts a slice back into the pool. Every record is + // zeroed, save for its Headers slice: the decoder reuses that + // slice's capacity on the next get. PutKRecords([]kmsg.Record) } @@ -143,6 +147,13 @@ func (r *Record) Recycle() { return } + ps.release() +} + +// release zeroes and puts the pooled slices back. Called by a batch's last +// Recycle, or directly by the fetch processor when a batch kept no records +// (so no Recycle will ever run). +func (ps *recordPools) release() { // Reset the length of slices to max to ensure we zero things and so // that users can avoid this resetting. ps.decompressBytes = ps.decompressBytes[:cap(ps.decompressBytes)] @@ -192,6 +203,10 @@ func implementsAnyPool(p Pool) bool { return false } +// ensureLen returns s reset to exactly length n, growing it if needed. n +// must be >= 0: a negative n panics on the s[:n] slice expression. Callers +// pass a record count read off the wire, which is rejected for < 0 before +// reaching here (see processRecordBatch's negative-count guard). func ensureLen[S ~[]E, E any](s S, n int) S { s = s[:cap(s)] if len(s) >= n { diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/producer.go b/vendor/github.com/twmb/franz-go/pkg/kgo/producer.go index c4a13618f92..56a5dfe19a0 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/producer.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/producer.go @@ -59,9 +59,34 @@ type producer struct { batchPromises ring[batchPromise] // we never call die() on it - txnMu xsync.Mutex - inTxn bool - tx890p2 atomic.Bool + // onBatchPromiseBroadcast, if non-nil, is invoked from finishPromises + // immediately before the per-batch p.c.Broadcast() fires, with moreQueued + // reporting whether further promise elements are still queued in the ring + // (i.e. the broadcast is firing mid-drain rather than at ring exit). It + // exists purely so tests can observe the broadcast deterministically at + // its source instead of racing a woken goroutine; it is always nil in + // production. + onBatchPromiseBroadcast func(moreQueued bool) + + txnMu xsync.Mutex + inTxn bool + // endUnconfirmed, guarded by txnMu, is set when an attempted EndTxn + // outcome is unconfirmed (transport error, retries exhausted, or + // UNKNOWN_SERVER_ERROR). EndTransaction restores the transaction + // state it consumed so the documented TryAbort retry can heal via + // producer id reload; this flag tells the retry that the reload is + // the abort and no EndTxn should be sent. + endUnconfirmed bool + tx890p2 atomic.Bool + + // producedInTxn is set when a record is buffered within the current + // transaction and reset by BeginTransaction. EndTransaction consults + // it under KIP-890 part 2, where produce requests implicitly add + // partitions broker-side before the data append: a transaction whose + // every produce FAILED still needs an EndTxn abort even though no + // partition was marked addedToTxn client-side (marking happens only + // on produce success). + producedInTxn atomic.Bool } // BufferedProduceRecords returns the number of records currently buffered for @@ -87,6 +112,7 @@ func (cl *Client) BufferedProduceBytes() int64 { // EnsureProduceConnectionIsOpen attempts to open a produce connection to all // specified brokers, or all brokers if `brokers` is empty or contains -1. +// Broker IDs less than -1 are ignored. // // This can be used in an attempt to reduce the latency when producing if your // application produces infrequently: you can force open a produce connection a @@ -127,7 +153,7 @@ func (cl *Client) EnsureProduceConnectionIsOpen(ctx context.Context, brokers ... } cl.brokersMu.RUnlock() } else { - for _, b := range brokers { + for _, b := range keep { wg.Add(1) go func() { defer wg.Done() @@ -211,6 +237,20 @@ func (p *producer) purgeTopics(topics []string) { p.topicsMu.Lock() defer p.topicsMu.Unlock() + // We sweep unknown-topic waiters AND store the cleaned topics map + // while unknownTopicsMu is held. The store must not happen after the + // mu is released: partitionsForTopicProduce re-checks the topic's + // presence in p.topics under this mu before (re)creating an + // unknown-topic waiter, so holding the mu across both steps means a + // concurrent produce either sees the topic still present - and its + // just-added waiter is then swept by us - or sees it gone and + // re-registers the topic properly. If we instead released the mu + // between the sweep and the store (old behavior), a produce could + // land in that window: it saw the topic in p.topics, re-created a + // waiter, and we then removed the topic from the map - orphaning the + // waiter, which no metadata update would ever notify (the request set + // is built from p.topics), silently hanging the record forever. This + // mirrors storePartitionsUpdate's store-before-unlock requirement. p.unknownTopicsMu.Lock() for _, topic := range topics { if unknown, exists := p.unknownTopics[topic]; exists { @@ -222,17 +262,20 @@ func (p *producer) purgeTopics(topics []string) { }) } } - p.unknownTopicsMu.Unlock() - toStore := p.topics.clone() - defer p.topics.storeData(toStore) - + var purged []*topicPartitionsData for _, topic := range topics { d := toStore.loadTopic(topic) if d == nil { continue } delete(toStore, topic) + purged = append(purged, d) + } + p.topics.storeData(toStore) + p.unknownTopicsMu.Unlock() + + for _, d := range purged { for _, p := range d.partitions { r := p.records @@ -296,7 +339,7 @@ func (rs ProduceResults) FirstErr() error { return nil } -// First the first record and error in the produce results. +// First returns the first record and error in the produce results. // // This function is useful if you only passed one record to ProduceSync. func (rs ProduceResults) First() (*Record, error) { @@ -476,16 +519,26 @@ func (cl *Client) TryProduce( // Kafka replies. For a synchronous produce, see ProduceSync. Records are // produced in order per partition if the record is produced successfully. // Successfully produced records will have their attributes, offset, and -// partition set before the promise is called. All promises are called serially -// (and should be relatively fast). If a record's timestamp is unset, this -// sets the timestamp to time.Now. +// partition set before the promise is called. All promises are called +// serially, so they should be relatively fast and must not block: a promise +// that blocks on the client itself -- for example, a blocking Produce while +// the client is at its max-buffered limits, or a Flush -- waits on progress +// that only later promises can deliver and can deadlock the client. To +// produce from within a promise, spawn a goroutine (as +// AbortingFirstErrPromise does for aborting): a goroutine'd produce that +// blocks simply waits for the promise worker to make space. A direct +// TryProduce inside a promise is safe only while promise delivery is keeping +// up; if the record fails before buffering while the client is saturated +// with an extreme backlog of failing records, delivering that failure blocks +// the promise worker on itself. If a record's timestamp is unset, this sets +// the timestamp to time.Now. // // If the topic field is empty, the client will use the DefaultProduceTopic; if // that is also empty, the record is failed immediately. If the record is too // large to fit in a batch on its own in a produce request, the record will be -// failed with immediately kerr.MessageTooLarge. +// failed immediately with kerr.MessageTooLarge. // -// If the client is configured to automatically flush the client currently has +// If the client is configured to automatically flush and the client currently has // the configured maximum amount of records buffered, Produce will block. The // context can be used to cancel waiting while records flush to make space. In // contrast, if manual flushing is configured, the record will be failed @@ -625,6 +678,18 @@ func (cl *Client) produce( }() <-wait // we wait for the goroutine to exit, then unlock again (since the goroutine leaves the mutex locked) p.mu.Unlock() + // The goroutine above decremented p.blocked, but this is the + // cancel path: the record is failed, not buffered, so there is + // no compensating bufferedRecords++ (the success path below + // has one, keeping the sum unchanged). The bufferedRecords + + // blocked sum that Flush waits on therefore just dropped, and + // the only broadcast on this path - the one that woke the + // goroutine above - fired BEFORE its decrement, so a Flush that + // re-checked its predicate in between observed the stale + // pre-decrement sum and went back to waiting. Broadcast now, + // after the decrement is visible, so a Flush whose sum reached + // zero is woken; without this it can hang forever. + p.c.Broadcast() p.promiseRecordBeforeBuf(promisedRec{ctx, promise, r}, err) } @@ -645,6 +710,16 @@ func (cl *Client) produce( p.bufferedBytes += userSize p.mu.Unlock() + // Set at buffer time, before any produce reaches the broker, so this can + // over-set: a record counted here may still be failed locally (client + // close, unknown-topic timeout) before it is ever sent. The only + // consequence is an unnecessary EndTxn abort, which is always legal under + // KIP-890p2 -- an empty abort succeeds, bumps the epoch, and has nothing to + // commit. See the producedInTxn field doc and EndTransaction. + if cl.cfg.txnID != nil && !p.producedInTxn.Load() { + p.producedInTxn.Store(true) + } + cl.loadPartsAndPartition(promisedRec{ctx, promise, r}) } @@ -658,8 +733,18 @@ type batchPromise struct { err error } +// promiseBatch finishes a batch of records. This never parks on the ring's +// maxLen: every caller either carries records already admitted under the +// max-buffered accounting (sink responses, fail/purge paths) or holds a +// client lock (purgeTopics and failBufferedRecords under topicsMu and +// unknownTopicsMu, storePartitionsUpdate under unknownTopicsMu, recBuf +// failure paths under recBuf.mu). A parked lock-holder can deadlock: the +// promise worker is the only goroutine that frees ring space, and a user +// promise may re-enter the client (TryProduce) and need the very lock the +// parked pusher holds, so the worker would wait on the lock while the lock +// holder waits on the worker. func (p *producer) promiseBatch(b batchPromise) { - if first, _ := p.batchPromises.push(b); first { + if first, _ := p.batchPromises.pushForce(b); first { go p.finishPromises(b) } } @@ -668,32 +753,54 @@ func (p *producer) promiseRecord(pr promisedRec, err error) { p.promiseBatch(batchPromise{recs: []promisedRec{pr}, err: err}) } +// promiseRecordBeforeBuf finishes a record that failed before it was ever +// buffered (and before it counted toward bufferedRecords). Only this entry +// applies the ring's maxLen backpressure: pre-buffer failures are the one +// promise source not bounded by the max-buffered admission, so a spin loop +// of failing produces - blocking Produce or TryProduce alike - could +// otherwise grow the ring without bound (#1194). Parking here is the +// deliberate trade: every accepted record costs memory until its promise +// runs and the promise is the only completion channel, so a caller outpacing +// the promise worker must be blocked, not absorbed. The one caller that can +// never park is the promise worker itself (a promise calling TryProduce with +// a record that fails pre-buffer); produce-from-promise is documented to +// spawn a goroutine, whose park is safe: the worker keeps draining and the +// goroutine proceeds when space frees. func (p *producer) promiseRecordBeforeBuf(pr promisedRec, err error) { - p.promiseBatch(batchPromise{recs: []promisedRec{pr}, beforeBuf: true, err: err}) + b := batchPromise{recs: []promisedRec{pr}, beforeBuf: true, err: err} + if first, _ := p.batchPromises.push(b); first { + go p.finishPromises(b) + } } func (p *producer) finishPromises(b batchPromise) { cl := p.cl var more bool var broadcast bool - defer func() { - if broadcast { - p.c.Broadcast() - } - }() start: for i, pr := range b.recs { pr.LeaderEpoch = -1 - if b.baseOffset == -1 { - // if the base offset is invalid/unknown (-1), all record offsets should - // be treated as unknown + if b.err != nil { + // Failed records carry unknown-sentinels, not the + // batchPromise zero values: without this, a failed + // record's offset was its index within the failed + // batch and its producer id/epoch were 0 - + // plausible-looking garbage. pr.Offset = -1 + pr.ProducerID = -1 + pr.ProducerEpoch = -1 } else { - pr.Offset = b.baseOffset + int64(i) + if b.baseOffset == -1 { + // if the base offset is invalid/unknown (-1), all record offsets should + // be treated as unknown + pr.Offset = -1 + } else { + pr.Offset = b.baseOffset + int64(i) + } + pr.ProducerID = b.pid + pr.ProducerEpoch = b.epoch + pr.Attrs = b.attrs } - pr.ProducerID = b.pid - pr.ProducerEpoch = b.epoch - pr.Attrs = b.attrs recBroadcast := cl.finishRecordPromise(pr, b.err, b.beforeBuf) broadcast = broadcast || recBroadcast } @@ -702,6 +809,28 @@ start: cl.prsPool.put(b.recs) } + // We broadcast per batch, not per record (waking blocked producers on + // every record forces tiny one-record batches; see ead18d3c) - but + // also not once per ring drain: while pre-buffer failure promises keep + // arriving from other goroutines, this loop never observes an empty + // ring and never exits, and a deferred-to-exit broadcast would starve + // a Flush whose condition (bufferedRecords == 0) became true mid-drain + // and blocked Produce calls whose space opened. + if broadcast { + if p.onBatchPromiseBroadcast != nil { + // The current (just-processed) element is still in the ring + // here, since dropPeek runs below; l > 1 thus means more + // elements are queued behind it and the broadcast is firing + // mid-drain rather than at ring exit. + p.batchPromises.mu.Lock() + moreQueued := p.batchPromises.l > 1 + p.batchPromises.mu.Unlock() + p.onBatchPromiseBroadcast(moreQueued) + } + p.c.Broadcast() + broadcast = false + } + b, more, _ = p.batchPromises.dropPeek() if more { goto start @@ -767,6 +896,18 @@ func (cl *Client) doPartition(parts *topicPartitions, partsData *topicPartitions mapping := partsData.writablePartitions if parts.partitioner.RequiresConsistency(pr.Record) { mapping = partsData.partitions + } else if len(mapping) == 0 && len(partsData.partitions) > 0 { + // Every partition has a retriable load error, e.g. a rolling + // restart of an RF=1 broker briefly left all partitions + // leaderless. Rather than failing the record up front with + // the synthetic error below, fall back to the full set: the + // record buffers and rides the normal metadata-refresh retry + // path, the same as records on consistency-requiring + // partitioners via the branch above. If the outage outlasts + // the delivery timeout or retry limits, the record fails + // with the partition's actual load error. The Java client + // falls back identically when no partition is available. + mapping = partsData.partitions } if len(mapping) == 0 { cl.producer.promiseRecord(pr, errors.New("unable to partition record due to no usable partitions")) @@ -846,7 +987,7 @@ type producerID struct { var errReloadProducerID = errors.New("producer id needs reloading") -// initProducerID initializes the client's producer ID for idempotent +// producerID returns, loading if necessary, the client's producer ID for idempotent // producing only (no transactions, which are more special). After the first // load, this clears all buffered unknown topics. func (cl *Client) producerID(ctxFn func() context.Context) (int64, int16, error) { @@ -997,7 +1138,21 @@ func (cl *Client) doInitProducerID(ctxFn func() context.Context, lastID int64, l if err != nil { return err } - return nil // resp.ErrorCode handled below + // We return ConcurrentTransactions so that our wrapping + // doWithConcurrentTransactions retries in place: the + // coordinator replies with it while still completing (or + // fence-aborting) a previous transaction for this + // transactional ID. Notably, taking over a crashed + // incarnation's ongoing transaction ALWAYS receives it at + // least once: the broker internally aborts the old + // transaction and tells us to retry. Surfacing the error + // instead would bubble a routine, transient condition up as a + // BeginTransaction failure. All other response error codes + // are classified below. + if err := kerr.ErrorForCode(resp.ErrorCode); errors.Is(err, kerr.ConcurrentTransactions) { + return err + } + return nil }) if err != nil { if errors.Is(err, errUnknownRequestKey) || errors.Is(err, errBrokerTooOld) { @@ -1046,47 +1201,68 @@ func (cl *Client) partitionsForTopicProduce(pr promisedRec) (*topicPartitions, * p := &cl.producer topic := pr.Topic - topics := p.topics.load() - parts, exists := topics[topic] - if exists { - if v := parts.load(); len(v.partitions) > 0 { - return parts, v + for { + topics := p.topics.load() + parts, exists := topics[topic] + if exists { + if v := parts.load(); len(v.partitions) > 0 { + return parts, v + } } - } - - if !exists { // topic did not exist: check again under mu and potentially create it - p.topicsMu.Lock() - defer p.topicsMu.Unlock() - if parts, exists = p.topics.load()[topic]; !exists { // update parts for below - // Before we store the new topic, we lock unknown - // topics to prevent a concurrent metadata update - // seeing our new topic before we are waiting from the - // addUnknownTopicRecord fn. Otherwise, we would wait - // and never be re-notified. - p.unknownTopicsMu.Lock() - defer p.unknownTopicsMu.Unlock() - - p.topics.storeTopics([]string{topic}) - cl.addUnknownTopicRecord(pr) - cl.triggerUpdateMetadataNow("forced load because we are producing to a topic for the first time") - return nil, nil + if !exists { // topic did not exist: check again under mu and potentially create it + p.topicsMu.Lock() + if _, exists = p.topics.load()[topic]; !exists { + // Before we store the new topic, we lock unknown + // topics to prevent a concurrent metadata update + // seeing our new topic before we are waiting from the + // addUnknownTopicRecord fn. Otherwise, we would wait + // and never be re-notified. + p.unknownTopicsMu.Lock() + p.topics.storeTopics([]string{topic}) + cl.addUnknownTopicRecord(pr) + cl.triggerUpdateMetadataNow("forced load because we are producing to a topic for the first time") + p.unknownTopicsMu.Unlock() + p.topicsMu.Unlock() + return nil, nil + } + p.topicsMu.Unlock() } - } - // Here, the topic existed, but maybe has not loaded partitions yet. We - // have to lock unknown topics first to ensure ordering just in case a - // load has not happened. - p.unknownTopicsMu.Lock() - defer p.unknownTopicsMu.Unlock() + // Here, the topic existed, but maybe has not loaded partitions + // yet. We have to lock unknown topics first to ensure ordering + // just in case a load has not happened. + p.unknownTopicsMu.Lock() + + // Re-resolve the topic now that we hold the mu. Both sides of + // the entry's lifecycle change only under unknownTopicsMu: + // storePartitionsUpdate stores loaded partitions before + // releasing it, and purgeTopics stores the topic's removal + // from p.topics before releasing it. Without the re-check we + // could add a waiter for a topic a concurrent purge already + // swept: the purge then removes the topic from p.topics, no + // metadata update ever requests it (the request set is built + // from p.topics), and the waiter - and its records - silently + // hang forever. Re-resolving from the current map (not the + // `parts` pointer loaded above) also covers a purge+recreate + // swapping the topicPartitions object in between. + parts, exists = p.topics.load()[topic] + if !exists { + // Purged between our load and the lock; retry from the + // top, which re-creates the topic properly. + p.unknownTopicsMu.Unlock() + continue + } + if v := parts.load(); len(v.partitions) > 0 { + p.unknownTopicsMu.Unlock() + return parts, v + } + cl.addUnknownTopicRecord(pr) + cl.triggerUpdateMetadata(false, "reload trigger due to produce topic still not known") + p.unknownTopicsMu.Unlock() - if v := parts.load(); len(v.partitions) > 0 { - return parts, v + return nil, nil // our record is buffered waiting for metadata update; nothing to return } - cl.addUnknownTopicRecord(pr) - cl.triggerUpdateMetadata(false, "reload trigger due to produce topic still not known") - - return nil, nil // our record is buffered waiting for metadata update; nothing to return } // addUnknownTopicRecord adds a record to a topic whose partitions are @@ -1107,7 +1283,11 @@ func (cl *Client) addUnknownTopicRecord(pr promisedRec) { } } -// waitUnknownTopic waits for a notification +// waitUnknownTopic waits for the topic to be resolved by a metadata update +// (the wait channel is closed, or receives retryable load errors that count +// toward the retry limits), or for the record/produce contexts, the client, +// the record timeout, or an abort (the fatal channel) to end the wait and +// fail all buffered records. func (cl *Client) waitUnknownTopic( pctx context.Context, // context passed to Produce rctx context.Context, // context on the record itself @@ -1154,7 +1334,11 @@ func (cl *Client) waitUnknownTopic( case err = <-unknown.fatal: case retryableErr, ok := <-unknown.wait: if !ok { - cl.cfg.logger.Log(LogLevelInfo, "done waiting for metadata for new topic", "topic", topic) + // The channel is closed when the topic's partitions + // load, but also when the topic is purged or all + // buffered records are failed; whoever closed it + // already handled the buffered records. + cl.cfg.logger.Log(LogLevelInfo, "done waiting on metadata for new topic", "topic", topic) return // metadata was successful! } cl.cfg.logger.Log(LogLevelInfo, "new topic metadata wait failed, retrying wait", "topic", topic, "err", retryableErr) @@ -1214,7 +1398,7 @@ func (cl *Client) unlingerDueToMaxRecsBuffered() { // If the context finishes (Done), this returns the context's error. // // This function is safe to call multiple times concurrently, and safe to call -// concurrent with Flush. +// concurrent with AbortBufferedRecords. func (cl *Client) Flush(ctx context.Context) error { p := &cl.producer diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/record_and_fetch.go b/vendor/github.com/twmb/franz-go/pkg/kgo/record_and_fetch.go index 2c0275b16d1..a1bb8e485e7 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/record_and_fetch.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/record_and_fetch.go @@ -655,17 +655,28 @@ func (fs Fetches) EachTopic(fn func(FetchTopic)) { return } + // A topic's partitions are led by different brokers, so the same topic + // is spread across multiple Fetch entries (one per broker response); we + // must carry the TopicID across them rather than zeroing it. The broker + // returns the same ID in every fetch response for the topic, so the + // first non-zero copy is authoritative. Without this, EachTopic returns + // a zero TopicID whenever more than one broker replied -- i.e. nearly + // always in a real cluster, yet never in a single-broker test. topics := make(map[string][]FetchPartition) + ids := make(map[string][16]byte) for _, fetch := range fs { for _, topic := range fetch.Topics { topics[topic.Topic] = append(topics[topic.Topic], topic.Partitions...) + if topic.TopicID != ([16]byte{}) { + ids[topic.Topic] = topic.TopicID + } } } for topic, partitions := range topics { fn(FetchTopic{ topic, - [16]byte{}, + ids[topic], partitions, }) } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/record_formatter.go b/vendor/github.com/twmb/franz-go/pkg/kgo/record_formatter.go index 59f9d75d82d..3747dd4dc3a 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/record_formatter.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/record_formatter.go @@ -84,7 +84,7 @@ func (f *RecordFormatter) AppendPartitionRecord(b []byte, p *FetchPartition, r * // %D share group delivery count (0 if not from a share group) // %A share group acquisition deadline (timestamp, 0 if not from a share group) // -// For AppendPartitionRecord, the formatter also undersands the following three +// For AppendPartitionRecord, the formatter also understands the following three // formatting options: // // %[ partition log start offset @@ -238,9 +238,7 @@ func NewRecordFormatter(layout string) (*RecordFormatter, error) { var f RecordFormatter var literal []byte // non-formatted raw text to output - var i int for len(layout) > 0 { - i++ c, size := utf8.DecodeRuneInString(layout) rawc := layout[:size] layout = layout[size:] @@ -777,7 +775,7 @@ func parseUnpack(layout string) (func([]byte, []byte) []byte, error) { islittle := little fns = append(fns, func(dst, src []byte) ([]byte, int) { if len(src) < need { - return append(dst, fmt.Sprintf("%%!%%s(have %d bytes, need %d)", len(src), need)...), len(src) + return append(dst, fmt.Sprintf("%%!(have %d bytes, need %d)", len(src), need)...), len(src) } var ul, ub uint64 @@ -1226,7 +1224,11 @@ func (r *RecordReader) parseReadLayout(layout string) error { switch escaped { default: - return fmt.Errorf("unknown percent escape sequence %q", layout[:1]) + // escaped is the verb byte; layout has already advanced past + // it (and past any '{'), so it can be empty here - slicing + // layout[:1] would panic for an unknown verb at the end of + // the layout (e.g. "%q"). + return fmt.Errorf("unknown percent escape sequence %q", string(escaped)) case 'T', 'K', 'V', 'H': var dst *uint64 @@ -1391,7 +1393,7 @@ func (r *RecordReader) parseReadLayout(layout string) error { inner(b, r) return nil }} - bit.set(bit) + bits.set(bit) if bits.has(bitSize) { if re != nil { return errors.New("cannot specify exact size and regular expression") @@ -1481,6 +1483,13 @@ func (r *RecordReader) parseReadLayout(layout string) error { reads = append(reads, fn) } } + // A layout consisting solely of noread verbs (fixed sizes/numbers like + // "%p{3}") never consumes input, so next() never reaches an EOF, never + // sets r.done, and ReadRecord returns identical records forever. Reject + // it at construction rather than looping at read time. + if len(reads) == 0 { + return errors.New("RecordReader: layout reads nothing from the input") + } r.fns = make([]readParse, 0, len(noreads)+len(reads)) r.fns = append(r.fns, noreads...) r.fns = append(r.fns, reads...) @@ -1767,6 +1776,20 @@ func (r *RecordReader) next(rec *Record) error { continue } + // If the input EOF'd before a fixed-size read accumulated its full + // byte count, r.buf is short. This happens on the fall-through + // above: a zero-byte read surfaces as plain io.EOF (readSize only + // reports io.EOF when it read nothing; a partial read is already + // io.ErrUnexpectedEOF), and if that read is the last fn after an + // earlier real read it is not the clean record boundary, so it + // reaches here with an empty buffer. The fixed-width number parsers + // index r.buf at constant offsets (binary.*.Uint64 etc.) and panic + // on a short slice, so surface the truncation as the unexpected EOF + // that ReadRecord's doc already promises for a mid-record EOF. + if fn.read.size > 0 && len(r.buf) < fn.read.size { + return io.ErrUnexpectedEOF + } + if err := fn.parse(r.buf, rec); err != nil { return err } @@ -1837,10 +1860,34 @@ func (r *RecordReader) readRe(re *regexp.Regexp) error { } func (r *RecordReader) readSize(n int) error { - r.buf = append(r.buf, make([]byte, n)...) - n, err := io.ReadFull(r.r, r.buf) - r.buf = r.buf[:n] - return err + if n < 0 { + // A size verb (%T/%K/%V) reads its value from the input as a + // uint64; converting to int can wrap negative for values above + // math.MaxInt64. Reject rather than panicking in make below. + return fmt.Errorf("invalid negative read size %d", n) + } + // Read in bounded chunks rather than pre-allocating n bytes up front: + // a hostile or corrupt size verb can claim a huge length that would + // OOM the process before io.ReadFull notices the input is short. The + // caller resets r.buf to empty before invoking us, so we accumulate + // from index 0. + const chunk = 64 << 10 + for len(r.buf) < n { + start := len(r.buf) + r.buf = append(r.buf, make([]byte, min(n-start, chunk))...) + nn, err := io.ReadFull(r.r, r.buf[start:]) + r.buf = r.buf[:start+nn] + if err != nil { + // io.ReadFull reports EOF only when it read zero bytes of + // this chunk; if we have already accumulated bytes for this + // field the value is truncated, which is an unexpected EOF. + if err == io.EOF && len(r.buf) > 0 { + err = io.ErrUnexpectedEOF + } + return err + } + } + return nil } func (r *RecordReader) readExact(d []byte) error { @@ -2263,7 +2310,10 @@ func parseLayoutSlash(layout string) (byte, int, error) { return 0, 0, errors.New("invalid non-terminated hex escape sequence at end of delim string") } hex := layout[1:3] - n, err := strconv.ParseInt(hex, 16, 8) + // A \xNN escape names the byte with hex value NN, i.e. the full + // [0, 255] range. ParseInt with bitSize 8 caps at 0x7f and + // rejected 0x80-0xff; ParseUint with bitSize 8 accepts [0, 255]. + n, err := strconv.ParseUint(hex, 16, 8) if err != nil { return 0, 0, fmt.Errorf("unable to parse hex escape sequence %q: %v", hex, err) } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/ring.go b/vendor/github.com/twmb/franz-go/pkg/kgo/ring.go index 9aad112547b..31a4d4485d3 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/ring.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/ring.go @@ -65,13 +65,43 @@ func (r *ring[T]) die() { } } +// empty returns whether the ring currently holds no elements. Because an +// element being processed stays in the ring until dropPeek removes it, +// empty also means no worker goroutine is mid-element. +func (r *ring[T]) empty() bool { + r.mu.Lock() + defer r.mu.Unlock() + return r.l == 0 +} + func (r *ring[T]) push(elem T) (first, dead bool) { + return r.doPush(elem, true) +} + +// pushForce pushes even when the ring is at maxLen. The maxLen wait can only +// be used by pushers that do not deadlock against the ring's worker: the +// worker is the only goroutine that signals space (dropPeek), and a push +// made while holding a client lock (purge/fail paths, storePartitionsUpdate, +// recBuf failure paths) would park holding a lock the worker can need +// through a user promise re-entering the client - the worker then waits on +// the lock while the lock holder waits on the worker. Those internal pushers +// force. Forcing does not unbound the ring: every record an internal push +// carries was already admitted under the max-buffered-records accounting, so +// forced volume is capped by that admission; only produce-entry failure +// pushes (the unbounded source) take the blocking push. +func (r *ring[T]) pushForce(elem T) (first, dead bool) { + return r.doPush(elem, false) +} + +func (r *ring[T]) doPush(elem T, wait bool) (first, dead bool) { r.mu.Lock() defer r.mu.Unlock() // If a max length is set, block until there's space. - for r.maxLen > 0 && r.l >= r.maxLen && !r.dead { - r.cond.Wait() + if wait { + for r.maxLen > 0 && r.l >= r.maxLen && !r.dead { + r.cond.Wait() + } } if r.dead { diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/sink.go b/vendor/github.com/twmb/franz-go/pkg/kgo/sink.go index 29099f6ce15..406ff7335d3 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/sink.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/sink.go @@ -31,9 +31,9 @@ type sink struct { drainState workLoop - // seqRespsMu, guarded by seqRespsMu, contains responses that must - // be handled sequentially. These responses are handled asynchronously, - // but sequentially. + // seqResps contains responses that must be handled sequentially: the + // ring preserves issue order, and its single transient worker handles + // responses asynchronously but in that order. seqResps ring[*seqResp] // we never call die() on it backoffMu xsync.Mutex // guards the following @@ -461,10 +461,14 @@ func (s *sink) produce(sem <-chan struct{}) bool { // records for a new transaction. Any records in the request are // from the current transaction at epoch N, which is correct. // - // This undo is safe: resetBatchDrainIdx + decInflight rewind - // each recBuf to its pre-drain state, the existing defer releases - // the semaphore (produced is still false), and returning true - // retries produce() with the correct epoch. + // This undo is safe: undoStagedBatches rewinds each recBuf to its + // pre-drain state -- drain index, inflight, and (for any partition + // this createReq newly added to the transaction) the addedToTxn flag, + // so the next drain re-issues its AddPartitionsToTxn instead of + // producing to a partition the broker never learned is in the txn (see + // undoStagedBatches). The existing defer releases the semaphore + // (produced is still false), and returning true retries produce() with + // the correct epoch. // // We use a raw atomic load rather than producerID() to avoid // side effects (blocking on idMu, triggering InitProducerID @@ -491,10 +495,7 @@ func (s *sink) produce(sem <-chan struct{}) bool { // unchanged, so we bail and the next drain pulls the reloaded // (id, epoch) with seq=0 consistently. if cur := s.cl.producer.id.Load().(*producerID); cur.id != id || cur.epoch != epoch || cur.err != nil { - req.batches.sliced().eachOwnerLocked(func(b *recBatch) { - b.owner.resetBatchDrainIdx() - b.decInflight() - }) + req.undoStagedBatches(txnReq) return true } @@ -510,18 +511,30 @@ func (s *sink) produce(sem <-chan struct{}) bool { batchesStripped, err := s.doTxnReq(req, txnReq) if err != nil { switch { - case errors.Is(err, kerr.TransactionAbortable): - // If we get TransactionAbortable, we continue into producing. - // The produce will fail with the same error, and this is the - // only way to notify the user to abort the txn. case isRetryableBrokerErr(err) || isDialNonTimeoutErr(err): s.cl.bumpRepeatedLoadErr(err) s.cl.cfg.logger.Log(LogLevelWarn, "unable to AddPartitionsToTxn due to retryable broker err, bumping client's buffered record load errors by 1 and retrying", "err", err) s.cl.triggerUpdateMetadata(false, "attempting to refresh broker list due to failed AddPartitionsToTxn requests") return moreToDrain || len(req.batches.bs) > 0 // nothing stripped if request-issuing error default: - // Note that err can be InvalidProducerEpoch, which is - // potentially recoverable in EndTransaction. + // This includes TransactionAbortable. We used to + // continue into producing on TransactionAbortable so + // the produce failure would carry the error to the + // user, but doTxnReq's error path has already + // requeued every batch in the request (reset drain + // indexes, decremented inflight, and un-marked + // addedToTxn for the partitions whose add actually + // failed): producing those batches anyway would + // decrement inflight a second time (wrapping the + // counter and permanently wedging the recBuf's + // drain gate) and could re-drain batches that are + // already in flight. Failing the producer ID delivers + // the same error to all buffered records on the next + // drain, and TransactionAbortable remains recoverable + // via EndTransaction. + // + // Note that err can also be InvalidProducerEpoch, + // which is potentially recoverable in EndTransaction. // // We do not fail all buffered records here, // because that can lead to undesirable behavior @@ -574,9 +587,10 @@ func (s *sink) doSequenced( // We can NOT use any record context. If we do, we force the request to // fail while also force the batch to be unfailable (due to no - // response). If and only if the user has disabled idempotency, we - // allow the user to cancel the request via some random record with a - // canceling context. + // response). Only if the user has disabled idempotency or opted into + // AllowIdempotentProduceCancellation do we allow canceling the request + // via some random record with a canceling context (createReq only + // sets firstCancelingCtx under those options). ctx := req.firstCancelingCtx if ctx == nil { ctx = s.cl.ctx @@ -618,14 +632,20 @@ func (s *sink) doTxnReq( req *produceRequest, txnReq *kmsg.AddPartitionsToTxnRequest, ) (stripped bool, err error) { - // If we return an unretryable error, then we have to reset everything - // to not be in the transaction and begin draining at the start. + // If we return an unretryable error, every batch in this request must + // be requeued and any partition this request newly added to the + // transaction must be un-marked, since we will not issue the produce + // request. undoStagedBatches scopes the un-marking to txnReq so a + // partition added by an EARLIER AddPartitionsToTxn of this transaction + // (a broker-acked fact, deliberately absent here) keeps its membership; + // clearing it would make EndTransaction's anyAdded walk skip EndTxn and + // strand the broker-side transaction until its timeout abort. // // These batches must be the first in their recBuf, because we would // not be trying to add them to a partition if they were not. defer func() { if err != nil { - req.batches.eachOwnerLocked(seqRecBatch.removeFromTxn) + req.undoStagedBatches(txnReq) } }() // We do NOT let record context cancelations fail this request: doing @@ -633,6 +653,12 @@ func (s *sink) doTxnReq( // similar to the warning we give in the txn.go file, but the // difference there is the user knows explicitly at the function call // that canceling the context will opt them into invalid state. + // + // Note that the concurrent-transactions wrapper is defensive only: + // AddPartitionsToTxn is pinned at most v3 (no top-level error code) + // and a per-partition CONCURRENT_TRANSACTIONS is retriable, so it is + // stripped in issueTxnReq and healed by requeue+backoff rather than + // ever surfacing to the wrapper. err = s.cl.doWithConcurrentTransactions(s.cl.ctx, fmt.Sprintf("AddPartitionsToTxn-sink%d", s.nodeID), func() error { stripped, err = s.issueTxnReq(req, txnReq) return err @@ -640,6 +666,54 @@ func (s *sink) doTxnReq( return stripped, err } +// txnReqContains returns whether the AddPartitionsToTxn request contains the +// topic and partition. Partitions already in the transaction from an earlier +// request are deliberately absent (see txnReqBuilder.add); failure handling +// and response processing must not touch their addedToTxn state. +func txnReqContains(txnReq *kmsg.AddPartitionsToTxnRequest, topic string, partition int32) bool { + for i := range txnReq.Topics { + t := &txnReq.Topics[i] + if t.Topic != topic { + continue + } + for _, p := range t.Partitions { + if p == partition { + return true + } + } + } + return false +} + +// undoStagedBatches rewinds every batch that createReq staged into this request +// back to its pre-drain state, for the early-return arms that decide not to +// issue the request after staging it: the producer-ID/epoch recheck in +// produce() and doTxnReq's failure defer. It resets each recBuf's drain index +// and decrements inflight, and -- for the partitions THIS request newly added +// to the transaction -- clears addedToTxn so the next drain re-issues their +// AddPartitionsToTxn. +// +// txnReq holds exactly the partitions createReq newly added: txnReqBuilder.add +// only records a partition whose addedToTxn flipped false->true, so partitions +// added to the transaction by an EARLIER request are deliberately absent and +// keep their broker-acked membership. Leaving a newly-added partition's +// addedToTxn set after rewinding would suppress its AddPartitionsToTxn on the +// next drain (txnReqBuilder.add skips already-added partitions); the broker +// then rejects the produce to that unverified partition with INVALID_TXN_STATE +// (or, on a non-verifying broker, the records hang in a transaction the +// coordinator never learned the partition belongs to). txnReq is nil for +// non-transactional and pv12+ (KIP-890p2) producers, which never stage +// addedToTxn in createReq, so the clear is correctly skipped for them. +func (p *produceRequest) undoStagedBatches(txnReq *kmsg.AddPartitionsToTxnRequest) { + p.batches.eachOwnerLocked(func(batch seqRecBatch) { + if txnReq != nil && txnReqContains(txnReq, batch.owner.topic, batch.owner.partition) { + batch.owner.addedToTxn.Store(false) + } + batch.owner.resetBatchDrainIdx() + batch.decInflight() + }) +} + // Removing a batch from the transaction means we will not be issuing it // inflight, and that it was not added to the txn and that we need to reset the // drain index. @@ -665,7 +739,24 @@ func (s *sink) issueTxnReq( continue } for _, partition := range topic.Partitions { - if err := kerr.ErrorForCode(partition.ErrorCode); err != nil && err != kerr.TransactionAbortable { // see below for txn abortable + // TransactionAbortable partitions are deliberately NOT + // handled as errors here: the batch stays in the request, + // the subsequent produce fails with the same abortable + // error, and the record promises carry it to the user (who + // then aborts; recovery happens via EndTransaction). + if err := kerr.ErrorForCode(partition.ErrorCode); err != nil && err != kerr.TransactionAbortable { + // An errored partition that we did not ask to add must + // not strip a batch nor fail the producer ID: it could + // name a partition added by an earlier request of this + // transaction (deliberately absent from this txnReq), + // and un-marking that would break EndTransaction's + // anyAdded accounting -- see doTxnReq's deferred + // failure handling. + if !txnReqContains(txnReq, topic.Topic, partition.Partition) { + s.cl.cfg.logger.Log(LogLevelError, "broker replied with errored partition in AddPartitionsToTxnResponse that was not in the request", "topic", topic.Topic, "partition", partition.Partition) + continue + } + // OperationNotAttempted is set for all partitions that are authorized // if any partition is unauthorized _or_ does not exist. We simply remove // unattempted partitions and treat them as retryable. @@ -821,11 +912,18 @@ func (s *sink) handleReqResp(br *broker, req *produceRequest, resp kmsg.Response rt := &kresp.Topics[i] topic := rt.Topic tid := rt.TopicID + // For topics (and partitions below) that we did not produce to, + // we deliberately do NOT touch req.metrics: metrics entries only + // exist for batches that were actually appended to the request, + // so a genuinely invented entry has nothing to remove -- and a + // DUPLICATED reply entry lands here too (the first occurrence + // empties req.batches), where deleting would erase the metrics + // of a batch the first occurrence legitimately processed and + // silently skip its OnProduceBatchWritten hook. if req.version >= 13 { var ok bool if topic, ok = req.batches.id2t[rt.TopicID]; !ok { - s.cl.cfg.logger.Log(LogLevelError, "broker erroneously replied with topic id in produce request that we did not produce to", "broker", logID(s.nodeID), "topic", topic, "topic_id", strtid(rt.TopicID)) - delete(req.metrics, topic) + s.cl.cfg.logger.Log(LogLevelError, "broker erroneously replied with topic id in produce request that we did not produce to", "broker", logID(s.nodeID), "topic_id", strtid(rt.TopicID)) continue } } else { @@ -834,7 +932,6 @@ func (s *sink) handleReqResp(br *broker, req *produceRequest, resp kmsg.Response partitions, ok := req.batches.bs[topic] if !ok { s.cl.cfg.logger.Log(LogLevelError, "broker erroneously replied with topic in produce request that we did not produce to", "broker", logID(s.nodeID), "topic", topic) - delete(req.metrics, topic) continue } @@ -849,8 +946,7 @@ func (s *sink) handleReqResp(br *broker, req *produceRequest, resp kmsg.Response batch, ok := partitions[partition] if !ok { s.cl.cfg.logger.Log(LogLevelError, "broker erroneously replied with partition in produce request that we did not produce to", "broker", logID(s.nodeID), "topic", rt.Topic, "partition", partition) - delete(tmetrics, partition) - continue // should not hit this + continue // should not hit this; see the topic-level comment above for why tmetrics is left alone } delete(partitions, partition) @@ -1076,7 +1172,15 @@ func (s *sink) handleReqRespBatch( return false, false } if s.cl.cfg.onDataLoss != nil { - s.cl.cfg.onDataLoss(topic, rp.Partition) + // Dispatch on a fresh goroutine: we hold this partition's + // recBuf.mu here, and the natural reaction to "data loss + // on (topic, partition)" is to produce to that partition + // -- which re-enters recBuf.mu on this goroutine and + // deadlocks it forever, wedging the partition and this + // sink's response processing. The callback is an + // informational notification with no ordering contract + // (same dispatch style as HookProduceBatchWritten). + go s.cl.cfg.onDataLoss(topic, rp.Partition) } // For OOOSN, and UnknownProducerID @@ -1420,7 +1524,13 @@ type recBuf struct { // this recBuf. Every time this hits zero, if the batchDrainIdx is not // at the end, we clear inflightOnSink and trigger the *current* sink // to drain. - inflight uint8 + // + // This is bounded by the sink's inflight sem: 1 or 4 when idempotent, + // or the user's MaxProduceRequestsInflightPerBroker (no upper bound) + // when idempotency is disabled -- which is why this is an int32 and + // not a small type that a large user value could wrap, breaking the + // != 0 drain gates here and in createReq. + inflight int32 lastAckedOffset int64 // last ProduceResponse's BaseOffset + how many records we produced @@ -1509,6 +1619,27 @@ func (recBuf *recBuf) bufferRecord(pr promisedRec, abortOnNewBatch bool) bool { return true } + // If the client is closing, fail the record rather than buffering it + // into a recBuf whose sink drain loop has already exited. close() cancels + // cl.ctx and then sweeps every recBuf exactly once via + // failBufferedRecords; a record buffered after that sweep would never be + // failed - its promise would never fire, BufferedProduceRecords would + // never return to zero, and a later Flush would hang - contradicting the + // documented ErrClientClosed contract ("for producing, records are failed + // with this error"). Checking cl.ctx under recBuf.mu (held here and by + // failAllRecords) is race-free given the close ordering (ctxCancel then + // sweep): we either observe the cancel and fail here, or we buffer before + // the sweep and the sweep fails us. The unknown-topic sibling path already + // honors this via waitUnknownTopic's cl.ctx.Done arm; this is the missing + // guard on the known-topic sibling. We select on Done rather than calling + // Err to keep this per-record hot path free of the context's per-call mutex. + select { + case <-recBuf.cl.ctx.Done(): + recBuf.cl.producer.promiseRecord(pr, ErrClientClosed) + return true + default: + } + var ( mkNewBatch = true produceVersion = recBuf.sink.produceVersion.Load() @@ -1604,9 +1735,11 @@ func (recBuf *recBuf) unlingerAndManuallyDrain() { // load errors during metadata updates. // // Partition load errors are generally temporary (leader/listener/replica not -// available), and this try bump is not expected to do much. If for some reason -// a partition errors for a long time and we are not idempotent, this function -// drops all buffered records. +// available, or a metadata response from an out of date broker that is +// missing a partition we know about), and this try bump is not expected to do +// much. Records are failed only once a bound trips: the record timeout or +// retry limit, or for unknown-partition style errors (including a metadata +// response missing the partition), the unknown fail limit. func (recBuf *recBuf) bumpRepeatedLoadErr(err error) { recBuf.mu.Lock() defer recBuf.mu.Unlock() @@ -1624,10 +1757,10 @@ func (recBuf *recBuf) bumpRepeatedLoadErr(err error) { canFail = !recBuf.cl.idempotent() || recBuf.cl.cfg.allowIdempotentProduceCancellation || (batch0.canFailFromLoadErrs && !batch0.unsureIfProduced) // we can only fail if we are not idempotent, cancellation is allowed, or if we have no outstanding requests batch0Fail = batch0.maybeFailErr(&recBuf.cl.cfg) != nil // timeout, retries, or aborting netErr = isRetryableBrokerErr(err) || isDialNonTimeoutErr(err) // we can fail if this is *not* a network error - retryableKerr = kerr.IsRetriable(err) // we fail if this is not a retryable kerr, - isUnknownLimit = recBuf.checkUnknownFailLimit(err) // or if it is, but it is UnknownTopicOrPartition and we are at our limit + retryableErr = kerr.IsRetriable(err) || errors.Is(err, errMissingMetadataPartition) // we fail if this is not a retryable error (missing-metadata-partition retries like unknown topic), + isUnknownLimit = recBuf.checkUnknownFailLimit(err) // or if it is, but it is an unknown topic error and we are at our limit - willFail = canFail && (batch0Fail || !netErr && (!retryableKerr || retryableKerr && isUnknownLimit)) + willFail = canFail && (batch0Fail || !netErr && (!retryableErr || retryableErr && isUnknownLimit)) ) batch0.isFailingFromLoadErr = willFail batch0.mu.Unlock() @@ -1640,7 +1773,7 @@ func (recBuf *recBuf) bumpRepeatedLoadErr(err error) { "can_fail", canFail, "batch0_should_fail", batch0Fail, "is_network_err", netErr, - "is_retryable_kerr", retryableKerr, + "is_retryable_err", retryableErr, "is_unknown_limit", isUnknownLimit, "will_fail", willFail, ) @@ -1650,13 +1783,20 @@ func (recBuf *recBuf) bumpRepeatedLoadErr(err error) { } } -// Called locked, if err is an unknown error, bumps our limit, otherwise resets -// it. This returns if we have reached or exceeded the limit. +// Called locked. A successful produce (nil err) resets the count; an unknown +// topic error bumps it; any other error leaves it unchanged -- resetting only +// on success is what keeps interleaved errors (e.g. an alternating +// NOT_LEADER_FOR_PARTITION) from holding the count below the limit forever. +// Three errors count: UNKNOWN_TOPIC_OR_PARTITION, UNKNOWN_TOPIC_ID (a deleted- +// and-recreated topic returns it until the user purges and re-adds, since +// produce v13+ keys topics by ID), and the metadata-side +// errMissingMetadataPartition twin. Returns whether we have exceeded the limit. func (recBuf *recBuf) checkUnknownFailLimit(err error) bool { - if errors.Is(err, kerr.UnknownTopicOrPartition) { - recBuf.unknownFailures++ - } else { + switch { + case err == nil: recBuf.unknownFailures = 0 + case errors.Is(err, kerr.UnknownTopicOrPartition) || errors.Is(err, kerr.UnknownTopicID) || errors.Is(err, errMissingMetadataPartition): + recBuf.unknownFailures++ } return recBuf.cl.cfg.maxUnknownFailures >= 0 && recBuf.unknownFailures > recBuf.cl.cfg.maxUnknownFailures } @@ -1918,7 +2058,7 @@ type produceRequest struct { timeout int32 batches seqRecBatches - firstCancelingCtx context.Context // of all batches added, the first one with a record that has a canceling context; only used with disableIdempotency + firstCancelingCtx context.Context // of all batches added, the first one with a record that has a canceling context; only used with disableIdempotency or allowIdempotentProduceCancellation producerID int64 producerEpoch int16 @@ -2311,7 +2451,10 @@ func (p *produceRequest) IsFlexible() bool { return p.version >= 9 } func (p *produceRequest) AppendTo(dst []byte) []byte { flexible := p.IsFlexible() - p.metrics = make(map[string]map[int32]ProduceBatchMetrics) + // The metrics maps are rebuilt on every AppendTo and take one entry + // per topic and one per partition we actually write, so size them up + // front rather than growing our way there. + p.metrics = make(map[string]map[int32]ProduceBatchMetrics, len(p.batches.bs)) if p.version >= 3 { if flexible { @@ -2342,7 +2485,7 @@ func (p *produceRequest) AppendTo(dst []byte) []byte { dst = kbin.AppendArrayLen(dst, len(partitions)) } - tmetrics := make(map[int32]ProduceBatchMetrics) + tmetrics := make(map[int32]ProduceBatchMetrics, len(partitions)) p.metrics[topic] = tmetrics for partition, batch := range partitions { @@ -2351,6 +2494,16 @@ func (p *produceRequest) AppendTo(dst []byte) []byte { if batch.records == nil || batch.isFailingFromLoadErr { // concurrent failAllRecords OR concurrent bumpRepeatedLoadErr if flexible { dst = kbin.AppendCompactNullableBytes(dst, nil) + // Flexible versions terminate EVERY partition + // element with a tagged-field count; the healthy + // arm appends it after the batch bytes below. + // Skipping it here left the request one byte + // short per failed batch, desyncing the broker's + // parse of every following partition: the whole + // request was corrupt, the broker killed the + // connection, and every healthy batch in the + // request rode the connection-death path. + dst = append(dst, 0) } else { dst = kbin.AppendNullableBytes(dst, nil) } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/source.go b/vendor/github.com/twmb/franz-go/pkg/kgo/source.go index 4266cbea2d5..0621b1661b8 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/source.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/source.go @@ -29,7 +29,7 @@ type readerFrom interface { // another fetch in the background. type source struct { cl *Client // our owning client, for cfg, metadata triggering, context, etc. - nodeID int32 // the node ID of the broker this sink belongs to + nodeID int32 // the node ID of the broker this source belongs to // Tracks how many _failed_ fetch requests we have in a row (unable to // receive a response). Any response, even responses with an ErrorCode @@ -117,7 +117,17 @@ func (s *source) removeCursor(rm *cursor) { // cursor is where we are consuming from for an individual partition. type cursor struct { - topic string + topic string + // topicID is written once at cursor creation and is deliberately + // never re-adopted if a delete+recreate hands back a new ID for the + // same name: a recreated topic stalls loudly (UNKNOWN_TOPIC_ID, see + // the UnknownTopicID arm below) and the user must purge+re-add. This + // is the principled alternative to librdkafka/Java's adopt-and-gamble; + // issue #908 records why auto-adoption was backed out (PR #391/#377: + // OffsetForLeaderEpoch has no TopicID field, so an adopted ID cannot + // be validated against truncation). The metadata merge copies this + // pointer over rather than swapping the ID; do not "fix" the stall + // into an adopt without solving #908. topicID [16]byte partition int32 @@ -297,7 +307,25 @@ func (p *cursorOffsetPreferred) move() { c.source.cl.sinksAndSourcesMu.Unlock() if !exists { + // The preferred replica is a broker we have not yet learned from + // metadata - e.g. a freshly added replica that the broker we + // fetched from already knows about, before our periodic refresh + // caught up. We force a metadata update so the source comes to + // exist for a future move, but we must ALSO re-enable the cursor + // on its current (leader) source. The caller (source.fetch) deletes + // this cursor from the request's used offsets right after we return, + // so neither the fetch's used-offset finishing nor a later buffered + // poll will re-enable it: leaving it unusable here would strand the + // partition. The leader is unchanged, so no cursor + // migration re-enables it, and a metadata refresh that merely + // learns the new broker never touches cursor usability - the + // partition would silently never be consumed again until an + // unrelated session restart (rebalance, assign, leader change). + // + // Re-enabling on the current source keeps us consuming from the + // leader until a later fetch's preferred replica can be honored. c.source.cl.triggerUpdateMetadataNow("cursor moving to a different broker that is not yet known") + c.allowUsable() return } @@ -398,22 +426,13 @@ type bufferedFetch struct { usedOffsets usedOffsets // what the offsets will be next if this fetch is used } -func (s *source) hook(f *Fetch, buffered, polled bool) { +func (s *source) hookBuffered(f *Fetch) { // Collect matching hooks once, then fuse dispatch with the metrics walk // so we visit each record exactly once regardless of hook count. - var ( - bufH []HookFetchRecordBuffered - unbH []HookFetchRecordUnbuffered - ) + var bufH []HookFetchRecordBuffered s.cl.cfg.hooks.each(func(h Hook) { - if buffered { - if h, ok := h.(HookFetchRecordBuffered); ok { - bufH = append(bufH, h) - } - } else { - if h, ok := h.(HookFetchRecordUnbuffered); ok { - unbH = append(unbH, h) - } + if h, ok := h.(HookFetchRecordBuffered); ok { + bufH = append(bufH, h) } }) @@ -430,19 +449,91 @@ func (s *source) hook(f *Fetch, buffered, polled bool) { for _, h := range bufH { h.OnFetchRecordBuffered(r) } - for _, h := range unbH { - h.OnFetchRecordUnbuffered(r, polled) + } + } + } + s.cl.consumer.bufferedRecords.Add(int64(nrecs)) + s.cl.consumer.bufferedBytes.Add(nbytes) +} + +// hookDeferUnbuffered is the unbuffered counterpart of hookBuffered, split +// because its dispatch must NOT run at the call sites: every take/discard +// path holds c.sourcesReadyMu, and the poll path additionally holds c.mu +// (the invalidation path holds c.mu and sessionChangeMu too). User hook +// code invoked there can re-enter the client -- the hook docs bless +// interceptor usage and warn only about slowness -- and a re-entrant call +// that needs c.mu (polling, AddConsumeTopics, ...) would park forever with +// c.mu held, wedging every future poll, every rebalance's assign, and +// Close. So this captures what dispatch needs NOW and queues the user-code +// dispatch on the consumer, to run once the locks release. +// +// The capture must be eager for a second reason: callers compact the +// fetch's Topics/Partitions slices in place after this returns (pause +// stripping reuses the same backing arrays), so a closure over f would +// observe a corrupted view. Records themselves are never mutated; we +// flatten the record pointers. Gauge accounting is atomic and happens +// immediately -- only user code is deferred, and only when an unbuffered +// hook is actually registered. +// +// Must be called with c.sourcesReadyMu held. +func (s *source) hookDeferUnbuffered(f *Fetch, polled bool) { + var unbH []HookFetchRecordUnbuffered + s.cl.cfg.hooks.each(func(h Hook) { + if h, ok := h.(HookFetchRecordUnbuffered); ok { + unbH = append(unbH, h) + } + }) + + c := &s.cl.consumer + var nrecs int + var nbytes int64 + if len(unbH) == 0 { + // No hook to dispatch. The gauges still need the walk (bytes + // are per-record), but nothing is captured and nothing is + // allocated. + for i := range f.Topics { + t := &f.Topics[i] + for j := range t.Partitions { + p := &t.Partitions[j] + nrecs += len(p.Records) + for k := range p.Records { + nbytes += p.Records[k].userSize() } } } + c.bufferedRecords.Add(-int64(nrecs)) + c.bufferedBytes.Add(-nbytes) + return } - if buffered { - s.cl.consumer.bufferedRecords.Add(int64(nrecs)) - s.cl.consumer.bufferedBytes.Add(nbytes) - } else { - s.cl.consumer.bufferedRecords.Add(-int64(nrecs)) - s.cl.consumer.bufferedBytes.Add(-nbytes) + + var recs []*Record + for i := range f.Topics { + t := &f.Topics[i] + for j := range t.Partitions { + p := &t.Partitions[j] + nrecs += len(p.Records) + for k := range p.Records { + r := p.Records[k] + nbytes += r.userSize() + recs = append(recs, r) + } + } } + c.bufferedRecords.Add(-int64(nrecs)) + c.bufferedBytes.Add(-nbytes) + + if len(recs) == 0 { + return + } + c.deferredFetchHooks = append(c.deferredFetchHooks, func() { + // unbH is almost always length one; keeping it outermost keeps + // the per-record loop free of the hook-slice ranging. + for _, h := range unbH { + for _, r := range recs { + h.OnFetchRecordUnbuffered(r, polled) + } + } + }) } // takeBuffered drains a buffered fetch and updates offsets. @@ -630,9 +721,9 @@ func (s *source) takeNBuffered(paused pausedTopics, n int) (Fetch, int, bool) { } if len(rstrip.Topics) > 0 { - s.hook(&rstrip, false, true) + s.hookDeferUnbuffered(&rstrip, true) } - s.hook(&r, false, true) // unbuffered, polled + s.hookDeferUnbuffered(&r, true) // unbuffered, polled drained := len(bf.Topics) == 0 if drained { @@ -648,7 +739,7 @@ func (s *source) takeBufferedFn(polled bool, offsetFn func(usedOffsets)) Fetch { r.doneFetch <- true close(s.sem) - s.hook(&r.fetch, false, polled) // unbuffered, potentially polled + s.hookDeferUnbuffered(&r.fetch, polled) // unbuffered, potentially polled return r.fetch } @@ -1011,13 +1102,21 @@ func (s *source) fetch(consumerSession *consumerSession, doneFetch chan<- bool) return fetched default: - // Any other top-level error is unexpected: current brokers - // only emit session-related codes here. Rather than bumping - // the session epoch against a failed request, reset defensively - // so the next request re-establishes state the broker agrees - // with. - s.cl.cfg.logger.Log(LogLevelWarn, "fetch response has unexpected top-level error, resetting session", "broker", logID(s.nodeID), "err", err) - s.session.reset() + // Any other top-level error is unexpected: current brokers only + // emit session-related codes here, and every one of those arms + // above self-heals in a single round-trip (a reset re-establishes + // the session at epoch 0, which the broker then accepts). An + // unexpected code has no such bounded heal: a non-conformant or + // future broker that returns one persistently would spin this + // fetch at round-trip pace, re-logging on every iteration, because + // nothing here paces the loop. Back off rather than bumping the + // session epoch against a failed request; backoff also resets the + // session defensively so the next request re-establishes state the + // broker agrees with. This mirrors the transport-error and + // all-partitions-stripped paths, and the share fetch loop's + // top-level-error arm. + s.cl.cfg.logger.Log(LogLevelWarn, "fetch response has unexpected top-level error, resetting session and backing off", "broker", logID(s.nodeID), "err", err) + backoff(err) return fetched } @@ -1066,7 +1165,7 @@ func (s *source) fetch(consumerSession *consumerSession, doneFetch chan<- bool) usedOffsets: req.usedOffsets, } s.sem = make(chan struct{}) - s.hook(&fetch, true, false) // buffered, not polled + s.hookBuffered(&fetch) // buffered, not polled s.cl.consumer.addSourceReadyForDraining(s) } else if allErrsStripped { // If we stripped all errors from the response, we are likely @@ -1096,6 +1195,15 @@ func (s *source) handleReqResp(br *broker, req *fetchRequest, resp *kmsg.FetchRe numErrsStripped int kip320 = s.cl.supportsOffsetForLeaderEpoch() kmove kip951move + // seen guards against a broker returning the same partition (or the + // same topic) more than once in a single fetch response. Each + // requested partition maps to one stable *cursorOffsetNext for the + // life of the request; processing one twice would double-advance its + // offset / double-append its records, or enqueue two move()s for one + // cursor (the #1167 concurrent-source hazard). We must not dedup by + // deleting from req.usedOffsets - that map re-enables the cursor + // after the response - so we track seen pointers separately. + seen map[*cursorOffsetNext]struct{} ) defer kmove.maybeBeginMove(s.cl) @@ -1145,6 +1253,18 @@ func (s *source) handleReqResp(br *broker, req *fetchRequest, resp *kmsg.FetchRe ) continue } + if _, dup := seen[partOffset]; dup { + s.cl.cfg.logger.Log(LogLevelWarn, "broker returned a duplicate partition in a fetch response, ignoring the duplicate", + "broker", logID(s.nodeID), + "topic", topic, + "partition", partition, + ) + continue + } + if seen == nil { + seen = make(map[*cursorOffsetNext]struct{}, req.numOffsets) + } + seen[partOffset] = struct{}{} c := partOffset.from // If we are fetching from the replica already, Kafka replies with a -1 @@ -1158,6 +1278,7 @@ func (s *source) handleReqResp(br *broker, req *fetchRequest, resp *kmsg.FetchRe continue } + priorOffset := partOffset.offset fp := partOffset.processRespPartition(br, rp, s.cl.cfg.decompressor, s.cl.cfg.hooks) if fp.Err != nil { if moving := kmove.maybeAddFetchPartition(resp, rp, c); moving { @@ -1167,6 +1288,25 @@ func (s *source) handleReqResp(br *broker, req *fetchRequest, resp *kmsg.FetchRe updateWhy.add(topic, partition, fp.Err) } + // A response can carry batch data for a partition yet + // advance nothing: every batch's last offset below our + // requested offset (a broker violating "return the batch + // containing the fetch offset"). Nothing buffers, no error + // is set, and the cursor re-enables at the same offset -- + // without intervention the next fetch re-requests + // immediately and the loop runs hot at round-trip pace, + // silently, forever. Strip the partition: if the WHOLE + // response is such non-progress, the allErrsStripped + // backoff below paces us like any other all-stripped + // response. Legitimate empties are excluded: a caught-up + // partition has no batch bytes, control/aborted records + // advance the offset even when not kept, and a compacted + // empty batch advances via its preserved last offset. + if fp.Err == nil && len(fp.Records) == 0 && partOffset.offset == priorOffset && len(rp.RecordBatches) > 0 { + strip(topic, partition, errFetchNoProgress) + continue + } + // We only keep the partition if it has no error, or an // error we do not internally retry. var keep bool @@ -1496,7 +1636,13 @@ func ProcessFetchPartition(o ProcessFetchPartitionOpts, rp *kmsg.FetchResponseTo offset := int64(binary.BigEndian.Uint64(in)) length = int32(binary.BigEndian.Uint32(in[8:])) length += 12 // for the int64 offset we skipped and int32 length field itself - if len(in) < int(length) { + // length is read as a signed int32: a high-bit-set length field (or a + // near-MaxInt32 one, which overflows negative once we add 12) is + // negative and would slip past the truncation check below, panicking + // check()'s in[:length] with a negative bound. Treat a negative length + // as an untrustworthy/truncated batch and stop, matching the negative + // guards already in parseReadSize and the xerial decoder. + if length < 0 || len(in) < int(length) { break } @@ -1593,6 +1739,25 @@ func buildAborter(rp *kmsg.FetchResponseTopicPartition) aborter { for _, abort := range rp.AbortedTransactions { a[abort.ProducerID] = append(a[abort.ProducerID], abort.FirstOffset) } + // shouldAbortBatch and trackAbortedPID below both treat a[pid][0] as the + // smallest remaining aborted first offset for that producer: a batch is + // aborted once its FirstOffset reaches a[pid][0], and each abort marker + // pops a[pid][0]. The broker is NOT required to return a producer's aborted + // transactions sorted by first offset, though. Apache Kafka happens to (its + // transaction index is appended in last-offset order, which for one + // producer's strictly sequential transactions coincides with first-offset + // order), but Redpanda concatenates its newest in-memory aborted ranges + // (highest offsets) ahead of older on-disk snapshot ranges, so one + // producer's entries can arrive highest-first-offset first. With a[pid][0] + // not the smallest, a lower aborted transaction slips past the + // `FirstOffset < pidAborts[0]` guard and its records are surfaced to the + // application as committed - a read_committed violation. Sort each + // producer's first offsets ascending to restore the invariant the rest of + // the filtering relies on (the Java client makes the same guarantee with a + // first-offset-ordered priority queue). + for pid := range a { + slices.Sort(a[pid]) + } return a } @@ -1613,7 +1778,16 @@ func (a aborter) shouldAbortBatch(b *kmsg.RecordBatch) bool { } func (a aborter) trackAbortedPID(producerID int64) { - remaining := a[producerID][1:] + pidAborts := a[producerID] + if len(pidAborts) == 0 { + // Already exhausted for this PID. A well-formed response pops once + // per aborted transaction (one abort marker each), so this is only + // reachable from a buggy/hostile broker; reslicing a[producerID][1:] + // on the nil/empty slice would panic. Java removes the PID from a Set + // here, which is idempotent - mirror that. + return + } + remaining := pidAborts[1:] if len(remaining) == 0 { delete(a, producerID) } else { @@ -1625,22 +1799,24 @@ func (a aborter) trackAbortedPID(producerID int64) { // processing records to fetch part // ////////////////////////////////////// -// readRawRecordsInto reads records from in and returns them, returning early -// if there were partial records. -func readRawRecordsInto(rs []kmsg.Record, in []byte) []kmsg.Record { +// readRawRecordsInto reads records from in and returns them and the total +// number of headers they hold, returning early if there were partial records. +func readRawRecordsInto(rs []kmsg.Record, in []byte) ([]kmsg.Record, int) { + var nheaders int for i := range rs { length, used := kbin.Varint(in) total := used + int(length) if used == 0 || length < 0 || len(in) < total { - return rs[:i] + return rs[:i], nheaders } if err := (&rs[i]).ReadFrom(in[:total]); err != nil { rs[i] = kmsg.Record{} // clear any invalid partial data - return rs[:i] + return rs[:i], nheaders } + nheaders += len(rs[i].Headers) in = in[total:] } - return rs + return rs, nheaders } func (o *ProcessFetchPartitionOpts) processRecordBatch( @@ -1691,6 +1867,43 @@ func (o *ProcessFetchPartitionOpts) processRecordBatch( uncompressedBytes := len(rawRecords) numRecords := int(batch.NumRecords) + // NumRecords is decoded straight off the wire and is therefore + // attacker/bug controlled. A negative count would panic the slice + // sizing below (ensureLen does s[:n], which panics for n<0); reject it + // as a corrupt batch, matching the Java client's InvalidRecordException + // guard (DefaultRecordBatch: "Found invalid record count"). A count + // larger than the available record bytes is likewise impossible for a + // well-formed batch - every record needs at least one byte - so clamp + // the up-front allocation to the byte count to keep a bogus huge count + // from driving a massive allocation. The true decodable count is + // recomputed by readRawRecordsInto, and the truncation defer below + // leaves the offset unadvanced whenever it disagrees with numRecords. + if numRecords < 0 { + fp.Err = fmt.Errorf("invalid record batch: negative record count %d", numRecords) + return 0, 0 + } + if numRecords > len(rawRecords) { + // A batch claiming records with ZERO record bytes deserves a + // special word: the clamp below would make it decode zero + // records "successfully", and the KAFKA-5443 defer would then + // advance the offset past the batch's whole claimed range -- a + // silent skip of offsets the broker asserts hold records. The + // legitimate compacted-empty batch (KAFKA-5443) claims ZERO + // records, so claiming more with no bytes is corruption; error + // loudly like the Java client's InvalidRecordException instead + // of silently skipping. + if len(rawRecords) == 0 { + fp.Err = fmt.Errorf("invalid record batch: %d claimed records with no record bytes", numRecords) + return 0, uncompressedBytes + } + numRecords = len(rawRecords) + } + + // Presize for the first batch; later batches grow the slice normally. + if cap(fp.Records) == 0 { + fp.Records = make([]*Record, 0, numRecords) + } + var krecords []kmsg.Record var krecordsPool PoolKRecords pools(o.Pools).each(func(p Pool) bool { @@ -1708,7 +1921,7 @@ func (o *ProcessFetchPartitionOpts) processRecordBatch( }() } krecords = ensureLen(krecords, numRecords) - krecords = readRawRecordsInto(krecords, rawRecords) + krecords, nheaders := readRawRecordsInto(krecords, rawRecords) // KAFKA-5443: compacted topics preserve the last offset in a batch, // even if the last record is removed, meaning that using offsets from @@ -1739,6 +1952,8 @@ func (o *ProcessFetchPartitionOpts) processRecordBatch( }) rrecords = ensureLen(rrecords, numRecords) + hslab := make([]RecordHeader, nheaders) // headers are dropped together, same as records, with the same slab tradeoffs above + var p *recordPools var poolsCtx context.Context if usesPools { @@ -1746,8 +1961,10 @@ func (o *ProcessFetchPartitionOpts) processRecordBatch( } recordCtx := poolsCtx + var slabbed bool if o.shareAckSlab != nil && len(rrecords) > 0 { if slab := o.shareAckSlab(numRecords, &rrecords[0]); slab != nil { + slabbed = true parent := poolsCtx if parent == nil { parent = context.Background() @@ -1757,11 +1974,36 @@ func (o *ProcessFetchPartitionOpts) processRecordBatch( } var nkept int defer func() { - if p != nil && nkept > 0 { + if p == nil { + return + } + if nkept > 0 { p.n.Add(int64(nkept)) + return + } + // No record from this batch was kept: an aborted transaction's + // data batch, a control/marker batch, or a batch wholly below + // the requested offset. Nothing will ever call Recycle, so the + // recordPools put-back would never run and abort-heavy + // read_committed workloads would leak every pool Get. Release + // the pooled slices now, zeroing the written-then-discarded + // records like Recycle would have. Skip when a share-ack slab + // was created: the slab indexes rrecords by pointer, and putting + // the slice back would let the pool hand out memory the slab + // still references. + if slabbed { + return } + clear(p.recs) + p.release() }() + // A control batch ends at most one aborted transaction for its producer, + // so we pop the aborter at most once per batch. A well-formed control + // batch holds a single marker record; a buggy/hostile broker can pack many + // (and Java inspects only a control batch's first record), so without this + // guard a second abort marker would pop an already-empty aborter slice. + abortMarkerHandled := false for i := range krecords { record := &rrecords[i] recordToRecord( @@ -1770,19 +2012,26 @@ func (o *ProcessFetchPartitionOpts) processRecordBatch( batch, &krecords[i], record, + &hslab, ) - record.Context = recordCtx //nolint:fatcontext // not a nested context - krecords[i] = kmsg.Record{} // prevent the kmsg.Record from hanging onto anything + record.Context = recordCtx //nolint:fatcontext // not a nested context + + // Prevent the kmsg.Record from hanging onto anything. The + // header slice is kept: the decoder reuses its capacity. + clear(krecords[i].Headers) + krecords[i] = kmsg.Record{Headers: krecords[i].Headers} + if kept := o.maybeKeepRecord(fp, record, abortBatch); kept { nkept++ } - if abortBatch && record.Attrs.IsControl() { + if abortBatch && !abortMarkerHandled && record.Attrs.IsControl() { // A control record has a key and a value where the key // is int16 version and int16 type. Aborted records // have a type of 0. if key := record.Key; len(key) >= 4 && key[2] == 0 && key[3] == 0 { aborter.trackAbortedPID(batch.ProducerID) + abortMarkerHandled = true } } } @@ -1818,7 +2067,10 @@ out: for len(rawInner) > 17 { // magic at byte 17 length := int32(binary.BigEndian.Uint32(rawInner[8:])) length += 12 // offset and length fields - if len(rawInner) < int(length) { + // A negative length (high-bit-set length field, signed int32) would + // slip past the truncation check and panic rawInner[:length]; treat it + // as a truncated message set. See the record-batch loop's guard. + if length < 0 || len(rawInner) < int(length) { break } @@ -1868,18 +2120,53 @@ out: return 0, uncompressedBytes } - firstOffset := message.Offset - int64(len(innerMessages)) + 1 + // Inner offsets: the log cleaner preserves each retained inner + // message's original offset, so a compacted compressed message set + // legally contains offset gaps. For a v1 wrapper, inner offsets are + // stored relative to the set's first offset and the wrapper carries + // the absolute offset of the LAST inner message, so absolute = + // (wrapper - lastInner) + inner. We previously relabeled inner + // messages contiguously counting back from the wrapper offset, which + // mislabels every record before a gap; a commit taken mid-set then + // names an offset that skips real records for any other client + // reading the log honestly. Kafka and librdkafka both honor the + // stored offsets; downstream we already handle gapped offsets (see + // maybeKeepRecord's compaction comment). + // + // Two wrapper quirks, matching Kafka's own consumer: a wrapper + // offset of 0 means the inner offsets are used as-is (certain + // versions of librdkafka produced wrapper offset 0), and a wrapper + // offset below the last inner offset is an invalid set that we + // surface rather than guess at. + innerOffset := func(m readerFrom) int64 { + switch m := m.(type) { + case *kmsg.MessageV0: + return m.Offset + case *kmsg.MessageV1: + return m.Offset + } + return 0 + } + var base int64 + if message.Offset != 0 { + lastInner := innerOffset(innerMessages[len(innerMessages)-1]) + if message.Offset < lastInner { + fp.Err = fmt.Errorf("invalid compressed message set: wrapper offset %d is less than the last inner offset %d", message.Offset, lastInner) + return 0, uncompressedBytes + } + base = message.Offset - lastInner + } for i := range innerMessages { innerMessage := innerMessages[i] switch innerMessage := innerMessage.(type) { case *kmsg.MessageV0: - innerMessage.Offset = firstOffset + int64(i) + innerMessage.Offset += base innerMessage.Attributes |= int8(compression) if !o.processV0Message(fp, innerMessage) { return i, uncompressedBytes } case *kmsg.MessageV1: - innerMessage.Offset = firstOffset + int64(i) + innerMessage.Offset += base innerMessage.Attributes |= int8(compression) if !o.processV1Message(fp, innerMessage) { return i, uncompressedBytes @@ -1931,7 +2218,10 @@ func (o *ProcessFetchPartitionOpts) processV0OuterMessage( for len(rawInner) > 17 { // magic at byte 17 length := int32(binary.BigEndian.Uint32(rawInner[8:])) length += 12 // offset and length fields - if len(rawInner) < int(length) { + // A negative length (high-bit-set length field, signed int32) would + // slip past the truncation check and panic rawInner[:length]; treat it + // as a truncated message set. See the record-batch loop's guard. + if length < 0 || len(rawInner) < int(length) { break // truncated batch } var m kmsg.MessageV0 @@ -1956,11 +2246,16 @@ func (o *ProcessFetchPartitionOpts) processV0OuterMessage( return 0, uncompressedBytes } - firstOffset := message.Offset - int64(len(innerMessages)) + 1 + // For a v0 wrapper, inner offsets are stored ABSOLUTE (magic-0-era + // brokers rewrote compressed sets server-side on append), so we use + // them as-is; Kafka's own consumer does the same. The log cleaner + // preserves retained messages' offsets, so gaps from compaction are + // legal and handled downstream (see maybeKeepRecord). We previously + // relabeled contiguously counting back from the wrapper offset, + // mislabeling every record before a gap. for i := range innerMessages { innerMessage := &innerMessages[i] innerMessage.Attributes |= int8(compression) - innerMessage.Offset = firstOffset + int64(i) if !o.processV0Message(fp, innerMessage) { return i, uncompressedBytes } @@ -2026,10 +2321,11 @@ func recordToRecord( batch *kmsg.RecordBatch, krecord *kmsg.Record, r *Record, + hslab *[]RecordHeader, ) { var h []RecordHeader - if len(krecord.Headers) > 0 { - h = make([]RecordHeader, len(krecord.Headers)) + if n := len(krecord.Headers); n > 0 { + h, *hslab = (*hslab)[:n:n], (*hslab)[n:] for i, kv := range krecord.Headers { h[i] = RecordHeader{ Key: kv.Key, @@ -2730,7 +3026,7 @@ func (s *source) removeShareCursor(c *shareCursor) { s.share.cursorsStart = 0 } s.share.mu.Unlock() - // We don't ned to wake the source to send this is a forgotten + // We don't need to wake the source to send this as a forgotten // partition, but it doesn't hurt. s.maybeShareConsume() } diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/topics_and_partitions.go b/vendor/github.com/twmb/franz-go/pkg/kgo/topics_and_partitions.go index 1fb5941996d..94d17069bba 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/topics_and_partitions.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/topics_and_partitions.go @@ -422,9 +422,25 @@ func (cl *Client) storePartitionsUpdate(topic string, l *topicPartitions, lv *to // the waiting goroutine that a try happened. It is possible the // goroutine is quitting and will not be draining unknownWait, so we do // not require the send. - if len(lv.partitions) == 0 && kerr.IsRetriable(lv.loadErr) { + // + // A load with NO error and NO partitions gets the same treatment with + // a synthesized error. Conformant brokers answer unknown topics with + // an error and existing topics with at least one partition, but a + // buggy broker or proxy can reply ErrorCode 0 with an empty partition + // array; the comprehensive-partition check in fetchTopicMetadata + // passes vacuously on empty, so loadErr is nil here. Falling through + // would hit the fatal-or-partition arm below and promise every + // buffered record with a NIL error: fabricated success (offset 0..n, + // producer id 0) for records that were never sent anywhere. We + // synthesize UnknownTopicOrPartition so the waiter both retries and + // counts the try against the max-unknown-failures bound. + if len(lv.partitions) == 0 && (lv.loadErr == nil || kerr.IsRetriable(lv.loadErr)) { + err := lv.loadErr + if err == nil { + err = kerr.UnknownTopicOrPartition + } select { - case unknown.wait <- lv.loadErr: + case unknown.wait <- err: default: } return @@ -657,9 +673,13 @@ func (old *topicPartition) migrateCursorTo( //nolint:revive // old/new naming ma // leader epoch on the new broker to see if we experienced data loss // before we can use this cursor. // - // Metadata ensures that leaderEpoch is non-negative only if the broker - // supports KIP-320. - if new.leaderEpoch != -1 && old.cursor.lastConsumedEpoch >= 0 { + // We can only validate against a real (non-negative) leader epoch. + // Metadata reports a non-negative epoch only if the broker supports + // KIP-320, and the metadata merge keeps our last known real epoch + // rather than ever migrating us to the -1 "no leader" sentinel (see + // mergeTopicPartitions), so a negative epoch here means we genuinely + // have nothing to validate against and must skip validation. + if new.leaderEpoch >= 0 && old.cursor.lastConsumedEpoch >= 0 { // Since the cursor consumed messages, it is definitely usable. // We use it so that the epoch load can finish using it // properly. @@ -681,6 +701,32 @@ func (old *topicPartition) migrateCursorTo( //nolint:revive // old/new naming ma func (tp *topicPartition) migrateShareCursorTo(cl *Client, new *topicPartition) { c := tp.shareCursor + new.shareCursor = c + + // Relocating the cursor between sources races the share consumer's + // leave. leave waits for every share worker to exit (sc.workers == 0), + // then drains each source's cursors via closeShareSession, iterating a + // snapshot of the source list taken after that barrier. A relocation that + // removes the cursor from its old source before that source is drained, + // and lands it on an already-drained source (or on one created after the + // snapshot), leaves the cursor's pending acks on a source nothing will + // drain: sc.pendingAcks never returns to 0 (FlushAcks hangs) and the held + // records release only via the broker's acquisition-lock timeout. + // + // Register the migration as a share worker so leave's barrier waits for an + // in-flight migration before it snapshots and drains. This mirrors + // applyMovesBlocking, the CurrentLeader-hint sibling that already does + // this; the metadata-merge path (this function) was the only share-cursor + // relocation not covered by the barrier. If the consumer is already dying, + // incWorker returns false: skip the swap and leave the cursor on its + // current source, which closeShareSession then drains. new.shareCursor is + // assigned above either way, so the stored partition data is always valid. + sc := cl.consumer.s + if !sc.incWorker() { + return + } + defer sc.decWorker() + cl.sinksAndSourcesMu.Lock() sns := cl.sinksAndSources[new.leader] cl.sinksAndSourcesMu.Unlock() @@ -689,7 +735,6 @@ func (tp *topicPartition) migrateShareCursorTo(cl *Client, new *topicPartition) } c.source.Store(sns.source) sns.source.addShareCursor(c) - new.shareCursor = c } type kip951move struct { @@ -805,6 +850,17 @@ func (k *kip951move) ensureBrokers(cl *Client) { // new objects with new connections, which breaks the single- // connection-per-broker ordering guarantee that Kafka requires // for idempotent/transactional produce. + // Replaced brokers are stopped after brokersMu is released: stopForever + // fires the user's OnBrokerDisconnect hook synchronously, and a hook + // re-entering the client would deadlock on the held write lock (see + // updateBrokers for the walkthrough). + var stopped []*broker + defer func() { + for _, b := range stopped { + b.stopForever() + } + }() + cl.brokersMu.Lock() defer cl.brokersMu.Unlock() @@ -827,7 +883,7 @@ func (k *kip951move) ensureBrokers(cl *Client) { } found = true if !existing.meta.equals(nb) { - existing.stopForever() + stopped = append(stopped, existing) cl.brokers[i] = cl.newBroker(b.NodeID, b.Host, b.Port, b.Rack) changed = true } @@ -907,8 +963,27 @@ func (k *kip951move) doMove(cl *Client) { // same (this allows easier injection of failures in local testing). A // higher epoch can come from a concurrent metadata update that // actually performed the move first. - modifyP := func(d *topicPartitionsData, partition int32, td topicPartitionData) (old, new *topicPartition, modified bool) { + // + // The hint was staged from a produce/fetch response and we are applied + // asynchronously: between staging and now, the user can purge the + // topic and re-add it (a produce or AddConsumeTopics recreates the + // topic with zero partitions until metadata loads), so the partition + // index can be out of range, and even in range the object at this + // index can belong to the new topic incarnation rather than the one + // whose response produced the hint. The owns check pins object + // identity: the records/cursor pointer is preserved across legitimate + // metadata updates and prior moves (the migrate functions copy it into + // the new topicPartition), so a mismatch can only mean purge+re-add - + // skip, and let the live incarnation resolve its own leader via + // metadata. + modifyP := func(d *topicPartitionsData, partition int32, td topicPartitionData, owns func(*topicPartition) bool) (old, new *topicPartition, modified bool) { + if int(partition) < 0 || int(partition) >= len(d.partitions) { + return nil, nil, false + } old = d.partitions[partition] + if !owns(old) { + return nil, nil, false + } if old.leaderEpoch > td.leaderEpoch { return nil, nil, false } @@ -959,7 +1034,7 @@ func (k *kip951move) doMove(cl *Client) { if !ok { continue // perhaps concurrently purged } - old, new, modified := modifyP(lr.r, recBuf.partition, td) + old, new, modified := modifyP(lr.r, recBuf.partition, td, func(tp *topicPartition) bool { return tp.records == recBuf }) if modified { cl.cfg.logger.Log(LogLevelInfo, "moving producing partition due to kip-951 not_leader_for_partition", "topic", recBuf.topic, @@ -990,7 +1065,7 @@ func (k *kip951move) doMove(cl *Client) { if !ok { continue // perhaps concurrently purged } - old, new, modified := modifyP(lr.r, cursor.partition, td) + old, new, modified := modifyP(lr.r, cursor.partition, td, func(tp *topicPartition) bool { return tp.cursor == cursor }) if modified { cl.cfg.logger.Log(LogLevelInfo, "moving consuming partition due to kip-951 not_leader_for_partition", "topic", cursor.topic, diff --git a/vendor/github.com/twmb/franz-go/pkg/kgo/txn.go b/vendor/github.com/twmb/franz-go/pkg/kgo/txn.go index 289777e25b4..d6bfd4c527b 100644 --- a/vendor/github.com/twmb/franz-go/pkg/kgo/txn.go +++ b/vendor/github.com/twmb/franz-go/pkg/kgo/txn.go @@ -27,10 +27,6 @@ const ( // GroupTransactSession abstracts away the proper way to begin and end a // transaction when consuming in a group, modifying records, and producing // (EOS). -// -// If you are running Kafka 2.5+, it is strongly recommended that you also use -// RequireStableFetchOffsets. See that config option's documentation for more -// details. type GroupTransactSession struct { cl *Client @@ -60,14 +56,19 @@ type GroupTransactSession struct { // occurs at any time before ending a transaction with a commit, this will // abort the transaction. // +// Do not call End synchronously from within an OnPartitionsRevoked or +// OnPartitionsLost callback: the session's internal callback wrappers hold +// the same lock End needs, deadlocking permanently. (The plain client's +// documented Close/LeaveGroup-from-callback restriction applies here too.) +// // This leaves the risk that ending the transaction itself exceeds the // rebalance timeout, but this is just one request with no cpu logic. With a // proper rebalance timeout, this single request will not fail and the commit // will succeed properly. // -// If this client detects you are talking to a pre-2.5 cluster, OR if you have -// not enabled RequireStableFetchOffsets, the client will sleep for 200ms after -// a successful commit to allow Kafka's txn markers to propagate. This is not +// If this client detects you are talking to a pre-2.5 cluster (one too old +// for KIP-447 stable fetch offsets), the client sleeps for 500ms after a +// successful commit to allow Kafka's txn markers to propagate. This is not // foolproof in the event of some extremely unlikely communication patterns and // **potentially** could allow duplicates. See this repo's transaction's doc // for more details. @@ -359,25 +360,54 @@ func (s *GroupTransactSession) End(ctx context.Context, commit TransactionEndTry // We should not be booted from the group if we receive an ok // heartbeat, meaning that, as mentioned, we should be able to end the // transaction safely. + // + // If the commit carried no offsets (the user produced but polled + // nothing), we skip the heartbeat: its only purpose is to secure the + // rebalance-timeout window so a rebalance cannot hand our committed + // offsets to another consumer before our EndTxn writes the markers. + // With nothing committed, membership is irrelevant to the transaction + // and an empty end is always safe. Skipping also matters for liveness: + // the force below is received only by a running heartbeat loop, and + // the manage loop that runs it starts only once a metadata update + // discovers a topic to consume. Walkthrough of the hang this avoids: + // the session consumes a topic that does not exist yet, the user + // begins, produces, and ends -- the group never joined, so nothing + // receives heartbeatForceCh, and no revoke or lost callback can ever + // fire to close revokedCh/lostCh; every select arm below blocks + // forever and End never returns. + // + // The ctx arms bound the remaining offsets-committed case: a + // first-ever join can legally block for the full rebalance timeout + // with the heartbeat loop not yet running, and the group could also + // never complete a join at all. Cancellation leaves okHeartbeat false + // and falls into the abort path below, same as a failed heartbeat. var okHeartbeat bool var heartbeatRebalance bool if g != nil && commitErr == nil { - waitHeartbeat := make(chan struct{}) - var heartbeatErr error - select { - case g.heartbeatForceCh <- func(err error) { - defer close(waitHeartbeat) - heartbeatErr = err - }: + if len(postcommit) == 0 { + okHeartbeat = true + } else { + waitHeartbeat := make(chan struct{}) + var heartbeatErr error select { - case <-waitHeartbeat: - okHeartbeat = heartbeatErr == nil - heartbeatRebalance = errors.Is(heartbeatErr, kerr.RebalanceInProgress) + case g.heartbeatForceCh <- func(err error) { + defer close(waitHeartbeat) + heartbeatErr = err + }: + select { + case <-waitHeartbeat: + okHeartbeat = heartbeatErr == nil + heartbeatRebalance = errors.Is(heartbeatErr, kerr.RebalanceInProgress) + case <-s.revokedCh: + case <-s.lostCh: + case <-ctx.Done(): + case <-s.cl.ctx.Done(): + } case <-s.revokedCh: case <-s.lostCh: + case <-ctx.Done(): + case <-s.cl.ctx.Done(): } - case <-s.revokedCh: - case <-s.lostCh: } } @@ -436,10 +466,11 @@ func (s *GroupTransactSession) End(ctx context.Context, commit TransactionEndTry // We have a few potential retryable errors from EndTransaction. // OperationNotAttempted will be returned at most once. // - // UnknownServerError should not be returned, but some brokers do: - // technically this is fatal, but there is no downside to retrying - // (even retrying a commit) and seeing if we are successful or if we - // get a better error. + // UnknownServerError should not be returned, but some brokers do + // (e.g. Redpanda in certain versions). It leaves the commit/abort + // unconfirmed: the broker may or may not have completed it. We + // retry as an abort (see the arm below) rather than reporting a + // commit we cannot confirm. var tries int retry: endTxnErr := s.cl.EndTransaction(ctx, TransactionEndTry(willTryCommit)) @@ -457,13 +488,20 @@ retry: goto retry case errors.Is(endTxnErr, kerr.UnknownServerError): - s.cl.cfg.logger.Log(LogLevelInfo, "end transaction with commit unknown server error; retrying") - after := time.NewTimer(s.cl.cfg.retryBackoff(tries)) - select { - case <-after.C: // context canceled; we will see when we retry - case <-s.cl.ctx.Done(): - after.Stop() - } + // We must downgrade to an abort exactly like the two arms + // above. EndTransaction already consumed inTxn on the + // erroring call, so re-calling it returns nil at its !inTxn + // guard without issuing another EndTxn: we cannot actually + // re-commit. If willTryCommit stayed true, that manufactured + // nil would fall into the "willTryCommit && endTxnErr == nil" + // success tail below and report a committed transaction, + // advancing the consumer offsets to postcommit even though the + // broker's UNKNOWN_SERVER_ERROR may have aborted it: a silent + // EOS data loss. Retrying as an abort reports not-committed and + // rewinds to the last committed offsets, so the caller + // reprocesses (at-least-once). + s.cl.cfg.logger.Log(LogLevelInfo, "end transaction returned an unknown server error; the commit is unconfirmed, retrying as abort to avoid reporting a false commit") + willTryCommit = false goto retry } } @@ -525,6 +563,7 @@ func (cl *Client) BeginTransaction() error { } cl.producer.inTxn = true + cl.producer.producedInTxn.Store(false) if !cl.producer.tx890p2.Load() && cl.supportsKIP890p2() { cl.producer.tx890p2.Store(true) } @@ -588,7 +627,7 @@ func (cl *Client) EndAndBeginTransaction( return cl.EndTransaction(ctx, commit) } -// AbortBufferedRecords fails all unflushed records with ErrAborted and waits +// AbortBufferedRecords fails all unflushed records with ErrAborting and waits // for there to be no buffered records. // // This accepts a context to quit the wait early, but quitting the wait may @@ -625,7 +664,7 @@ func (cl *Client) AbortBufferedRecords(ctx context.Context) error { return cl.Flush(ctx) } -// UnsafeAbortBufferedRecords fails all unflushed records with ErrAborted and +// UnsafeAbortBufferedRecords fails all unflushed records with ErrAborting and // waits for there to be no buffered records. This function does NOT wait for // any inflight produce requests to finish, meaning topics in the client may be // in an invalid state and producing to an invalid-state topic may cause the @@ -658,14 +697,20 @@ func (cl *Client) UnsafeAbortBufferedRecords() { // If the producer ID has an error and you are trying to commit, this will // return with kerr.OperationNotAttempted. If this happened, retry // EndTransaction with TryAbort. If this returns kerr.TransactionAbortable, you -// can retry with TryAbort. You should not retry this function on any other -// error. +// can retry with TryAbort. If a commit attempt's outcome is unconfirmed (a +// transport error, or the broker replied UNKNOWN_SERVER_ERROR), the error is +// returned and you should also retry with TryAbort: the retry aborts by +// reloading the producer ID, which bumps the epoch and fence-aborts anything +// still ongoing broker-side; retrying with TryCommit instead is refused, since +// the prior outcome is unknowable. You should not retry this function on any +// other error. // // It may be possible for the client to recover in a new transaction via // BeginTransaction if an error is returned from this function: // -// - Before Kafka 4.0, InvalidProducerIDMapping and InvalidProducerEpoch -// are recoverable +// - When transactions are not running under KIP-890 part 2 (the cluster's +// transaction.version feature is below 2), InvalidProducerIDMapping and +// InvalidProducerEpoch are recoverable // - UnknownProducerID is recoverable for Kafka 2.5+ // - TransactionAbortable is always recoverable (after aborting) // @@ -682,6 +727,13 @@ func (cl *Client) EndTransaction(ctx context.Context, commit TransactionEndTry) } cl.producer.inTxn = false + // If a prior EndTxn attempt's outcome was unconfirmed, this call is the + // documented TryAbort retry (state was restored so we could get here). + // Remember and clear; restored again below if this attempt also fails + // before confirming anything. + unconfirmed := cl.producer.endUnconfirmed + cl.producer.endUnconfirmed = false + cl.producer.producingTxn.Store(false) // forbid any new produces while ending txn // anyAdded tracks if any partitions were added to this txn, because @@ -692,12 +744,18 @@ func (cl *Client) EndTransaction(ctx context.Context, commit TransactionEndTry) // issues AddOffsetsToTxn, which internally adds a __consumer_offsets // partition to the transaction. Thus, if we added offsets, then we // also produced. - var anyAdded bool - if g := cl.consumer.g; g != nil { + var ( + anyAdded bool + addedSwapped []*recBuf // every addedToTxn we consume, restored if the commit is not attempted + offsetsWereAdded bool + ) + g := cl.consumer.g + if g != nil { // We do not lock because we expect commitTransactionOffsets to // be called *before* ending a transaction. if g.offsetsAddedToTxn { g.offsetsAddedToTxn = false + offsetsWereAdded = true anyAdded = true } } else { @@ -708,7 +766,10 @@ func (cl *Client) EndTransaction(ctx context.Context, commit TransactionEndTry) // addedToTxn to false outside of any mutex. for _, parts := range cl.producer.topics.load() { for _, part := range parts.load().partitions { - anyAdded = part.records.addedToTxn.Swap(false) || anyAdded + if part.records.addedToTxn.Swap(false) { + addedSwapped = append(addedSwapped, part.records) + anyAdded = true + } } } @@ -717,13 +778,53 @@ func (cl *Client) EndTransaction(ctx context.Context, commit TransactionEndTry) // Note that anyAdded is true if the producer ID was failed, meaning we will // get to the potential recovery logic below if necessary. if !anyAdded { - cl.cfg.logger.Log(LogLevelDebug, "no records were produced during the commit; thus no transaction was began; ending without doing anything") - return nil + // Under KIP-890 part 2, produce requests implicitly add their + // partition to the transaction on the broker BEFORE the data + // append; the registration is durable even if the append then + // fails, and we mark a partition added client-side only on a + // SUCCESSFUL produce response. If produces were attempted but + // none succeeded, the broker can have an ongoing transaction + // with registered partitions that only the transaction timeout + // would clear, and the next transaction's produces (same + // epoch, since no EndTxn bumped it) would silently join that + // ongoing transaction. Aborting is always legal under 890p2 + // (aborting an empty transaction succeeds and bumps the + // epoch), so abort regardless of what the caller asked: with + // zero successful produces and no committed offsets, there is + // nothing to commit anyway. + if !cl.producer.tx890p2.Load() || !cl.producer.producedInTxn.Load() { + cl.cfg.logger.Log(LogLevelDebug, "no records were produced during the commit; thus no transaction was began; ending without doing anything") + return nil + } + cl.cfg.logger.Log(LogLevelInfo, "no produce succeeded in this transaction but produces were attempted; issuing an abort to clear any server-side partition registrations", + "transactional_id", *cl.cfg.txnID, + ) + commit = TryAbort } id, epoch, err := cl.producerID(ctx2fn(ctx)) if err != nil { if commit { + // We are NOT attempting the commit: restore everything this + // call consumed (inTxn, addedToTxn, offsetsAddedToTxn). We + // document that the caller should retry with TryAbort, and + // that retry must still see the transaction state to issue + // the EndTxn abort; consuming the state here would turn the + // retry into a silent no-op that leaves the broker-side + // transaction ongoing (stalling read_committed consumers on + // the LSO) until the transaction timeout aborts it. + // producingTxn deliberately stays false: produces between + // the failed commit and the abort retry fail fast with + // errNotInTransaction rather than buffering against a + // failed producer ID. + for _, rb := range addedSwapped { + rb.addedToTxn.Store(true) + } + if offsetsWereAdded { + g.offsetsAddedToTxn = true + } + cl.producer.inTxn = true + cl.producer.endUnconfirmed = unconfirmed return kerr.OperationNotAttempted } @@ -737,6 +838,28 @@ func (cl *Client) EndTransaction(ctx context.Context, commit TransactionEndTry) } } + // This is the retry after an unconfirmed EndTxn outcome, and the + // producerID call above succeeded -- which, with the ID failed as + // errReloadProducerID, means it re-ran InitProducerID at our prior + // id/epoch: the broker bumped the epoch and fence-aborted anything + // still ongoing from the unconfirmed attempt. That reload IS the + // abort; issuing EndTxn now would end an empty transaction at the + // fresh epoch, which pre-KIP-890p2 brokers reject with + // INVALID_TXN_STATE. A commit retry is refused: the prior outcome is + // unknowable and the reload above may have just aborted it, so + // "success" here would lie to the caller. + if unconfirmed { + if commit { + return errors.New("cannot retry a commit whose outcome is unconfirmed: the transaction may already be aborted; retry with TryAbort") + } + cl.cfg.logger.Log(LogLevelInfo, "aborting an unconfirmed transaction via producer id reload; the epoch bump fence-aborted anything still ongoing", + "transactional_id", *cl.cfg.txnID, + "id", id, + "epoch", epoch, + ) + return nil + } + cl.cfg.logger.Log(LogLevelInfo, "ending transaction", "transactional_id", *cl.cfg.txnID, "commit", commit, @@ -798,17 +921,64 @@ func (cl *Client) EndTransaction(ctx context.Context, commit TransactionEndTry) return nil }) - // If the returned error is still a Kafka error, this is fatal and we - // need to fail our producer ID we loaded above. + // Any error after an attempted EndTxn must fail the producer ID. + // Walkthrough of what a healthy-PID + consumed-state combination + // would otherwise allow: EndTxn(commit) dies on a + // transport error the request may never have reached the broker, so + // the broker transaction is still ongoing; the documented TryAbort + // retry returns nil at the !inTxn guard above without sending + // anything; the next BeginTransaction succeeds (PID error-free) and + // produces run at the SAME id/epoch (nothing ever bumped it), so + // under KIP-890p2 they implicitly join the still-ongoing transaction; + // the next commit then commits the prior "failed" transaction's + // records too -- records the caller already rewound and reprocessed. // - // UNKNOWN_SERVER_ERROR can theoretically be returned (not all brokers - // do). This technically is fatal, but we do not really know whether it - // is. We can just return this error and let the caller decide to - // continue, if the caller does continue, we will try something and - // eventually then receive our proper transactional error, if any. - var ke *kerr.Error - if errors.As(err, &ke) && !ke.Retriable && ke.Code != kerr.UnknownServerError.Code { - cl.failProducerID(id, epoch, err) + // How we fail the PID depends on what we know: + // + // - A non-retriable Kafka error (fenced, invalid mapping, etc.) is a + // definitive broker answer: fail with that error so recovery flows + // through maybeRecoverProducerID's classification. + // + // - Everything else -- a transport error, a retriable error that + // outlived retries, or UNKNOWN_SERVER_ERROR (which some brokers + // return where the outcome is unknowable) -- leaves the commit or + // abort UNCONFIRMED. Fail with errReloadProducerID: the next + // produce or BeginTransaction re-runs InitProducerID at our + // current id/epoch, which bumps the epoch and fence-aborts any + // transaction still ongoing broker-side (the same KIP-360 heal + // maybeRecoverProducerID relies on). If the EndTxn actually did + // complete, the re-init is harmless. Either way the caller saw an + // error and reprocesses: at-least-once, never a silent join. + // + // failProducerID only swaps over an error-free PID, so this cannot + // clobber an already-fatal producer state. + // + // We also restore everything this call consumed and mark the outcome + // unconfirmed, so the documented TryAbort retry heals NOW instead of + // at the next transaction: the retry re-enters with transaction state + // intact, its producerID call reloads the failed ID (the epoch bump + // fence-aborts anything still ongoing broker-side), and the retry + // returns nil above without sending an EndTxn. For a definitively + // failed ID (fenced, invalid mapping), the retry instead flows + // through maybeRecoverProducerID's classification, same as an abort + // after a pre-attempt producerID failure. producingTxn stays false: + // produces between the failure and the retry fail fast rather than + // buffering against a failed producer ID. + if err != nil { + var ke *kerr.Error + if errors.As(err, &ke) && !ke.Retriable && ke.Code != kerr.UnknownServerError.Code { + cl.failProducerID(id, epoch, err) + } else { + cl.failProducerID(id, epoch, errReloadProducerID) + } + for _, rb := range addedSwapped { + rb.addedToTxn.Store(true) + } + if offsetsWereAdded { + g.offsetsAddedToTxn = true + } + cl.producer.inTxn = true + cl.producer.endUnconfirmed = true } return err @@ -847,11 +1017,37 @@ func (cl *Client) maybeRecoverProducerID(ctx context.Context) (necessary, did bo return true, false, err } + if ke.Retriable { + // The stored failure is a retriable broker code, e.g. + // COORDINATOR_LOAD_IN_PROGRESS or NOT_COORDINATOR that + // outlived its internal retries, or CONCURRENT_TRANSACTIONS + // that outlived doWithConcurrentTransactions. These are + // transient load failures, not a fatal producer state: flag + // the ID for reload exactly like the transport-level failures + // above, rather than reporting "fatal, unrecoverable" for a + // condition that clears on its own. + cl.producer.id.Store(&producerID{ + id: id, + epoch: epoch, + err: errReloadProducerID, + }) + return true, true, nil + } + var recoverable bool - if cl.supportsKeyVersion(int16(kmsg.EndTxn), 5) { - // As of KIP-890 / Kafka 4.0, InvalidProducerIDMapping and + if cl.producer.tx890p2.Load() { + // Under KIP-890 part 2 (transaction.version=2 in effect for + // this client's transactions), InvalidProducerIDMapping and // InvalidProducerEpoch are NOT recoverable. Only // UnknownProducerID and TransactionAbortable are. + // + // We gate on the mode our transactions actually ran in, NOT + // on broker-advertised EndTxn versions: a 4.0+ broker + // advertises EndTxn v5 even while the cluster's + // transaction.version is still 0 or 1, and under those the + // cluster still operates the pre-890p2 semantics where the + // KIP-360/KIP-588 re-init below is the designed recovery + // (e.g. after a transaction-timeout abort bumped our epoch). recoverable = errors.Is(ke, kerr.UnknownProducerID) || errors.Is(ke, kerr.TransactionAbortable) } else { kip360 := cl.producer.idVersion >= 3 && (errors.Is(ke, kerr.UnknownProducerID) || errors.Is(ke, kerr.InvalidProducerIDMapping)) @@ -876,6 +1072,31 @@ func (cl *Client) maybeRecoverProducerID(ctx context.Context) (necessary, did bo // If a transaction is begun too quickly after finishing an old transaction, // Kafka may still be finalizing its commit / abort and will return a // concurrent transactions error. We handle that by retrying for a bit. +// +// Constraints any change to EOS-under-coordinator-churn (here and in +// maybeRecoverProducerID / EndTransaction) must preserve — established by the +// txn-churn audit: +// +// 1. This wrapper / coordinator-retry division stays: the coordinator +// wrapper retries only coordinator-move codes; CONCURRENT_TRANSACTIONS +// loops belong to callers, ctx-bounded, because CT can legitimately last +// as long as a marker drain. Route CT recovery through this loop, not a +// second one. +// 2. anyAdded gating stays for TV1 — EndTxn on an EMPTY TV1 transaction is +// INVALID_TXN_STATE. The TV2 forced-abort-when-every-produce-failed path +// must stay TV2-only and attempted-only; idle Begin/End cycles stay +// wireless. +// 3. Producer-fenced means dead: no fix may add recovery for PRODUCER_FENCED +// from coordinator paths. Only the timeout-abort IPE-on-produce path is +// recoverable, and only under TV1 semantics. +// +// Two design-sized items remain deliberately NOT taken (would need their own +// round; until then docs + AbortingFirstErrPromise carry them): (a) +// commit-after-failed-produce — kgo commits whatever succeeded if the caller +// asks, unlike Java's abortable-state block, so changing it means tracking +// per-txn batch failures and changing End's contract; (b) TV2 feature +// downgrade mid-session (transaction.version 2=>1 while a client lives) — +// Java's per-EndTxn re-check is the reference shape if it ever bites. func (cl *Client) doWithConcurrentTransactions(ctx context.Context, name string, fn func() error) error { start := time.Now() tries := 0 @@ -885,20 +1106,21 @@ start: err := fn() if errors.Is(err, kerr.ConcurrentTransactions) { // The longer we are stalled, the more we enforce a minimum - // backoff. + // backoff. Checks are ordered longest first; switch takes the + // first true case. since := time.Since(start) switch { - case since > time.Second: - if backoff < 200*time.Millisecond { - backoff = 200 * time.Millisecond + case since > 5*time.Second: + if backoff < time.Second { + backoff = time.Second } case since > 5*time.Second/2: if backoff < 500*time.Millisecond { backoff = 500 * time.Millisecond } - case since > 5*time.Second: - if backoff < time.Second { - backoff = time.Second + case since > time.Second: + if backoff < 200*time.Millisecond { + backoff = 200 * time.Millisecond } } @@ -1069,31 +1291,12 @@ func (g *groupConsumer) commitTxn(ctx context.Context, tx890p2 bool, req *kmsg.T } priorDone := g.commitDone - - // Unlike the non-txn consumer, we use the group context for - // transaction offset committing. We want to quit when the group is - // left, and we are not committing when leaving. We rely on proper - // usage of the GroupTransactSession API to issue commits, so there is - // no reason not to use the group context here. - commitCtx, commitCancel := context.WithCancel(g.ctx) // enable ours to be canceled and waited for commitDone := make(chan struct{}) - g.commitDone = commitDone - if ctx.Done() != nil { - go func() { - select { - case <-ctx.Done(): - commitCancel() - case <-commitCtx.Done(): - } - }() - } - go func() { defer close(commitDone) // allow future commits to continue when we are done - defer commitCancel() - if priorDone != nil { // wait for any prior request to finish + if priorDone != nil { // wait for any prior request to finish // Same as commit(): we must NOT cancel the prior commit // because canceling kills the TCP connection, and our // subsequent request on a new connection can be processed @@ -1108,7 +1311,14 @@ func (g *groupConsumer) commitTxn(ctx context.Context, tx890p2 bool, req *kmsg.T g.cl.cfg.logger.Log(LogLevelDebug, "issuing txn offset commit", "uncommitted", req) start := time.Now() - ctx := ctx // capture a local ctx variable; do not use the shared one that is concurrently read above + // The request rides the caller's context (the End context), + // not the group context: a transactional offset commit must + // not be canceled by group teardown midway, because canceling + // an in-flight request kills the connection and a replacement + // commit on a new connection can be reordered behind the + // canceled one by the broker. End documents that canceling + // ITS context risks an invalid state. + ctx := ctx if !tx890p2 { ctx = context.WithValue(ctx, ctxPinReq, &pinReq{pinMax: true, max: 4}) // v5 is only supported with KIP-890 part 2 } diff --git a/vendor/github.com/twmb/franz-go/pkg/sasl/scram/scram.go b/vendor/github.com/twmb/franz-go/pkg/sasl/scram/scram.go index 6272da666a6..557c4f09420 100644 --- a/vendor/github.com/twmb/franz-go/pkg/sasl/scram/scram.go +++ b/vendor/github.com/twmb/franz-go/pkg/sasl/scram/scram.go @@ -16,7 +16,7 @@ import ( "strconv" "strings" - "golang.org/x/crypto/pbkdf2" + "crypto/pbkdf2" "github.com/twmb/franz-go/pkg/sasl" ) @@ -209,7 +209,10 @@ func (s *session) authenticateClient(serverFirstMsg []byte) ([]byte, error) { ////////////////// h := s.newhash() - saltedPassword := pbkdf2.Key([]byte(s.auth.Pass), salt, iters, h.Size(), s.newhash) // SaltedPassword := Hi(Normalize(password), salt, i) + saltedPassword, err := pbkdf2.Key(s.newhash, s.auth.Pass, salt, iters, h.Size()) // SaltedPassword := Hi(Normalize(password), salt, i) + if err != nil { + return nil, fmt.Errorf("pbkdf2 err: %v", err) + } mac := hmac.New(s.newhash, saltedPassword) if _, err = mac.Write([]byte("Client Key")); err != nil { diff --git a/vendor/github.com/ua-parser/uap-go/uaparser/parser.go b/vendor/github.com/ua-parser/uap-go/uaparser/parser.go index 7c28b82ef7b..dc2c340d34d 100644 --- a/vendor/github.com/ua-parser/uap-go/uaparser/parser.go +++ b/vendor/github.com/ua-parser/uap-go/uaparser/parser.go @@ -266,11 +266,12 @@ func New(options ...Option) (*Parser, error) { } if parser.RegexDefinitions == nil { + // Clone the cached default so the per-parser mustCompile() writes + // to its own pointer set instead of the shared sync.OnceValue + // slice elements. regexesDefinitions := defaultRegexesDefinitions() - parser.RegexDefinitions = ®exesDefinitions - } - - if parser.config.UseSort { + parser.RegexDefinitions = regexesDefinitions.Clone() + } else if parser.config.UseSort { parser.RegexDefinitions = parser.RegexDefinitions.Clone() } diff --git a/vendor/github.com/yuin/gopher-lua/README.md b/vendor/github.com/yuin/gopher-lua/README.md new file mode 100644 index 00000000000..c51026cd42c --- /dev/null +++ b/vendor/github.com/yuin/gopher-lua/README.md @@ -0,0 +1,833 @@ +# GopherLua: VM and compiler for Lua in Go. + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/yuin/gopher-lua.svg)](https://pkg.go.dev/github.com/yuin/gopher-lua) [![test](https://github.com/yuin/gopher-lua/workflows/test/badge.svg?branch=master&event=push)](https://github.com/yuin/gopher-lua/actions?query=workflow:test) [![Coverage Status](https://coveralls.io/repos/github/yuin/gopher-lua/badge.svg?branch=master)](https://coveralls.io/github/yuin/gopher-lua) + +GopherLua is a Lua5.1(+ `goto` statement in Lua5.2) VM and compiler written in Go. GopherLua has a same goal +with Lua: **Be a scripting language with extensible semantics** . It provides +Go APIs that allow you to easily embed a scripting language to your Go host +programs. + +## Table of Contents + +- [Design principle](#design-principle) +- [How about performance?](#how-about-performance) +- [Installation](#installation) +- [Usage](#usage) +- [Differences between Lua and GopherLua](#differences-between-lua-and-gopherlua) +- [Standalone interpreter](#standalone-interpreter) +- [How to Contribute](#how-to-contribute) +- [Libraries for GopherLua](#libraries-for-gopherlua) +- [Donation](#donation) +- [License](#license) +- [Author](#author) + +## Design principle + +- Be a scripting language with extensible semantics. +- User-friendly Go API + - The stack based API like the one used in the original Lua + implementation will cause a performance improvements in GopherLua + (It will reduce memory allocations and concrete type <-> interface conversions). + GopherLua API is **not** the stack based API. + GopherLua give preference to the user-friendliness over the performance. + +## How about performance? + +GopherLua is not fast but not too slow, I think. + +GopherLua has almost equivalent ( or little bit better ) performance as Python3 on micro benchmarks. + +There are some benchmarks on the [wiki page](https://github.com/yuin/gopher-lua/wiki/Benchmarks) . + +## Installation + +```bash +$ go get github.com/yuin/gopher-lua +``` + +GopherLua supports >= Go1.9. + +## Usage + +GopherLua APIs perform in much the same way as Lua, **but the stack is used only +for passing arguments and receiving returned values.** + +GopherLua supports channel operations. See **"Goroutines"** section. + +Import a package. + +```go +import ( + "github.com/yuin/gopher-lua" +) +``` + +Run scripts in the VM. + +```go +L := lua.NewState() +defer L.Close() +if err := L.DoString(`print("hello")`); err != nil { + panic(err) +} +``` + +```go +L := lua.NewState() +defer L.Close() +if err := L.DoFile("hello.lua"); err != nil { + panic(err) +} +``` + +Refer to [Lua Reference Manual](http://www.lua.org/manual/5.1/) and [Go doc](http://godoc.org/github.com/yuin/gopher-lua) for further information. + +Note that elements that are not commented in [Go doc](http://godoc.org/github.com/yuin/gopher-lua) equivalent to [Lua Reference Manual](http://www.lua.org/manual/5.1/) , except GopherLua uses objects instead of Lua stack indices. + +### Data model + +All data in a GopherLua program is an `LValue` . `LValue` is an interface +type that has following methods. + +- `String() string` +- `Type() LValueType` + +Objects implement an LValue interface are + +| Type name | Go type | Type() value | Constants | +|-------------|----------------|--------------|----------------------| +| `LNilType` | (constants) | `LTNil` | `LNil` | +| `LBool` | (constants) | `LTBool` | `LTrue`, `LFalse` | +| `LNumber` | float64 | `LTNumber` | `-` | +| `LString` | string | `LTString` | `-` | +| `LFunction` | struct pointer | `LTFunction` | `-` | +| `LUserData` | struct pointer | `LTUserData` | `-` | +| `LState` | struct pointer | `LTThread` | `-` | +| `LTable` | struct pointer | `LTTable` | `-` | +| `LChannel` | chan LValue | `LTChannel` | `-` | + +You can test an object type in Go way(type assertion) or using a `Type()` value. + +```go +lv := L.Get(-1) // get the value at the top of the stack +if str, ok := lv.(lua.LString); ok { + // lv is LString + fmt.Println(string(str)) +} +if lv.Type() != lua.LTString { + panic("string required.") +} +``` + +```go +lv := L.Get(-1) // get the value at the top of the stack +if tbl, ok := lv.(*lua.LTable); ok { + // lv is LTable + fmt.Println(L.ObjLen(tbl)) +} +``` + +Note that `LBool` , `LNumber` , `LString` is not a pointer. + +To test `LNilType` and `LBool`, You **must** use pre-defined constants. + +```go +lv := L.Get(-1) // get the value at the top of the stack + +if lv == lua.LTrue { // correct +} + +if bl, ok := lv.(lua.LBool); ok && bool(bl) { // wrong +} +``` + +In Lua, both `nil` and `false` make a condition false. `LVIsFalse` and `LVAsBool` implement this specification. + +```go +lv := L.Get(-1) // get the value at the top of the stack +if lua.LVIsFalse(lv) { // lv is nil or false +} + +if lua.LVAsBool(lv) { // lv is neither nil nor false +} +``` + +Objects that based on go structs(`LFunction`. `LUserData`, `LTable`) +have some public methods and fields. You can use these methods and fields for +performance and debugging, but there are some limitations. + +- Metatable does not work. +- No error handlings. + +### Callstack & Registry size + +The size of an `LState`'s callstack controls the maximum call depth for Lua functions within a script (Go function calls do not count). + +The registry of an `LState` implements stack storage for calling functions (both Lua and Go functions) and also for temporary variables in expressions. Its storage requirements will increase with callstack usage and also with code complexity. + +Both the registry and the callstack can be set to either a fixed size or to auto size. + +When you have a large number of `LStates` instantiated in a process, it's worth taking the time to tune the registry and callstack options. + +#### Registry + +The registry can have an initial size, a maximum size and a step size configured on a per `LState` basis. This will allow the registry to grow as needed. It will not shrink again after growing. + +```go +L := lua.NewState(lua.Options{ + RegistrySize: 1024 * 20, // this is the initial size of the registry + RegistryMaxSize: 1024 * 80, // this is the maximum size that the registry can grow to. If set to `0` (the default) then the registry will not auto grow + RegistryGrowStep: 32, // this is how much to step up the registry by each time it runs out of space. The default is `32`. +}) +defer L.Close() +``` + +A registry which is too small for a given script will ultimately result in a panic. A registry which is too big will waste memory (which can be significant if many `LStates` are instantiated). +Auto growing registries incur a small performance hit at the point they are resized but will not otherwise affect performance. + +#### Callstack + +The callstack can operate in two different modes, fixed or auto size. +A fixed size callstack has the highest performance and has a fixed memory overhead. +An auto sizing callstack will allocate and release callstack pages on demand which will ensure the minimum amount of memory is in use at any time. The downside is it will incur a small performance impact every time a new page of callframes is allocated. +By default an `LState` will allocate and free callstack frames in pages of 8, so the allocation overhead is not incurred on every function call. It is very likely that the performance impact of an auto resizing callstack will be negligible for most use cases. + +```go +L := lua.NewState(lua.Options{ + CallStackSize: 120, // this is the maximum callstack size of this LState + MinimizeStackMemory: true, // Defaults to `false` if not specified. If set, the callstack will auto grow and shrink as needed up to a max of `CallStackSize`. If not set, the callstack will be fixed at `CallStackSize`. +}) +defer L.Close() +``` + +#### Option defaults + +The above examples show how to customize the callstack and registry size on a per `LState` basis. You can also adjust some defaults for when options are not specified by altering the values of `lua.RegistrySize`, `lua.RegistryGrowStep` and `lua.CallStackSize`. + +An `LState` object that has been created by `*LState#NewThread()` inherits the callstack & registry size from the parent `LState` object. + +### Miscellaneous lua.NewState options + +- **Options.SkipOpenLibs bool(default false)** + - By default, GopherLua opens all built-in libraries when new LState is created. + - You can skip this behaviour by setting this to `true` . + - Using the various `OpenXXX(L *LState) int` functions you can open only those libraries that you require, for an example see below. +- **Options.IncludeGoStackTrace bool(default false)** + - By default, GopherLua does not show Go stack traces when panics occur. + - You can get Go stack traces by setting this to `true` . + +### API + +Refer to [Lua Reference Manual](http://www.lua.org/manual/5.1/) and [Go doc(LState methods)](http://godoc.org/github.com/yuin/gopher-lua) for further information. + +#### Calling Go from Lua + +```go +func Double(L *lua.LState) int { + lv := L.ToInt(1) /* get argument */ + L.Push(lua.LNumber(lv * 2)) /* push result */ + return 1 /* number of results */ +} + +func main() { + L := lua.NewState() + defer L.Close() + L.SetGlobal("double", L.NewFunction(Double)) /* Original lua_setglobal uses stack... */ +} +``` + +```lua +print(double(20)) -- > "40" +``` + +Any function registered with GopherLua is a `lua.LGFunction`, defined in `value.go` + +```go +type LGFunction func(*LState) int +``` + +Working with coroutines. + +```go +co, _ := L.NewThread() /* create a new thread */ +fn := L.GetGlobal("coro").(*lua.LFunction) /* get function from lua */ +for { + st, err, values := L.Resume(co, fn) + if st == lua.ResumeError { + fmt.Println("yield break(error)") + fmt.Println(err.Error()) + break + } + + for i, lv := range values { + fmt.Printf("%v : %v\n", i, lv) + } + + if st == lua.ResumeOK { + fmt.Println("yield break(ok)") + break + } +} +``` + +#### Opening a subset of builtin modules + +The following demonstrates how to open a subset of the built-in modules in Lua, say for example to avoid enabling modules with access to local files or system calls. + +main.go + +```go +func main() { + L := lua.NewState(lua.Options{SkipOpenLibs: true}) + defer L.Close() + for _, pair := range []struct { + n string + f lua.LGFunction + }{ + {lua.LoadLibName, lua.OpenPackage}, // Must be first + {lua.BaseLibName, lua.OpenBase}, + {lua.TabLibName, lua.OpenTable}, + } { + if err := L.CallByParam(lua.P{ + Fn: L.NewFunction(pair.f), + NRet: 0, + Protect: true, + }, lua.LString(pair.n)); err != nil { + panic(err) + } + } + if err := L.DoFile("main.lua"); err != nil { + panic(err) + } +} +``` + +#### Creating a module by Go + +mymodule.go + +```go +package mymodule + +import ( + "github.com/yuin/gopher-lua" +) + +func Loader(L *lua.LState) int { + // register functions to the table + mod := L.SetFuncs(L.NewTable(), exports) + // register other stuff + L.SetField(mod, "name", lua.LString("value")) + + // returns the module + L.Push(mod) + return 1 +} + +var exports = map[string]lua.LGFunction{ + "myfunc": myfunc, +} + +func myfunc(L *lua.LState) int { + return 0 +} +``` + +mymain.go + +```go +package main + +import ( + "./mymodule" + "github.com/yuin/gopher-lua" +) + +func main() { + L := lua.NewState() + defer L.Close() + L.PreloadModule("mymodule", mymodule.Loader) + if err := L.DoFile("main.lua"); err != nil { + panic(err) + } +} +``` + +main.lua + +```lua +local m = require("mymodule") +m.myfunc() +print(m.name) +``` + +#### Calling Lua from Go + +```go +L := lua.NewState() +defer L.Close() +if err := L.DoFile("double.lua"); err != nil { + panic(err) +} +if err := L.CallByParam(lua.P{ + Fn: L.GetGlobal("double"), + NRet: 1, + Protect: true, + }, lua.LNumber(10)); err != nil { + panic(err) +} +ret := L.Get(-1) // returned value +L.Pop(1) // remove received value +``` + +If `Protect` is false, GopherLua will panic instead of returning an `error` value. + +#### User-Defined types + +You can extend GopherLua with new types written in Go. +`LUserData` is provided for this purpose. + +```go +type Person struct { + Name string +} + +const luaPersonTypeName = "person" + +// Registers my person type to given L. +func registerPersonType(L *lua.LState) { + mt := L.NewTypeMetatable(luaPersonTypeName) + L.SetGlobal("person", mt) + // static attributes + L.SetField(mt, "new", L.NewFunction(newPerson)) + // methods + L.SetField(mt, "__index", L.SetFuncs(L.NewTable(), personMethods)) +} + +// Constructor +func newPerson(L *lua.LState) int { + person := &Person{L.CheckString(1)} + ud := L.NewUserData() + ud.Value = person + L.SetMetatable(ud, L.GetTypeMetatable(luaPersonTypeName)) + L.Push(ud) + return 1 +} + +// Checks whether the first lua argument is a *LUserData with *Person and returns this *Person. +func checkPerson(L *lua.LState) *Person { + ud := L.CheckUserData(1) + if v, ok := ud.Value.(*Person); ok { + return v + } + L.ArgError(1, "person expected") + return nil +} + +var personMethods = map[string]lua.LGFunction{ + "name": personGetSetName, +} + +// Getter and setter for the Person#Name +func personGetSetName(L *lua.LState) int { + p := checkPerson(L) + if L.GetTop() == 2 { + p.Name = L.CheckString(2) + return 0 + } + L.Push(lua.LString(p.Name)) + return 1 +} + +func main() { + L := lua.NewState() + defer L.Close() + registerPersonType(L) + if err := L.DoString(` + p = person.new("Steeve") + print(p:name()) -- "Steeve" + p:name("Alice") + print(p:name()) -- "Alice" + `); err != nil { + panic(err) + } +} +``` + +#### Terminating a running LState + +GopherLua supports the [Go Concurrency Patterns: Context](https://blog.golang.org/context) . + +```go +L := lua.NewState() +defer L.Close() +ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) +defer cancel() +// set the context to our LState +L.SetContext(ctx) +err := L.DoString(` + local clock = os.clock + function sleep(n) -- seconds + local t0 = clock() + while clock() - t0 <= n do end + end + sleep(3) +`) +// err.Error() contains "context deadline exceeded" +``` + +With coroutines + +```go +L := lua.NewState() +defer L.Close() +ctx, cancel := context.WithCancel(context.Background()) +L.SetContext(ctx) +defer cancel() +L.DoString(` + function coro() + local i = 0 + while true do + coroutine.yield(i) + i = i+1 + end + return i + end +`) +co, cocancel := L.NewThread() +defer cocancel() +fn := L.GetGlobal("coro").(*LFunction) + +_, err, values := L.Resume(co, fn) // err is nil + +cancel() // cancel the parent context + +_, err, values = L.Resume(co, fn) // err is NOT nil : child context was canceled +``` + +**Note that using a context causes performance degradation.** + +``` +time ./glua-with-context.exe fib.lua +9227465 +0.01s user 0.11s system 1% cpu 7.505 total + +time ./glua-without-context.exe fib.lua +9227465 +0.01s user 0.01s system 0% cpu 5.306 total +``` + +#### Sharing Lua byte code between LStates + +Calling `DoFile` will load a Lua script, compile it to byte code and run the byte code in a `LState`. + +If you have multiple `LStates` which are all required to run the same script, you can share the byte code between them, +which will save on memory. +Sharing byte code is safe as it is read only and cannot be altered by lua scripts. + +```go +// CompileLua reads the passed lua file from disk and compiles it. +func CompileLua(filePath string) (*lua.FunctionProto, error) { + file, err := os.Open(filePath) + defer file.Close() + if err != nil { + return nil, err + } + reader := bufio.NewReader(file) + chunk, err := parse.Parse(reader, filePath) + if err != nil { + return nil, err + } + proto, err := lua.Compile(chunk, filePath) + if err != nil { + return nil, err + } + return proto, nil +} + +// DoCompiledFile takes a FunctionProto, as returned by CompileLua, and runs it in the LState. It is equivalent +// to calling DoFile on the LState with the original source file. +func DoCompiledFile(L *lua.LState, proto *lua.FunctionProto) error { + lfunc := L.NewFunctionFromProto(proto) + L.Push(lfunc) + return L.PCall(0, lua.MultRet, nil) +} + +// Example shows how to share the compiled byte code from a lua script between multiple VMs. +func Example() { + codeToShare, err := CompileLua("mylua.lua") + if err != nil { + panic(err) + } + a := lua.NewState() + b := lua.NewState() + c := lua.NewState() + DoCompiledFile(a, codeToShare) + DoCompiledFile(b, codeToShare) + DoCompiledFile(c, codeToShare) +} +``` + +#### Goroutines + +The `LState` is not goroutine-safe. It is recommended to use one LState per goroutine and communicate between goroutines by using channels. + +Channels are represented by `channel` objects in GopherLua. And a `channel` table provides functions for performing channel operations. + +Some objects can not be sent over channels due to having non-goroutine-safe objects inside itself. + +- a thread(state) +- a function +- an userdata +- a table with a metatable + +You **must not** send these objects from Go APIs to channels. + +```go +func receiver(ch, quit chan lua.LValue) { + L := lua.NewState() + defer L.Close() + L.SetGlobal("ch", lua.LChannel(ch)) + L.SetGlobal("quit", lua.LChannel(quit)) + if err := L.DoString(` + local exit = false + while not exit do + channel.select( + {"|<-", ch, function(ok, v) + if not ok then + print("channel closed") + exit = true + else + print("received:", v) + end + end}, + {"|<-", quit, function(ok, v) + print("quit") + exit = true + end} + ) + end + `); err != nil { + panic(err) + } +} + +func sender(ch, quit chan lua.LValue) { + L := lua.NewState() + defer L.Close() + L.SetGlobal("ch", lua.LChannel(ch)) + L.SetGlobal("quit", lua.LChannel(quit)) + if err := L.DoString(` + ch:send("1") + ch:send("2") + `); err != nil { + panic(err) + } + ch <- lua.LString("3") + quit <- lua.LTrue +} + +func main() { + ch := make(chan lua.LValue) + quit := make(chan lua.LValue) + go receiver(ch, quit) + go sender(ch, quit) + time.Sleep(3 * time.Second) +} +``` + +##### Go API + +`ToChannel`, `CheckChannel`, `OptChannel` are available. + +Refer to [Go doc(LState methods)](http://godoc.org/github.com/yuin/gopher-lua) for further information. + +##### Lua API + +- **channel.make([buf:int]) -> ch:channel** + - Create new channel that has a buffer size of `buf`. By default, `buf` is 0. + +- **channel.select(case:table [, case:table, case:table ...]) -> {index:int, recv:any, ok}** + - Same as the `select` statement in Go. It returns the index of the chosen case and, if that + case was a receive operation, the value received and a boolean indicating whether the channel has been closed. + - `case` is a table that outlined below. + - receiving: `{"|<-", ch:channel [, handler:func(ok, data:any)]}` + - sending: `{"<-|", ch:channel, data:any [, handler:func(data:any)]}` + - default: `{"default" [, handler:func()]}` + +`channel.select` examples: + +```lua +local idx, recv, ok = channel.select( + {"|<-", ch1}, + {"|<-", ch2} +) +if not ok then + print("closed") +elseif idx == 1 then -- received from ch1 + print(recv) +elseif idx == 2 then -- received from ch2 + print(recv) +end +``` + +```lua +channel.select( + {"|<-", ch1, function(ok, data) + print(ok, data) + end}, + {"<-|", ch2, "value", function(data) + print(data) + end}, + {"default", function() + print("default action") + end} +) +``` + +- **channel:send(data:any)** + - Send `data` over the channel. +- **channel:receive() -> ok:bool, data:any** + - Receive some data over the channel. +- **channel:close()** + - Close the channel. + +##### The LState pool pattern + +To create per-thread LState instances, You can use the `sync.Pool` like mechanism. + +```go +type lStatePool struct { + m sync.Mutex + saved []*lua.LState +} + +func (pl *lStatePool) Get() *lua.LState { + pl.m.Lock() + defer pl.m.Unlock() + n := len(pl.saved) + if n == 0 { + return pl.New() + } + x := pl.saved[n-1] + pl.saved = pl.saved[0 : n-1] + return x +} + +func (pl *lStatePool) New() *lua.LState { + L := lua.NewState() + // setting the L up here. + // load scripts, set global variables, share channels, etc... + return L +} + +func (pl *lStatePool) Put(L *lua.LState) { + pl.m.Lock() + defer pl.m.Unlock() + pl.saved = append(pl.saved, L) +} + +func (pl *lStatePool) Shutdown() { + for _, L := range pl.saved { + L.Close() + } +} + +// Global LState pool +var luaPool = &lStatePool{ + saved: make([]*lua.LState, 0, 4), +} +``` + +Now, you can get per-thread LState objects from the `luaPool` . + +```go +func MyWorker() { + L := luaPool.Get() + defer luaPool.Put(L) + /* your code here */ +} + +func main() { + defer luaPool.Shutdown() + go MyWorker() + go MyWorker() + /* etc... */ +} +``` + +## Differences between Lua and GopherLua + +### Goroutines + +- GopherLua supports channel operations. + - GopherLua has a type named `channel`. + - The `channel` table provides functions for performing channel operations. + +### Unsupported functions + +- `string.dump` +- `os.setlocale` +- `lua_Debug.namewhat` +- `package.loadlib` +- debug hooks + +### Miscellaneous notes + +- `collectgarbage` does not take any arguments and runs the garbage collector for the entire Go program. +- `file:setvbuf` does not support a line buffering. +- Daylight saving time is not supported. +- GopherLua has a function to set an environment variable : `os.setenv(name, value)` +- GopherLua support `goto` and `::label::` statement in Lua5.2. + - `goto` is a keyword and not a valid variable name. + +## Standalone interpreter + +Lua has an interpreter called `lua` . GopherLua has an interpreter called `glua` . + +```bash +go get github.com/yuin/gopher-lua/cmd/glua +``` + +`glua` has same options as `lua` . + +## How to Contribute + +See [Guidelines for contributors](https://github.com/yuin/gopher-lua/tree/master/.github/CONTRIBUTING.md) . + +## Libraries for GopherLua + +- [gopher-luar](https://github.com/layeh/gopher-luar) : Simplifies data passing to and from gopher-lua +- [gluamapper](https://github.com/yuin/gluamapper) : Mapping a Lua table to a Go struct +- [gluare](https://github.com/yuin/gluare) : Regular expressions for gopher-lua +- [gluahttp](https://github.com/cjoudrey/gluahttp) : HTTP request module for gopher-lua +- [gopher-json](https://github.com/layeh/gopher-json) : A simple JSON encoder/decoder for gopher-lua +- [gluayaml](https://github.com/kohkimakimoto/gluayaml) : Yaml parser for gopher-lua +- [glua-lfs](https://github.com/layeh/gopher-lfs) : Partially implements the luafilesystem module for gopher-lua +- [gluaurl](https://github.com/cjoudrey/gluaurl) : A url parser/builder module for gopher-lua +- [gluahttpscrape](https://github.com/felipejfc/gluahttpscrape) : A simple HTML scraper module for gopher-lua +- [gluaxmlpath](https://github.com/ailncode/gluaxmlpath) : An xmlpath module for gopher-lua +- [gmoonscript](https://github.com/rucuriousyet/gmoonscript) : Moonscript Compiler for the Gopher Lua VM +- [loguago](https://github.com/rucuriousyet/loguago) : Zerolog wrapper for Gopher-Lua +- [gluabit32](https://github.com/PeerDB-io/gluabit32) : [Port of Lua 5.2 bit32](https://www.lua.org/manual/5.2/manual.html#6.7) +- [gluacrypto](https://github.com/tengattack/gluacrypto) : A native Go implementation of crypto library for the GopherLua VM. +- [gluasql](https://github.com/tengattack/gluasql) : A native Go implementation of SQL client for the GopherLua VM. +- [purr](https://github.com/leyafo/purr) : A http mock testing tool. +- [vadv/gopher-lua-libs](https://github.com/vadv/gopher-lua-libs) : Some usefull libraries for GopherLua VM. +- [gluasocket](https://gitlab.com/megalithic-llc/gluasocket) : A native Go implementation of LuaSocket for the GopherLua VM. +- [glua-async](https://github.com/CuberL/glua-async) : An async/await implement for gopher-lua. +- [gopherlua-debugger](https://github.com/edolphin-ydf/gopherlua-debugger) : A debugger for gopher-lua +- [gluamahonia](https://github.com/super1207/gluamahonia) : An encoding converter for gopher-lua +- [awesome-gopher-lua](https://github.com/Root-lee/awesome-gopher-lua) : Collections of awesome libraries for GopherLua. + +## Donation + +BTC: 1NEDSyUmo4SMTDP83JJQSWi1MvQUGGNMZB + +## License + +MIT + +## Author + +Yusuke Inuzuka diff --git a/vendor/github.com/yuin/gopher-lua/README.rst b/vendor/github.com/yuin/gopher-lua/README.rst deleted file mode 100644 index cc936311069..00000000000 --- a/vendor/github.com/yuin/gopher-lua/README.rst +++ /dev/null @@ -1,890 +0,0 @@ - -=============================================================================== -GopherLua: VM and compiler for Lua in Go. -=============================================================================== - -.. image:: https://pkg.go.dev/badge/github.com/yuin/gopher-lua.svg - :target: https://pkg.go.dev/github.com/yuin/gopher-lua - -.. image:: https://github.com/yuin/gopher-lua/workflows/test/badge.svg?branch=master&event=push - :target: https://github.com/yuin/gopher-lua/actions?query=workflow:test - -.. image:: https://coveralls.io/repos/github/yuin/gopher-lua/badge.svg?branch=master - :target: https://coveralls.io/github/yuin/gopher-lua - -.. image:: https://badges.gitter.im/Join%20Chat.svg - :alt: Join the chat at https://gitter.im/yuin/gopher-lua - :target: https://gitter.im/yuin/gopher-lua?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge - -| - - -GopherLua is a Lua5.1(+ `goto` statement in Lua5.2) VM and compiler written in Go. GopherLua has a same goal -with Lua: **Be a scripting language with extensible semantics** . It provides -Go APIs that allow you to easily embed a scripting language to your Go host -programs. - -.. contents:: - :depth: 1 - ----------------------------------------------------------------- -Design principle ----------------------------------------------------------------- - -- Be a scripting language with extensible semantics. -- User-friendly Go API - - The stack based API like the one used in the original Lua - implementation will cause a performance improvements in GopherLua - (It will reduce memory allocations and concrete type <-> interface conversions). - GopherLua API is **not** the stack based API. - GopherLua give preference to the user-friendliness over the performance. - ----------------------------------------------------------------- -How about performance? ----------------------------------------------------------------- -GopherLua is not fast but not too slow, I think. - -GopherLua has almost equivalent ( or little bit better ) performance as Python3 on micro benchmarks. - -There are some benchmarks on the `wiki page `_ . - ----------------------------------------------------------------- -Installation ----------------------------------------------------------------- - -.. code-block:: bash - - go get github.com/yuin/gopher-lua - -GopherLua supports >= Go1.9. - ----------------------------------------------------------------- -Usage ----------------------------------------------------------------- -GopherLua APIs perform in much the same way as Lua, **but the stack is used only -for passing arguments and receiving returned values.** - -GopherLua supports channel operations. See **"Goroutines"** section. - -Import a package. - -.. code-block:: go - - import ( - "github.com/yuin/gopher-lua" - ) - -Run scripts in the VM. - -.. code-block:: go - - L := lua.NewState() - defer L.Close() - if err := L.DoString(`print("hello")`); err != nil { - panic(err) - } - -.. code-block:: go - - L := lua.NewState() - defer L.Close() - if err := L.DoFile("hello.lua"); err != nil { - panic(err) - } - -Refer to `Lua Reference Manual `_ and `Go doc `_ for further information. - -Note that elements that are not commented in `Go doc `_ equivalent to `Lua Reference Manual `_ , except GopherLua uses objects instead of Lua stack indices. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Data model -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -All data in a GopherLua program is an ``LValue`` . ``LValue`` is an interface -type that has following methods. - -- ``String() string`` -- ``Type() LValueType`` - - -Objects implement an LValue interface are - -================ ========================= ================== ======================= - Type name Go type Type() value Constants -================ ========================= ================== ======================= - ``LNilType`` (constants) ``LTNil`` ``LNil`` - ``LBool`` (constants) ``LTBool`` ``LTrue``, ``LFalse`` - ``LNumber`` float64 ``LTNumber`` ``-`` - ``LString`` string ``LTString`` ``-`` - ``LFunction`` struct pointer ``LTFunction`` ``-`` - ``LUserData`` struct pointer ``LTUserData`` ``-`` - ``LState`` struct pointer ``LTThread`` ``-`` - ``LTable`` struct pointer ``LTTable`` ``-`` - ``LChannel`` chan LValue ``LTChannel`` ``-`` -================ ========================= ================== ======================= - -You can test an object type in Go way(type assertion) or using a ``Type()`` value. - -.. code-block:: go - - lv := L.Get(-1) // get the value at the top of the stack - if str, ok := lv.(lua.LString); ok { - // lv is LString - fmt.Println(string(str)) - } - if lv.Type() != lua.LTString { - panic("string required.") - } - -.. code-block:: go - - lv := L.Get(-1) // get the value at the top of the stack - if tbl, ok := lv.(*lua.LTable); ok { - // lv is LTable - fmt.Println(L.ObjLen(tbl)) - } - -Note that ``LBool`` , ``LNumber`` , ``LString`` is not a pointer. - -To test ``LNilType`` and ``LBool``, You **must** use pre-defined constants. - -.. code-block:: go - - lv := L.Get(-1) // get the value at the top of the stack - - if lv == lua.LTrue { // correct - } - - if bl, ok := lv.(lua.LBool); ok && bool(bl) { // wrong - } - -In Lua, both ``nil`` and ``false`` make a condition false. ``LVIsFalse`` and ``LVAsBool`` implement this specification. - -.. code-block:: go - - lv := L.Get(-1) // get the value at the top of the stack - if lua.LVIsFalse(lv) { // lv is nil or false - } - - if lua.LVAsBool(lv) { // lv is neither nil nor false - } - -Objects that based on go structs(``LFunction``. ``LUserData``, ``LTable``) -have some public methods and fields. You can use these methods and fields for -performance and debugging, but there are some limitations. - -- Metatable does not work. -- No error handlings. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Callstack & Registry size -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The size of an ``LState``'s callstack controls the maximum call depth for Lua functions within a script (Go function calls do not count). - -The registry of an ``LState`` implements stack storage for calling functions (both Lua and Go functions) and also for temporary variables in expressions. Its storage requirements will increase with callstack usage and also with code complexity. - -Both the registry and the callstack can be set to either a fixed size or to auto size. - -When you have a large number of ``LStates`` instantiated in a process, it's worth taking the time to tune the registry and callstack options. - -+++++++++ -Registry -+++++++++ - -The registry can have an initial size, a maximum size and a step size configured on a per ``LState`` basis. This will allow the registry to grow as needed. It will not shrink again after growing. - -.. code-block:: go - - L := lua.NewState(lua.Options{ - RegistrySize: 1024 * 20, // this is the initial size of the registry - RegistryMaxSize: 1024 * 80, // this is the maximum size that the registry can grow to. If set to `0` (the default) then the registry will not auto grow - RegistryGrowStep: 32, // this is how much to step up the registry by each time it runs out of space. The default is `32`. - }) - defer L.Close() - -A registry which is too small for a given script will ultimately result in a panic. A registry which is too big will waste memory (which can be significant if many ``LStates`` are instantiated). -Auto growing registries incur a small performance hit at the point they are resized but will not otherwise affect performance. - -+++++++++ -Callstack -+++++++++ - -The callstack can operate in two different modes, fixed or auto size. -A fixed size callstack has the highest performance and has a fixed memory overhead. -An auto sizing callstack will allocate and release callstack pages on demand which will ensure the minimum amount of memory is in use at any time. The downside is it will incur a small performance impact every time a new page of callframes is allocated. -By default an ``LState`` will allocate and free callstack frames in pages of 8, so the allocation overhead is not incurred on every function call. It is very likely that the performance impact of an auto resizing callstack will be negligible for most use cases. - -.. code-block:: go - - L := lua.NewState(lua.Options{ - CallStackSize: 120, // this is the maximum callstack size of this LState - MinimizeStackMemory: true, // Defaults to `false` if not specified. If set, the callstack will auto grow and shrink as needed up to a max of `CallStackSize`. If not set, the callstack will be fixed at `CallStackSize`. - }) - defer L.Close() - -++++++++++++++++ -Option defaults -++++++++++++++++ - -The above examples show how to customize the callstack and registry size on a per ``LState`` basis. You can also adjust some defaults for when options are not specified by altering the values of ``lua.RegistrySize``, ``lua.RegistryGrowStep`` and ``lua.CallStackSize``. - -An ``LState`` object that has been created by ``*LState#NewThread()`` inherits the callstack & registry size from the parent ``LState`` object. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Miscellaneous lua.NewState options -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- **Options.SkipOpenLibs bool(default false)** - - By default, GopherLua opens all built-in libraries when new LState is created. - - You can skip this behaviour by setting this to ``true`` . - - Using the various `OpenXXX(L *LState) int` functions you can open only those libraries that you require, for an example see below. -- **Options.IncludeGoStackTrace bool(default false)** - - By default, GopherLua does not show Go stack traces when panics occur. - - You can get Go stack traces by setting this to ``true`` . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -API -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Refer to `Lua Reference Manual `_ and `Go doc(LState methods) `_ for further information. - -+++++++++++++++++++++++++++++++++++++++++ -Calling Go from Lua -+++++++++++++++++++++++++++++++++++++++++ - -.. code-block:: go - - func Double(L *lua.LState) int { - lv := L.ToInt(1) /* get argument */ - L.Push(lua.LNumber(lv * 2)) /* push result */ - return 1 /* number of results */ - } - - func main() { - L := lua.NewState() - defer L.Close() - L.SetGlobal("double", L.NewFunction(Double)) /* Original lua_setglobal uses stack... */ - } - -.. code-block:: lua - - print(double(20)) -- > "40" - -Any function registered with GopherLua is a ``lua.LGFunction``, defined in ``value.go`` - -.. code-block:: go - - type LGFunction func(*LState) int - -Working with coroutines. - -.. code-block:: go - - co, _ := L.NewThread() /* create a new thread */ - fn := L.GetGlobal("coro").(*lua.LFunction) /* get function from lua */ - for { - st, err, values := L.Resume(co, fn) - if st == lua.ResumeError { - fmt.Println("yield break(error)") - fmt.Println(err.Error()) - break - } - - for i, lv := range values { - fmt.Printf("%v : %v\n", i, lv) - } - - if st == lua.ResumeOK { - fmt.Println("yield break(ok)") - break - } - } - -+++++++++++++++++++++++++++++++++++++++++ -Opening a subset of builtin modules -+++++++++++++++++++++++++++++++++++++++++ - -The following demonstrates how to open a subset of the built-in modules in Lua, say for example to avoid enabling modules with access to local files or system calls. - -main.go - -.. code-block:: go - - func main() { - L := lua.NewState(lua.Options{SkipOpenLibs: true}) - defer L.Close() - for _, pair := range []struct { - n string - f lua.LGFunction - }{ - {lua.LoadLibName, lua.OpenPackage}, // Must be first - {lua.BaseLibName, lua.OpenBase}, - {lua.TabLibName, lua.OpenTable}, - } { - if err := L.CallByParam(lua.P{ - Fn: L.NewFunction(pair.f), - NRet: 0, - Protect: true, - }, lua.LString(pair.n)); err != nil { - panic(err) - } - } - if err := L.DoFile("main.lua"); err != nil { - panic(err) - } - } - -+++++++++++++++++++++++++++++++++++++++++ -Creating a module by Go -+++++++++++++++++++++++++++++++++++++++++ - -mymodule.go - -.. code-block:: go - - package mymodule - - import ( - "github.com/yuin/gopher-lua" - ) - - func Loader(L *lua.LState) int { - // register functions to the table - mod := L.SetFuncs(L.NewTable(), exports) - // register other stuff - L.SetField(mod, "name", lua.LString("value")) - - // returns the module - L.Push(mod) - return 1 - } - - var exports = map[string]lua.LGFunction{ - "myfunc": myfunc, - } - - func myfunc(L *lua.LState) int { - return 0 - } - -mymain.go - -.. code-block:: go - - package main - - import ( - "./mymodule" - "github.com/yuin/gopher-lua" - ) - - func main() { - L := lua.NewState() - defer L.Close() - L.PreloadModule("mymodule", mymodule.Loader) - if err := L.DoFile("main.lua"); err != nil { - panic(err) - } - } - -main.lua - -.. code-block:: lua - - local m = require("mymodule") - m.myfunc() - print(m.name) - - -+++++++++++++++++++++++++++++++++++++++++ -Calling Lua from Go -+++++++++++++++++++++++++++++++++++++++++ - -.. code-block:: go - - L := lua.NewState() - defer L.Close() - if err := L.DoFile("double.lua"); err != nil { - panic(err) - } - if err := L.CallByParam(lua.P{ - Fn: L.GetGlobal("double"), - NRet: 1, - Protect: true, - }, lua.LNumber(10)); err != nil { - panic(err) - } - ret := L.Get(-1) // returned value - L.Pop(1) // remove received value - -If ``Protect`` is false, GopherLua will panic instead of returning an ``error`` value. - -+++++++++++++++++++++++++++++++++++++++++ -User-Defined types -+++++++++++++++++++++++++++++++++++++++++ -You can extend GopherLua with new types written in Go. -``LUserData`` is provided for this purpose. - -.. code-block:: go - - type Person struct { - Name string - } - - const luaPersonTypeName = "person" - - // Registers my person type to given L. - func registerPersonType(L *lua.LState) { - mt := L.NewTypeMetatable(luaPersonTypeName) - L.SetGlobal("person", mt) - // static attributes - L.SetField(mt, "new", L.NewFunction(newPerson)) - // methods - L.SetField(mt, "__index", L.SetFuncs(L.NewTable(), personMethods)) - } - - // Constructor - func newPerson(L *lua.LState) int { - person := &Person{L.CheckString(1)} - ud := L.NewUserData() - ud.Value = person - L.SetMetatable(ud, L.GetTypeMetatable(luaPersonTypeName)) - L.Push(ud) - return 1 - } - - // Checks whether the first lua argument is a *LUserData with *Person and returns this *Person. - func checkPerson(L *lua.LState) *Person { - ud := L.CheckUserData(1) - if v, ok := ud.Value.(*Person); ok { - return v - } - L.ArgError(1, "person expected") - return nil - } - - var personMethods = map[string]lua.LGFunction{ - "name": personGetSetName, - } - - // Getter and setter for the Person#Name - func personGetSetName(L *lua.LState) int { - p := checkPerson(L) - if L.GetTop() == 2 { - p.Name = L.CheckString(2) - return 0 - } - L.Push(lua.LString(p.Name)) - return 1 - } - - func main() { - L := lua.NewState() - defer L.Close() - registerPersonType(L) - if err := L.DoString(` - p = person.new("Steeve") - print(p:name()) -- "Steeve" - p:name("Alice") - print(p:name()) -- "Alice" - `); err != nil { - panic(err) - } - } - -+++++++++++++++++++++++++++++++++++++++++ -Terminating a running LState -+++++++++++++++++++++++++++++++++++++++++ -GopherLua supports the `Go Concurrency Patterns: Context `_ . - - -.. code-block:: go - - L := lua.NewState() - defer L.Close() - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) - defer cancel() - // set the context to our LState - L.SetContext(ctx) - err := L.DoString(` - local clock = os.clock - function sleep(n) -- seconds - local t0 = clock() - while clock() - t0 <= n do end - end - sleep(3) - `) - // err.Error() contains "context deadline exceeded" - -With coroutines - -.. code-block:: go - - L := lua.NewState() - defer L.Close() - ctx, cancel := context.WithCancel(context.Background()) - L.SetContext(ctx) - defer cancel() - L.DoString(` - function coro() - local i = 0 - while true do - coroutine.yield(i) - i = i+1 - end - return i - end - `) - co, cocancel := L.NewThread() - defer cocancel() - fn := L.GetGlobal("coro").(*LFunction) - - _, err, values := L.Resume(co, fn) // err is nil - - cancel() // cancel the parent context - - _, err, values = L.Resume(co, fn) // err is NOT nil : child context was canceled - -**Note that using a context causes performance degradation.** - -.. code-block:: - - time ./glua-with-context.exe fib.lua - 9227465 - 0.01s user 0.11s system 1% cpu 7.505 total - - time ./glua-without-context.exe fib.lua - 9227465 - 0.01s user 0.01s system 0% cpu 5.306 total - -+++++++++++++++++++++++++++++++++++++++++ -Sharing Lua byte code between LStates -+++++++++++++++++++++++++++++++++++++++++ -Calling ``DoFile`` will load a Lua script, compile it to byte code and run the byte code in a ``LState``. - -If you have multiple ``LStates`` which are all required to run the same script, you can share the byte code between them, -which will save on memory. -Sharing byte code is safe as it is read only and cannot be altered by lua scripts. - -.. code-block:: go - - // CompileLua reads the passed lua file from disk and compiles it. - func CompileLua(filePath string) (*lua.FunctionProto, error) { - file, err := os.Open(filePath) - defer file.Close() - if err != nil { - return nil, err - } - reader := bufio.NewReader(file) - chunk, err := parse.Parse(reader, filePath) - if err != nil { - return nil, err - } - proto, err := lua.Compile(chunk, filePath) - if err != nil { - return nil, err - } - return proto, nil - } - - // DoCompiledFile takes a FunctionProto, as returned by CompileLua, and runs it in the LState. It is equivalent - // to calling DoFile on the LState with the original source file. - func DoCompiledFile(L *lua.LState, proto *lua.FunctionProto) error { - lfunc := L.NewFunctionFromProto(proto) - L.Push(lfunc) - return L.PCall(0, lua.MultRet, nil) - } - - // Example shows how to share the compiled byte code from a lua script between multiple VMs. - func Example() { - codeToShare := CompileLua("mylua.lua") - a := lua.NewState() - b := lua.NewState() - c := lua.NewState() - DoCompiledFile(a, codeToShare) - DoCompiledFile(b, codeToShare) - DoCompiledFile(c, codeToShare) - } - -+++++++++++++++++++++++++++++++++++++++++ -Goroutines -+++++++++++++++++++++++++++++++++++++++++ -The ``LState`` is not goroutine-safe. It is recommended to use one LState per goroutine and communicate between goroutines by using channels. - -Channels are represented by ``channel`` objects in GopherLua. And a ``channel`` table provides functions for performing channel operations. - -Some objects can not be sent over channels due to having non-goroutine-safe objects inside itself. - -- a thread(state) -- a function -- an userdata -- a table with a metatable - -You **must not** send these objects from Go APIs to channels. - - - -.. code-block:: go - - func receiver(ch, quit chan lua.LValue) { - L := lua.NewState() - defer L.Close() - L.SetGlobal("ch", lua.LChannel(ch)) - L.SetGlobal("quit", lua.LChannel(quit)) - if err := L.DoString(` - local exit = false - while not exit do - channel.select( - {"|<-", ch, function(ok, v) - if not ok then - print("channel closed") - exit = true - else - print("received:", v) - end - end}, - {"|<-", quit, function(ok, v) - print("quit") - exit = true - end} - ) - end - `); err != nil { - panic(err) - } - } - - func sender(ch, quit chan lua.LValue) { - L := lua.NewState() - defer L.Close() - L.SetGlobal("ch", lua.LChannel(ch)) - L.SetGlobal("quit", lua.LChannel(quit)) - if err := L.DoString(` - ch:send("1") - ch:send("2") - `); err != nil { - panic(err) - } - ch <- lua.LString("3") - quit <- lua.LTrue - } - - func main() { - ch := make(chan lua.LValue) - quit := make(chan lua.LValue) - go receiver(ch, quit) - go sender(ch, quit) - time.Sleep(3 * time.Second) - } - -''''''''''''''' -Go API -''''''''''''''' - -``ToChannel``, ``CheckChannel``, ``OptChannel`` are available. - -Refer to `Go doc(LState methods) `_ for further information. - -''''''''''''''' -Lua API -''''''''''''''' - -- **channel.make([buf:int]) -> ch:channel** - - Create new channel that has a buffer size of ``buf``. By default, ``buf`` is 0. - -- **channel.select(case:table [, case:table, case:table ...]) -> {index:int, recv:any, ok}** - - Same as the ``select`` statement in Go. It returns the index of the chosen case and, if that - case was a receive operation, the value received and a boolean indicating whether the channel has been closed. - - ``case`` is a table that outlined below. - - receiving: `{"|<-", ch:channel [, handler:func(ok, data:any)]}` - - sending: `{"<-|", ch:channel, data:any [, handler:func(data:any)]}` - - default: `{"default" [, handler:func()]}` - -``channel.select`` examples: - -.. code-block:: lua - - local idx, recv, ok = channel.select( - {"|<-", ch1}, - {"|<-", ch2} - ) - if not ok then - print("closed") - elseif idx == 1 then -- received from ch1 - print(recv) - elseif idx == 2 then -- received from ch2 - print(recv) - end - -.. code-block:: lua - - channel.select( - {"|<-", ch1, function(ok, data) - print(ok, data) - end}, - {"<-|", ch2, "value", function(data) - print(data) - end}, - {"default", function() - print("default action") - end} - ) - -- **channel:send(data:any)** - - Send ``data`` over the channel. -- **channel:receive() -> ok:bool, data:any** - - Receive some data over the channel. -- **channel:close()** - - Close the channel. - -'''''''''''''''''''''''''''''' -The LState pool pattern -'''''''''''''''''''''''''''''' -To create per-thread LState instances, You can use the ``sync.Pool`` like mechanism. - -.. code-block:: go - - type lStatePool struct { - m sync.Mutex - saved []*lua.LState - } - - func (pl *lStatePool) Get() *lua.LState { - pl.m.Lock() - defer pl.m.Unlock() - n := len(pl.saved) - if n == 0 { - return pl.New() - } - x := pl.saved[n-1] - pl.saved = pl.saved[0 : n-1] - return x - } - - func (pl *lStatePool) New() *lua.LState { - L := lua.NewState() - // setting the L up here. - // load scripts, set global variables, share channels, etc... - return L - } - - func (pl *lStatePool) Put(L *lua.LState) { - pl.m.Lock() - defer pl.m.Unlock() - pl.saved = append(pl.saved, L) - } - - func (pl *lStatePool) Shutdown() { - for _, L := range pl.saved { - L.Close() - } - } - - // Global LState pool - var luaPool = &lStatePool{ - saved: make([]*lua.LState, 0, 4), - } - -Now, you can get per-thread LState objects from the ``luaPool`` . - -.. code-block:: go - - func MyWorker() { - L := luaPool.Get() - defer luaPool.Put(L) - /* your code here */ - } - - func main() { - defer luaPool.Shutdown() - go MyWorker() - go MyWorker() - /* etc... */ - } - - ----------------------------------------------------------------- -Differences between Lua and GopherLua ----------------------------------------------------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Goroutines -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- GopherLua supports channel operations. - - GopherLua has a type named ``channel``. - - The ``channel`` table provides functions for performing channel operations. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Unsupported functions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- ``string.dump`` -- ``os.setlocale`` -- ``lua_Debug.namewhat`` -- ``package.loadlib`` -- debug hooks - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Miscellaneous notes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- ``collectgarbage`` does not take any arguments and runs the garbage collector for the entire Go program. -- ``file:setvbuf`` does not support a line buffering. -- Daylight saving time is not supported. -- GopherLua has a function to set an environment variable : ``os.setenv(name, value)`` -- GopherLua support ``goto`` and ``::label::`` statement in Lua5.2. - - `goto` is a keyword and not a valid variable name. - ----------------------------------------------------------------- -Standalone interpreter ----------------------------------------------------------------- -Lua has an interpreter called ``lua`` . GopherLua has an interpreter called ``glua`` . - -.. code-block:: bash - - go get github.com/yuin/gopher-lua/cmd/glua - -``glua`` has same options as ``lua`` . - ----------------------------------------------------------------- -How to Contribute ----------------------------------------------------------------- -See `Guidlines for contributors `_ . - ----------------------------------------------------------------- -Libraries for GopherLua ----------------------------------------------------------------- - -- `gopher-luar `_ : Simplifies data passing to and from gopher-lua -- `gluamapper `_ : Mapping a Lua table to a Go struct -- `gluare `_ : Regular expressions for gopher-lua -- `gluahttp `_ : HTTP request module for gopher-lua -- `gopher-json `_ : A simple JSON encoder/decoder for gopher-lua -- `gluayaml `_ : Yaml parser for gopher-lua -- `glua-lfs `_ : Partially implements the luafilesystem module for gopher-lua -- `gluaurl `_ : A url parser/builder module for gopher-lua -- `gluahttpscrape `_ : A simple HTML scraper module for gopher-lua -- `gluaxmlpath `_ : An xmlpath module for gopher-lua -- `gmoonscript `_ : Moonscript Compiler for the Gopher Lua VM -- `loguago `_ : Zerolog wrapper for Gopher-Lua -- `gluacrypto `_ : A native Go implementation of crypto library for the GopherLua VM. -- `gluasql `_ : A native Go implementation of SQL client for the GopherLua VM. -- `purr `_ : A http mock testing tool. -- `vadv/gopher-lua-libs `_ : Some usefull libraries for GopherLua VM. -- `gluaperiphery `_ : A periphery library for the GopherLua VM (GPIO, SPI, I2C, MMIO, and Serial peripheral I/O for Linux). -- `glua-async `_ : An async/await implement for gopher-lua. -- `gopherlua-debugger `_ : A debugger for gopher-lua -- `gluamahonia `_ : An encoding converter for gopher-lua ----------------------------------------------------------------- -Donation ----------------------------------------------------------------- - -BTC: 1NEDSyUmo4SMTDP83JJQSWi1MvQUGGNMZB - ----------------------------------------------------------------- -License ----------------------------------------------------------------- -MIT - ----------------------------------------------------------------- -Author ----------------------------------------------------------------- -Yusuke Inuzuka diff --git a/vendor/github.com/yuin/gopher-lua/compile.go b/vendor/github.com/yuin/gopher-lua/compile.go index c3736777a4d..f9fbf576205 100644 --- a/vendor/github.com/yuin/gopher-lua/compile.go +++ b/vendor/github.com/yuin/gopher-lua/compile.go @@ -236,12 +236,13 @@ func (cd *codeStore) PropagateMV(top int, save *int, reg *int, inc int) { } func (cd *codeStore) AddLoadNil(a, b, line int) { - last := cd.Last() - if opGetOpCode(last) == OP_LOADNIL && (opGetArgA(last)+opGetArgB(last)) == a { - cd.SetB(cd.LastPC(), b) - } else { - cd.AddABC(OP_LOADNIL, a, b, 0, line) - } + // this method used to merge multiple consecutive LOADNIL instructions + // of consecutive registers into a single LOADNIL instruction, but it + // caused issues when the merged instructions were JMP targets, and so + // generated invalid code; so the merging functionality has been removed. + // It is safe to merge the LOADNIL instructions under certain conditions, + // but additional logic / complexity would be needed here. + cd.AddABC(OP_LOADNIL, a, b, 0, line) } func (cd *codeStore) SetOpCode(pc int, v int) { diff --git a/vendor/github.com/yuin/gopher-lua/iolib.go b/vendor/github.com/yuin/gopher-lua/iolib.go index 3f5f295cedc..ba0b8334fc5 100644 --- a/vendor/github.com/yuin/gopher-lua/iolib.go +++ b/vendor/github.com/yuin/gopher-lua/iolib.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "os/exec" "syscall" @@ -373,7 +372,7 @@ func fileReadAux(L *LState, file *lFile, idx int) int { L.Push(v) case 'a': var buf []byte - buf, err = ioutil.ReadAll(file.reader) + buf, err = io.ReadAll(file.reader) if err == io.EOF { L.Push(emptyLString) goto normalreturn @@ -404,10 +403,10 @@ normalreturn: return L.GetTop() - top errreturn: - L.RaiseError(err.Error()) - //L.Push(LNil) - //L.Push(LString(err.Error())) - return 2 + L.Push(LNil) + L.Push(LString(err.Error())) + L.Push(LNumber(1)) // C-Lua compatibility: Original Lua pushes errno to the stack + return 3 } var fileSeekOptions = []string{"set", "cur", "end"} @@ -704,7 +703,7 @@ func ioType(L *LState) int { } func ioTmpFile(L *LState) int { - file, err := ioutil.TempFile("", "") + file, err := os.CreateTemp("", "") if err != nil { L.Push(LNil) L.Push(LString(err.Error())) diff --git a/vendor/github.com/yuin/gopher-lua/oslib.go b/vendor/github.com/yuin/gopher-lua/oslib.go index 5448cc1f8b2..b8ebaea56cf 100644 --- a/vendor/github.com/yuin/gopher-lua/oslib.go +++ b/vendor/github.com/yuin/gopher-lua/oslib.go @@ -1,7 +1,6 @@ package lua import ( - "io/ioutil" "os" "strings" "time" @@ -223,7 +222,7 @@ func osTime(L *LState) int { } func osTmpname(L *LState) int { - file, err := ioutil.TempFile("", "") + file, err := os.CreateTemp("", "") if err != nil { L.RaiseError("unable to generate a unique filename") } diff --git a/vendor/github.com/yuin/gopher-lua/pm/pm.go b/vendor/github.com/yuin/gopher-lua/pm/pm.go index e5c651f942e..9abf57ec253 100644 --- a/vendor/github.com/yuin/gopher-lua/pm/pm.go +++ b/vendor/github.com/yuin/gopher-lua/pm/pm.go @@ -5,8 +5,11 @@ import ( "fmt" ) -const EOS = -1 -const _UNKNOWN = -2 +const ( + EOS = -1 + _UNKNOWN = -2 + maxRecursionLevel = 1000000 +) /* Error {{{ */ @@ -524,7 +527,11 @@ func compilePattern(p pattern, ps ...*iptr) []inst { // Simple recursive virtual machine based on the // "Regular Expression Matching: the Virtual Machine Approach" (https://swtch.com/~rsc/regexp/regexp2.html) -func recursiveVM(src []byte, insts []inst, pc, sp int, ms ...*MatchData) (bool, int, *MatchData) { +func recursiveVM(src []byte, insts []inst, pc, sp, recLevel int, ms ...*MatchData) (bool, int, *MatchData) { + recLevel++ + if recLevel > maxRecursionLevel { + panic(newError(_UNKNOWN, "pattern/input too complex")) + } var m *MatchData if len(ms) == 0 { m = newMatchState() @@ -549,14 +556,14 @@ redo: pc = inst.Operand1 goto redo case opSplit: - if ok, nsp, _ := recursiveVM(src, insts, inst.Operand1, sp, m); ok { + if ok, nsp, _ := recursiveVM(src, insts, inst.Operand1, sp, recLevel, m); ok { return true, nsp, m } pc = inst.Operand2 goto redo case opSave: s := m.setCapture(inst.Operand1, sp) - if ok, nsp, _ := recursiveVM(src, insts, pc+1, sp, m); ok { + if ok, nsp, _ := recursiveVM(src, insts, pc+1, sp, recLevel, m); ok { return true, nsp, m } m.restoreCapture(inst.Operand1, s) @@ -620,7 +627,7 @@ func Find(p string, src []byte, offset, limit int) (matches []*MatchData, err er insts := compilePattern(pat) matches = []*MatchData{} for sp := offset; sp <= len(src); { - ok, nsp, ms := recursiveVM(src, insts, 0, sp) + ok, nsp, ms := recursiveVM(src, insts, 0, sp, 0) sp++ if ok { if sp < nsp { diff --git a/vendor/go.opentelemetry.io/contrib/detectors/gcp/cloud-function.go b/vendor/go.opentelemetry.io/contrib/detectors/gcp/cloud-function.go index 524a0421b1b..3eea78e52e1 100644 --- a/vendor/go.opentelemetry.io/contrib/detectors/gcp/cloud-function.go +++ b/vendor/go.opentelemetry.io/contrib/detectors/gcp/cloud-function.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.40.0" + semconv "go.opentelemetry.io/otel/semconv/v1.41.0" ) const ( diff --git a/vendor/go.opentelemetry.io/contrib/detectors/gcp/cloud-run.go b/vendor/go.opentelemetry.io/contrib/detectors/gcp/cloud-run.go index 914d22dc96d..98bcfdb9521 100644 --- a/vendor/go.opentelemetry.io/contrib/detectors/gcp/cloud-run.go +++ b/vendor/go.opentelemetry.io/contrib/detectors/gcp/cloud-run.go @@ -12,7 +12,7 @@ import ( "cloud.google.com/go/compute/metadata" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.40.0" + semconv "go.opentelemetry.io/otel/semconv/v1.41.0" ) const serviceNamespace = "cloud-run-managed" diff --git a/vendor/go.opentelemetry.io/contrib/detectors/gcp/detector.go b/vendor/go.opentelemetry.io/contrib/detectors/gcp/detector.go index 35bdceaea08..11b0d673148 100644 --- a/vendor/go.opentelemetry.io/contrib/detectors/gcp/detector.go +++ b/vendor/go.opentelemetry.io/contrib/detectors/gcp/detector.go @@ -12,7 +12,7 @@ import ( "github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.40.0" + semconv "go.opentelemetry.io/otel/semconv/v1.41.0" ) // NewDetector returns a resource detector which detects resource attributes on: diff --git a/vendor/go.opentelemetry.io/contrib/detectors/gcp/gce.go b/vendor/go.opentelemetry.io/contrib/detectors/gcp/gce.go index 42c69ba208a..800ca29a8f7 100644 --- a/vendor/go.opentelemetry.io/contrib/detectors/gcp/gce.go +++ b/vendor/go.opentelemetry.io/contrib/detectors/gcp/gce.go @@ -13,7 +13,7 @@ import ( "cloud.google.com/go/compute/metadata" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.40.0" + semconv "go.opentelemetry.io/otel/semconv/v1.41.0" ) // GCE collects resource information of GCE computing instances. diff --git a/vendor/go.opentelemetry.io/contrib/detectors/gcp/gke.go b/vendor/go.opentelemetry.io/contrib/detectors/gcp/gke.go index b5c3c3379f0..f284f4d2c41 100644 --- a/vendor/go.opentelemetry.io/contrib/detectors/gcp/gke.go +++ b/vendor/go.opentelemetry.io/contrib/detectors/gcp/gke.go @@ -11,7 +11,7 @@ import ( "cloud.google.com/go/compute/metadata" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.40.0" + semconv "go.opentelemetry.io/otel/semconv/v1.41.0" ) // GKE collects resource information of GKE computing instances. diff --git a/vendor/go.opentelemetry.io/contrib/detectors/gcp/version.go b/vendor/go.opentelemetry.io/contrib/detectors/gcp/version.go index 1b98a97f145..60344e17f91 100644 --- a/vendor/go.opentelemetry.io/contrib/detectors/gcp/version.go +++ b/vendor/go.opentelemetry.io/contrib/detectors/gcp/version.go @@ -5,7 +5,7 @@ package gcp // import "go.opentelemetry.io/contrib/detectors/gcp" // Version is the current release version of the GCP resource detector. func Version() string { - return "1.43.0" + return "1.44.0" // This string is updated by the pre_release.sh script during release } diff --git a/vendor/golang.org/x/mod/LICENSE b/vendor/golang.org/x/mod/LICENSE deleted file mode 100644 index 2a7cf70da6e..00000000000 --- a/vendor/golang.org/x/mod/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2009 The Go Authors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google LLC nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/mod/PATENTS b/vendor/golang.org/x/mod/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/golang.org/x/mod/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/mod/semver/semver.go b/vendor/golang.org/x/mod/semver/semver.go deleted file mode 100644 index 824b282c830..00000000000 --- a/vendor/golang.org/x/mod/semver/semver.go +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package semver implements comparison of semantic version strings. -// In this package, semantic version strings must begin with a leading "v", -// as in "v1.0.0". -// -// The general form of a semantic version string accepted by this package is -// -// vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]] -// -// where square brackets indicate optional parts of the syntax; -// MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros; -// PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers -// using only alphanumeric characters and hyphens; and -// all-numeric PRERELEASE identifiers must not have leading zeros. -// -// This package follows Semantic Versioning 2.0.0 (see semver.org) -// with two exceptions. First, it requires the "v" prefix. Second, it recognizes -// vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes) -// as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. -package semver - -import ( - "slices" - "strings" -) - -// parsed returns the parsed form of a semantic version string. -type parsed struct { - major string - minor string - patch string - short string - prerelease string - build string -} - -// IsValid reports whether v is a valid semantic version string. -func IsValid(v string) bool { - _, ok := parse(v) - return ok -} - -// Canonical returns the canonical formatting of the semantic version v. -// It fills in any missing .MINOR or .PATCH and discards build metadata. -// Two semantic versions compare equal only if their canonical formatting -// is an identical string. -// The canonical invalid semantic version is the empty string. -func Canonical(v string) string { - p, ok := parse(v) - if !ok { - return "" - } - if p.build != "" { - return v[:len(v)-len(p.build)] - } - if p.short != "" { - return v + p.short - } - return v -} - -// Major returns the major version prefix of the semantic version v. -// For example, Major("v2.1.0") == "v2". -// If v is an invalid semantic version string, Major returns the empty string. -func Major(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return v[:1+len(pv.major)] -} - -// MajorMinor returns the major.minor version prefix of the semantic version v. -// For example, MajorMinor("v2.1.0") == "v2.1". -// If v is an invalid semantic version string, MajorMinor returns the empty string. -func MajorMinor(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - i := 1 + len(pv.major) - if j := i + 1 + len(pv.minor); j <= len(v) && v[i] == '.' && v[i+1:j] == pv.minor { - return v[:j] - } - return v[:i] + "." + pv.minor -} - -// Prerelease returns the prerelease suffix of the semantic version v. -// For example, Prerelease("v2.1.0-pre+meta") == "-pre". -// If v is an invalid semantic version string, Prerelease returns the empty string. -func Prerelease(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.prerelease -} - -// Build returns the build suffix of the semantic version v. -// For example, Build("v2.1.0+meta") == "+meta". -// If v is an invalid semantic version string, Build returns the empty string. -func Build(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.build -} - -// Compare returns an integer comparing two versions according to -// semantic version precedence. -// The result will be 0 if v == w, -1 if v < w, or +1 if v > w. -// -// An invalid semantic version string is considered less than a valid one. -// All invalid semantic version strings compare equal to each other. -func Compare(v, w string) int { - pv, ok1 := parse(v) - pw, ok2 := parse(w) - if !ok1 && !ok2 { - return 0 - } - if !ok1 { - return -1 - } - if !ok2 { - return +1 - } - if c := compareInt(pv.major, pw.major); c != 0 { - return c - } - if c := compareInt(pv.minor, pw.minor); c != 0 { - return c - } - if c := compareInt(pv.patch, pw.patch); c != 0 { - return c - } - return comparePrerelease(pv.prerelease, pw.prerelease) -} - -// Max canonicalizes its arguments and then returns the version string -// that compares greater. -// -// Deprecated: use [Compare] instead. In most cases, returning a canonicalized -// version is not expected or desired. -func Max(v, w string) string { - v = Canonical(v) - w = Canonical(w) - if Compare(v, w) > 0 { - return v - } - return w -} - -// ByVersion implements [sort.Interface] for sorting semantic version strings. -type ByVersion []string - -func (vs ByVersion) Len() int { return len(vs) } -func (vs ByVersion) Swap(i, j int) { vs[i], vs[j] = vs[j], vs[i] } -func (vs ByVersion) Less(i, j int) bool { return compareVersion(vs[i], vs[j]) < 0 } - -// Sort sorts a list of semantic version strings using [Compare] and falls back -// to use [strings.Compare] if both versions are considered equal. -func Sort(list []string) { - slices.SortFunc(list, compareVersion) -} - -func compareVersion(a, b string) int { - cmp := Compare(a, b) - if cmp != 0 { - return cmp - } - return strings.Compare(a, b) -} - -func parse(v string) (p parsed, ok bool) { - if v == "" || v[0] != 'v' { - return - } - p.major, v, ok = parseInt(v[1:]) - if !ok { - return - } - if v == "" { - p.minor = "0" - p.patch = "0" - p.short = ".0.0" - return - } - if v[0] != '.' { - ok = false - return - } - p.minor, v, ok = parseInt(v[1:]) - if !ok { - return - } - if v == "" { - p.patch = "0" - p.short = ".0" - return - } - if v[0] != '.' { - ok = false - return - } - p.patch, v, ok = parseInt(v[1:]) - if !ok { - return - } - if len(v) > 0 && v[0] == '-' { - p.prerelease, v, ok = parsePrerelease(v) - if !ok { - return - } - } - if len(v) > 0 && v[0] == '+' { - p.build, v, ok = parseBuild(v) - if !ok { - return - } - } - if v != "" { - ok = false - return - } - ok = true - return -} - -func parseInt(v string) (t, rest string, ok bool) { - if v == "" { - return - } - if v[0] < '0' || '9' < v[0] { - return - } - i := 1 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - if v[0] == '0' && i != 1 { - return - } - return v[:i], v[i:], true -} - -func parsePrerelease(v string) (t, rest string, ok bool) { - // "A pre-release version MAY be denoted by appending a hyphen and - // a series of dot separated identifiers immediately following the patch version. - // Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. - // Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes." - if v == "" || v[0] != '-' { - return - } - i := 1 - start := 1 - for i < len(v) && v[i] != '+' { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i || isBadNum(v[start:i]) { - return - } - start = i + 1 - } - i++ - } - if start == i || isBadNum(v[start:i]) { - return - } - return v[:i], v[i:], true -} - -func parseBuild(v string) (t, rest string, ok bool) { - if v == "" || v[0] != '+' { - return - } - i := 1 - start := 1 - for i < len(v) { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i { - return - } - start = i + 1 - } - i++ - } - if start == i { - return - } - return v[:i], v[i:], true -} - -func isIdentChar(c byte) bool { - return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-' -} - -func isBadNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) && i > 1 && v[0] == '0' -} - -func isNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) -} - -func compareInt(x, y string) int { - if x == y { - return 0 - } - if len(x) < len(y) { - return -1 - } - if len(x) > len(y) { - return +1 - } - if x < y { - return -1 - } else { - return +1 - } -} - -func comparePrerelease(x, y string) int { - // "When major, minor, and patch are equal, a pre-release version has - // lower precedence than a normal version. - // Example: 1.0.0-alpha < 1.0.0. - // Precedence for two pre-release versions with the same major, minor, - // and patch version MUST be determined by comparing each dot separated - // identifier from left to right until a difference is found as follows: - // identifiers consisting of only digits are compared numerically and - // identifiers with letters or hyphens are compared lexically in ASCII - // sort order. Numeric identifiers always have lower precedence than - // non-numeric identifiers. A larger set of pre-release fields has a - // higher precedence than a smaller set, if all of the preceding - // identifiers are equal. - // Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < - // 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0." - if x == y { - return 0 - } - if x == "" { - return +1 - } - if y == "" { - return -1 - } - for x != "" && y != "" { - x = x[1:] // skip - or . - y = y[1:] // skip - or . - var dx, dy string - dx, x = nextIdent(x) - dy, y = nextIdent(y) - if dx != dy { - ix := isNum(dx) - iy := isNum(dy) - if ix != iy { - if ix { - return -1 - } else { - return +1 - } - } - if ix { - if len(dx) < len(dy) { - return -1 - } - if len(dx) > len(dy) { - return +1 - } - } - if dx < dy { - return -1 - } else { - return +1 - } - } - } - if x == "" { - return -1 - } else { - return +1 - } -} - -func nextIdent(x string) (dx, rest string) { - i := 0 - for i < len(x) && x[i] != '.' { - i++ - } - return x[:i], x[i:] -} diff --git a/vendor/golang.org/x/net/html/escape.go b/vendor/golang.org/x/net/html/escape.go index df3edc5b125..293f118da13 100644 --- a/vendor/golang.org/x/net/html/escape.go +++ b/vendor/golang.org/x/net/html/escape.go @@ -154,10 +154,7 @@ func unescapeEntity(s []byte, attribute bool) (rune, rune, int) { } else if x := entity2[entityName]; x[0] != 0 { return x[0], x[1], i } else if !attribute { - maxLen := len(entityName) - 1 - if maxLen > longestEntityWithoutSemicolon { - maxLen = longestEntityWithoutSemicolon - } + maxLen := min(len(entityName)-1, longestEntityWithoutSemicolon) for j := maxLen; j > 1; j-- { if x := entity[entityName[:j]]; x != 0 { return x, 0, j + 1 diff --git a/vendor/golang.org/x/net/http2/ascii.go b/vendor/golang.org/x/net/http2/ascii.go index 17caa205869..3a7aed12c59 100644 --- a/vendor/golang.org/x/net/http2/ascii.go +++ b/vendor/golang.org/x/net/http2/ascii.go @@ -4,7 +4,9 @@ package http2 -import "strings" +import ( + "strings" +) // The HTTP protocols are defined in terms of ASCII, not Unicode. This file // contains helper functions which may use Unicode-aware functions which would @@ -43,6 +45,16 @@ func isASCIIPrint(s string) bool { return true } +// isASCII returns whether s is ASCII. +func isASCII(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] > 0x7f { + return false + } + } + return true +} + // asciiToLower returns the lowercase version of s if s is ASCII and printable, // and whether or not it was. func asciiToLower(s string) (lower string, ok bool) { diff --git a/vendor/golang.org/x/net/http2/databuffer.go b/vendor/golang.org/x/net/http2/databuffer.go index e6f55cbd163..9763ab134c2 100644 --- a/vendor/golang.org/x/net/http2/databuffer.go +++ b/vendor/golang.org/x/net/http2/databuffer.go @@ -121,10 +121,7 @@ func (b *dataBuffer) Write(p []byte) (int, error) { // If the last chunk is empty, allocate a new chunk. Try to allocate // enough to fully copy p plus any additional bytes we expect to // receive. However, this may allocate less than len(p). - want := int64(len(p)) - if b.expected > want { - want = b.expected - } + want := max(int64(len(p)), b.expected) chunk := b.lastChunkOrAlloc(want) n := copy(chunk[b.w:], p) p = p[n:] diff --git a/vendor/golang.org/x/net/http2/h2c/h2c.go b/vendor/golang.org/x/net/http2/h2c/h2c.go index b5807d557f5..23470b4960e 100644 --- a/vendor/golang.org/x/net/http2/h2c/h2c.go +++ b/vendor/golang.org/x/net/http2/h2c/h2c.go @@ -24,6 +24,7 @@ // client := &http.Client{Transport: tr} // // Deprecated: This package is deprecated. +// It is not maintained and should not be used. package h2c import ( @@ -84,6 +85,10 @@ type h2cHandler struct { // NewHandler is deprecated. // +// The Handler returned by NewHandler will read the first request on a connection entirely +// into memory. To limit the memory consumed by this request, wrap the result of NewHandler +// in an http.MaxBytesHandler. +// // Deprecated: Set the [http.Server] Protocols field to use unencrypted HTTP/2 instead. func NewHandler(h http.Handler, s *http2.Server) http.Handler { return &h2cHandler{ diff --git a/vendor/golang.org/x/net/http2/server_common.go b/vendor/golang.org/x/net/http2/server_common.go index 449538c861a..fec369092a2 100644 --- a/vendor/golang.org/x/net/http2/server_common.go +++ b/vendor/golang.org/x/net/http2/server_common.go @@ -25,6 +25,8 @@ import ( // // https://golang.org/pkg/net/http/#ResponseWriter // https://golang.org/pkg/net/http/#example_ResponseWriter_trailers +// +// Deprecated: Use [http.TrailerPrefix] instead. const TrailerPrefix = "Trailer:" // Push errors. @@ -38,16 +40,22 @@ var ( // The configuration conf may be nil. // // ConfigureServer must be called before s begins serving. +// +// Deprecated: Set [http.Server.Protocols] instead. func ConfigureServer(s *http.Server, conf *Server) error { return configureServer(s, conf) } // Server is an HTTP/2 server. +// +// Deprecated: Use [http.Server] instead. type Server struct { // MaxHandlers limits the number of http.Handler ServeHTTP goroutines // which may run at a time over all connections. // Negative or zero no limit. // TODO: implement + // + // Deprecated: This field has never had any effect. MaxHandlers int // MaxConcurrentStreams optionally specifies the number of @@ -56,6 +64,9 @@ type Server struct { // which may be active globally, which is MaxHandlers. // If zero, MaxConcurrentStreams defaults to at least 100, per // the HTTP/2 spec's recommendations. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxConcurrentStreams] instead. MaxConcurrentStreams uint32 // MaxDecoderHeaderTableSize optionally specifies the http2 @@ -63,44 +74,67 @@ type Server struct { // informs the remote endpoint of the maximum size of the header compression // table used to decode header blocks, in octets. If zero, the default value // of 4096 is used. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxDecoderHeaderTableSize] instead. MaxDecoderHeaderTableSize uint32 // MaxEncoderHeaderTableSize optionally specifies an upper limit for the // header compression table used for encoding request headers. Received // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, // the default value of 4096 is used. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxEncoderHeaderTableSize] instead. MaxEncoderHeaderTableSize uint32 // MaxReadFrameSize optionally specifies the largest frame // this server is willing to read. A valid value is between // 16k and 16M, inclusive. If zero or otherwise invalid, a // default value is used. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxReadFrameSize] instead. MaxReadFrameSize uint32 // PermitProhibitedCipherSuites, if true, permits the use of // cipher suites prohibited by the HTTP/2 spec. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.PermitProhibitedCipherSuites] instead. PermitProhibitedCipherSuites bool // IdleTimeout specifies how long until idle clients should be // closed with a GOAWAY frame. PING frames are not considered // activity for the purposes of IdleTimeout. // If zero or negative, there is no timeout. + // + // Deprecated: Use [http.Server.IdleTimeout] instead. IdleTimeout time.Duration // ReadIdleTimeout is the timeout after which a health check using a ping // frame will be carried out if no frame is received on the connection. // If zero, no health check is performed. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.SendPingTimeout] instead. ReadIdleTimeout time.Duration // PingTimeout is the timeout after which the connection will be closed // if a response to a ping is not received. // If zero, a default of 15 seconds is used. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.PingTimeout] instead. PingTimeout time.Duration // WriteByteTimeout is the timeout after which a connection will be // closed if no data can be written to it. The timeout begins when data is // available to write, and is extended whenever any bytes are written. // If zero or negative, there is no timeout. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.WriteByteTimeout] instead. WriteByteTimeout time.Duration // MaxUploadBufferPerConnection is the size of the initial flow @@ -108,12 +142,18 @@ type Server struct { // allow this to be smaller than 65535 or larger than 2^32-1. // If the value is outside this range, a default value will be // used instead. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxReceiveBufferPerConnection] instead. MaxUploadBufferPerConnection int32 // MaxUploadBufferPerStream is the size of the initial flow control // window for each stream. The HTTP/2 spec does not allow this to // be larger than 2^32-1. If the value is zero or larger than the // maximum, a default value will be used instead. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.MaxReceiveBufferPerStream] instead. MaxUploadBufferPerStream int32 // NewWriteScheduler constructs a write scheduler for a connection. @@ -126,6 +166,9 @@ type Server struct { // It's intended to increment a metric for monitoring, such // as an expvar or Prometheus metric. // The errType consists of only ASCII word characters. + // + // Deprecated: Use [http.Server.HTTP2] and + // [http.HTTP2Config.CountError] instead. CountError func(errType string) // Internal state. This is a pointer (rather than embedded directly) @@ -135,6 +178,8 @@ type Server struct { } // ServeConnOpts are options for the Server.ServeConn method. +// +// Deprecated: ServeConnOpts is deprecated. type ServeConnOpts struct { // Context is the base context to use. // If nil, context.Background is used. @@ -178,6 +223,8 @@ type ServeConnOpts struct { // implemented in terms of providing a suitably-behaving net.Conn. // // The opts parameter is optional. If nil, default values are used. +// +// Deprecated: Use [http.Server.Serve] or [http.Server.ServeTLS] instead. func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { if opts == nil { opts = &ServeConnOpts{} diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 08ac409b0e0..088eb9bef8e 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -184,6 +184,8 @@ func (t *Transport) initConnPool() { // ClientConn is the state of a single HTTP/2 client connection to an // HTTP/2 server. +// +// Deprecated: Use [http.ClientConn] instead. type ClientConn struct { t *Transport tconn net.Conn // usually *tls.Conn, except specialized impls diff --git a/vendor/golang.org/x/net/http2/transport_common.go b/vendor/golang.org/x/net/http2/transport_common.go index b9f52932e92..4f0333a7037 100644 --- a/vendor/golang.org/x/net/http2/transport_common.go +++ b/vendor/golang.org/x/net/http2/transport_common.go @@ -24,6 +24,8 @@ import ( // It returns an error if t1 has already been HTTP/2-enabled. // // Use ConfigureTransports instead to configure the HTTP/2 Transport. +// +// Deprecated: Set [http.Transport.Protocols] instead. func ConfigureTransport(t1 *http.Transport) error { return configureTransport(t1) } @@ -31,6 +33,8 @@ func ConfigureTransport(t1 *http.Transport) error { // ConfigureTransports configures a net/http HTTP/1 Transport to use HTTP/2. // It returns a new HTTP/2 Transport for further configuration. // It returns an error if t1 has already been HTTP/2-enabled. +// +// Deprecated: Set [http.Transport.Protocols] instead. func ConfigureTransports(t1 *http.Transport) (*Transport, error) { return configureTransports(t1) } @@ -39,6 +43,8 @@ func ConfigureTransports(t1 *http.Transport) (*Transport, error) { // // A Transport internally caches connections to servers. It is safe // for concurrent use by multiple goroutines. +// +// Deprecated: Use [http.Transport] instead. type Transport struct { // DialTLSContext specifies an optional dial function with context for // creating TLS connections for requests. @@ -47,6 +53,8 @@ type Transport struct { // // If the returned net.Conn has a ConnectionState method like tls.Conn, // it will be used to set http.Response.TLS. + // + // Deprecated: Use [http.Transport.DialTLSContext] instead. DialTLSContext func(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error) // DialTLS specifies an optional dial function for creating @@ -54,17 +62,21 @@ type Transport struct { // // If DialTLSContext and DialTLS is nil, tls.Dial is used. // - // Deprecated: Use DialTLSContext instead, which allows the transport - // to cancel dials as soon as they are no longer needed. - // If both are set, DialTLSContext takes priority. + // Deprecated: Use [http.Transport.DialTLSContext] instead. DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error) // TLSClientConfig specifies the TLS configuration to use with // tls.Client. If nil, the default configuration is used. + // + // Deprecated: Use [http.Transport.TLSClientConfig] instead. TLSClientConfig *tls.Config // ConnPool optionally specifies an alternate connection pool to use. // If nil, the default is used. + // + // Deprecated: To create a custom connection pool, implement + // [http.RoundTripper]. Use [http.Transport.NewClientConn] + // to create connections for the pool. ConnPool ClientConnPool // DisableCompression, if true, prevents the Transport from @@ -75,10 +87,14 @@ type Transport struct { // decoded in the Response.Body. However, if the user // explicitly requested gzip it is not automatically // uncompressed. + // + // Deprecated: Use [http.Transport.DisableCompression] instead. DisableCompression bool // AllowHTTP, if true, permits HTTP/2 requests using the insecure, // plain-text "http" scheme. Note that this does not enable h2c support. + // + // Deprecated: Use [http.Transport.Protocols] instead. AllowHTTP bool // MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to @@ -88,6 +104,8 @@ type Transport struct { // want to advertise an unlimited value to the peer, Transport // interprets the highest possible value here (0xffffffff or 1<<32-1) // to mean no limit. + // + // Deprecated: Use [http.Transport.MaxResponseHeaderBytes] instead. MaxHeaderListSize uint32 // MaxReadFrameSize is the http2 SETTINGS_MAX_FRAME_SIZE to send in the @@ -97,6 +115,9 @@ type Transport struct { // according to the spec: // https://datatracker.ietf.org/doc/html/rfc7540#section-6.5.2. // Values are bounded in the range 16k to 16M. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.MaxReadFrameSize] instead. MaxReadFrameSize uint32 // MaxDecoderHeaderTableSize optionally specifies the http2 @@ -104,12 +125,18 @@ type Transport struct { // informs the remote endpoint of the maximum size of the header compression // table used to decode header blocks, in octets. If zero, the default value // of 4096 is used. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.MaxDecoderHeaderTableSize] instead. MaxDecoderHeaderTableSize uint32 // MaxEncoderHeaderTableSize optionally specifies an upper limit for the // header compression table used for encoding request headers. Received // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, // the default value of 4096 is used. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.MaxEncoderHeaderTableSize] instead. MaxEncoderHeaderTableSize uint32 // StrictMaxConcurrentStreams controls whether the server's @@ -120,12 +147,17 @@ type Transport struct { // server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as // a global limit and callers of RoundTrip block when needed, // waiting for their turn. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.StrictMaxConcurrentRequests] instead. StrictMaxConcurrentStreams bool // IdleConnTimeout is the maximum amount of time an idle // (keep-alive) connection will remain idle before closing // itself. // Zero means no limit. + // + // Deprecated: Use [http.Transport.IdleConnTimeout] instead. IdleConnTimeout time.Duration // ReadIdleTimeout is the timeout after which a health check using ping @@ -134,22 +166,34 @@ type Transport struct { // there is no other traffic on the connection, the health check will // be performed every ReadIdleTimeout interval. // If zero, no health check is performed. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.SendPingTimeout] instead. ReadIdleTimeout time.Duration // PingTimeout is the timeout after which the connection will be closed // if a response to Ping is not received. // Defaults to 15s. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.PingTimeout] instead. PingTimeout time.Duration // WriteByteTimeout is the timeout after which the connection will be // closed no data can be written to it. The timeout begins when data is // available to write, and is extended whenever any bytes are written. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.WriteByteTimeout] instead. WriteByteTimeout time.Duration // CountError, if non-nil, is called on HTTP/2 transport errors. // It's intended to increment a metric for monitoring, such // as an expvar or Prometheus metric. // The errType consists of only ASCII word characters. + // + // Deprecated: Use [http.Transport.HTTP2] and + // [http.HTTP2Config.CountError] instead. CountError func(errType string) // Internal state, differs between wrapped and non-wrapped implementations. @@ -165,6 +209,10 @@ var ( ) // ClientConnPool manages a pool of HTTP/2 client connections. +// +// Deprecated: To create a custom connection pool, implement +// [http.RoundTripper]. Use [http.Transport.NewClientConn] +// to create connections for the pool. type ClientConnPool interface { // GetClientConn returns a specific HTTP/2 connection (usually // a TLS-TCP connection) to an HTTP/2 server. On success, the @@ -177,6 +225,8 @@ type ClientConnPool interface { } // ClientConnState describes the state of a ClientConn. +// +// Deprecated: Use [http.ClientConn] instead. type ClientConnState struct { // Closed is whether the connection is closed. Closed bool @@ -210,6 +260,8 @@ type ClientConnState struct { } // RoundTripOpt are options for the Transport.RoundTripOpt method. +// +// Deprecated: There are no options to set. type RoundTripOpt struct { // OnlyCachedConn controls whether RoundTripOpt may // create a new TCP connection. If set true and @@ -222,11 +274,14 @@ type RoundTripOpt struct { allowHTTP bool // allow http:// URLs } +// Deprecated: Use [http.Transport.RoundTrip] instead. func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { return t.RoundTripOpt(req, RoundTripOpt{}) } // RoundTripOpt is like RoundTrip, but takes options. +// +// Deprecated: Use [http.Transport.RoundTrip] instead. func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) { return t.roundTripOpt(req, opt) } @@ -234,10 +289,15 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res // CloseIdleConnections closes any connections which were previously // connected from previous requests but are now sitting idle. // It does not interrupt any connections currently in use. +// +// Deprecated: Use [http.Transport.CloseIdleConnections] instead. func (t *Transport) CloseIdleConnections() { t.closeIdleConnections() } +// NewClientConn is deprecated. +// +// Deprecated: Use [http.Transport.NewClientConn] instead. func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { return t.newUserClientConn(c) } @@ -256,8 +316,15 @@ func authorityAddr(scheme string, authority string) (addr string) { port = "80" } } - if a, err := idna.ToASCII(host); err == nil { - host = a + // Skip IDNA processing on hosts which are already ASCII. + // This is consistent with net/http and the WHATWG URL Specification. + // (We currently don't follow all of WHATWG, but we're aligned on + // permitting all-ASCII hostnames which fail IDNA validation. + // There are existing, valid domain names which TR #46 processing rejects.) + if !isASCII(host) { + if a, err := idna.Lookup.ToASCII(host); err == nil && a != "" { + host = a + } } // IPv6 address literal, without a port: if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") { @@ -414,6 +481,8 @@ func (t *Transport) dialTLSWithContext(ctx context.Context, network, addr string // GoAwayError is returned by the Transport when the server closes the // TCP connection after sending a GOAWAY frame. +// +// Deprecated: GoAwayError is deprecated. type GoAwayError struct { LastStreamID uint32 ErrCode ErrCode diff --git a/vendor/golang.org/x/net/http2/transport_wrap.go b/vendor/golang.org/x/net/http2/transport_wrap.go index 741fb97062e..34dfb3cca62 100644 --- a/vendor/golang.org/x/net/http2/transport_wrap.go +++ b/vendor/golang.org/x/net/http2/transport_wrap.go @@ -216,6 +216,8 @@ func (t *Transport) newUserClientConn(c net.Conn) (*ClientConn, error) { // ClientConn is the state of a single HTTP/2 client connection to an // HTTP/2 server. +// +// Deprecated: Use [http.ClientConn] instead. type ClientConn struct { cc *http.ClientConn tconn net.Conn diff --git a/vendor/golang.org/x/net/internal/httpcommon/README.md b/vendor/golang.org/x/net/internal/httpcommon/README.md new file mode 100644 index 00000000000..951c346c2d2 --- /dev/null +++ b/vendor/golang.org/x/net/internal/httpcommon/README.md @@ -0,0 +1,7 @@ +These two packages are identical: + +- net/http/internal/httpcommon +- golang.org/x/net/internal/httpcommon + +The two are kept in sync manually. +Any change to one should be made in the other. diff --git a/vendor/golang.org/x/net/internal/httpcommon/request.go b/vendor/golang.org/x/net/internal/httpcommon/request.go index d94c87429a6..5aaca5989b0 100644 --- a/vendor/golang.org/x/net/internal/httpcommon/request.go +++ b/vendor/golang.org/x/net/internal/httpcommon/request.go @@ -391,6 +391,7 @@ type ServerRequestParam struct { // ServerRequestResult is the result of NewServerRequest. type ServerRequestResult struct { // Various http.Request fields. + Host string URL *url.URL RequestURI string Trailer map[string][]string @@ -433,20 +434,46 @@ func NewServerRequest(rp ServerRequestParam) ServerRequestResult { } delete(rp.Header, "Trailer") + authority := rp.Authority + if host := rp.Header["Host"]; len(host) == 1 { + // HTTP/2 and HTTP/3 permit the Host header to be present, + // but it must match the :authority pseudo-header. + if authority == "" { + authority = host[0] + } else if host[0] != authority { + return ServerRequestResult{ + InvalidReason: "authority_host_mismatch", + } + } + delete(rp.Header, "Host") + } else if len(host) > 1 { + // HTTP/1.1 rejects any request containing more than one Host header. + // HTTP/2 and HTTP/3 don't use the Host header, but reject multiple anyway. + return ServerRequestResult{ + InvalidReason: "multiple_host_headers", + } + } + // "':authority' MUST NOT include the deprecated userinfo subcomponent // for "http" or "https" schemed URIs." // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.8 - if strings.IndexByte(rp.Authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") { + if strings.IndexByte(authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") { return ServerRequestResult{ InvalidReason: "userinfo_in_authority", } } + if authority != "" && !httpguts.ValidHostHeader(authority) { + return ServerRequestResult{ + InvalidReason: "invalid_authority", + } + } + var url_ *url.URL var requestURI string if rp.Method == "CONNECT" && rp.Protocol == "" { - url_ = &url.URL{Host: rp.Authority} - requestURI = rp.Authority // mimic HTTP/1 server behavior + url_ = &url.URL{Host: authority} + requestURI = authority // mimic HTTP/1 server behavior } else { // "[The :path] pseudo-header field MUST NOT be empty [...]" // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.4.2 @@ -467,6 +494,7 @@ func NewServerRequest(rp ServerRequestParam) ServerRequestResult { } return ServerRequestResult{ + Host: authority, URL: url_, NeedsContinue: needsContinue, RequestURI: requestURI, diff --git a/vendor/golang.org/x/net/trace/histogram.go b/vendor/golang.org/x/net/trace/histogram.go index d6c71101e4d..2f786831448 100644 --- a/vendor/golang.org/x/net/trace/histogram.go +++ b/vendor/golang.org/x/net/trace/histogram.go @@ -70,10 +70,7 @@ func log2(i int64) int { } func getBucket(i int64) (index int) { - index = log2(i) - 1 - if index < 0 { - index = 0 - } + index = max(log2(i)-1, 0) if index >= bucketCount { index = bucketCount - 1 } diff --git a/vendor/golang.org/x/sync/semaphore/semaphore.go b/vendor/golang.org/x/sync/semaphore/semaphore.go index 96a035aedeb..f2a7d3ff494 100644 --- a/vendor/golang.org/x/sync/semaphore/semaphore.go +++ b/vendor/golang.org/x/sync/semaphore/semaphore.go @@ -17,10 +17,13 @@ type waiter struct { } // NewWeighted creates a new weighted semaphore with the given -// maximum combined weight for concurrent access. +// maximum combined weight for concurrent access. NewWeighted panics if n is +// negative. func NewWeighted(n int64) *Weighted { - w := &Weighted{size: n} - return w + if n < 0 { + panic("semaphore: size < 0") + } + return &Weighted{size: n} } // Weighted provides a way to bound concurrent access to a resource. diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index f1ce515d5c9..df8dbd1dbf1 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -182,12 +182,13 @@ var MIPS64X struct { // require kernel support to work (DARN, SCV), so there are feature bits for // those as well. The struct is padded to avoid false sharing. var PPC64 struct { - _ CacheLinePad - HasDARN bool // Hardware random number generator (requires kernel enablement) - HasSCV bool // Syscall vectored (requires kernel enablement) - IsPOWER8 bool // ISA v2.07 (POWER8) - IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8 - _ CacheLinePad + _ CacheLinePad + HasDARN bool // Hardware random number generator (requires kernel enablement) + HasSCV bool // Syscall vectored (requires kernel enablement) + IsPOWER8 bool // ISA v2.07 (POWER8) + IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8 + IsPOWER10 bool // ISA v3.1 (POWER10 and POWER11; POWER11 did not add a new architected level), implies IsPOWER9 + _ CacheLinePad } // S390X contains the supported CPU features of the current IBM Z @@ -248,13 +249,21 @@ var RISCV64 struct { HasZvks bool // ShangMi Algorithm Suite HasZvksc bool // ShangMi Algorithm Suite with carryless multiplication HasZvksg bool // ShangMi Algorithm Suite with GCM + VLENB uint // Vector register length in bytes, 0 if undetected _ CacheLinePad } +// doDerived, if non-nil, is called after processing GODEBUG to set "derived" +// feature flags. +var doDerived func() + func init() { archInit() initOptions() processOptions() + if doDerived != nil { + doDerived() + } } // options contains the cpu debug options that can be used in GODEBUG. diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go new file mode 100644 index 00000000000..3d660dd48c5 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go @@ -0,0 +1,11 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc + +package cpu + +// Can only be called when the vector extension is present. +// Implemented in cpu_riscv64.s. +func readVLENB() uint diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go index 197188e67f3..70b3dc7dd0d 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go @@ -11,6 +11,7 @@ const ( // ISA Level _PPC_FEATURE2_ARCH_2_07 = 0x80000000 _PPC_FEATURE2_ARCH_3_00 = 0x00800000 + _PPC_FEATURE2_ARCH_3_1 = 0x00040000 // CPU features _PPC_FEATURE2_DARN = 0x00200000 @@ -21,6 +22,9 @@ func doinit() { // HWCAP2 feature bits PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) + // ISA 3.1 covers both POWER10 and POWER11: POWER11 did not introduce a + // new architected HWCAP level, so there is no separate IsPOWER11. + PPC64.IsPOWER10 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_1) PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) } diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go index f4fb52ee966..53e909114bb 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go @@ -130,6 +130,9 @@ func doinit() { RISCV64.HasFastMisaligned = v == riscv_HWPROBE_MISALIGNED_FAST } } + if RISCV64.HasV { + RISCV64.VLENB = readVLENB() + } // Let's double check with HWCAP if the C extension does not appear to be supported. // This may happen if we're running on a kernel older than 6.4. @@ -137,6 +140,14 @@ func doinit() { if !RISCV64.HasC { RISCV64.HasC = isSet(hwCap, hwcap_RISCV_ISA_C) } + + doDerived = func() { + // If the vector extension is disabled by GODEBUG, then the VLENB is zero. + if !RISCV64.HasV { + RISCV64.VLENB = 0 + } + } + } func isSet(hwc uint, value uint) bool { diff --git a/vendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go b/vendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go new file mode 100644 index 00000000000..4f981b1c8a6 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go @@ -0,0 +1,47 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build netbsd && amd64 && gc + +package cpu + +func doinit() { + // NetBSD corrupts avx registers when receiving signals. + // See issue 80285. + // TODO: when NetBSD fixes the bug, add a version + // check and skip here. + X86.HasAVX = false + X86.HasAVX2 = false + // Set these also, just to be safe + X86.HasAVXVNNI = false + X86.HasAVX512 = false + X86.HasAVX512F = false + X86.HasAVX512CD = false + X86.HasAVX512CD = false + X86.HasAVX512ER = false + X86.HasAVX512PF = false + X86.HasAVX512VL = false + X86.HasAVX512BW = false + X86.HasAVX512DQ = false + X86.HasAVX512IFMA = false + X86.HasAVX512VBMI = false + X86.HasAVX5124VNNIW = false + X86.HasAVX5124FMAPS = false + X86.HasAVX512VPOPCNTDQ = false + X86.HasAVX512VPCLMULQDQ = false + X86.HasAVX512VNNI = false + X86.HasAVX512GFNI = false + X86.HasAVX512VAES = false + X86.HasAVX512VBMI2 = false + X86.HasAVX512BITALG = false + X86.HasAVX512BF16 = false + X86.HasAVXIFMA = false + X86.HasAVXVNNI = false + X86.HasAVXVNNIInt8 = false + +} + +func darwinSupportsAVX512() bool { + panic("only implemented for gc && amd64 && darwin") +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_x86.go b/vendor/golang.org/x/sys/cpu/cpu_other_x86.go index a0fd7e2f75d..82b7580d0b7 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_x86.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build 386 || amd64p32 || (amd64 && (!darwin || !gc)) +//go:build 386 || amd64p32 || (amd64 && ((!darwin && !netbsd) || !gc)) package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.s b/vendor/golang.org/x/sys/cpu/cpu_riscv64.s new file mode 100644 index 00000000000..b092fb2697e --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.s @@ -0,0 +1,17 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc + +#include "textflag.h" + +// Read the vector register length in bytes from the vlenb CSR. +// May only be called when the vector extension is present. +// func readVLENB() uint +TEXT ·readVLENB(SB), NOSPLIT|NOFRAME, $0-8 + // Go 1.25's assembler does not recognize VLENB, so use its raw CSRR encoding. + // Replace WORD with CSRR VLENB, X10 once go.mod requires Go 1.27. + WORD $0xc2202573 + MOV X10, ret+0(FP) + RET diff --git a/vendor/golang.org/x/sys/cpu/cpu_sparc64.go b/vendor/golang.org/x/sys/cpu/cpu_sparc64.go new file mode 100644 index 00000000000..0199ef19ba9 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_sparc64.go @@ -0,0 +1,12 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build sparc64 + +package cpu + +// The L1 line is 32 bytes; false sharing is governed by the 64-byte L2 line. +const cacheLineSize = 64 + +func initOptions() {} diff --git a/vendor/golang.org/x/sys/unix/ifreq_linux.go b/vendor/golang.org/x/sys/unix/ifreq_linux.go index 309f5a2b0c7..3f7fa766437 100644 --- a/vendor/golang.org/x/sys/unix/ifreq_linux.go +++ b/vendor/golang.org/x/sys/unix/ifreq_linux.go @@ -22,7 +22,13 @@ import ( // fields can be get and set using the following methods: // - Uint16/SetUint16: flags // - Uint32/SetUint32: ifindex, metric, mtu -type Ifreq struct{ raw ifreq } +type Ifreq struct { + // Aligns the union for the accessors below, which cast it in place; + // the generated ifreq is all byte arrays, so its alignment is one. + _ [0]int64 + + raw ifreq +} // NewIfreq creates an Ifreq with the input network interface name after // validating the name does not exceed IFNAMSIZ-1 (trailing NULL required) diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/vendor/golang.org/x/sys/unix/ioctl_linux.go index 7ca4fa12aa6..5589d4f665f 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_linux.go +++ b/vendor/golang.org/x/sys/unix/ioctl_linux.go @@ -332,3 +332,10 @@ func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error { func IoctlLoopConfigure(fd int, value *LoopConfig) error { return ioctlPtr(fd, LOOP_CONFIGURE, unsafe.Pointer(value)) } + +// IoctlPidfdInfo fetches information about a pidfd. +// The Mask field of the info argument indicates which +// values to fetch. +func IoctlPidfdInfo(fd int, info *PidfdInfo) error { + return ioctlPtr(fd, PIDFD_GET_INFO, unsafe.Pointer(info)) +} diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index fa74cfe9e8a..9e907ac2967 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -290,14 +290,7 @@ struct ltchars { #include #include -#if defined(__sparc__) -// On sparc{,64}, the kernel defines struct termios2 itself which clashes with the -// definition in glibc. As only the error constants are needed here, include the -// generic termibits.h (which is included by termbits.h on sparc). -#include -#else #include -#endif #ifndef PTRACE_GETREGS #define PTRACE_GETREGS 0xc @@ -544,7 +537,7 @@ ccflags="$@" $2 ~ /^LO_(KEY|NAME)_SIZE$/ || $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || $2 == "LOOP_CONFIGURE" || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|MLOCK|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ || $2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ || $2 ~ /^NFC_.*_(MAX)?SIZE$/ || $2 ~ /^PTP_/ || diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go index 5ea74da9820..8f27e7ecb58 100644 --- a/vendor/golang.org/x/sys/unix/syscall.go +++ b/vendor/golang.org/x/sys/unix/syscall.go @@ -76,7 +76,7 @@ func BytePtrToString(p *byte) string { // Find NUL terminator. n := 0 for ptr := unsafe.Pointer(p); *(*byte)(ptr) != 0; n++ { - ptr = unsafe.Pointer(uintptr(ptr) + 1) + ptr = unsafe.Add(ptr, 1) } return string(unsafe.Slice(p, n)) diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index a00c3e5450b..035c2cd9167 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -188,7 +188,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { } sa.raw.Len = byte(3 + n) // 2 for Family, Len; 1 for NUL sa.raw.Family = AF_UNIX - for i := 0; i < n; i++ { + for i := range n { sa.raw.Path[i] = int8(name[i]) } return unsafe.Pointer(&sa.raw), _Socklen(sa.raw.Len), nil diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 21e2bfa398b..6926057e9e8 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -2363,7 +2363,7 @@ func (fh *FileHandle) Bytes() []byte { if n == 0 { return nil } - return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type))+4)), n) + return unsafe.Slice((*byte)(unsafe.Add(unsafe.Pointer(&fh.fileHandle.Type), 4)), n) } // NameToHandleAt wraps the name_to_handle_at system call; it obtains diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 5bb51d7ae1e..45feb124536 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -2048,6 +2048,7 @@ const ( MINIX3_SUPER_MAGIC = 0x4d5a MINIX_SUPER_MAGIC = 0x137f MINIX_SUPER_MAGIC2 = 0x138f + MLOCK_ONFAULT = 0x1 MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 @@ -3862,6 +3863,7 @@ const ( TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 + TIOCSER_TEMT = 0x1 TIPC_ADDR_ID = 0x3 TIPC_ADDR_MCAST = 0x1 TIPC_ADDR_NAME = 0x2 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index c0a8ea1de0e..6f74d4a0cff 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -483,7 +483,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index ff927c83010..36c1f0b68c4 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -484,7 +484,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 55294eda5bc..c5512dbea60 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -489,7 +489,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 5dac54c35cc..4dabfae0711 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -483,7 +483,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 46ac1fcb220..ea97930f1f3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -476,7 +476,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index b55483e8a98..0826a929e01 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -481,7 +481,6 @@ const ( TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a - TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 71890c98a40..139deedd956 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -481,7 +481,6 @@ const ( TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a - TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index a78b6cc14bf..b8018af3352 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -481,7 +481,6 @@ const ( TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a - TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index d0e38ca7390..deb5c2e6a9c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -481,7 +481,6 @@ const ( TIOCSERGWILD = 0x5489 TIOCSERSETMULTI = 0x5490 TIOCSERSWILD = 0x548a - TIOCSER_TEMT = 0x1 TIOCSETD = 0x7401 TIOCSETN = 0x740a TIOCSETP = 0x7409 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index c883e14c772..0603bf3a1a1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -535,7 +535,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 1834273d44a..5fa8a5d3672 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -539,7 +539,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 39945dd9aec..2733e999345 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -539,7 +539,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index bc0f372416f..1470172fd9e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -486,7 +486,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 6e87bd6598b..1871579c5c8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -545,7 +545,6 @@ const ( TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 TIOCSETD = 0x5423 TIOCSIG = 0x40045436 TIOCSISO7816 = 0xc0285443 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 7e2b2e8a667..10881cf6d31 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -14,21 +14,21 @@ const ( ASI_LEON_DFLUSH = 0x11 ASI_LEON_IFLUSH = 0x10 ASI_LEON_MMUFLUSH = 0x18 - B1000000 = 0x1008 + B1000000 = 0x100c B115200 = 0x1002 - B1152000 = 0x1009 - B1500000 = 0x100a - B2000000 = 0x100b + B1152000 = 0x100d + B1500000 = 0x100e + B153600 = 0x1006 + B2000000 = 0x100f B230400 = 0x1003 - B2500000 = 0x100c - B3000000 = 0x100d - B3500000 = 0x100e - B4000000 = 0x100f + B307200 = 0x1007 B460800 = 0x1004 - B500000 = 0x1005 + B500000 = 0x100a B57600 = 0x1001 - B576000 = 0x1006 - B921600 = 0x1007 + B576000 = 0x100b + B614400 = 0x1008 + B76800 = 0x1005 + B921600 = 0x1009 BLKALIGNOFF = 0x2000127a BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 @@ -91,7 +91,7 @@ const ( FFDLY = 0x8000 FICLONE = 0x80049409 FICLONERANGE = 0x8020940d - FLUSHO = 0x1000 + FLUSHO = 0x2000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_NONCE = 0x4010661b @@ -563,6 +563,9 @@ const ( TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 + TIOCM_LOOP = 0x8000 + TIOCM_OUT1 = 0x2000 + TIOCM_OUT2 = 0x4000 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 @@ -641,10 +644,11 @@ const ( UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0xd + VDSUSP = 0xb VEOF = 0x4 - VEOL = 0xb - VEOL2 = 0x10 - VMIN = 0x6 + VEOL = 0x5 + VEOL2 = 0x6 + VMIN = 0x4 VREPRINT = 0xc VSTART = 0x8 VSTOP = 0x9 @@ -664,6 +668,7 @@ const ( WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 + WRAP = 0x20000 XCASE = 0x4 XTABS = 0x1800 _HIDIOCGRAWNAME = 0x40804804 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 526a0d5f434..538a18f27c2 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -4264,19 +4264,29 @@ type HwTstampConfig struct { } const ( - HWTSTAMP_FILTER_NONE = 0x0 - HWTSTAMP_FILTER_ALL = 0x1 - HWTSTAMP_FILTER_SOME = 0x2 - HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3 - HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6 - HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9 - HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc + HWTSTAMP_FILTER_NONE = 0x0 + HWTSTAMP_FILTER_ALL = 0x1 + HWTSTAMP_FILTER_SOME = 0x2 + HWTSTAMP_FILTER_PTP_V1_L4_EVENT = 0x3 + HWTSTAMP_FILTER_PTP_V1_L4_SYNC = 0x4 + HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ = 0x5 + HWTSTAMP_FILTER_PTP_V2_L4_EVENT = 0x6 + HWTSTAMP_FILTER_PTP_V2_L4_SYNC = 0x7 + HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ = 0x8 + HWTSTAMP_FILTER_PTP_V2_L2_EVENT = 0x9 + HWTSTAMP_FILTER_PTP_V2_L2_SYNC = 0xa + HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ = 0xb + HWTSTAMP_FILTER_PTP_V2_EVENT = 0xc + HWTSTAMP_FILTER_PTP_V2_SYNC = 0xd + HWTSTAMP_FILTER_PTP_V2_DELAY_REQ = 0xe + HWTSTAMP_FILTER_NTP_ALL = 0xf ) const ( HWTSTAMP_TX_OFF = 0x0 HWTSTAMP_TX_ON = 0x1 HWTSTAMP_TX_ONESTEP_SYNC = 0x2 + HWTSTAMP_TX_ONESTEP_P2P = 0x3 ) type ( @@ -4541,6 +4551,48 @@ const ( LANDLOCK_RULE_PATH_BENEATH = 0x1 ) +const ( + PIDFD_SIGNAL_THREAD = 0x1 + PIDFD_SIGNAL_THREAD_GROUP = 0x2 + PIDFD_SIGNAL_PROCESS_GROUP = 0x4 + PIDFD_SELF_THREAD = -0x2710 + PIDFD_SELF_THREAD_GROUP = -0x2711 + PIDFD_SELF = -0x2710 + PIDFD_SELF_PROCESS = -0x2711 + PIDFD_INFO_PID = 0x1 + PIDFD_INFO_CREDS = 0x2 + PIDFD_INFO_CGROUPID = 0x4 + PIDFD_INFO_EXIT = 0x8 + PIDFD_INFO_COREDUMP = 0x10 + PIDFD_COREDUMPED = 0x1 + PIDFD_COREDUMP_SKIP = 0x2 + PIDFD_COREDUMP_USER = 0x4 + PIDFD_COREDUMP_ROOT = 0x8 + PIDFD_INFO_SIZE_VER0 = 0x40 + PIDFD_GET_INFO = 0xc048ff0b +) + +const SizeofPidfdInfo = 0x48 + +type PidfdInfo struct { + Mask uint64 + Cgroupid uint64 + Pid uint32 + Tgid uint32 + Ppid uint32 + Ruid uint32 + Rgid uint32 + Euid uint32 + Egid uint32 + Suid uint32 + Sgid uint32 + Fsuid uint32 + Fsgid uint32 + Exit_code int32 + Coredump_mask uint32 + _ uint32 +} + const ( IPC_CREAT = 0x200 IPC_EXCL = 0x400 @@ -6473,3 +6525,23 @@ type GPIOV2LineEvent struct { Line_seqno uint32 _ [6]uint32 } + +const ( + IPMI_MAX_ADDR_SIZE = 0x20 + IPMI_SYSTEM_INTERFACE_ADDR_TYPE = 0xc + IPMI_BMC_CHANNEL = 0xf + IPMI_RESPONSE_RECV_TYPE = 0x1 +) + +type IPMISystemInterfaceAddr struct { + Type int32 + Channel int16 + Lun uint8 + _ [1]byte +} +type IPMIMsg struct { + Netfn uint8 + Cmd uint8 + Len uint16 + Data *uint8 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index aede1de7f2e..38658a345bd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -680,7 +680,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -715,3 +726,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index bb3bc4dc2c4..267ffe05f32 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -697,7 +697,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -729,3 +740,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 1fdf4c5175c..ec459d5f3fd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -674,7 +674,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -709,3 +720,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 063e6f0b41e..fa45ab7d2ce 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -676,7 +676,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -708,3 +719,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 9cf836c708f..3da72ccdf8b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -677,7 +677,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -709,3 +720,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 1d222fcb312..78f8c6d5557 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -680,7 +680,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x80 + PIDFD_NONBLOCK = 0x80 + PIDFD_THREAD = 0x400 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -714,3 +725,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 912cc4ab63b..bbd4c6c2b92 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -679,7 +679,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x80 + PIDFD_NONBLOCK = 0x80 + PIDFD_THREAD = 0x400 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -711,3 +722,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 1e358ef34f2..644d31d6ae5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -679,7 +679,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x80 + PIDFD_NONBLOCK = 0x80 + PIDFD_THREAD = 0x400 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -711,3 +722,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index df59f32f5e4..a976f62676b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -680,7 +680,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x80 + PIDFD_NONBLOCK = 0x80 + PIDFD_THREAD = 0x400 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -714,3 +725,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 29355aa0bfe..46324695f64 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -686,7 +686,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -722,3 +733,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4014690d + IPMICTL_RECEIVE_MSG = 0xc018690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int32 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int32 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index c6083a15d7d..cbc303974fe 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -686,7 +686,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -717,3 +728,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 6321cc76266..b47f7b49844 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -686,7 +686,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -717,3 +728,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index b44f402feb6..cb16add54c4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -704,7 +704,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -796,3 +807,22 @@ const ( const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index b22c795a646..a57ab8fadd7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -700,7 +700,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x800 + PIDFD_NONBLOCK = 0x800 + PIDFD_THREAD = 0x80 + PIDFD_GET_CGROUP_NAMESPACE = 0xff01 + PIDFD_GET_IPC_NAMESPACE = 0xff02 + PIDFD_GET_MNT_NAMESPACE = 0xff03 + PIDFD_GET_NET_NAMESPACE = 0xff04 + PIDFD_GET_PID_NAMESPACE = 0xff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0xff06 + PIDFD_GET_TIME_NAMESPACE = 0xff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0xff08 + PIDFD_GET_USER_NAMESPACE = 0xff09 + PIDFD_GET_UTS_NAMESPACE = 0xff0a ) type SysvIpcPerm struct { @@ -731,3 +742,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x8028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 0b18075b53e..bf99635d8ad 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -681,7 +681,18 @@ const ( ) const ( - PIDFD_NONBLOCK = 0x4000 + PIDFD_NONBLOCK = 0x4000 + PIDFD_THREAD = 0x800 + PIDFD_GET_CGROUP_NAMESPACE = 0x2000ff01 + PIDFD_GET_IPC_NAMESPACE = 0x2000ff02 + PIDFD_GET_MNT_NAMESPACE = 0x2000ff03 + PIDFD_GET_NET_NAMESPACE = 0x2000ff04 + PIDFD_GET_PID_NAMESPACE = 0x2000ff05 + PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE = 0x2000ff06 + PIDFD_GET_TIME_NAMESPACE = 0x2000ff07 + PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE = 0x2000ff08 + PIDFD_GET_USER_NAMESPACE = 0x2000ff09 + PIDFD_GET_UTS_NAMESPACE = 0x2000ff0a ) type SysvIpcPerm struct { @@ -712,3 +723,22 @@ type SysvShmDesc struct { const ( GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 ) + +const ( + IPMICTL_SEND_COMMAND = 0x4028690d + IPMICTL_RECEIVE_MSG = 0xc030690c +) + +type IPMIReq struct { + Addr *uint8 + Len uint32 + Msgid int64 + Msg IPMIMsg +} +type IPMIRecv struct { + Recv_type int32 + Addr *uint8 + Addr_len uint32 + Msgid int64 + Msg IPMIMsg +} diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 75a50b3165e..643737d4553 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -1065,6 +1065,7 @@ const ( SO_BROADCAST = 32 SO_LINGER = 128 SO_RCVBUF = 0x1002 + SO_SNDTIMEO = 0x1005 SO_RCVTIMEO = 0x1006 SO_SNDBUF = 0x1001 SO_UPDATE_ACCEPT_CONTEXT = 0x700b diff --git a/vendor/golang.org/x/term/terminal.go b/vendor/golang.org/x/term/terminal.go index 6ec537cdc1a..e8327c83fca 100644 --- a/vendor/golang.org/x/term/terminal.go +++ b/vendor/golang.org/x/term/terminal.go @@ -106,6 +106,9 @@ type Terminal struct { // a read. It aliases into inBuf. remainder []byte inBuf [256]byte + // readErr is an error returned by a read that also returned data. It is + // reported after all of that data has been processed. + readErr error // History records and retrieves lines of input read by [ReadLine] which // a user can retrieve and navigate using the up and down arrow keys. @@ -788,7 +791,11 @@ func (t *Terminal) ReadPassword(prompt string) (line string, err error) { return } -// ReadLine returns a line of input from the terminal. +// ReadLine returns a line of input from the terminal, excluding the +// trailing newline. It may return partial data along with an error. +// An [io.EOF] error indicates the end of the stream. For other errors, +// such as [ErrPasteIndicator] in bracketed paste mode, a subsequent +// call may return more data. func (t *Terminal) ReadLine() (line string, err error) { t.lock.Lock() defer t.lock.Unlock() @@ -863,21 +870,24 @@ func (t *Terminal) readLine() (line string, err error) { } return } + if t.readErr != nil { + err = t.readErr + t.readErr = nil + return + } // t.remainder is a slice at the beginning of t.inBuf // containing a partial key sequence readBuf := t.inBuf[len(t.remainder):] - var n int t.lock.Unlock() - n, err = t.c.Read(readBuf) + n, readErr := t.c.Read(readBuf) t.lock.Lock() - if err != nil { - return - } - t.remainder = t.inBuf[:n+len(t.remainder)] + if readErr != nil { + t.readErr = readErr + } } } diff --git a/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go b/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go index 6f7bd460a6c..10fbd86bcc5 100644 --- a/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go +++ b/vendor/golang.org/x/text/encoding/japanese/iso2022jp.go @@ -14,6 +14,16 @@ import ( ) // ISO2022JP is the ISO-2022-JP encoding. +// +// Decoding accepts ISO-2022-JP as specified in RFC 2237, +// which includes support for inputs which are not supported by +// the intentionally more restrictive WHATWG Encoding Standard, +// such as JIS X 0212 and half-width Katakana characters. +// +// Encoding always produces output that is valid according to WHATWG. +// +// Programs which forward inputs after parsing should take care to +// re-encode the parsed input for forwarding. var ISO2022JP encoding.Encoding = &iso2022JP var iso2022JP = internal.Encoding{ diff --git a/vendor/golang.org/x/text/unicode/bidi/core.go b/vendor/golang.org/x/text/unicode/bidi/core.go index fb8273236dd..e28ac8c8aa2 100644 --- a/vendor/golang.org/x/text/unicode/bidi/core.go +++ b/vendor/golang.org/x/text/unicode/bidi/core.go @@ -6,7 +6,6 @@ package bidi import ( "fmt" - "log" ) // This implementation is a port based on the reference implementation found at: @@ -248,7 +247,7 @@ func (p *paragraph) determineParagraphEmbeddingLevel(start, end int) level { } else if t.in(FSI, LRI, RLI) { i = p.matchingPDI[i] // skip over to the matching PDI if i > end { - log.Panic("assert (i <= end)") + panic("assert (i <= end)") } } } @@ -729,7 +728,7 @@ loop: continue loop } } - log.Panicf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i]) + panic(fmt.Errorf("invalid bidi code %v present in assertOnly at position %d", t, s.indexes[i])) } } diff --git a/vendor/golang.org/x/text/unicode/norm/composition.go b/vendor/golang.org/x/text/unicode/norm/composition.go index e2087bce527..e024e74b9f9 100644 --- a/vendor/golang.org/x/text/unicode/norm/composition.go +++ b/vendor/golang.org/x/text/unicode/norm/composition.go @@ -449,6 +449,16 @@ func (rb *reorderBuffer) combineHangul(s, i, k int) { // ACxx plus 11Ax to LVT rb.assignRune(s, l+v-jamoTBase) default: + // Not a Hangul composition. The segment may still + // contain regular canonical compositions, such as + // combining marks following a Hangul syllable, so + // fall back to the composition table. + if b[i].combinesBackward() { + if combined := combine(l, v); combined != 0 { + rb.assignRune(s, combined) + continue + } + } b[k] = b[i] k++ } @@ -484,25 +494,27 @@ func (rb *reorderBuffer) compose() { return } ii := b[i] + // Track the last starter unconditionally: b[i] must be blocked by + // any starter between it and s, even one that b[i] itself cannot + // combine with, and even if the runes in between never enter the + // combinesBackward branch below. + cccB := b[k-1].ccc + cccC := ii.ccc + blocked := false // b[i] blocked by starter or greater or equal CCC? + if cccB == 0 { + s = k - 1 + } else { + blocked = s != k-1 && cccB >= cccC + } // We can only use combineForward as a filter if we later // get the info for the combined character. This is more // expensive than using the filter. Using combinesBackward() // is safe. - if ii.combinesBackward() { - cccB := b[k-1].ccc - cccC := ii.ccc - blocked := false // b[i] blocked by starter or greater or equal CCC? - if cccB == 0 { - s = k - 1 - } else { - blocked = s != k-1 && cccB >= cccC - } - if !blocked { - combined := combine(rb.runeAt(s), rb.runeAt(i)) - if combined != 0 { - rb.assignRune(s, combined) - continue - } + if ii.combinesBackward() && !blocked { + combined := combine(rb.runeAt(s), rb.runeAt(i)) + if combined != 0 { + rb.assignRune(s, combined) + continue } } b[k] = b[i] diff --git a/vendor/golang.org/x/text/unicode/norm/forminfo.go b/vendor/golang.org/x/text/unicode/norm/forminfo.go index b3cf5d9bdee..956708eec0d 100644 --- a/vendor/golang.org/x/text/unicode/norm/forminfo.go +++ b/vendor/golang.org/x/text/unicode/norm/forminfo.go @@ -191,30 +191,30 @@ func (p Properties) TrailCCC() uint8 { return ccc[p.tccc] } +// Recomposition +// Each entry of recompMapPacked holds the two runes of the key and the +// composed rune of the value packed into a big-endian uint64 as three +// 21-bit fields, which is wide enough for any rune. +// Note that the recomposition map for NFC and NFKC are identical. + +const recompShift = 21 + func buildRecompMap() { - recompMap = make(map[uint32]rune, len(recompMapPacked)/8) + recompMap = make(map[uint64]rune, len(recompMapPacked)/8) var buf [8]byte for i := 0; i < len(recompMapPacked); i += 8 { copy(buf[:], recompMapPacked[i:i+8]) - key := binary.BigEndian.Uint32(buf[:4]) - val := binary.BigEndian.Uint32(buf[4:]) - recompMap[key] = rune(val) + e := binary.BigEndian.Uint64(buf[:]) + recompMap[e>>recompShift] = rune(e & (1<" + // 0x006C030C: 0x0000013E - "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 - "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 - "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 - "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 - "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 - "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 - "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C - "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D - "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E - "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F - "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 - "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 - "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 - "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 - "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 - "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 - "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 - "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 - "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A - "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B - "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C - "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D - "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E - "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F - "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 - "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 - "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 - "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 - "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 - "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 - "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 - "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 - "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A - "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B - "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C - "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D - "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E - "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F - "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 - "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 - "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 - "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 - "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 - "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 - "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 - "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 - "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 - "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 - "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A - "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B - "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C - "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D - "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E - "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 - "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 - "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF - "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 - "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD - "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE - "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF - "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 - "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 - "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 - "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 - "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 - "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 - "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 - "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 - "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 - "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 - "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA - "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB - "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC - "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE - "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF - "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 - "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 - "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 - "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 - "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 - "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 - "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 - "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 - "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA - "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB - "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC - "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED - "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE - "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF - "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 - "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 - "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 - "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 - "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 - "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA - "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB - "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC - "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD - "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE - "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF - "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 - "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 - "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 - "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 - "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 - "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 - "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 - "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 - "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 - "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 - "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A - "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B - "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C - "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D - "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E - "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F - "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 - "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 - "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 - "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 - "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 - "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 - "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 - "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 - "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 - "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 - "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A - "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B - "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E - "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F - "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 - "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 - "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 - "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 - "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A - "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B - "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C - "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D - "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E - "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F - "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 - "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 - "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 - "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 - "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 - "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 - "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 - "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 - "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A - "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C - "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E - "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F - "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 - "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA - "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB - "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC - "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD - "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE - "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF - "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 - "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA - "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB - "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC - "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD - "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE - "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 - "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 - "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 - "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 - "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 - "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 - "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C - "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D - "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E - "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 - "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 - "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 - "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 - "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 - "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 - "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C - "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D - "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E - "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 - "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 - "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 - "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 - "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 - "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 - "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 - "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 - "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 - "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 - "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA - "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB - "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC - "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD - "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE - "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF - "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 - "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 - "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 - "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 - "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 - "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 - "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA - "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB - "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC - "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED - "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE - "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF - "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 - "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 - "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 - "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 - "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 - "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 - "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 - "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 - "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 - "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 - "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 - "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 - "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 - "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 - "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 - "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 - "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 - "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 - "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 - "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB - "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC - "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 - "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B - "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C - "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 - "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA - "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB - "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC - "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 - "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 - "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 - "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 - "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA - "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB - "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A - "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B - "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C - "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA - "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC - "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD - "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE - "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 - "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 - "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 - "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A - "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C - "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E - "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 - "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B - "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D - "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 - "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 - "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 - "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 - "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 - "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 - "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 - "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 - "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 - "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 - "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 - "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 - "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 - "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A - "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B - "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C - "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D - "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E - "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F - "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 - "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 - "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 - "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 - "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 - "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 - "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 - "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 - "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 - "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 - "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A - "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B - "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C - "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D - "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E - "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F - "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 - "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 - "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 - "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 - "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 - "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 - "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 - "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 - "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 - "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 - "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A - "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B - "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C - "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D - "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E - "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F - "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 - "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 - "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 - "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 - "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 - "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 - "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 - "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 - "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 - "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 - "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A - "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B - "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C - "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D - "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E - "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F - "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 - "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 - "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 - "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 - "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 - "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 - "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 - "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 - "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 - "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 - "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A - "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B - "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C - "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D - "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E - "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F - "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 - "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 - "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 - "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 - "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 - "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 - "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 - "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 - "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 - "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 - "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A - "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B - "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C - "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D - "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E - "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F - "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 - "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 - "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 - "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 - "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 - "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 - "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 - "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 - "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 - "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 - "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A - "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B - "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C - "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D - "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E - "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F - "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 - "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 - "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 - "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 - "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 - "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 - "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 - "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 - "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 - "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 - "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A - "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B - "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C - "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D - "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E - "\x00v\x03#\x00\x00\x1e\x7f" + // 0x00760323: 0x00001E7F - "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 - "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 - "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 - "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 - "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 - "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 - "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 - "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 - "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 - "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 - "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A - "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B - "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C - "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D - "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E - "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F - "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 - "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 - "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 - "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 - "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 - "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 - "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 - "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 - "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 - "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 - "\x01\x7f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B - "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 - "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 - "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 - "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 - "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 - "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 - "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 - "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 - "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 - "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 - "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA - "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB - "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC - "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD - "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE - "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF - "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 - "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 - "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 - "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 - "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 - "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 - "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 - "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 - "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 - "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 - "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA - "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB - "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC - "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD - "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE - "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF - "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 - "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 - "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 - "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 - "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 - "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 - "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 - "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 - "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 - "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 - "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA - "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB - "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC - "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD - "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE - "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF - "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 - "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 - "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 - "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 - "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 - "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 - "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 - "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 - "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 - "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 - "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA - "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB - "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC - "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD - "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE - "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF - "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 - "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 - "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 - "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 - "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 - "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 - "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 - "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 - "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 - "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 - "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA - "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB - "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC - "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED - "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE - "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF - "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 - "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 - "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 - "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 - "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 - "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 - "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 - "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 - "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 - "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 - "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 - "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 - "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 - "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 - "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 - "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 - "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 - "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 - "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 - "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 - "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A - "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B - "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C - "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D - "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E - "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F - "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 - "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 - "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 - "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 - "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 - "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 - "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 - "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 - "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A - "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B - "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C - "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D - "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 - "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 - "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 - "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 - "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 - "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 - "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 - "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 - "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 - "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 - "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A - "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B - "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C - "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D - "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E - "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F - "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 - "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 - "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 - "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 - "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 - "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 - "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 - "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 - "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 - "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 - "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A - "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B - "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C - "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D - "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E - "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F - "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 - "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 - "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 - "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 - "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 - "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 - "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 - "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 - "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A - "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B - "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C - "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D - "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 - "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 - "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 - "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 - "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 - "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 - "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 - "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 - "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 - "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B - "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D - "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F - "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 - "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 - "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 - "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 - "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 - "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 - "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 - "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 - "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 - "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 - "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A - "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B - "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C - "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D - "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E - "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F - "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 - "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 - "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 - "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 - "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 - "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A - "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C - "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 - "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 - "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 - "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 - "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 - "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 - "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 - "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 - "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 - "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 - "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A - "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B - "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C - "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D - "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E - "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F - "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 - "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 - "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 - "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 - "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 - "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 - "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 - "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 - "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 - "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 - "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A - "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B - "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C - "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D - "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E - "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F - "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 - "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 - "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 - "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 - "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 - "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 - "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 - "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 - "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 - "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 - "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA - "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB - "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC - "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD - "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE - "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF - "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 - "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 - "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 - "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 - "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 - "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 - "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 - "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 - "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 - "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA - "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC - "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 - "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 - "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 - "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 - "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 - "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 - "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 - "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA - "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC - "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD - "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE - "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF - "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 - "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 - "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 - "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 - "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 - "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 - "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 - "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA - "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD - "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE - "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF - "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 - "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 - "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 - "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 - "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 - "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 - "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 - "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 - "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 - "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA - "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC - "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED - "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 - "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 - "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 - "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 - "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 - "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 - "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA - "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC - "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A - "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B - "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE - "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD - "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE - "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF - "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 - "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 - "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C - "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 - "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 - "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 - "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 - "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 - "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 - "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 - "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 - "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D - "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E - "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F - "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 - "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 - "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 - "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 - "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 - "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 - "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 - "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 - "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 - "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 - "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 - "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 - "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC - "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD - "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE - "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF - "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 - "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 - "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 - "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 - "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA - "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB - "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC - "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED - "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C - "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E - "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 - "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 - "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 - "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 - "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 - "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A - "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C - "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E - "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 - "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 - "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 - "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 - "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 - "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 - "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 - "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 - "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 - "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 - "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 - "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 - "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A - "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C - "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D - "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 - "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E - "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC - "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE - "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 - "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 - "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 - "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 - "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 - "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA - "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC - "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE - "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 - "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 - "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 - "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 - "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 - "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 - "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 - "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 - "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 - "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 - "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 - "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 - "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA - "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC - "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD - "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 - "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 - "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 - "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 - "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA - "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE - "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A - "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C - "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB - "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E - "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F - "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B - "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C - "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB - "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC - "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE - "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA - "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB - "\x195\x190\x00\x01\x198" + // 0x19351930: 0x00011938 + "\x00\x01\x04\x00`\x00\x00\xc0" + // 0x00041 0x00300: 0x000C0 + "\x00\x01\x04\x00` \x00\xc1" + // 0x00041 0x00301: 0x000C1 + "\x00\x01\x04\x00`@\x00\xc2" + // 0x00041 0x00302: 0x000C2 + "\x00\x01\x04\x00``\x00\xc3" + // 0x00041 0x00303: 0x000C3 + "\x00\x01\x04\x00a\x00\x00\xc4" + // 0x00041 0x00308: 0x000C4 + "\x00\x01\x04\x00a@\x00\xc5" + // 0x00041 0x0030A: 0x000C5 + "\x00\x01\f\x00d\xe0\x00\xc7" + // 0x00043 0x00327: 0x000C7 + "\x00\x01\x14\x00`\x00\x00\xc8" + // 0x00045 0x00300: 0x000C8 + "\x00\x01\x14\x00` \x00\xc9" + // 0x00045 0x00301: 0x000C9 + "\x00\x01\x14\x00`@\x00\xca" + // 0x00045 0x00302: 0x000CA + "\x00\x01\x14\x00a\x00\x00\xcb" + // 0x00045 0x00308: 0x000CB + "\x00\x01$\x00`\x00\x00\xcc" + // 0x00049 0x00300: 0x000CC + "\x00\x01$\x00` \x00\xcd" + // 0x00049 0x00301: 0x000CD + "\x00\x01$\x00`@\x00\xce" + // 0x00049 0x00302: 0x000CE + "\x00\x01$\x00a\x00\x00\xcf" + // 0x00049 0x00308: 0x000CF + "\x00\x018\x00``\x00\xd1" + // 0x0004E 0x00303: 0x000D1 + "\x00\x01<\x00`\x00\x00\xd2" + // 0x0004F 0x00300: 0x000D2 + "\x00\x01<\x00` \x00\xd3" + // 0x0004F 0x00301: 0x000D3 + "\x00\x01<\x00`@\x00\xd4" + // 0x0004F 0x00302: 0x000D4 + "\x00\x01<\x00``\x00\xd5" + // 0x0004F 0x00303: 0x000D5 + "\x00\x01<\x00a\x00\x00\xd6" + // 0x0004F 0x00308: 0x000D6 + "\x00\x01T\x00`\x00\x00\xd9" + // 0x00055 0x00300: 0x000D9 + "\x00\x01T\x00` \x00\xda" + // 0x00055 0x00301: 0x000DA + "\x00\x01T\x00`@\x00\xdb" + // 0x00055 0x00302: 0x000DB + "\x00\x01T\x00a\x00\x00\xdc" + // 0x00055 0x00308: 0x000DC + "\x00\x01d\x00` \x00\xdd" + // 0x00059 0x00301: 0x000DD + "\x00\x01\x84\x00`\x00\x00\xe0" + // 0x00061 0x00300: 0x000E0 + "\x00\x01\x84\x00` \x00\xe1" + // 0x00061 0x00301: 0x000E1 + "\x00\x01\x84\x00`@\x00\xe2" + // 0x00061 0x00302: 0x000E2 + "\x00\x01\x84\x00``\x00\xe3" + // 0x00061 0x00303: 0x000E3 + "\x00\x01\x84\x00a\x00\x00\xe4" + // 0x00061 0x00308: 0x000E4 + "\x00\x01\x84\x00a@\x00\xe5" + // 0x00061 0x0030A: 0x000E5 + "\x00\x01\x8c\x00d\xe0\x00\xe7" + // 0x00063 0x00327: 0x000E7 + "\x00\x01\x94\x00`\x00\x00\xe8" + // 0x00065 0x00300: 0x000E8 + "\x00\x01\x94\x00` \x00\xe9" + // 0x00065 0x00301: 0x000E9 + "\x00\x01\x94\x00`@\x00\xea" + // 0x00065 0x00302: 0x000EA + "\x00\x01\x94\x00a\x00\x00\xeb" + // 0x00065 0x00308: 0x000EB + "\x00\x01\xa4\x00`\x00\x00\xec" + // 0x00069 0x00300: 0x000EC + "\x00\x01\xa4\x00` \x00\xed" + // 0x00069 0x00301: 0x000ED + "\x00\x01\xa4\x00`@\x00\xee" + // 0x00069 0x00302: 0x000EE + "\x00\x01\xa4\x00a\x00\x00\xef" + // 0x00069 0x00308: 0x000EF + "\x00\x01\xb8\x00``\x00\xf1" + // 0x0006E 0x00303: 0x000F1 + "\x00\x01\xbc\x00`\x00\x00\xf2" + // 0x0006F 0x00300: 0x000F2 + "\x00\x01\xbc\x00` \x00\xf3" + // 0x0006F 0x00301: 0x000F3 + "\x00\x01\xbc\x00`@\x00\xf4" + // 0x0006F 0x00302: 0x000F4 + "\x00\x01\xbc\x00``\x00\xf5" + // 0x0006F 0x00303: 0x000F5 + "\x00\x01\xbc\x00a\x00\x00\xf6" + // 0x0006F 0x00308: 0x000F6 + "\x00\x01\xd4\x00`\x00\x00\xf9" + // 0x00075 0x00300: 0x000F9 + "\x00\x01\xd4\x00` \x00\xfa" + // 0x00075 0x00301: 0x000FA + "\x00\x01\xd4\x00`@\x00\xfb" + // 0x00075 0x00302: 0x000FB + "\x00\x01\xd4\x00a\x00\x00\xfc" + // 0x00075 0x00308: 0x000FC + "\x00\x01\xe4\x00` \x00\xfd" + // 0x00079 0x00301: 0x000FD + "\x00\x01\xe4\x00a\x00\x00\xff" + // 0x00079 0x00308: 0x000FF + "\x00\x01\x04\x00`\x80\x01\x00" + // 0x00041 0x00304: 0x00100 + "\x00\x01\x84\x00`\x80\x01\x01" + // 0x00061 0x00304: 0x00101 + "\x00\x01\x04\x00`\xc0\x01\x02" + // 0x00041 0x00306: 0x00102 + "\x00\x01\x84\x00`\xc0\x01\x03" + // 0x00061 0x00306: 0x00103 + "\x00\x01\x04\x00e\x00\x01\x04" + // 0x00041 0x00328: 0x00104 + "\x00\x01\x84\x00e\x00\x01\x05" + // 0x00061 0x00328: 0x00105 + "\x00\x01\f\x00` \x01\x06" + // 0x00043 0x00301: 0x00106 + "\x00\x01\x8c\x00` \x01\a" + // 0x00063 0x00301: 0x00107 + "\x00\x01\f\x00`@\x01\b" + // 0x00043 0x00302: 0x00108 + "\x00\x01\x8c\x00`@\x01\t" + // 0x00063 0x00302: 0x00109 + "\x00\x01\f\x00`\xe0\x01\n" + // 0x00043 0x00307: 0x0010A + "\x00\x01\x8c\x00`\xe0\x01\v" + // 0x00063 0x00307: 0x0010B + "\x00\x01\f\x00a\x80\x01\f" + // 0x00043 0x0030C: 0x0010C + "\x00\x01\x8c\x00a\x80\x01\r" + // 0x00063 0x0030C: 0x0010D + "\x00\x01\x10\x00a\x80\x01\x0e" + // 0x00044 0x0030C: 0x0010E + "\x00\x01\x90\x00a\x80\x01\x0f" + // 0x00064 0x0030C: 0x0010F + "\x00\x01\x14\x00`\x80\x01\x12" + // 0x00045 0x00304: 0x00112 + "\x00\x01\x94\x00`\x80\x01\x13" + // 0x00065 0x00304: 0x00113 + "\x00\x01\x14\x00`\xc0\x01\x14" + // 0x00045 0x00306: 0x00114 + "\x00\x01\x94\x00`\xc0\x01\x15" + // 0x00065 0x00306: 0x00115 + "\x00\x01\x14\x00`\xe0\x01\x16" + // 0x00045 0x00307: 0x00116 + "\x00\x01\x94\x00`\xe0\x01\x17" + // 0x00065 0x00307: 0x00117 + "\x00\x01\x14\x00e\x00\x01\x18" + // 0x00045 0x00328: 0x00118 + "\x00\x01\x94\x00e\x00\x01\x19" + // 0x00065 0x00328: 0x00119 + "\x00\x01\x14\x00a\x80\x01\x1a" + // 0x00045 0x0030C: 0x0011A + "\x00\x01\x94\x00a\x80\x01\x1b" + // 0x00065 0x0030C: 0x0011B + "\x00\x01\x1c\x00`@\x01\x1c" + // 0x00047 0x00302: 0x0011C + "\x00\x01\x9c\x00`@\x01\x1d" + // 0x00067 0x00302: 0x0011D + "\x00\x01\x1c\x00`\xc0\x01\x1e" + // 0x00047 0x00306: 0x0011E + "\x00\x01\x9c\x00`\xc0\x01\x1f" + // 0x00067 0x00306: 0x0011F + "\x00\x01\x1c\x00`\xe0\x01 " + // 0x00047 0x00307: 0x00120 + "\x00\x01\x9c\x00`\xe0\x01!" + // 0x00067 0x00307: 0x00121 + "\x00\x01\x1c\x00d\xe0\x01\"" + // 0x00047 0x00327: 0x00122 + "\x00\x01\x9c\x00d\xe0\x01#" + // 0x00067 0x00327: 0x00123 + "\x00\x01 \x00`@\x01$" + // 0x00048 0x00302: 0x00124 + "\x00\x01\xa0\x00`@\x01%" + // 0x00068 0x00302: 0x00125 + "\x00\x01$\x00``\x01(" + // 0x00049 0x00303: 0x00128 + "\x00\x01\xa4\x00``\x01)" + // 0x00069 0x00303: 0x00129 + "\x00\x01$\x00`\x80\x01*" + // 0x00049 0x00304: 0x0012A + "\x00\x01\xa4\x00`\x80\x01+" + // 0x00069 0x00304: 0x0012B + "\x00\x01$\x00`\xc0\x01," + // 0x00049 0x00306: 0x0012C + "\x00\x01\xa4\x00`\xc0\x01-" + // 0x00069 0x00306: 0x0012D + "\x00\x01$\x00e\x00\x01." + // 0x00049 0x00328: 0x0012E + "\x00\x01\xa4\x00e\x00\x01/" + // 0x00069 0x00328: 0x0012F + "\x00\x01$\x00`\xe0\x010" + // 0x00049 0x00307: 0x00130 + "\x00\x01(\x00`@\x014" + // 0x0004A 0x00302: 0x00134 + "\x00\x01\xa8\x00`@\x015" + // 0x0006A 0x00302: 0x00135 + "\x00\x01,\x00d\xe0\x016" + // 0x0004B 0x00327: 0x00136 + "\x00\x01\xac\x00d\xe0\x017" + // 0x0006B 0x00327: 0x00137 + "\x00\x010\x00` \x019" + // 0x0004C 0x00301: 0x00139 + "\x00\x01\xb0\x00` \x01:" + // 0x0006C 0x00301: 0x0013A + "\x00\x010\x00d\xe0\x01;" + // 0x0004C 0x00327: 0x0013B + "\x00\x01\xb0\x00d\xe0\x01<" + // 0x0006C 0x00327: 0x0013C + "\x00\x010\x00a\x80\x01=" + // 0x0004C 0x0030C: 0x0013D + "\x00\x01\xb0\x00a\x80\x01>" + // 0x0006C 0x0030C: 0x0013E + "\x00\x018\x00` \x01C" + // 0x0004E 0x00301: 0x00143 + "\x00\x01\xb8\x00` \x01D" + // 0x0006E 0x00301: 0x00144 + "\x00\x018\x00d\xe0\x01E" + // 0x0004E 0x00327: 0x00145 + "\x00\x01\xb8\x00d\xe0\x01F" + // 0x0006E 0x00327: 0x00146 + "\x00\x018\x00a\x80\x01G" + // 0x0004E 0x0030C: 0x00147 + "\x00\x01\xb8\x00a\x80\x01H" + // 0x0006E 0x0030C: 0x00148 + "\x00\x01<\x00`\x80\x01L" + // 0x0004F 0x00304: 0x0014C + "\x00\x01\xbc\x00`\x80\x01M" + // 0x0006F 0x00304: 0x0014D + "\x00\x01<\x00`\xc0\x01N" + // 0x0004F 0x00306: 0x0014E + "\x00\x01\xbc\x00`\xc0\x01O" + // 0x0006F 0x00306: 0x0014F + "\x00\x01<\x00a`\x01P" + // 0x0004F 0x0030B: 0x00150 + "\x00\x01\xbc\x00a`\x01Q" + // 0x0006F 0x0030B: 0x00151 + "\x00\x01H\x00` \x01T" + // 0x00052 0x00301: 0x00154 + "\x00\x01\xc8\x00` \x01U" + // 0x00072 0x00301: 0x00155 + "\x00\x01H\x00d\xe0\x01V" + // 0x00052 0x00327: 0x00156 + "\x00\x01\xc8\x00d\xe0\x01W" + // 0x00072 0x00327: 0x00157 + "\x00\x01H\x00a\x80\x01X" + // 0x00052 0x0030C: 0x00158 + "\x00\x01\xc8\x00a\x80\x01Y" + // 0x00072 0x0030C: 0x00159 + "\x00\x01L\x00` \x01Z" + // 0x00053 0x00301: 0x0015A + "\x00\x01\xcc\x00` \x01[" + // 0x00073 0x00301: 0x0015B + "\x00\x01L\x00`@\x01\\" + // 0x00053 0x00302: 0x0015C + "\x00\x01\xcc\x00`@\x01]" + // 0x00073 0x00302: 0x0015D + "\x00\x01L\x00d\xe0\x01^" + // 0x00053 0x00327: 0x0015E + "\x00\x01\xcc\x00d\xe0\x01_" + // 0x00073 0x00327: 0x0015F + "\x00\x01L\x00a\x80\x01`" + // 0x00053 0x0030C: 0x00160 + "\x00\x01\xcc\x00a\x80\x01a" + // 0x00073 0x0030C: 0x00161 + "\x00\x01P\x00d\xe0\x01b" + // 0x00054 0x00327: 0x00162 + "\x00\x01\xd0\x00d\xe0\x01c" + // 0x00074 0x00327: 0x00163 + "\x00\x01P\x00a\x80\x01d" + // 0x00054 0x0030C: 0x00164 + "\x00\x01\xd0\x00a\x80\x01e" + // 0x00074 0x0030C: 0x00165 + "\x00\x01T\x00``\x01h" + // 0x00055 0x00303: 0x00168 + "\x00\x01\xd4\x00``\x01i" + // 0x00075 0x00303: 0x00169 + "\x00\x01T\x00`\x80\x01j" + // 0x00055 0x00304: 0x0016A + "\x00\x01\xd4\x00`\x80\x01k" + // 0x00075 0x00304: 0x0016B + "\x00\x01T\x00`\xc0\x01l" + // 0x00055 0x00306: 0x0016C + "\x00\x01\xd4\x00`\xc0\x01m" + // 0x00075 0x00306: 0x0016D + "\x00\x01T\x00a@\x01n" + // 0x00055 0x0030A: 0x0016E + "\x00\x01\xd4\x00a@\x01o" + // 0x00075 0x0030A: 0x0016F + "\x00\x01T\x00a`\x01p" + // 0x00055 0x0030B: 0x00170 + "\x00\x01\xd4\x00a`\x01q" + // 0x00075 0x0030B: 0x00171 + "\x00\x01T\x00e\x00\x01r" + // 0x00055 0x00328: 0x00172 + "\x00\x01\xd4\x00e\x00\x01s" + // 0x00075 0x00328: 0x00173 + "\x00\x01\\\x00`@\x01t" + // 0x00057 0x00302: 0x00174 + "\x00\x01\xdc\x00`@\x01u" + // 0x00077 0x00302: 0x00175 + "\x00\x01d\x00`@\x01v" + // 0x00059 0x00302: 0x00176 + "\x00\x01\xe4\x00`@\x01w" + // 0x00079 0x00302: 0x00177 + "\x00\x01d\x00a\x00\x01x" + // 0x00059 0x00308: 0x00178 + "\x00\x01h\x00` \x01y" + // 0x0005A 0x00301: 0x00179 + "\x00\x01\xe8\x00` \x01z" + // 0x0007A 0x00301: 0x0017A + "\x00\x01h\x00`\xe0\x01{" + // 0x0005A 0x00307: 0x0017B + "\x00\x01\xe8\x00`\xe0\x01|" + // 0x0007A 0x00307: 0x0017C + "\x00\x01h\x00a\x80\x01}" + // 0x0005A 0x0030C: 0x0017D + "\x00\x01\xe8\x00a\x80\x01~" + // 0x0007A 0x0030C: 0x0017E + "\x00\x01<\x00c`\x01\xa0" + // 0x0004F 0x0031B: 0x001A0 + "\x00\x01\xbc\x00c`\x01\xa1" + // 0x0006F 0x0031B: 0x001A1 + "\x00\x01T\x00c`\x01\xaf" + // 0x00055 0x0031B: 0x001AF + "\x00\x01\xd4\x00c`\x01\xb0" + // 0x00075 0x0031B: 0x001B0 + "\x00\x01\x04\x00a\x80\x01\xcd" + // 0x00041 0x0030C: 0x001CD + "\x00\x01\x84\x00a\x80\x01\xce" + // 0x00061 0x0030C: 0x001CE + "\x00\x01$\x00a\x80\x01\xcf" + // 0x00049 0x0030C: 0x001CF + "\x00\x01\xa4\x00a\x80\x01\xd0" + // 0x00069 0x0030C: 0x001D0 + "\x00\x01<\x00a\x80\x01\xd1" + // 0x0004F 0x0030C: 0x001D1 + "\x00\x01\xbc\x00a\x80\x01\xd2" + // 0x0006F 0x0030C: 0x001D2 + "\x00\x01T\x00a\x80\x01\xd3" + // 0x00055 0x0030C: 0x001D3 + "\x00\x01\xd4\x00a\x80\x01\xd4" + // 0x00075 0x0030C: 0x001D4 + "\x00\x03p\x00`\x80\x01\xd5" + // 0x000DC 0x00304: 0x001D5 + "\x00\x03\xf0\x00`\x80\x01\xd6" + // 0x000FC 0x00304: 0x001D6 + "\x00\x03p\x00` \x01\xd7" + // 0x000DC 0x00301: 0x001D7 + "\x00\x03\xf0\x00` \x01\xd8" + // 0x000FC 0x00301: 0x001D8 + "\x00\x03p\x00a\x80\x01\xd9" + // 0x000DC 0x0030C: 0x001D9 + "\x00\x03\xf0\x00a\x80\x01\xda" + // 0x000FC 0x0030C: 0x001DA + "\x00\x03p\x00`\x00\x01\xdb" + // 0x000DC 0x00300: 0x001DB + "\x00\x03\xf0\x00`\x00\x01\xdc" + // 0x000FC 0x00300: 0x001DC + "\x00\x03\x10\x00`\x80\x01\xde" + // 0x000C4 0x00304: 0x001DE + "\x00\x03\x90\x00`\x80\x01\xdf" + // 0x000E4 0x00304: 0x001DF + "\x00\b\x98\x00`\x80\x01\xe0" + // 0x00226 0x00304: 0x001E0 + "\x00\b\x9c\x00`\x80\x01\xe1" + // 0x00227 0x00304: 0x001E1 + "\x00\x03\x18\x00`\x80\x01\xe2" + // 0x000C6 0x00304: 0x001E2 + "\x00\x03\x98\x00`\x80\x01\xe3" + // 0x000E6 0x00304: 0x001E3 + "\x00\x01\x1c\x00a\x80\x01\xe6" + // 0x00047 0x0030C: 0x001E6 + "\x00\x01\x9c\x00a\x80\x01\xe7" + // 0x00067 0x0030C: 0x001E7 + "\x00\x01,\x00a\x80\x01\xe8" + // 0x0004B 0x0030C: 0x001E8 + "\x00\x01\xac\x00a\x80\x01\xe9" + // 0x0006B 0x0030C: 0x001E9 + "\x00\x01<\x00e\x00\x01\xea" + // 0x0004F 0x00328: 0x001EA + "\x00\x01\xbc\x00e\x00\x01\xeb" + // 0x0006F 0x00328: 0x001EB + "\x00\a\xa8\x00`\x80\x01\xec" + // 0x001EA 0x00304: 0x001EC + "\x00\a\xac\x00`\x80\x01\xed" + // 0x001EB 0x00304: 0x001ED + "\x00\x06\xdc\x00a\x80\x01\xee" + // 0x001B7 0x0030C: 0x001EE + "\x00\nH\x00a\x80\x01\xef" + // 0x00292 0x0030C: 0x001EF + "\x00\x01\xa8\x00a\x80\x01\xf0" + // 0x0006A 0x0030C: 0x001F0 + "\x00\x01\x1c\x00` \x01\xf4" + // 0x00047 0x00301: 0x001F4 + "\x00\x01\x9c\x00` \x01\xf5" + // 0x00067 0x00301: 0x001F5 + "\x00\x018\x00`\x00\x01\xf8" + // 0x0004E 0x00300: 0x001F8 + "\x00\x01\xb8\x00`\x00\x01\xf9" + // 0x0006E 0x00300: 0x001F9 + "\x00\x03\x14\x00` \x01\xfa" + // 0x000C5 0x00301: 0x001FA + "\x00\x03\x94\x00` \x01\xfb" + // 0x000E5 0x00301: 0x001FB + "\x00\x03\x18\x00` \x01\xfc" + // 0x000C6 0x00301: 0x001FC + "\x00\x03\x98\x00` \x01\xfd" + // 0x000E6 0x00301: 0x001FD + "\x00\x03`\x00` \x01\xfe" + // 0x000D8 0x00301: 0x001FE + "\x00\x03\xe0\x00` \x01\xff" + // 0x000F8 0x00301: 0x001FF + "\x00\x01\x04\x00a\xe0\x02\x00" + // 0x00041 0x0030F: 0x00200 + "\x00\x01\x84\x00a\xe0\x02\x01" + // 0x00061 0x0030F: 0x00201 + "\x00\x01\x04\x00b \x02\x02" + // 0x00041 0x00311: 0x00202 + "\x00\x01\x84\x00b \x02\x03" + // 0x00061 0x00311: 0x00203 + "\x00\x01\x14\x00a\xe0\x02\x04" + // 0x00045 0x0030F: 0x00204 + "\x00\x01\x94\x00a\xe0\x02\x05" + // 0x00065 0x0030F: 0x00205 + "\x00\x01\x14\x00b \x02\x06" + // 0x00045 0x00311: 0x00206 + "\x00\x01\x94\x00b \x02\a" + // 0x00065 0x00311: 0x00207 + "\x00\x01$\x00a\xe0\x02\b" + // 0x00049 0x0030F: 0x00208 + "\x00\x01\xa4\x00a\xe0\x02\t" + // 0x00069 0x0030F: 0x00209 + "\x00\x01$\x00b \x02\n" + // 0x00049 0x00311: 0x0020A + "\x00\x01\xa4\x00b \x02\v" + // 0x00069 0x00311: 0x0020B + "\x00\x01<\x00a\xe0\x02\f" + // 0x0004F 0x0030F: 0x0020C + "\x00\x01\xbc\x00a\xe0\x02\r" + // 0x0006F 0x0030F: 0x0020D + "\x00\x01<\x00b \x02\x0e" + // 0x0004F 0x00311: 0x0020E + "\x00\x01\xbc\x00b \x02\x0f" + // 0x0006F 0x00311: 0x0020F + "\x00\x01H\x00a\xe0\x02\x10" + // 0x00052 0x0030F: 0x00210 + "\x00\x01\xc8\x00a\xe0\x02\x11" + // 0x00072 0x0030F: 0x00211 + "\x00\x01H\x00b \x02\x12" + // 0x00052 0x00311: 0x00212 + "\x00\x01\xc8\x00b \x02\x13" + // 0x00072 0x00311: 0x00213 + "\x00\x01T\x00a\xe0\x02\x14" + // 0x00055 0x0030F: 0x00214 + "\x00\x01\xd4\x00a\xe0\x02\x15" + // 0x00075 0x0030F: 0x00215 + "\x00\x01T\x00b \x02\x16" + // 0x00055 0x00311: 0x00216 + "\x00\x01\xd4\x00b \x02\x17" + // 0x00075 0x00311: 0x00217 + "\x00\x01L\x00d\xc0\x02\x18" + // 0x00053 0x00326: 0x00218 + "\x00\x01\xcc\x00d\xc0\x02\x19" + // 0x00073 0x00326: 0x00219 + "\x00\x01P\x00d\xc0\x02\x1a" + // 0x00054 0x00326: 0x0021A + "\x00\x01\xd0\x00d\xc0\x02\x1b" + // 0x00074 0x00326: 0x0021B + "\x00\x01 \x00a\x80\x02\x1e" + // 0x00048 0x0030C: 0x0021E + "\x00\x01\xa0\x00a\x80\x02\x1f" + // 0x00068 0x0030C: 0x0021F + "\x00\x01\x04\x00`\xe0\x02&" + // 0x00041 0x00307: 0x00226 + "\x00\x01\x84\x00`\xe0\x02'" + // 0x00061 0x00307: 0x00227 + "\x00\x01\x14\x00d\xe0\x02(" + // 0x00045 0x00327: 0x00228 + "\x00\x01\x94\x00d\xe0\x02)" + // 0x00065 0x00327: 0x00229 + "\x00\x03X\x00`\x80\x02*" + // 0x000D6 0x00304: 0x0022A + "\x00\x03\xd8\x00`\x80\x02+" + // 0x000F6 0x00304: 0x0022B + "\x00\x03T\x00`\x80\x02," + // 0x000D5 0x00304: 0x0022C + "\x00\x03\xd4\x00`\x80\x02-" + // 0x000F5 0x00304: 0x0022D + "\x00\x01<\x00`\xe0\x02." + // 0x0004F 0x00307: 0x0022E + "\x00\x01\xbc\x00`\xe0\x02/" + // 0x0006F 0x00307: 0x0022F + "\x00\b\xb8\x00`\x80\x020" + // 0x0022E 0x00304: 0x00230 + "\x00\b\xbc\x00`\x80\x021" + // 0x0022F 0x00304: 0x00231 + "\x00\x01d\x00`\x80\x022" + // 0x00059 0x00304: 0x00232 + "\x00\x01\xe4\x00`\x80\x023" + // 0x00079 0x00304: 0x00233 + "\x00\x02\xa0\x00` \x03\x85" + // 0x000A8 0x00301: 0x00385 + "\x00\x0eD\x00` \x03\x86" + // 0x00391 0x00301: 0x00386 + "\x00\x0eT\x00` \x03\x88" + // 0x00395 0x00301: 0x00388 + "\x00\x0e\\\x00` \x03\x89" + // 0x00397 0x00301: 0x00389 + "\x00\x0ed\x00` \x03\x8a" + // 0x00399 0x00301: 0x0038A + "\x00\x0e|\x00` \x03\x8c" + // 0x0039F 0x00301: 0x0038C + "\x00\x0e\x94\x00` \x03\x8e" + // 0x003A5 0x00301: 0x0038E + "\x00\x0e\xa4\x00` \x03\x8f" + // 0x003A9 0x00301: 0x0038F + "\x00\x0f(\x00` \x03\x90" + // 0x003CA 0x00301: 0x00390 + "\x00\x0ed\x00a\x00\x03\xaa" + // 0x00399 0x00308: 0x003AA + "\x00\x0e\x94\x00a\x00\x03\xab" + // 0x003A5 0x00308: 0x003AB + "\x00\x0e\xc4\x00` \x03\xac" + // 0x003B1 0x00301: 0x003AC + "\x00\x0e\xd4\x00` \x03\xad" + // 0x003B5 0x00301: 0x003AD + "\x00\x0e\xdc\x00` \x03\xae" + // 0x003B7 0x00301: 0x003AE + "\x00\x0e\xe4\x00` \x03\xaf" + // 0x003B9 0x00301: 0x003AF + "\x00\x0f,\x00` \x03\xb0" + // 0x003CB 0x00301: 0x003B0 + "\x00\x0e\xe4\x00a\x00\x03\xca" + // 0x003B9 0x00308: 0x003CA + "\x00\x0f\x14\x00a\x00\x03\xcb" + // 0x003C5 0x00308: 0x003CB + "\x00\x0e\xfc\x00` \x03\xcc" + // 0x003BF 0x00301: 0x003CC + "\x00\x0f\x14\x00` \x03\xcd" + // 0x003C5 0x00301: 0x003CD + "\x00\x0f$\x00` \x03\xce" + // 0x003C9 0x00301: 0x003CE + "\x00\x0fH\x00` \x03\xd3" + // 0x003D2 0x00301: 0x003D3 + "\x00\x0fH\x00a\x00\x03\xd4" + // 0x003D2 0x00308: 0x003D4 + "\x00\x10T\x00`\x00\x04\x00" + // 0x00415 0x00300: 0x00400 + "\x00\x10T\x00a\x00\x04\x01" + // 0x00415 0x00308: 0x00401 + "\x00\x10L\x00` \x04\x03" + // 0x00413 0x00301: 0x00403 + "\x00\x10\x18\x00a\x00\x04\a" + // 0x00406 0x00308: 0x00407 + "\x00\x10h\x00` \x04\f" + // 0x0041A 0x00301: 0x0040C + "\x00\x10`\x00`\x00\x04\r" + // 0x00418 0x00300: 0x0040D + "\x00\x10\x8c\x00`\xc0\x04\x0e" + // 0x00423 0x00306: 0x0040E + "\x00\x10`\x00`\xc0\x04\x19" + // 0x00418 0x00306: 0x00419 + "\x00\x10\xe0\x00`\xc0\x049" + // 0x00438 0x00306: 0x00439 + "\x00\x10\xd4\x00`\x00\x04P" + // 0x00435 0x00300: 0x00450 + "\x00\x10\xd4\x00a\x00\x04Q" + // 0x00435 0x00308: 0x00451 + "\x00\x10\xcc\x00` \x04S" + // 0x00433 0x00301: 0x00453 + "\x00\x11X\x00a\x00\x04W" + // 0x00456 0x00308: 0x00457 + "\x00\x10\xe8\x00` \x04\\" + // 0x0043A 0x00301: 0x0045C + "\x00\x10\xe0\x00`\x00\x04]" + // 0x00438 0x00300: 0x0045D + "\x00\x11\f\x00`\xc0\x04^" + // 0x00443 0x00306: 0x0045E + "\x00\x11\xd0\x00a\xe0\x04v" + // 0x00474 0x0030F: 0x00476 + "\x00\x11\xd4\x00a\xe0\x04w" + // 0x00475 0x0030F: 0x00477 + "\x00\x10X\x00`\xc0\x04\xc1" + // 0x00416 0x00306: 0x004C1 + "\x00\x10\xd8\x00`\xc0\x04\xc2" + // 0x00436 0x00306: 0x004C2 + "\x00\x10@\x00`\xc0\x04\xd0" + // 0x00410 0x00306: 0x004D0 + "\x00\x10\xc0\x00`\xc0\x04\xd1" + // 0x00430 0x00306: 0x004D1 + "\x00\x10@\x00a\x00\x04\xd2" + // 0x00410 0x00308: 0x004D2 + "\x00\x10\xc0\x00a\x00\x04\xd3" + // 0x00430 0x00308: 0x004D3 + "\x00\x10T\x00`\xc0\x04\xd6" + // 0x00415 0x00306: 0x004D6 + "\x00\x10\xd4\x00`\xc0\x04\xd7" + // 0x00435 0x00306: 0x004D7 + "\x00\x13`\x00a\x00\x04\xda" + // 0x004D8 0x00308: 0x004DA + "\x00\x13d\x00a\x00\x04\xdb" + // 0x004D9 0x00308: 0x004DB + "\x00\x10X\x00a\x00\x04\xdc" + // 0x00416 0x00308: 0x004DC + "\x00\x10\xd8\x00a\x00\x04\xdd" + // 0x00436 0x00308: 0x004DD + "\x00\x10\\\x00a\x00\x04\xde" + // 0x00417 0x00308: 0x004DE + "\x00\x10\xdc\x00a\x00\x04\xdf" + // 0x00437 0x00308: 0x004DF + "\x00\x10`\x00`\x80\x04\xe2" + // 0x00418 0x00304: 0x004E2 + "\x00\x10\xe0\x00`\x80\x04\xe3" + // 0x00438 0x00304: 0x004E3 + "\x00\x10`\x00a\x00\x04\xe4" + // 0x00418 0x00308: 0x004E4 + "\x00\x10\xe0\x00a\x00\x04\xe5" + // 0x00438 0x00308: 0x004E5 + "\x00\x10x\x00a\x00\x04\xe6" + // 0x0041E 0x00308: 0x004E6 + "\x00\x10\xf8\x00a\x00\x04\xe7" + // 0x0043E 0x00308: 0x004E7 + "\x00\x13\xa0\x00a\x00\x04\xea" + // 0x004E8 0x00308: 0x004EA + "\x00\x13\xa4\x00a\x00\x04\xeb" + // 0x004E9 0x00308: 0x004EB + "\x00\x10\xb4\x00a\x00\x04\xec" + // 0x0042D 0x00308: 0x004EC + "\x00\x114\x00a\x00\x04\xed" + // 0x0044D 0x00308: 0x004ED + "\x00\x10\x8c\x00`\x80\x04\xee" + // 0x00423 0x00304: 0x004EE + "\x00\x11\f\x00`\x80\x04\xef" + // 0x00443 0x00304: 0x004EF + "\x00\x10\x8c\x00a\x00\x04\xf0" + // 0x00423 0x00308: 0x004F0 + "\x00\x11\f\x00a\x00\x04\xf1" + // 0x00443 0x00308: 0x004F1 + "\x00\x10\x8c\x00a`\x04\xf2" + // 0x00423 0x0030B: 0x004F2 + "\x00\x11\f\x00a`\x04\xf3" + // 0x00443 0x0030B: 0x004F3 + "\x00\x10\x9c\x00a\x00\x04\xf4" + // 0x00427 0x00308: 0x004F4 + "\x00\x11\x1c\x00a\x00\x04\xf5" + // 0x00447 0x00308: 0x004F5 + "\x00\x10\xac\x00a\x00\x04\xf8" + // 0x0042B 0x00308: 0x004F8 + "\x00\x11,\x00a\x00\x04\xf9" + // 0x0044B 0x00308: 0x004F9 + "\x00\x18\x9c\x00\xca`\x06\"" + // 0x00627 0x00653: 0x00622 + "\x00\x18\x9c\x00ʀ\x06#" + // 0x00627 0x00654: 0x00623 + "\x00\x19 \x00ʀ\x06$" + // 0x00648 0x00654: 0x00624 + "\x00\x18\x9c\x00ʠ\x06%" + // 0x00627 0x00655: 0x00625 + "\x00\x19(\x00ʀ\x06&" + // 0x0064A 0x00654: 0x00626 + "\x00\x1bT\x00ʀ\x06\xc0" + // 0x006D5 0x00654: 0x006C0 + "\x00\x1b\x04\x00ʀ\x06\xc2" + // 0x006C1 0x00654: 0x006C2 + "\x00\x1bH\x00ʀ\x06\xd3" + // 0x006D2 0x00654: 0x006D3 + "\x00$\xa0\x01'\x80\t)" + // 0x00928 0x0093C: 0x00929 + "\x00$\xc0\x01'\x80\t1" + // 0x00930 0x0093C: 0x00931 + "\x00$\xcc\x01'\x80\t4" + // 0x00933 0x0093C: 0x00934 + "\x00'\x1c\x017\xc0\t\xcb" + // 0x009C7 0x009BE: 0x009CB + "\x00'\x1c\x01:\xe0\t\xcc" + // 0x009C7 0x009D7: 0x009CC + "\x00-\x1c\x01j\xc0\vH" + // 0x00B47 0x00B56: 0x00B48 + "\x00-\x1c\x01g\xc0\vK" + // 0x00B47 0x00B3E: 0x00B4B + "\x00-\x1c\x01j\xe0\vL" + // 0x00B47 0x00B57: 0x00B4C + "\x00.H\x01z\xe0\v\x94" + // 0x00B92 0x00BD7: 0x00B94 + "\x00/\x18\x01w\xc0\v\xca" + // 0x00BC6 0x00BBE: 0x00BCA + "\x00/\x1c\x01w\xc0\v\xcb" + // 0x00BC7 0x00BBE: 0x00BCB + "\x00/\x18\x01z\xe0\v\xcc" + // 0x00BC6 0x00BD7: 0x00BCC + "\x001\x18\x01\x8a\xc0\fH" + // 0x00C46 0x00C56: 0x00C48 + "\x002\xfc\x01\x9a\xa0\f\xc0" + // 0x00CBF 0x00CD5: 0x00CC0 + "\x003\x18\x01\x9a\xa0\f\xc7" + // 0x00CC6 0x00CD5: 0x00CC7 + "\x003\x18\x01\x9a\xc0\f\xc8" + // 0x00CC6 0x00CD6: 0x00CC8 + "\x003\x18\x01\x98@\f\xca" + // 0x00CC6 0x00CC2: 0x00CCA + "\x003(\x01\x9a\xa0\f\xcb" + // 0x00CCA 0x00CD5: 0x00CCB + "\x005\x18\x01\xa7\xc0\rJ" + // 0x00D46 0x00D3E: 0x00D4A + "\x005\x1c\x01\xa7\xc0\rK" + // 0x00D47 0x00D3E: 0x00D4B + "\x005\x18\x01\xaa\xe0\rL" + // 0x00D46 0x00D57: 0x00D4C + "\x007d\x01\xb9@\r\xda" + // 0x00DD9 0x00DCA: 0x00DDA + "\x007d\x01\xb9\xe0\r\xdc" + // 0x00DD9 0x00DCF: 0x00DDC + "\x007p\x01\xb9@\r\xdd" + // 0x00DDC 0x00DCA: 0x00DDD + "\x007d\x01\xbb\xe0\r\xde" + // 0x00DD9 0x00DDF: 0x00DDE + "\x00@\x94\x02\x05\xc0\x10&" + // 0x01025 0x0102E: 0x01026 + "\x00l\x14\x03f\xa0\x1b\x06" + // 0x01B05 0x01B35: 0x01B06 + "\x00l\x1c\x03f\xa0\x1b\b" + // 0x01B07 0x01B35: 0x01B08 + "\x00l$\x03f\xa0\x1b\n" + // 0x01B09 0x01B35: 0x01B0A + "\x00l,\x03f\xa0\x1b\f" + // 0x01B0B 0x01B35: 0x01B0C + "\x00l4\x03f\xa0\x1b\x0e" + // 0x01B0D 0x01B35: 0x01B0E + "\x00lD\x03f\xa0\x1b\x12" + // 0x01B11 0x01B35: 0x01B12 + "\x00l\xe8\x03f\xa0\x1b;" + // 0x01B3A 0x01B35: 0x01B3B + "\x00l\xf0\x03f\xa0\x1b=" + // 0x01B3C 0x01B35: 0x01B3D + "\x00l\xf8\x03f\xa0\x1b@" + // 0x01B3E 0x01B35: 0x01B40 + "\x00l\xfc\x03f\xa0\x1bA" + // 0x01B3F 0x01B35: 0x01B41 + "\x00m\b\x03f\xa0\x1bC" + // 0x01B42 0x01B35: 0x01B43 + "\x00\x01\x04\x00d\xa0\x1e\x00" + // 0x00041 0x00325: 0x01E00 + "\x00\x01\x84\x00d\xa0\x1e\x01" + // 0x00061 0x00325: 0x01E01 + "\x00\x01\b\x00`\xe0\x1e\x02" + // 0x00042 0x00307: 0x01E02 + "\x00\x01\x88\x00`\xe0\x1e\x03" + // 0x00062 0x00307: 0x01E03 + "\x00\x01\b\x00d`\x1e\x04" + // 0x00042 0x00323: 0x01E04 + "\x00\x01\x88\x00d`\x1e\x05" + // 0x00062 0x00323: 0x01E05 + "\x00\x01\b\x00f \x1e\x06" + // 0x00042 0x00331: 0x01E06 + "\x00\x01\x88\x00f \x1e\a" + // 0x00062 0x00331: 0x01E07 + "\x00\x03\x1c\x00` \x1e\b" + // 0x000C7 0x00301: 0x01E08 + "\x00\x03\x9c\x00` \x1e\t" + // 0x000E7 0x00301: 0x01E09 + "\x00\x01\x10\x00`\xe0\x1e\n" + // 0x00044 0x00307: 0x01E0A + "\x00\x01\x90\x00`\xe0\x1e\v" + // 0x00064 0x00307: 0x01E0B + "\x00\x01\x10\x00d`\x1e\f" + // 0x00044 0x00323: 0x01E0C + "\x00\x01\x90\x00d`\x1e\r" + // 0x00064 0x00323: 0x01E0D + "\x00\x01\x10\x00f \x1e\x0e" + // 0x00044 0x00331: 0x01E0E + "\x00\x01\x90\x00f \x1e\x0f" + // 0x00064 0x00331: 0x01E0F + "\x00\x01\x10\x00d\xe0\x1e\x10" + // 0x00044 0x00327: 0x01E10 + "\x00\x01\x90\x00d\xe0\x1e\x11" + // 0x00064 0x00327: 0x01E11 + "\x00\x01\x10\x00e\xa0\x1e\x12" + // 0x00044 0x0032D: 0x01E12 + "\x00\x01\x90\x00e\xa0\x1e\x13" + // 0x00064 0x0032D: 0x01E13 + "\x00\x04H\x00`\x00\x1e\x14" + // 0x00112 0x00300: 0x01E14 + "\x00\x04L\x00`\x00\x1e\x15" + // 0x00113 0x00300: 0x01E15 + "\x00\x04H\x00` \x1e\x16" + // 0x00112 0x00301: 0x01E16 + "\x00\x04L\x00` \x1e\x17" + // 0x00113 0x00301: 0x01E17 + "\x00\x01\x14\x00e\xa0\x1e\x18" + // 0x00045 0x0032D: 0x01E18 + "\x00\x01\x94\x00e\xa0\x1e\x19" + // 0x00065 0x0032D: 0x01E19 + "\x00\x01\x14\x00f\x00\x1e\x1a" + // 0x00045 0x00330: 0x01E1A + "\x00\x01\x94\x00f\x00\x1e\x1b" + // 0x00065 0x00330: 0x01E1B + "\x00\b\xa0\x00`\xc0\x1e\x1c" + // 0x00228 0x00306: 0x01E1C + "\x00\b\xa4\x00`\xc0\x1e\x1d" + // 0x00229 0x00306: 0x01E1D + "\x00\x01\x18\x00`\xe0\x1e\x1e" + // 0x00046 0x00307: 0x01E1E + "\x00\x01\x98\x00`\xe0\x1e\x1f" + // 0x00066 0x00307: 0x01E1F + "\x00\x01\x1c\x00`\x80\x1e " + // 0x00047 0x00304: 0x01E20 + "\x00\x01\x9c\x00`\x80\x1e!" + // 0x00067 0x00304: 0x01E21 + "\x00\x01 \x00`\xe0\x1e\"" + // 0x00048 0x00307: 0x01E22 + "\x00\x01\xa0\x00`\xe0\x1e#" + // 0x00068 0x00307: 0x01E23 + "\x00\x01 \x00d`\x1e$" + // 0x00048 0x00323: 0x01E24 + "\x00\x01\xa0\x00d`\x1e%" + // 0x00068 0x00323: 0x01E25 + "\x00\x01 \x00a\x00\x1e&" + // 0x00048 0x00308: 0x01E26 + "\x00\x01\xa0\x00a\x00\x1e'" + // 0x00068 0x00308: 0x01E27 + "\x00\x01 \x00d\xe0\x1e(" + // 0x00048 0x00327: 0x01E28 + "\x00\x01\xa0\x00d\xe0\x1e)" + // 0x00068 0x00327: 0x01E29 + "\x00\x01 \x00e\xc0\x1e*" + // 0x00048 0x0032E: 0x01E2A + "\x00\x01\xa0\x00e\xc0\x1e+" + // 0x00068 0x0032E: 0x01E2B + "\x00\x01$\x00f\x00\x1e," + // 0x00049 0x00330: 0x01E2C + "\x00\x01\xa4\x00f\x00\x1e-" + // 0x00069 0x00330: 0x01E2D + "\x00\x03<\x00` \x1e." + // 0x000CF 0x00301: 0x01E2E + "\x00\x03\xbc\x00` \x1e/" + // 0x000EF 0x00301: 0x01E2F + "\x00\x01,\x00` \x1e0" + // 0x0004B 0x00301: 0x01E30 + "\x00\x01\xac\x00` \x1e1" + // 0x0006B 0x00301: 0x01E31 + "\x00\x01,\x00d`\x1e2" + // 0x0004B 0x00323: 0x01E32 + "\x00\x01\xac\x00d`\x1e3" + // 0x0006B 0x00323: 0x01E33 + "\x00\x01,\x00f \x1e4" + // 0x0004B 0x00331: 0x01E34 + "\x00\x01\xac\x00f \x1e5" + // 0x0006B 0x00331: 0x01E35 + "\x00\x010\x00d`\x1e6" + // 0x0004C 0x00323: 0x01E36 + "\x00\x01\xb0\x00d`\x1e7" + // 0x0006C 0x00323: 0x01E37 + "\x00x\xd8\x00`\x80\x1e8" + // 0x01E36 0x00304: 0x01E38 + "\x00x\xdc\x00`\x80\x1e9" + // 0x01E37 0x00304: 0x01E39 + "\x00\x010\x00f \x1e:" + // 0x0004C 0x00331: 0x01E3A + "\x00\x01\xb0\x00f \x1e;" + // 0x0006C 0x00331: 0x01E3B + "\x00\x010\x00e\xa0\x1e<" + // 0x0004C 0x0032D: 0x01E3C + "\x00\x01\xb0\x00e\xa0\x1e=" + // 0x0006C 0x0032D: 0x01E3D + "\x00\x014\x00` \x1e>" + // 0x0004D 0x00301: 0x01E3E + "\x00\x01\xb4\x00` \x1e?" + // 0x0006D 0x00301: 0x01E3F + "\x00\x014\x00`\xe0\x1e@" + // 0x0004D 0x00307: 0x01E40 + "\x00\x01\xb4\x00`\xe0\x1eA" + // 0x0006D 0x00307: 0x01E41 + "\x00\x014\x00d`\x1eB" + // 0x0004D 0x00323: 0x01E42 + "\x00\x01\xb4\x00d`\x1eC" + // 0x0006D 0x00323: 0x01E43 + "\x00\x018\x00`\xe0\x1eD" + // 0x0004E 0x00307: 0x01E44 + "\x00\x01\xb8\x00`\xe0\x1eE" + // 0x0006E 0x00307: 0x01E45 + "\x00\x018\x00d`\x1eF" + // 0x0004E 0x00323: 0x01E46 + "\x00\x01\xb8\x00d`\x1eG" + // 0x0006E 0x00323: 0x01E47 + "\x00\x018\x00f \x1eH" + // 0x0004E 0x00331: 0x01E48 + "\x00\x01\xb8\x00f \x1eI" + // 0x0006E 0x00331: 0x01E49 + "\x00\x018\x00e\xa0\x1eJ" + // 0x0004E 0x0032D: 0x01E4A + "\x00\x01\xb8\x00e\xa0\x1eK" + // 0x0006E 0x0032D: 0x01E4B + "\x00\x03T\x00` \x1eL" + // 0x000D5 0x00301: 0x01E4C + "\x00\x03\xd4\x00` \x1eM" + // 0x000F5 0x00301: 0x01E4D + "\x00\x03T\x00a\x00\x1eN" + // 0x000D5 0x00308: 0x01E4E + "\x00\x03\xd4\x00a\x00\x1eO" + // 0x000F5 0x00308: 0x01E4F + "\x00\x050\x00`\x00\x1eP" + // 0x0014C 0x00300: 0x01E50 + "\x00\x054\x00`\x00\x1eQ" + // 0x0014D 0x00300: 0x01E51 + "\x00\x050\x00` \x1eR" + // 0x0014C 0x00301: 0x01E52 + "\x00\x054\x00` \x1eS" + // 0x0014D 0x00301: 0x01E53 + "\x00\x01@\x00` \x1eT" + // 0x00050 0x00301: 0x01E54 + "\x00\x01\xc0\x00` \x1eU" + // 0x00070 0x00301: 0x01E55 + "\x00\x01@\x00`\xe0\x1eV" + // 0x00050 0x00307: 0x01E56 + "\x00\x01\xc0\x00`\xe0\x1eW" + // 0x00070 0x00307: 0x01E57 + "\x00\x01H\x00`\xe0\x1eX" + // 0x00052 0x00307: 0x01E58 + "\x00\x01\xc8\x00`\xe0\x1eY" + // 0x00072 0x00307: 0x01E59 + "\x00\x01H\x00d`\x1eZ" + // 0x00052 0x00323: 0x01E5A + "\x00\x01\xc8\x00d`\x1e[" + // 0x00072 0x00323: 0x01E5B + "\x00yh\x00`\x80\x1e\\" + // 0x01E5A 0x00304: 0x01E5C + "\x00yl\x00`\x80\x1e]" + // 0x01E5B 0x00304: 0x01E5D + "\x00\x01H\x00f \x1e^" + // 0x00052 0x00331: 0x01E5E + "\x00\x01\xc8\x00f \x1e_" + // 0x00072 0x00331: 0x01E5F + "\x00\x01L\x00`\xe0\x1e`" + // 0x00053 0x00307: 0x01E60 + "\x00\x01\xcc\x00`\xe0\x1ea" + // 0x00073 0x00307: 0x01E61 + "\x00\x01L\x00d`\x1eb" + // 0x00053 0x00323: 0x01E62 + "\x00\x01\xcc\x00d`\x1ec" + // 0x00073 0x00323: 0x01E63 + "\x00\x05h\x00`\xe0\x1ed" + // 0x0015A 0x00307: 0x01E64 + "\x00\x05l\x00`\xe0\x1ee" + // 0x0015B 0x00307: 0x01E65 + "\x00\x05\x80\x00`\xe0\x1ef" + // 0x00160 0x00307: 0x01E66 + "\x00\x05\x84\x00`\xe0\x1eg" + // 0x00161 0x00307: 0x01E67 + "\x00y\x88\x00`\xe0\x1eh" + // 0x01E62 0x00307: 0x01E68 + "\x00y\x8c\x00`\xe0\x1ei" + // 0x01E63 0x00307: 0x01E69 + "\x00\x01P\x00`\xe0\x1ej" + // 0x00054 0x00307: 0x01E6A + "\x00\x01\xd0\x00`\xe0\x1ek" + // 0x00074 0x00307: 0x01E6B + "\x00\x01P\x00d`\x1el" + // 0x00054 0x00323: 0x01E6C + "\x00\x01\xd0\x00d`\x1em" + // 0x00074 0x00323: 0x01E6D + "\x00\x01P\x00f \x1en" + // 0x00054 0x00331: 0x01E6E + "\x00\x01\xd0\x00f \x1eo" + // 0x00074 0x00331: 0x01E6F + "\x00\x01P\x00e\xa0\x1ep" + // 0x00054 0x0032D: 0x01E70 + "\x00\x01\xd0\x00e\xa0\x1eq" + // 0x00074 0x0032D: 0x01E71 + "\x00\x01T\x00d\x80\x1er" + // 0x00055 0x00324: 0x01E72 + "\x00\x01\xd4\x00d\x80\x1es" + // 0x00075 0x00324: 0x01E73 + "\x00\x01T\x00f\x00\x1et" + // 0x00055 0x00330: 0x01E74 + "\x00\x01\xd4\x00f\x00\x1eu" + // 0x00075 0x00330: 0x01E75 + "\x00\x01T\x00e\xa0\x1ev" + // 0x00055 0x0032D: 0x01E76 + "\x00\x01\xd4\x00e\xa0\x1ew" + // 0x00075 0x0032D: 0x01E77 + "\x00\x05\xa0\x00` \x1ex" + // 0x00168 0x00301: 0x01E78 + "\x00\x05\xa4\x00` \x1ey" + // 0x00169 0x00301: 0x01E79 + "\x00\x05\xa8\x00a\x00\x1ez" + // 0x0016A 0x00308: 0x01E7A + "\x00\x05\xac\x00a\x00\x1e{" + // 0x0016B 0x00308: 0x01E7B + "\x00\x01X\x00``\x1e|" + // 0x00056 0x00303: 0x01E7C + "\x00\x01\xd8\x00``\x1e}" + // 0x00076 0x00303: 0x01E7D + "\x00\x01X\x00d`\x1e~" + // 0x00056 0x00323: 0x01E7E + "\x00\x01\xd8\x00d`\x1e\x7f" + // 0x00076 0x00323: 0x01E7F + "\x00\x01\\\x00`\x00\x1e\x80" + // 0x00057 0x00300: 0x01E80 + "\x00\x01\xdc\x00`\x00\x1e\x81" + // 0x00077 0x00300: 0x01E81 + "\x00\x01\\\x00` \x1e\x82" + // 0x00057 0x00301: 0x01E82 + "\x00\x01\xdc\x00` \x1e\x83" + // 0x00077 0x00301: 0x01E83 + "\x00\x01\\\x00a\x00\x1e\x84" + // 0x00057 0x00308: 0x01E84 + "\x00\x01\xdc\x00a\x00\x1e\x85" + // 0x00077 0x00308: 0x01E85 + "\x00\x01\\\x00`\xe0\x1e\x86" + // 0x00057 0x00307: 0x01E86 + "\x00\x01\xdc\x00`\xe0\x1e\x87" + // 0x00077 0x00307: 0x01E87 + "\x00\x01\\\x00d`\x1e\x88" + // 0x00057 0x00323: 0x01E88 + "\x00\x01\xdc\x00d`\x1e\x89" + // 0x00077 0x00323: 0x01E89 + "\x00\x01`\x00`\xe0\x1e\x8a" + // 0x00058 0x00307: 0x01E8A + "\x00\x01\xe0\x00`\xe0\x1e\x8b" + // 0x00078 0x00307: 0x01E8B + "\x00\x01`\x00a\x00\x1e\x8c" + // 0x00058 0x00308: 0x01E8C + "\x00\x01\xe0\x00a\x00\x1e\x8d" + // 0x00078 0x00308: 0x01E8D + "\x00\x01d\x00`\xe0\x1e\x8e" + // 0x00059 0x00307: 0x01E8E + "\x00\x01\xe4\x00`\xe0\x1e\x8f" + // 0x00079 0x00307: 0x01E8F + "\x00\x01h\x00`@\x1e\x90" + // 0x0005A 0x00302: 0x01E90 + "\x00\x01\xe8\x00`@\x1e\x91" + // 0x0007A 0x00302: 0x01E91 + "\x00\x01h\x00d`\x1e\x92" + // 0x0005A 0x00323: 0x01E92 + "\x00\x01\xe8\x00d`\x1e\x93" + // 0x0007A 0x00323: 0x01E93 + "\x00\x01h\x00f \x1e\x94" + // 0x0005A 0x00331: 0x01E94 + "\x00\x01\xe8\x00f \x1e\x95" + // 0x0007A 0x00331: 0x01E95 + "\x00\x01\xa0\x00f \x1e\x96" + // 0x00068 0x00331: 0x01E96 + "\x00\x01\xd0\x00a\x00\x1e\x97" + // 0x00074 0x00308: 0x01E97 + "\x00\x01\xdc\x00a@\x1e\x98" + // 0x00077 0x0030A: 0x01E98 + "\x00\x01\xe4\x00a@\x1e\x99" + // 0x00079 0x0030A: 0x01E99 + "\x00\x05\xfc\x00`\xe0\x1e\x9b" + // 0x0017F 0x00307: 0x01E9B + "\x00\x01\x04\x00d`\x1e\xa0" + // 0x00041 0x00323: 0x01EA0 + "\x00\x01\x84\x00d`\x1e\xa1" + // 0x00061 0x00323: 0x01EA1 + "\x00\x01\x04\x00a \x1e\xa2" + // 0x00041 0x00309: 0x01EA2 + "\x00\x01\x84\x00a \x1e\xa3" + // 0x00061 0x00309: 0x01EA3 + "\x00\x03\b\x00` \x1e\xa4" + // 0x000C2 0x00301: 0x01EA4 + "\x00\x03\x88\x00` \x1e\xa5" + // 0x000E2 0x00301: 0x01EA5 + "\x00\x03\b\x00`\x00\x1e\xa6" + // 0x000C2 0x00300: 0x01EA6 + "\x00\x03\x88\x00`\x00\x1e\xa7" + // 0x000E2 0x00300: 0x01EA7 + "\x00\x03\b\x00a \x1e\xa8" + // 0x000C2 0x00309: 0x01EA8 + "\x00\x03\x88\x00a \x1e\xa9" + // 0x000E2 0x00309: 0x01EA9 + "\x00\x03\b\x00``\x1e\xaa" + // 0x000C2 0x00303: 0x01EAA + "\x00\x03\x88\x00``\x1e\xab" + // 0x000E2 0x00303: 0x01EAB + "\x00z\x80\x00`@\x1e\xac" + // 0x01EA0 0x00302: 0x01EAC + "\x00z\x84\x00`@\x1e\xad" + // 0x01EA1 0x00302: 0x01EAD + "\x00\x04\b\x00` \x1e\xae" + // 0x00102 0x00301: 0x01EAE + "\x00\x04\f\x00` \x1e\xaf" + // 0x00103 0x00301: 0x01EAF + "\x00\x04\b\x00`\x00\x1e\xb0" + // 0x00102 0x00300: 0x01EB0 + "\x00\x04\f\x00`\x00\x1e\xb1" + // 0x00103 0x00300: 0x01EB1 + "\x00\x04\b\x00a \x1e\xb2" + // 0x00102 0x00309: 0x01EB2 + "\x00\x04\f\x00a \x1e\xb3" + // 0x00103 0x00309: 0x01EB3 + "\x00\x04\b\x00``\x1e\xb4" + // 0x00102 0x00303: 0x01EB4 + "\x00\x04\f\x00``\x1e\xb5" + // 0x00103 0x00303: 0x01EB5 + "\x00z\x80\x00`\xc0\x1e\xb6" + // 0x01EA0 0x00306: 0x01EB6 + "\x00z\x84\x00`\xc0\x1e\xb7" + // 0x01EA1 0x00306: 0x01EB7 + "\x00\x01\x14\x00d`\x1e\xb8" + // 0x00045 0x00323: 0x01EB8 + "\x00\x01\x94\x00d`\x1e\xb9" + // 0x00065 0x00323: 0x01EB9 + "\x00\x01\x14\x00a \x1e\xba" + // 0x00045 0x00309: 0x01EBA + "\x00\x01\x94\x00a \x1e\xbb" + // 0x00065 0x00309: 0x01EBB + "\x00\x01\x14\x00``\x1e\xbc" + // 0x00045 0x00303: 0x01EBC + "\x00\x01\x94\x00``\x1e\xbd" + // 0x00065 0x00303: 0x01EBD + "\x00\x03(\x00` \x1e\xbe" + // 0x000CA 0x00301: 0x01EBE + "\x00\x03\xa8\x00` \x1e\xbf" + // 0x000EA 0x00301: 0x01EBF + "\x00\x03(\x00`\x00\x1e\xc0" + // 0x000CA 0x00300: 0x01EC0 + "\x00\x03\xa8\x00`\x00\x1e\xc1" + // 0x000EA 0x00300: 0x01EC1 + "\x00\x03(\x00a \x1e\xc2" + // 0x000CA 0x00309: 0x01EC2 + "\x00\x03\xa8\x00a \x1e\xc3" + // 0x000EA 0x00309: 0x01EC3 + "\x00\x03(\x00``\x1e\xc4" + // 0x000CA 0x00303: 0x01EC4 + "\x00\x03\xa8\x00``\x1e\xc5" + // 0x000EA 0x00303: 0x01EC5 + "\x00z\xe0\x00`@\x1e\xc6" + // 0x01EB8 0x00302: 0x01EC6 + "\x00z\xe4\x00`@\x1e\xc7" + // 0x01EB9 0x00302: 0x01EC7 + "\x00\x01$\x00a \x1e\xc8" + // 0x00049 0x00309: 0x01EC8 + "\x00\x01\xa4\x00a \x1e\xc9" + // 0x00069 0x00309: 0x01EC9 + "\x00\x01$\x00d`\x1e\xca" + // 0x00049 0x00323: 0x01ECA + "\x00\x01\xa4\x00d`\x1e\xcb" + // 0x00069 0x00323: 0x01ECB + "\x00\x01<\x00d`\x1e\xcc" + // 0x0004F 0x00323: 0x01ECC + "\x00\x01\xbc\x00d`\x1e\xcd" + // 0x0006F 0x00323: 0x01ECD + "\x00\x01<\x00a \x1e\xce" + // 0x0004F 0x00309: 0x01ECE + "\x00\x01\xbc\x00a \x1e\xcf" + // 0x0006F 0x00309: 0x01ECF + "\x00\x03P\x00` \x1e\xd0" + // 0x000D4 0x00301: 0x01ED0 + "\x00\x03\xd0\x00` \x1e\xd1" + // 0x000F4 0x00301: 0x01ED1 + "\x00\x03P\x00`\x00\x1e\xd2" + // 0x000D4 0x00300: 0x01ED2 + "\x00\x03\xd0\x00`\x00\x1e\xd3" + // 0x000F4 0x00300: 0x01ED3 + "\x00\x03P\x00a \x1e\xd4" + // 0x000D4 0x00309: 0x01ED4 + "\x00\x03\xd0\x00a \x1e\xd5" + // 0x000F4 0x00309: 0x01ED5 + "\x00\x03P\x00``\x1e\xd6" + // 0x000D4 0x00303: 0x01ED6 + "\x00\x03\xd0\x00``\x1e\xd7" + // 0x000F4 0x00303: 0x01ED7 + "\x00{0\x00`@\x1e\xd8" + // 0x01ECC 0x00302: 0x01ED8 + "\x00{4\x00`@\x1e\xd9" + // 0x01ECD 0x00302: 0x01ED9 + "\x00\x06\x80\x00` \x1e\xda" + // 0x001A0 0x00301: 0x01EDA + "\x00\x06\x84\x00` \x1e\xdb" + // 0x001A1 0x00301: 0x01EDB + "\x00\x06\x80\x00`\x00\x1e\xdc" + // 0x001A0 0x00300: 0x01EDC + "\x00\x06\x84\x00`\x00\x1e\xdd" + // 0x001A1 0x00300: 0x01EDD + "\x00\x06\x80\x00a \x1e\xde" + // 0x001A0 0x00309: 0x01EDE + "\x00\x06\x84\x00a \x1e\xdf" + // 0x001A1 0x00309: 0x01EDF + "\x00\x06\x80\x00``\x1e\xe0" + // 0x001A0 0x00303: 0x01EE0 + "\x00\x06\x84\x00``\x1e\xe1" + // 0x001A1 0x00303: 0x01EE1 + "\x00\x06\x80\x00d`\x1e\xe2" + // 0x001A0 0x00323: 0x01EE2 + "\x00\x06\x84\x00d`\x1e\xe3" + // 0x001A1 0x00323: 0x01EE3 + "\x00\x01T\x00d`\x1e\xe4" + // 0x00055 0x00323: 0x01EE4 + "\x00\x01\xd4\x00d`\x1e\xe5" + // 0x00075 0x00323: 0x01EE5 + "\x00\x01T\x00a \x1e\xe6" + // 0x00055 0x00309: 0x01EE6 + "\x00\x01\xd4\x00a \x1e\xe7" + // 0x00075 0x00309: 0x01EE7 + "\x00\x06\xbc\x00` \x1e\xe8" + // 0x001AF 0x00301: 0x01EE8 + "\x00\x06\xc0\x00` \x1e\xe9" + // 0x001B0 0x00301: 0x01EE9 + "\x00\x06\xbc\x00`\x00\x1e\xea" + // 0x001AF 0x00300: 0x01EEA + "\x00\x06\xc0\x00`\x00\x1e\xeb" + // 0x001B0 0x00300: 0x01EEB + "\x00\x06\xbc\x00a \x1e\xec" + // 0x001AF 0x00309: 0x01EEC + "\x00\x06\xc0\x00a \x1e\xed" + // 0x001B0 0x00309: 0x01EED + "\x00\x06\xbc\x00``\x1e\xee" + // 0x001AF 0x00303: 0x01EEE + "\x00\x06\xc0\x00``\x1e\xef" + // 0x001B0 0x00303: 0x01EEF + "\x00\x06\xbc\x00d`\x1e\xf0" + // 0x001AF 0x00323: 0x01EF0 + "\x00\x06\xc0\x00d`\x1e\xf1" + // 0x001B0 0x00323: 0x01EF1 + "\x00\x01d\x00`\x00\x1e\xf2" + // 0x00059 0x00300: 0x01EF2 + "\x00\x01\xe4\x00`\x00\x1e\xf3" + // 0x00079 0x00300: 0x01EF3 + "\x00\x01d\x00d`\x1e\xf4" + // 0x00059 0x00323: 0x01EF4 + "\x00\x01\xe4\x00d`\x1e\xf5" + // 0x00079 0x00323: 0x01EF5 + "\x00\x01d\x00a \x1e\xf6" + // 0x00059 0x00309: 0x01EF6 + "\x00\x01\xe4\x00a \x1e\xf7" + // 0x00079 0x00309: 0x01EF7 + "\x00\x01d\x00``\x1e\xf8" + // 0x00059 0x00303: 0x01EF8 + "\x00\x01\xe4\x00``\x1e\xf9" + // 0x00079 0x00303: 0x01EF9 + "\x00\x0e\xc4\x00b`\x1f\x00" + // 0x003B1 0x00313: 0x01F00 + "\x00\x0e\xc4\x00b\x80\x1f\x01" + // 0x003B1 0x00314: 0x01F01 + "\x00|\x00\x00`\x00\x1f\x02" + // 0x01F00 0x00300: 0x01F02 + "\x00|\x04\x00`\x00\x1f\x03" + // 0x01F01 0x00300: 0x01F03 + "\x00|\x00\x00` \x1f\x04" + // 0x01F00 0x00301: 0x01F04 + "\x00|\x04\x00` \x1f\x05" + // 0x01F01 0x00301: 0x01F05 + "\x00|\x00\x00h@\x1f\x06" + // 0x01F00 0x00342: 0x01F06 + "\x00|\x04\x00h@\x1f\a" + // 0x01F01 0x00342: 0x01F07 + "\x00\x0eD\x00b`\x1f\b" + // 0x00391 0x00313: 0x01F08 + "\x00\x0eD\x00b\x80\x1f\t" + // 0x00391 0x00314: 0x01F09 + "\x00| \x00`\x00\x1f\n" + // 0x01F08 0x00300: 0x01F0A + "\x00|$\x00`\x00\x1f\v" + // 0x01F09 0x00300: 0x01F0B + "\x00| \x00` \x1f\f" + // 0x01F08 0x00301: 0x01F0C + "\x00|$\x00` \x1f\r" + // 0x01F09 0x00301: 0x01F0D + "\x00| \x00h@\x1f\x0e" + // 0x01F08 0x00342: 0x01F0E + "\x00|$\x00h@\x1f\x0f" + // 0x01F09 0x00342: 0x01F0F + "\x00\x0e\xd4\x00b`\x1f\x10" + // 0x003B5 0x00313: 0x01F10 + "\x00\x0e\xd4\x00b\x80\x1f\x11" + // 0x003B5 0x00314: 0x01F11 + "\x00|@\x00`\x00\x1f\x12" + // 0x01F10 0x00300: 0x01F12 + "\x00|D\x00`\x00\x1f\x13" + // 0x01F11 0x00300: 0x01F13 + "\x00|@\x00` \x1f\x14" + // 0x01F10 0x00301: 0x01F14 + "\x00|D\x00` \x1f\x15" + // 0x01F11 0x00301: 0x01F15 + "\x00\x0eT\x00b`\x1f\x18" + // 0x00395 0x00313: 0x01F18 + "\x00\x0eT\x00b\x80\x1f\x19" + // 0x00395 0x00314: 0x01F19 + "\x00|`\x00`\x00\x1f\x1a" + // 0x01F18 0x00300: 0x01F1A + "\x00|d\x00`\x00\x1f\x1b" + // 0x01F19 0x00300: 0x01F1B + "\x00|`\x00` \x1f\x1c" + // 0x01F18 0x00301: 0x01F1C + "\x00|d\x00` \x1f\x1d" + // 0x01F19 0x00301: 0x01F1D + "\x00\x0e\xdc\x00b`\x1f " + // 0x003B7 0x00313: 0x01F20 + "\x00\x0e\xdc\x00b\x80\x1f!" + // 0x003B7 0x00314: 0x01F21 + "\x00|\x80\x00`\x00\x1f\"" + // 0x01F20 0x00300: 0x01F22 + "\x00|\x84\x00`\x00\x1f#" + // 0x01F21 0x00300: 0x01F23 + "\x00|\x80\x00` \x1f$" + // 0x01F20 0x00301: 0x01F24 + "\x00|\x84\x00` \x1f%" + // 0x01F21 0x00301: 0x01F25 + "\x00|\x80\x00h@\x1f&" + // 0x01F20 0x00342: 0x01F26 + "\x00|\x84\x00h@\x1f'" + // 0x01F21 0x00342: 0x01F27 + "\x00\x0e\\\x00b`\x1f(" + // 0x00397 0x00313: 0x01F28 + "\x00\x0e\\\x00b\x80\x1f)" + // 0x00397 0x00314: 0x01F29 + "\x00|\xa0\x00`\x00\x1f*" + // 0x01F28 0x00300: 0x01F2A + "\x00|\xa4\x00`\x00\x1f+" + // 0x01F29 0x00300: 0x01F2B + "\x00|\xa0\x00` \x1f," + // 0x01F28 0x00301: 0x01F2C + "\x00|\xa4\x00` \x1f-" + // 0x01F29 0x00301: 0x01F2D + "\x00|\xa0\x00h@\x1f." + // 0x01F28 0x00342: 0x01F2E + "\x00|\xa4\x00h@\x1f/" + // 0x01F29 0x00342: 0x01F2F + "\x00\x0e\xe4\x00b`\x1f0" + // 0x003B9 0x00313: 0x01F30 + "\x00\x0e\xe4\x00b\x80\x1f1" + // 0x003B9 0x00314: 0x01F31 + "\x00|\xc0\x00`\x00\x1f2" + // 0x01F30 0x00300: 0x01F32 + "\x00|\xc4\x00`\x00\x1f3" + // 0x01F31 0x00300: 0x01F33 + "\x00|\xc0\x00` \x1f4" + // 0x01F30 0x00301: 0x01F34 + "\x00|\xc4\x00` \x1f5" + // 0x01F31 0x00301: 0x01F35 + "\x00|\xc0\x00h@\x1f6" + // 0x01F30 0x00342: 0x01F36 + "\x00|\xc4\x00h@\x1f7" + // 0x01F31 0x00342: 0x01F37 + "\x00\x0ed\x00b`\x1f8" + // 0x00399 0x00313: 0x01F38 + "\x00\x0ed\x00b\x80\x1f9" + // 0x00399 0x00314: 0x01F39 + "\x00|\xe0\x00`\x00\x1f:" + // 0x01F38 0x00300: 0x01F3A + "\x00|\xe4\x00`\x00\x1f;" + // 0x01F39 0x00300: 0x01F3B + "\x00|\xe0\x00` \x1f<" + // 0x01F38 0x00301: 0x01F3C + "\x00|\xe4\x00` \x1f=" + // 0x01F39 0x00301: 0x01F3D + "\x00|\xe0\x00h@\x1f>" + // 0x01F38 0x00342: 0x01F3E + "\x00|\xe4\x00h@\x1f?" + // 0x01F39 0x00342: 0x01F3F + "\x00\x0e\xfc\x00b`\x1f@" + // 0x003BF 0x00313: 0x01F40 + "\x00\x0e\xfc\x00b\x80\x1fA" + // 0x003BF 0x00314: 0x01F41 + "\x00}\x00\x00`\x00\x1fB" + // 0x01F40 0x00300: 0x01F42 + "\x00}\x04\x00`\x00\x1fC" + // 0x01F41 0x00300: 0x01F43 + "\x00}\x00\x00` \x1fD" + // 0x01F40 0x00301: 0x01F44 + "\x00}\x04\x00` \x1fE" + // 0x01F41 0x00301: 0x01F45 + "\x00\x0e|\x00b`\x1fH" + // 0x0039F 0x00313: 0x01F48 + "\x00\x0e|\x00b\x80\x1fI" + // 0x0039F 0x00314: 0x01F49 + "\x00} \x00`\x00\x1fJ" + // 0x01F48 0x00300: 0x01F4A + "\x00}$\x00`\x00\x1fK" + // 0x01F49 0x00300: 0x01F4B + "\x00} \x00` \x1fL" + // 0x01F48 0x00301: 0x01F4C + "\x00}$\x00` \x1fM" + // 0x01F49 0x00301: 0x01F4D + "\x00\x0f\x14\x00b`\x1fP" + // 0x003C5 0x00313: 0x01F50 + "\x00\x0f\x14\x00b\x80\x1fQ" + // 0x003C5 0x00314: 0x01F51 + "\x00}@\x00`\x00\x1fR" + // 0x01F50 0x00300: 0x01F52 + "\x00}D\x00`\x00\x1fS" + // 0x01F51 0x00300: 0x01F53 + "\x00}@\x00` \x1fT" + // 0x01F50 0x00301: 0x01F54 + "\x00}D\x00` \x1fU" + // 0x01F51 0x00301: 0x01F55 + "\x00}@\x00h@\x1fV" + // 0x01F50 0x00342: 0x01F56 + "\x00}D\x00h@\x1fW" + // 0x01F51 0x00342: 0x01F57 + "\x00\x0e\x94\x00b\x80\x1fY" + // 0x003A5 0x00314: 0x01F59 + "\x00}d\x00`\x00\x1f[" + // 0x01F59 0x00300: 0x01F5B + "\x00}d\x00` \x1f]" + // 0x01F59 0x00301: 0x01F5D + "\x00}d\x00h@\x1f_" + // 0x01F59 0x00342: 0x01F5F + "\x00\x0f$\x00b`\x1f`" + // 0x003C9 0x00313: 0x01F60 + "\x00\x0f$\x00b\x80\x1fa" + // 0x003C9 0x00314: 0x01F61 + "\x00}\x80\x00`\x00\x1fb" + // 0x01F60 0x00300: 0x01F62 + "\x00}\x84\x00`\x00\x1fc" + // 0x01F61 0x00300: 0x01F63 + "\x00}\x80\x00` \x1fd" + // 0x01F60 0x00301: 0x01F64 + "\x00}\x84\x00` \x1fe" + // 0x01F61 0x00301: 0x01F65 + "\x00}\x80\x00h@\x1ff" + // 0x01F60 0x00342: 0x01F66 + "\x00}\x84\x00h@\x1fg" + // 0x01F61 0x00342: 0x01F67 + "\x00\x0e\xa4\x00b`\x1fh" + // 0x003A9 0x00313: 0x01F68 + "\x00\x0e\xa4\x00b\x80\x1fi" + // 0x003A9 0x00314: 0x01F69 + "\x00}\xa0\x00`\x00\x1fj" + // 0x01F68 0x00300: 0x01F6A + "\x00}\xa4\x00`\x00\x1fk" + // 0x01F69 0x00300: 0x01F6B + "\x00}\xa0\x00` \x1fl" + // 0x01F68 0x00301: 0x01F6C + "\x00}\xa4\x00` \x1fm" + // 0x01F69 0x00301: 0x01F6D + "\x00}\xa0\x00h@\x1fn" + // 0x01F68 0x00342: 0x01F6E + "\x00}\xa4\x00h@\x1fo" + // 0x01F69 0x00342: 0x01F6F + "\x00\x0e\xc4\x00`\x00\x1fp" + // 0x003B1 0x00300: 0x01F70 + "\x00\x0e\xd4\x00`\x00\x1fr" + // 0x003B5 0x00300: 0x01F72 + "\x00\x0e\xdc\x00`\x00\x1ft" + // 0x003B7 0x00300: 0x01F74 + "\x00\x0e\xe4\x00`\x00\x1fv" + // 0x003B9 0x00300: 0x01F76 + "\x00\x0e\xfc\x00`\x00\x1fx" + // 0x003BF 0x00300: 0x01F78 + "\x00\x0f\x14\x00`\x00\x1fz" + // 0x003C5 0x00300: 0x01F7A + "\x00\x0f$\x00`\x00\x1f|" + // 0x003C9 0x00300: 0x01F7C + "\x00|\x00\x00h\xa0\x1f\x80" + // 0x01F00 0x00345: 0x01F80 + "\x00|\x04\x00h\xa0\x1f\x81" + // 0x01F01 0x00345: 0x01F81 + "\x00|\b\x00h\xa0\x1f\x82" + // 0x01F02 0x00345: 0x01F82 + "\x00|\f\x00h\xa0\x1f\x83" + // 0x01F03 0x00345: 0x01F83 + "\x00|\x10\x00h\xa0\x1f\x84" + // 0x01F04 0x00345: 0x01F84 + "\x00|\x14\x00h\xa0\x1f\x85" + // 0x01F05 0x00345: 0x01F85 + "\x00|\x18\x00h\xa0\x1f\x86" + // 0x01F06 0x00345: 0x01F86 + "\x00|\x1c\x00h\xa0\x1f\x87" + // 0x01F07 0x00345: 0x01F87 + "\x00| \x00h\xa0\x1f\x88" + // 0x01F08 0x00345: 0x01F88 + "\x00|$\x00h\xa0\x1f\x89" + // 0x01F09 0x00345: 0x01F89 + "\x00|(\x00h\xa0\x1f\x8a" + // 0x01F0A 0x00345: 0x01F8A + "\x00|,\x00h\xa0\x1f\x8b" + // 0x01F0B 0x00345: 0x01F8B + "\x00|0\x00h\xa0\x1f\x8c" + // 0x01F0C 0x00345: 0x01F8C + "\x00|4\x00h\xa0\x1f\x8d" + // 0x01F0D 0x00345: 0x01F8D + "\x00|8\x00h\xa0\x1f\x8e" + // 0x01F0E 0x00345: 0x01F8E + "\x00|<\x00h\xa0\x1f\x8f" + // 0x01F0F 0x00345: 0x01F8F + "\x00|\x80\x00h\xa0\x1f\x90" + // 0x01F20 0x00345: 0x01F90 + "\x00|\x84\x00h\xa0\x1f\x91" + // 0x01F21 0x00345: 0x01F91 + "\x00|\x88\x00h\xa0\x1f\x92" + // 0x01F22 0x00345: 0x01F92 + "\x00|\x8c\x00h\xa0\x1f\x93" + // 0x01F23 0x00345: 0x01F93 + "\x00|\x90\x00h\xa0\x1f\x94" + // 0x01F24 0x00345: 0x01F94 + "\x00|\x94\x00h\xa0\x1f\x95" + // 0x01F25 0x00345: 0x01F95 + "\x00|\x98\x00h\xa0\x1f\x96" + // 0x01F26 0x00345: 0x01F96 + "\x00|\x9c\x00h\xa0\x1f\x97" + // 0x01F27 0x00345: 0x01F97 + "\x00|\xa0\x00h\xa0\x1f\x98" + // 0x01F28 0x00345: 0x01F98 + "\x00|\xa4\x00h\xa0\x1f\x99" + // 0x01F29 0x00345: 0x01F99 + "\x00|\xa8\x00h\xa0\x1f\x9a" + // 0x01F2A 0x00345: 0x01F9A + "\x00|\xac\x00h\xa0\x1f\x9b" + // 0x01F2B 0x00345: 0x01F9B + "\x00|\xb0\x00h\xa0\x1f\x9c" + // 0x01F2C 0x00345: 0x01F9C + "\x00|\xb4\x00h\xa0\x1f\x9d" + // 0x01F2D 0x00345: 0x01F9D + "\x00|\xb8\x00h\xa0\x1f\x9e" + // 0x01F2E 0x00345: 0x01F9E + "\x00|\xbc\x00h\xa0\x1f\x9f" + // 0x01F2F 0x00345: 0x01F9F + "\x00}\x80\x00h\xa0\x1f\xa0" + // 0x01F60 0x00345: 0x01FA0 + "\x00}\x84\x00h\xa0\x1f\xa1" + // 0x01F61 0x00345: 0x01FA1 + "\x00}\x88\x00h\xa0\x1f\xa2" + // 0x01F62 0x00345: 0x01FA2 + "\x00}\x8c\x00h\xa0\x1f\xa3" + // 0x01F63 0x00345: 0x01FA3 + "\x00}\x90\x00h\xa0\x1f\xa4" + // 0x01F64 0x00345: 0x01FA4 + "\x00}\x94\x00h\xa0\x1f\xa5" + // 0x01F65 0x00345: 0x01FA5 + "\x00}\x98\x00h\xa0\x1f\xa6" + // 0x01F66 0x00345: 0x01FA6 + "\x00}\x9c\x00h\xa0\x1f\xa7" + // 0x01F67 0x00345: 0x01FA7 + "\x00}\xa0\x00h\xa0\x1f\xa8" + // 0x01F68 0x00345: 0x01FA8 + "\x00}\xa4\x00h\xa0\x1f\xa9" + // 0x01F69 0x00345: 0x01FA9 + "\x00}\xa8\x00h\xa0\x1f\xaa" + // 0x01F6A 0x00345: 0x01FAA + "\x00}\xac\x00h\xa0\x1f\xab" + // 0x01F6B 0x00345: 0x01FAB + "\x00}\xb0\x00h\xa0\x1f\xac" + // 0x01F6C 0x00345: 0x01FAC + "\x00}\xb4\x00h\xa0\x1f\xad" + // 0x01F6D 0x00345: 0x01FAD + "\x00}\xb8\x00h\xa0\x1f\xae" + // 0x01F6E 0x00345: 0x01FAE + "\x00}\xbc\x00h\xa0\x1f\xaf" + // 0x01F6F 0x00345: 0x01FAF + "\x00\x0e\xc4\x00`\xc0\x1f\xb0" + // 0x003B1 0x00306: 0x01FB0 + "\x00\x0e\xc4\x00`\x80\x1f\xb1" + // 0x003B1 0x00304: 0x01FB1 + "\x00}\xc0\x00h\xa0\x1f\xb2" + // 0x01F70 0x00345: 0x01FB2 + "\x00\x0e\xc4\x00h\xa0\x1f\xb3" + // 0x003B1 0x00345: 0x01FB3 + "\x00\x0e\xb0\x00h\xa0\x1f\xb4" + // 0x003AC 0x00345: 0x01FB4 + "\x00\x0e\xc4\x00h@\x1f\xb6" + // 0x003B1 0x00342: 0x01FB6 + "\x00~\xd8\x00h\xa0\x1f\xb7" + // 0x01FB6 0x00345: 0x01FB7 + "\x00\x0eD\x00`\xc0\x1f\xb8" + // 0x00391 0x00306: 0x01FB8 + "\x00\x0eD\x00`\x80\x1f\xb9" + // 0x00391 0x00304: 0x01FB9 + "\x00\x0eD\x00`\x00\x1f\xba" + // 0x00391 0x00300: 0x01FBA + "\x00\x0eD\x00h\xa0\x1f\xbc" + // 0x00391 0x00345: 0x01FBC + "\x00\x02\xa0\x00h@\x1f\xc1" + // 0x000A8 0x00342: 0x01FC1 + "\x00}\xd0\x00h\xa0\x1f\xc2" + // 0x01F74 0x00345: 0x01FC2 + "\x00\x0e\xdc\x00h\xa0\x1f\xc3" + // 0x003B7 0x00345: 0x01FC3 + "\x00\x0e\xb8\x00h\xa0\x1f\xc4" + // 0x003AE 0x00345: 0x01FC4 + "\x00\x0e\xdc\x00h@\x1f\xc6" + // 0x003B7 0x00342: 0x01FC6 + "\x00\x7f\x18\x00h\xa0\x1f\xc7" + // 0x01FC6 0x00345: 0x01FC7 + "\x00\x0eT\x00`\x00\x1f\xc8" + // 0x00395 0x00300: 0x01FC8 + "\x00\x0e\\\x00`\x00\x1f\xca" + // 0x00397 0x00300: 0x01FCA + "\x00\x0e\\\x00h\xa0\x1f\xcc" + // 0x00397 0x00345: 0x01FCC + "\x00~\xfc\x00`\x00\x1f\xcd" + // 0x01FBF 0x00300: 0x01FCD + "\x00~\xfc\x00` \x1f\xce" + // 0x01FBF 0x00301: 0x01FCE + "\x00~\xfc\x00h@\x1f\xcf" + // 0x01FBF 0x00342: 0x01FCF + "\x00\x0e\xe4\x00`\xc0\x1f\xd0" + // 0x003B9 0x00306: 0x01FD0 + "\x00\x0e\xe4\x00`\x80\x1f\xd1" + // 0x003B9 0x00304: 0x01FD1 + "\x00\x0f(\x00`\x00\x1f\xd2" + // 0x003CA 0x00300: 0x01FD2 + "\x00\x0e\xe4\x00h@\x1f\xd6" + // 0x003B9 0x00342: 0x01FD6 + "\x00\x0f(\x00h@\x1f\xd7" + // 0x003CA 0x00342: 0x01FD7 + "\x00\x0ed\x00`\xc0\x1f\xd8" + // 0x00399 0x00306: 0x01FD8 + "\x00\x0ed\x00`\x80\x1f\xd9" + // 0x00399 0x00304: 0x01FD9 + "\x00\x0ed\x00`\x00\x1f\xda" + // 0x00399 0x00300: 0x01FDA + "\x00\x7f\xf8\x00`\x00\x1f\xdd" + // 0x01FFE 0x00300: 0x01FDD + "\x00\x7f\xf8\x00` \x1f\xde" + // 0x01FFE 0x00301: 0x01FDE + "\x00\x7f\xf8\x00h@\x1f\xdf" + // 0x01FFE 0x00342: 0x01FDF + "\x00\x0f\x14\x00`\xc0\x1f\xe0" + // 0x003C5 0x00306: 0x01FE0 + "\x00\x0f\x14\x00`\x80\x1f\xe1" + // 0x003C5 0x00304: 0x01FE1 + "\x00\x0f,\x00`\x00\x1f\xe2" + // 0x003CB 0x00300: 0x01FE2 + "\x00\x0f\x04\x00b`\x1f\xe4" + // 0x003C1 0x00313: 0x01FE4 + "\x00\x0f\x04\x00b\x80\x1f\xe5" + // 0x003C1 0x00314: 0x01FE5 + "\x00\x0f\x14\x00h@\x1f\xe6" + // 0x003C5 0x00342: 0x01FE6 + "\x00\x0f,\x00h@\x1f\xe7" + // 0x003CB 0x00342: 0x01FE7 + "\x00\x0e\x94\x00`\xc0\x1f\xe8" + // 0x003A5 0x00306: 0x01FE8 + "\x00\x0e\x94\x00`\x80\x1f\xe9" + // 0x003A5 0x00304: 0x01FE9 + "\x00\x0e\x94\x00`\x00\x1f\xea" + // 0x003A5 0x00300: 0x01FEA + "\x00\x0e\x84\x00b\x80\x1f\xec" + // 0x003A1 0x00314: 0x01FEC + "\x00\x02\xa0\x00`\x00\x1f\xed" + // 0x000A8 0x00300: 0x01FED + "\x00}\xf0\x00h\xa0\x1f\xf2" + // 0x01F7C 0x00345: 0x01FF2 + "\x00\x0f$\x00h\xa0\x1f\xf3" + // 0x003C9 0x00345: 0x01FF3 + "\x00\x0f8\x00h\xa0\x1f\xf4" + // 0x003CE 0x00345: 0x01FF4 + "\x00\x0f$\x00h@\x1f\xf6" + // 0x003C9 0x00342: 0x01FF6 + "\x00\x7f\xd8\x00h\xa0\x1f\xf7" + // 0x01FF6 0x00345: 0x01FF7 + "\x00\x0e|\x00`\x00\x1f\xf8" + // 0x0039F 0x00300: 0x01FF8 + "\x00\x0e\xa4\x00`\x00\x1f\xfa" + // 0x003A9 0x00300: 0x01FFA + "\x00\x0e\xa4\x00h\xa0\x1f\xfc" + // 0x003A9 0x00345: 0x01FFC + "\x00\x86@\x00g\x00!\x9a" + // 0x02190 0x00338: 0x0219A + "\x00\x86H\x00g\x00!\x9b" + // 0x02192 0x00338: 0x0219B + "\x00\x86P\x00g\x00!\xae" + // 0x02194 0x00338: 0x021AE + "\x00\x87@\x00g\x00!\xcd" + // 0x021D0 0x00338: 0x021CD + "\x00\x87P\x00g\x00!\xce" + // 0x021D4 0x00338: 0x021CE + "\x00\x87H\x00g\x00!\xcf" + // 0x021D2 0x00338: 0x021CF + "\x00\x88\f\x00g\x00\"\x04" + // 0x02203 0x00338: 0x02204 + "\x00\x88 \x00g\x00\"\t" + // 0x02208 0x00338: 0x02209 + "\x00\x88,\x00g\x00\"\f" + // 0x0220B 0x00338: 0x0220C + "\x00\x88\x8c\x00g\x00\"$" + // 0x02223 0x00338: 0x02224 + "\x00\x88\x94\x00g\x00\"&" + // 0x02225 0x00338: 0x02226 + "\x00\x88\xf0\x00g\x00\"A" + // 0x0223C 0x00338: 0x02241 + "\x00\x89\f\x00g\x00\"D" + // 0x02243 0x00338: 0x02244 + "\x00\x89\x14\x00g\x00\"G" + // 0x02245 0x00338: 0x02247 + "\x00\x89 \x00g\x00\"I" + // 0x02248 0x00338: 0x02249 + "\x00\x00\xf4\x00g\x00\"`" + // 0x0003D 0x00338: 0x02260 + "\x00\x89\x84\x00g\x00\"b" + // 0x02261 0x00338: 0x02262 + "\x00\x894\x00g\x00\"m" + // 0x0224D 0x00338: 0x0226D + "\x00\x00\xf0\x00g\x00\"n" + // 0x0003C 0x00338: 0x0226E + "\x00\x00\xf8\x00g\x00\"o" + // 0x0003E 0x00338: 0x0226F + "\x00\x89\x90\x00g\x00\"p" + // 0x02264 0x00338: 0x02270 + "\x00\x89\x94\x00g\x00\"q" + // 0x02265 0x00338: 0x02271 + "\x00\x89\xc8\x00g\x00\"t" + // 0x02272 0x00338: 0x02274 + "\x00\x89\xcc\x00g\x00\"u" + // 0x02273 0x00338: 0x02275 + "\x00\x89\xd8\x00g\x00\"x" + // 0x02276 0x00338: 0x02278 + "\x00\x89\xdc\x00g\x00\"y" + // 0x02277 0x00338: 0x02279 + "\x00\x89\xe8\x00g\x00\"\x80" + // 0x0227A 0x00338: 0x02280 + "\x00\x89\xec\x00g\x00\"\x81" + // 0x0227B 0x00338: 0x02281 + "\x00\x8a\b\x00g\x00\"\x84" + // 0x02282 0x00338: 0x02284 + "\x00\x8a\f\x00g\x00\"\x85" + // 0x02283 0x00338: 0x02285 + "\x00\x8a\x18\x00g\x00\"\x88" + // 0x02286 0x00338: 0x02288 + "\x00\x8a\x1c\x00g\x00\"\x89" + // 0x02287 0x00338: 0x02289 + "\x00\x8a\x88\x00g\x00\"\xac" + // 0x022A2 0x00338: 0x022AC + "\x00\x8a\xa0\x00g\x00\"\xad" + // 0x022A8 0x00338: 0x022AD + "\x00\x8a\xa4\x00g\x00\"\xae" + // 0x022A9 0x00338: 0x022AE + "\x00\x8a\xac\x00g\x00\"\xaf" + // 0x022AB 0x00338: 0x022AF + "\x00\x89\xf0\x00g\x00\"\xe0" + // 0x0227C 0x00338: 0x022E0 + "\x00\x89\xf4\x00g\x00\"\xe1" + // 0x0227D 0x00338: 0x022E1 + "\x00\x8aD\x00g\x00\"\xe2" + // 0x02291 0x00338: 0x022E2 + "\x00\x8aH\x00g\x00\"\xe3" + // 0x02292 0x00338: 0x022E3 + "\x00\x8a\xc8\x00g\x00\"\xea" + // 0x022B2 0x00338: 0x022EA + "\x00\x8a\xcc\x00g\x00\"\xeb" + // 0x022B3 0x00338: 0x022EB + "\x00\x8a\xd0\x00g\x00\"\xec" + // 0x022B4 0x00338: 0x022EC + "\x00\x8a\xd4\x00g\x00\"\xed" + // 0x022B5 0x00338: 0x022ED + "\x00\xc1,\x06\x13 0L" + // 0x0304B 0x03099: 0x0304C + "\x00\xc14\x06\x13 0N" + // 0x0304D 0x03099: 0x0304E + "\x00\xc1<\x06\x13 0P" + // 0x0304F 0x03099: 0x03050 + "\x00\xc1D\x06\x13 0R" + // 0x03051 0x03099: 0x03052 + "\x00\xc1L\x06\x13 0T" + // 0x03053 0x03099: 0x03054 + "\x00\xc1T\x06\x13 0V" + // 0x03055 0x03099: 0x03056 + "\x00\xc1\\\x06\x13 0X" + // 0x03057 0x03099: 0x03058 + "\x00\xc1d\x06\x13 0Z" + // 0x03059 0x03099: 0x0305A + "\x00\xc1l\x06\x13 0\\" + // 0x0305B 0x03099: 0x0305C + "\x00\xc1t\x06\x13 0^" + // 0x0305D 0x03099: 0x0305E + "\x00\xc1|\x06\x13 0`" + // 0x0305F 0x03099: 0x03060 + "\x00\xc1\x84\x06\x13 0b" + // 0x03061 0x03099: 0x03062 + "\x00\xc1\x90\x06\x13 0e" + // 0x03064 0x03099: 0x03065 + "\x00\xc1\x98\x06\x13 0g" + // 0x03066 0x03099: 0x03067 + "\x00\xc1\xa0\x06\x13 0i" + // 0x03068 0x03099: 0x03069 + "\x00\xc1\xbc\x06\x13 0p" + // 0x0306F 0x03099: 0x03070 + "\x00\xc1\xbc\x06\x13@0q" + // 0x0306F 0x0309A: 0x03071 + "\x00\xc1\xc8\x06\x13 0s" + // 0x03072 0x03099: 0x03073 + "\x00\xc1\xc8\x06\x13@0t" + // 0x03072 0x0309A: 0x03074 + "\x00\xc1\xd4\x06\x13 0v" + // 0x03075 0x03099: 0x03076 + "\x00\xc1\xd4\x06\x13@0w" + // 0x03075 0x0309A: 0x03077 + "\x00\xc1\xe0\x06\x13 0y" + // 0x03078 0x03099: 0x03079 + "\x00\xc1\xe0\x06\x13@0z" + // 0x03078 0x0309A: 0x0307A + "\x00\xc1\xec\x06\x13 0|" + // 0x0307B 0x03099: 0x0307C + "\x00\xc1\xec\x06\x13@0}" + // 0x0307B 0x0309A: 0x0307D + "\x00\xc1\x18\x06\x13 0\x94" + // 0x03046 0x03099: 0x03094 + "\x00\xc2t\x06\x13 0\x9e" + // 0x0309D 0x03099: 0x0309E + "\x00¬\x06\x13 0\xac" + // 0x030AB 0x03099: 0x030AC + "\x00´\x06\x13 0\xae" + // 0x030AD 0x03099: 0x030AE + "\x00¼\x06\x13 0\xb0" + // 0x030AF 0x03099: 0x030B0 + "\x00\xc2\xc4\x06\x13 0\xb2" + // 0x030B1 0x03099: 0x030B2 + "\x00\xc2\xcc\x06\x13 0\xb4" + // 0x030B3 0x03099: 0x030B4 + "\x00\xc2\xd4\x06\x13 0\xb6" + // 0x030B5 0x03099: 0x030B6 + "\x00\xc2\xdc\x06\x13 0\xb8" + // 0x030B7 0x03099: 0x030B8 + "\x00\xc2\xe4\x06\x13 0\xba" + // 0x030B9 0x03099: 0x030BA + "\x00\xc2\xec\x06\x13 0\xbc" + // 0x030BB 0x03099: 0x030BC + "\x00\xc2\xf4\x06\x13 0\xbe" + // 0x030BD 0x03099: 0x030BE + "\x00\xc2\xfc\x06\x13 0\xc0" + // 0x030BF 0x03099: 0x030C0 + "\x00\xc3\x04\x06\x13 0\xc2" + // 0x030C1 0x03099: 0x030C2 + "\x00\xc3\x10\x06\x13 0\xc5" + // 0x030C4 0x03099: 0x030C5 + "\x00\xc3\x18\x06\x13 0\xc7" + // 0x030C6 0x03099: 0x030C7 + "\x00\xc3 \x06\x13 0\xc9" + // 0x030C8 0x03099: 0x030C9 + "\x00\xc3<\x06\x13 0\xd0" + // 0x030CF 0x03099: 0x030D0 + "\x00\xc3<\x06\x13@0\xd1" + // 0x030CF 0x0309A: 0x030D1 + "\x00\xc3H\x06\x13 0\xd3" + // 0x030D2 0x03099: 0x030D3 + "\x00\xc3H\x06\x13@0\xd4" + // 0x030D2 0x0309A: 0x030D4 + "\x00\xc3T\x06\x13 0\xd6" + // 0x030D5 0x03099: 0x030D6 + "\x00\xc3T\x06\x13@0\xd7" + // 0x030D5 0x0309A: 0x030D7 + "\x00\xc3`\x06\x13 0\xd9" + // 0x030D8 0x03099: 0x030D9 + "\x00\xc3`\x06\x13@0\xda" + // 0x030D8 0x0309A: 0x030DA + "\x00\xc3l\x06\x13 0\xdc" + // 0x030DB 0x03099: 0x030DC + "\x00\xc3l\x06\x13@0\xdd" + // 0x030DB 0x0309A: 0x030DD + "\x00\u0098\x06\x13 0\xf4" + // 0x030A6 0x03099: 0x030F4 + "\x00ü\x06\x13 0\xf7" + // 0x030EF 0x03099: 0x030F7 + "\x00\xc3\xc0\x06\x13 0\xf8" + // 0x030F0 0x03099: 0x030F8 + "\x00\xc3\xc4\x06\x13 0\xf9" + // 0x030F1 0x03099: 0x030F9 + "\x00\xc3\xc8\x06\x13 0\xfa" + // 0x030F2 0x03099: 0x030FA + "\x00\xc3\xf4\x06\x13 0\xfe" + // 0x030FD 0x03099: 0x030FE + "\x04Bd\"\x17A\x10\x9a" + // 0x11099 0x110BA: 0x1109A + "\x04Bl\"\x17A\x10\x9c" + // 0x1109B 0x110BA: 0x1109C + "\x04B\x94\"\x17A\x10\xab" + // 0x110A5 0x110BA: 0x110AB + "\x04D\xc4\"$\xe1\x11." + // 0x11131 0x11127: 0x1112E + "\x04D\xc8\"$\xe1\x11/" + // 0x11132 0x11127: 0x1112F + "\x04M\x1c\"g\xc1\x13K" + // 0x11347 0x1133E: 0x1134B + "\x04M\x1c\"j\xe1\x13L" + // 0x11347 0x11357: 0x1134C + "\x04R\xe4\"\x97A\x14\xbb" + // 0x114B9 0x114BA: 0x114BB + "\x04R\xe4\"\x96\x01\x14\xbc" + // 0x114B9 0x114B0: 0x114BC + "\x04R\xe4\"\x97\xa1\x14\xbe" + // 0x114B9 0x114BD: 0x114BE + "\x04V\xe0\"\xb5\xe1\x15\xba" + // 0x115B8 0x115AF: 0x115BA + "\x04V\xe4\"\xb5\xe1\x15\xbb" + // 0x115B9 0x115AF: 0x115BB + "\x04d\xd4#&\x01\x198" + // 0x11935 0x11930: 0x11938 "" // Total size of tables: 56KB (57068 bytes) diff --git a/vendor/golang.org/x/text/unicode/norm/tables17.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables17.0.0.go index dfd555fc1b5..c3231891205 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables17.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables17.0.0.go @@ -7135,970 +7135,970 @@ var nfkcSparseValues = [980]valueRange{ } // recompMap: 7688 bytes (entries only) -var recompMap map[uint32]rune +var recompMap map[uint64]rune var recompMapOnce sync.Once const recompMapPacked = "" + - "\x00A\x03\x00\x00\x00\x00\xc0" + // 0x00410300: 0x000000C0 - "\x00A\x03\x01\x00\x00\x00\xc1" + // 0x00410301: 0x000000C1 - "\x00A\x03\x02\x00\x00\x00\xc2" + // 0x00410302: 0x000000C2 - "\x00A\x03\x03\x00\x00\x00\xc3" + // 0x00410303: 0x000000C3 - "\x00A\x03\b\x00\x00\x00\xc4" + // 0x00410308: 0x000000C4 - "\x00A\x03\n\x00\x00\x00\xc5" + // 0x0041030A: 0x000000C5 - "\x00C\x03'\x00\x00\x00\xc7" + // 0x00430327: 0x000000C7 - "\x00E\x03\x00\x00\x00\x00\xc8" + // 0x00450300: 0x000000C8 - "\x00E\x03\x01\x00\x00\x00\xc9" + // 0x00450301: 0x000000C9 - "\x00E\x03\x02\x00\x00\x00\xca" + // 0x00450302: 0x000000CA - "\x00E\x03\b\x00\x00\x00\xcb" + // 0x00450308: 0x000000CB - "\x00I\x03\x00\x00\x00\x00\xcc" + // 0x00490300: 0x000000CC - "\x00I\x03\x01\x00\x00\x00\xcd" + // 0x00490301: 0x000000CD - "\x00I\x03\x02\x00\x00\x00\xce" + // 0x00490302: 0x000000CE - "\x00I\x03\b\x00\x00\x00\xcf" + // 0x00490308: 0x000000CF - "\x00N\x03\x03\x00\x00\x00\xd1" + // 0x004E0303: 0x000000D1 - "\x00O\x03\x00\x00\x00\x00\xd2" + // 0x004F0300: 0x000000D2 - "\x00O\x03\x01\x00\x00\x00\xd3" + // 0x004F0301: 0x000000D3 - "\x00O\x03\x02\x00\x00\x00\xd4" + // 0x004F0302: 0x000000D4 - "\x00O\x03\x03\x00\x00\x00\xd5" + // 0x004F0303: 0x000000D5 - "\x00O\x03\b\x00\x00\x00\xd6" + // 0x004F0308: 0x000000D6 - "\x00U\x03\x00\x00\x00\x00\xd9" + // 0x00550300: 0x000000D9 - "\x00U\x03\x01\x00\x00\x00\xda" + // 0x00550301: 0x000000DA - "\x00U\x03\x02\x00\x00\x00\xdb" + // 0x00550302: 0x000000DB - "\x00U\x03\b\x00\x00\x00\xdc" + // 0x00550308: 0x000000DC - "\x00Y\x03\x01\x00\x00\x00\xdd" + // 0x00590301: 0x000000DD - "\x00a\x03\x00\x00\x00\x00\xe0" + // 0x00610300: 0x000000E0 - "\x00a\x03\x01\x00\x00\x00\xe1" + // 0x00610301: 0x000000E1 - "\x00a\x03\x02\x00\x00\x00\xe2" + // 0x00610302: 0x000000E2 - "\x00a\x03\x03\x00\x00\x00\xe3" + // 0x00610303: 0x000000E3 - "\x00a\x03\b\x00\x00\x00\xe4" + // 0x00610308: 0x000000E4 - "\x00a\x03\n\x00\x00\x00\xe5" + // 0x0061030A: 0x000000E5 - "\x00c\x03'\x00\x00\x00\xe7" + // 0x00630327: 0x000000E7 - "\x00e\x03\x00\x00\x00\x00\xe8" + // 0x00650300: 0x000000E8 - "\x00e\x03\x01\x00\x00\x00\xe9" + // 0x00650301: 0x000000E9 - "\x00e\x03\x02\x00\x00\x00\xea" + // 0x00650302: 0x000000EA - "\x00e\x03\b\x00\x00\x00\xeb" + // 0x00650308: 0x000000EB - "\x00i\x03\x00\x00\x00\x00\xec" + // 0x00690300: 0x000000EC - "\x00i\x03\x01\x00\x00\x00\xed" + // 0x00690301: 0x000000ED - "\x00i\x03\x02\x00\x00\x00\xee" + // 0x00690302: 0x000000EE - "\x00i\x03\b\x00\x00\x00\xef" + // 0x00690308: 0x000000EF - "\x00n\x03\x03\x00\x00\x00\xf1" + // 0x006E0303: 0x000000F1 - "\x00o\x03\x00\x00\x00\x00\xf2" + // 0x006F0300: 0x000000F2 - "\x00o\x03\x01\x00\x00\x00\xf3" + // 0x006F0301: 0x000000F3 - "\x00o\x03\x02\x00\x00\x00\xf4" + // 0x006F0302: 0x000000F4 - "\x00o\x03\x03\x00\x00\x00\xf5" + // 0x006F0303: 0x000000F5 - "\x00o\x03\b\x00\x00\x00\xf6" + // 0x006F0308: 0x000000F6 - "\x00u\x03\x00\x00\x00\x00\xf9" + // 0x00750300: 0x000000F9 - "\x00u\x03\x01\x00\x00\x00\xfa" + // 0x00750301: 0x000000FA - "\x00u\x03\x02\x00\x00\x00\xfb" + // 0x00750302: 0x000000FB - "\x00u\x03\b\x00\x00\x00\xfc" + // 0x00750308: 0x000000FC - "\x00y\x03\x01\x00\x00\x00\xfd" + // 0x00790301: 0x000000FD - "\x00y\x03\b\x00\x00\x00\xff" + // 0x00790308: 0x000000FF - "\x00A\x03\x04\x00\x00\x01\x00" + // 0x00410304: 0x00000100 - "\x00a\x03\x04\x00\x00\x01\x01" + // 0x00610304: 0x00000101 - "\x00A\x03\x06\x00\x00\x01\x02" + // 0x00410306: 0x00000102 - "\x00a\x03\x06\x00\x00\x01\x03" + // 0x00610306: 0x00000103 - "\x00A\x03(\x00\x00\x01\x04" + // 0x00410328: 0x00000104 - "\x00a\x03(\x00\x00\x01\x05" + // 0x00610328: 0x00000105 - "\x00C\x03\x01\x00\x00\x01\x06" + // 0x00430301: 0x00000106 - "\x00c\x03\x01\x00\x00\x01\a" + // 0x00630301: 0x00000107 - "\x00C\x03\x02\x00\x00\x01\b" + // 0x00430302: 0x00000108 - "\x00c\x03\x02\x00\x00\x01\t" + // 0x00630302: 0x00000109 - "\x00C\x03\a\x00\x00\x01\n" + // 0x00430307: 0x0000010A - "\x00c\x03\a\x00\x00\x01\v" + // 0x00630307: 0x0000010B - "\x00C\x03\f\x00\x00\x01\f" + // 0x0043030C: 0x0000010C - "\x00c\x03\f\x00\x00\x01\r" + // 0x0063030C: 0x0000010D - "\x00D\x03\f\x00\x00\x01\x0e" + // 0x0044030C: 0x0000010E - "\x00d\x03\f\x00\x00\x01\x0f" + // 0x0064030C: 0x0000010F - "\x00E\x03\x04\x00\x00\x01\x12" + // 0x00450304: 0x00000112 - "\x00e\x03\x04\x00\x00\x01\x13" + // 0x00650304: 0x00000113 - "\x00E\x03\x06\x00\x00\x01\x14" + // 0x00450306: 0x00000114 - "\x00e\x03\x06\x00\x00\x01\x15" + // 0x00650306: 0x00000115 - "\x00E\x03\a\x00\x00\x01\x16" + // 0x00450307: 0x00000116 - "\x00e\x03\a\x00\x00\x01\x17" + // 0x00650307: 0x00000117 - "\x00E\x03(\x00\x00\x01\x18" + // 0x00450328: 0x00000118 - "\x00e\x03(\x00\x00\x01\x19" + // 0x00650328: 0x00000119 - "\x00E\x03\f\x00\x00\x01\x1a" + // 0x0045030C: 0x0000011A - "\x00e\x03\f\x00\x00\x01\x1b" + // 0x0065030C: 0x0000011B - "\x00G\x03\x02\x00\x00\x01\x1c" + // 0x00470302: 0x0000011C - "\x00g\x03\x02\x00\x00\x01\x1d" + // 0x00670302: 0x0000011D - "\x00G\x03\x06\x00\x00\x01\x1e" + // 0x00470306: 0x0000011E - "\x00g\x03\x06\x00\x00\x01\x1f" + // 0x00670306: 0x0000011F - "\x00G\x03\a\x00\x00\x01 " + // 0x00470307: 0x00000120 - "\x00g\x03\a\x00\x00\x01!" + // 0x00670307: 0x00000121 - "\x00G\x03'\x00\x00\x01\"" + // 0x00470327: 0x00000122 - "\x00g\x03'\x00\x00\x01#" + // 0x00670327: 0x00000123 - "\x00H\x03\x02\x00\x00\x01$" + // 0x00480302: 0x00000124 - "\x00h\x03\x02\x00\x00\x01%" + // 0x00680302: 0x00000125 - "\x00I\x03\x03\x00\x00\x01(" + // 0x00490303: 0x00000128 - "\x00i\x03\x03\x00\x00\x01)" + // 0x00690303: 0x00000129 - "\x00I\x03\x04\x00\x00\x01*" + // 0x00490304: 0x0000012A - "\x00i\x03\x04\x00\x00\x01+" + // 0x00690304: 0x0000012B - "\x00I\x03\x06\x00\x00\x01," + // 0x00490306: 0x0000012C - "\x00i\x03\x06\x00\x00\x01-" + // 0x00690306: 0x0000012D - "\x00I\x03(\x00\x00\x01." + // 0x00490328: 0x0000012E - "\x00i\x03(\x00\x00\x01/" + // 0x00690328: 0x0000012F - "\x00I\x03\a\x00\x00\x010" + // 0x00490307: 0x00000130 - "\x00J\x03\x02\x00\x00\x014" + // 0x004A0302: 0x00000134 - "\x00j\x03\x02\x00\x00\x015" + // 0x006A0302: 0x00000135 - "\x00K\x03'\x00\x00\x016" + // 0x004B0327: 0x00000136 - "\x00k\x03'\x00\x00\x017" + // 0x006B0327: 0x00000137 - "\x00L\x03\x01\x00\x00\x019" + // 0x004C0301: 0x00000139 - "\x00l\x03\x01\x00\x00\x01:" + // 0x006C0301: 0x0000013A - "\x00L\x03'\x00\x00\x01;" + // 0x004C0327: 0x0000013B - "\x00l\x03'\x00\x00\x01<" + // 0x006C0327: 0x0000013C - "\x00L\x03\f\x00\x00\x01=" + // 0x004C030C: 0x0000013D - "\x00l\x03\f\x00\x00\x01>" + // 0x006C030C: 0x0000013E - "\x00N\x03\x01\x00\x00\x01C" + // 0x004E0301: 0x00000143 - "\x00n\x03\x01\x00\x00\x01D" + // 0x006E0301: 0x00000144 - "\x00N\x03'\x00\x00\x01E" + // 0x004E0327: 0x00000145 - "\x00n\x03'\x00\x00\x01F" + // 0x006E0327: 0x00000146 - "\x00N\x03\f\x00\x00\x01G" + // 0x004E030C: 0x00000147 - "\x00n\x03\f\x00\x00\x01H" + // 0x006E030C: 0x00000148 - "\x00O\x03\x04\x00\x00\x01L" + // 0x004F0304: 0x0000014C - "\x00o\x03\x04\x00\x00\x01M" + // 0x006F0304: 0x0000014D - "\x00O\x03\x06\x00\x00\x01N" + // 0x004F0306: 0x0000014E - "\x00o\x03\x06\x00\x00\x01O" + // 0x006F0306: 0x0000014F - "\x00O\x03\v\x00\x00\x01P" + // 0x004F030B: 0x00000150 - "\x00o\x03\v\x00\x00\x01Q" + // 0x006F030B: 0x00000151 - "\x00R\x03\x01\x00\x00\x01T" + // 0x00520301: 0x00000154 - "\x00r\x03\x01\x00\x00\x01U" + // 0x00720301: 0x00000155 - "\x00R\x03'\x00\x00\x01V" + // 0x00520327: 0x00000156 - "\x00r\x03'\x00\x00\x01W" + // 0x00720327: 0x00000157 - "\x00R\x03\f\x00\x00\x01X" + // 0x0052030C: 0x00000158 - "\x00r\x03\f\x00\x00\x01Y" + // 0x0072030C: 0x00000159 - "\x00S\x03\x01\x00\x00\x01Z" + // 0x00530301: 0x0000015A - "\x00s\x03\x01\x00\x00\x01[" + // 0x00730301: 0x0000015B - "\x00S\x03\x02\x00\x00\x01\\" + // 0x00530302: 0x0000015C - "\x00s\x03\x02\x00\x00\x01]" + // 0x00730302: 0x0000015D - "\x00S\x03'\x00\x00\x01^" + // 0x00530327: 0x0000015E - "\x00s\x03'\x00\x00\x01_" + // 0x00730327: 0x0000015F - "\x00S\x03\f\x00\x00\x01`" + // 0x0053030C: 0x00000160 - "\x00s\x03\f\x00\x00\x01a" + // 0x0073030C: 0x00000161 - "\x00T\x03'\x00\x00\x01b" + // 0x00540327: 0x00000162 - "\x00t\x03'\x00\x00\x01c" + // 0x00740327: 0x00000163 - "\x00T\x03\f\x00\x00\x01d" + // 0x0054030C: 0x00000164 - "\x00t\x03\f\x00\x00\x01e" + // 0x0074030C: 0x00000165 - "\x00U\x03\x03\x00\x00\x01h" + // 0x00550303: 0x00000168 - "\x00u\x03\x03\x00\x00\x01i" + // 0x00750303: 0x00000169 - "\x00U\x03\x04\x00\x00\x01j" + // 0x00550304: 0x0000016A - "\x00u\x03\x04\x00\x00\x01k" + // 0x00750304: 0x0000016B - "\x00U\x03\x06\x00\x00\x01l" + // 0x00550306: 0x0000016C - "\x00u\x03\x06\x00\x00\x01m" + // 0x00750306: 0x0000016D - "\x00U\x03\n\x00\x00\x01n" + // 0x0055030A: 0x0000016E - "\x00u\x03\n\x00\x00\x01o" + // 0x0075030A: 0x0000016F - "\x00U\x03\v\x00\x00\x01p" + // 0x0055030B: 0x00000170 - "\x00u\x03\v\x00\x00\x01q" + // 0x0075030B: 0x00000171 - "\x00U\x03(\x00\x00\x01r" + // 0x00550328: 0x00000172 - "\x00u\x03(\x00\x00\x01s" + // 0x00750328: 0x00000173 - "\x00W\x03\x02\x00\x00\x01t" + // 0x00570302: 0x00000174 - "\x00w\x03\x02\x00\x00\x01u" + // 0x00770302: 0x00000175 - "\x00Y\x03\x02\x00\x00\x01v" + // 0x00590302: 0x00000176 - "\x00y\x03\x02\x00\x00\x01w" + // 0x00790302: 0x00000177 - "\x00Y\x03\b\x00\x00\x01x" + // 0x00590308: 0x00000178 - "\x00Z\x03\x01\x00\x00\x01y" + // 0x005A0301: 0x00000179 - "\x00z\x03\x01\x00\x00\x01z" + // 0x007A0301: 0x0000017A - "\x00Z\x03\a\x00\x00\x01{" + // 0x005A0307: 0x0000017B - "\x00z\x03\a\x00\x00\x01|" + // 0x007A0307: 0x0000017C - "\x00Z\x03\f\x00\x00\x01}" + // 0x005A030C: 0x0000017D - "\x00z\x03\f\x00\x00\x01~" + // 0x007A030C: 0x0000017E - "\x00O\x03\x1b\x00\x00\x01\xa0" + // 0x004F031B: 0x000001A0 - "\x00o\x03\x1b\x00\x00\x01\xa1" + // 0x006F031B: 0x000001A1 - "\x00U\x03\x1b\x00\x00\x01\xaf" + // 0x0055031B: 0x000001AF - "\x00u\x03\x1b\x00\x00\x01\xb0" + // 0x0075031B: 0x000001B0 - "\x00A\x03\f\x00\x00\x01\xcd" + // 0x0041030C: 0x000001CD - "\x00a\x03\f\x00\x00\x01\xce" + // 0x0061030C: 0x000001CE - "\x00I\x03\f\x00\x00\x01\xcf" + // 0x0049030C: 0x000001CF - "\x00i\x03\f\x00\x00\x01\xd0" + // 0x0069030C: 0x000001D0 - "\x00O\x03\f\x00\x00\x01\xd1" + // 0x004F030C: 0x000001D1 - "\x00o\x03\f\x00\x00\x01\xd2" + // 0x006F030C: 0x000001D2 - "\x00U\x03\f\x00\x00\x01\xd3" + // 0x0055030C: 0x000001D3 - "\x00u\x03\f\x00\x00\x01\xd4" + // 0x0075030C: 0x000001D4 - "\x00\xdc\x03\x04\x00\x00\x01\xd5" + // 0x00DC0304: 0x000001D5 - "\x00\xfc\x03\x04\x00\x00\x01\xd6" + // 0x00FC0304: 0x000001D6 - "\x00\xdc\x03\x01\x00\x00\x01\xd7" + // 0x00DC0301: 0x000001D7 - "\x00\xfc\x03\x01\x00\x00\x01\xd8" + // 0x00FC0301: 0x000001D8 - "\x00\xdc\x03\f\x00\x00\x01\xd9" + // 0x00DC030C: 0x000001D9 - "\x00\xfc\x03\f\x00\x00\x01\xda" + // 0x00FC030C: 0x000001DA - "\x00\xdc\x03\x00\x00\x00\x01\xdb" + // 0x00DC0300: 0x000001DB - "\x00\xfc\x03\x00\x00\x00\x01\xdc" + // 0x00FC0300: 0x000001DC - "\x00\xc4\x03\x04\x00\x00\x01\xde" + // 0x00C40304: 0x000001DE - "\x00\xe4\x03\x04\x00\x00\x01\xdf" + // 0x00E40304: 0x000001DF - "\x02&\x03\x04\x00\x00\x01\xe0" + // 0x02260304: 0x000001E0 - "\x02'\x03\x04\x00\x00\x01\xe1" + // 0x02270304: 0x000001E1 - "\x00\xc6\x03\x04\x00\x00\x01\xe2" + // 0x00C60304: 0x000001E2 - "\x00\xe6\x03\x04\x00\x00\x01\xe3" + // 0x00E60304: 0x000001E3 - "\x00G\x03\f\x00\x00\x01\xe6" + // 0x0047030C: 0x000001E6 - "\x00g\x03\f\x00\x00\x01\xe7" + // 0x0067030C: 0x000001E7 - "\x00K\x03\f\x00\x00\x01\xe8" + // 0x004B030C: 0x000001E8 - "\x00k\x03\f\x00\x00\x01\xe9" + // 0x006B030C: 0x000001E9 - "\x00O\x03(\x00\x00\x01\xea" + // 0x004F0328: 0x000001EA - "\x00o\x03(\x00\x00\x01\xeb" + // 0x006F0328: 0x000001EB - "\x01\xea\x03\x04\x00\x00\x01\xec" + // 0x01EA0304: 0x000001EC - "\x01\xeb\x03\x04\x00\x00\x01\xed" + // 0x01EB0304: 0x000001ED - "\x01\xb7\x03\f\x00\x00\x01\xee" + // 0x01B7030C: 0x000001EE - "\x02\x92\x03\f\x00\x00\x01\xef" + // 0x0292030C: 0x000001EF - "\x00j\x03\f\x00\x00\x01\xf0" + // 0x006A030C: 0x000001F0 - "\x00G\x03\x01\x00\x00\x01\xf4" + // 0x00470301: 0x000001F4 - "\x00g\x03\x01\x00\x00\x01\xf5" + // 0x00670301: 0x000001F5 - "\x00N\x03\x00\x00\x00\x01\xf8" + // 0x004E0300: 0x000001F8 - "\x00n\x03\x00\x00\x00\x01\xf9" + // 0x006E0300: 0x000001F9 - "\x00\xc5\x03\x01\x00\x00\x01\xfa" + // 0x00C50301: 0x000001FA - "\x00\xe5\x03\x01\x00\x00\x01\xfb" + // 0x00E50301: 0x000001FB - "\x00\xc6\x03\x01\x00\x00\x01\xfc" + // 0x00C60301: 0x000001FC - "\x00\xe6\x03\x01\x00\x00\x01\xfd" + // 0x00E60301: 0x000001FD - "\x00\xd8\x03\x01\x00\x00\x01\xfe" + // 0x00D80301: 0x000001FE - "\x00\xf8\x03\x01\x00\x00\x01\xff" + // 0x00F80301: 0x000001FF - "\x00A\x03\x0f\x00\x00\x02\x00" + // 0x0041030F: 0x00000200 - "\x00a\x03\x0f\x00\x00\x02\x01" + // 0x0061030F: 0x00000201 - "\x00A\x03\x11\x00\x00\x02\x02" + // 0x00410311: 0x00000202 - "\x00a\x03\x11\x00\x00\x02\x03" + // 0x00610311: 0x00000203 - "\x00E\x03\x0f\x00\x00\x02\x04" + // 0x0045030F: 0x00000204 - "\x00e\x03\x0f\x00\x00\x02\x05" + // 0x0065030F: 0x00000205 - "\x00E\x03\x11\x00\x00\x02\x06" + // 0x00450311: 0x00000206 - "\x00e\x03\x11\x00\x00\x02\a" + // 0x00650311: 0x00000207 - "\x00I\x03\x0f\x00\x00\x02\b" + // 0x0049030F: 0x00000208 - "\x00i\x03\x0f\x00\x00\x02\t" + // 0x0069030F: 0x00000209 - "\x00I\x03\x11\x00\x00\x02\n" + // 0x00490311: 0x0000020A - "\x00i\x03\x11\x00\x00\x02\v" + // 0x00690311: 0x0000020B - "\x00O\x03\x0f\x00\x00\x02\f" + // 0x004F030F: 0x0000020C - "\x00o\x03\x0f\x00\x00\x02\r" + // 0x006F030F: 0x0000020D - "\x00O\x03\x11\x00\x00\x02\x0e" + // 0x004F0311: 0x0000020E - "\x00o\x03\x11\x00\x00\x02\x0f" + // 0x006F0311: 0x0000020F - "\x00R\x03\x0f\x00\x00\x02\x10" + // 0x0052030F: 0x00000210 - "\x00r\x03\x0f\x00\x00\x02\x11" + // 0x0072030F: 0x00000211 - "\x00R\x03\x11\x00\x00\x02\x12" + // 0x00520311: 0x00000212 - "\x00r\x03\x11\x00\x00\x02\x13" + // 0x00720311: 0x00000213 - "\x00U\x03\x0f\x00\x00\x02\x14" + // 0x0055030F: 0x00000214 - "\x00u\x03\x0f\x00\x00\x02\x15" + // 0x0075030F: 0x00000215 - "\x00U\x03\x11\x00\x00\x02\x16" + // 0x00550311: 0x00000216 - "\x00u\x03\x11\x00\x00\x02\x17" + // 0x00750311: 0x00000217 - "\x00S\x03&\x00\x00\x02\x18" + // 0x00530326: 0x00000218 - "\x00s\x03&\x00\x00\x02\x19" + // 0x00730326: 0x00000219 - "\x00T\x03&\x00\x00\x02\x1a" + // 0x00540326: 0x0000021A - "\x00t\x03&\x00\x00\x02\x1b" + // 0x00740326: 0x0000021B - "\x00H\x03\f\x00\x00\x02\x1e" + // 0x0048030C: 0x0000021E - "\x00h\x03\f\x00\x00\x02\x1f" + // 0x0068030C: 0x0000021F - "\x00A\x03\a\x00\x00\x02&" + // 0x00410307: 0x00000226 - "\x00a\x03\a\x00\x00\x02'" + // 0x00610307: 0x00000227 - "\x00E\x03'\x00\x00\x02(" + // 0x00450327: 0x00000228 - "\x00e\x03'\x00\x00\x02)" + // 0x00650327: 0x00000229 - "\x00\xd6\x03\x04\x00\x00\x02*" + // 0x00D60304: 0x0000022A - "\x00\xf6\x03\x04\x00\x00\x02+" + // 0x00F60304: 0x0000022B - "\x00\xd5\x03\x04\x00\x00\x02," + // 0x00D50304: 0x0000022C - "\x00\xf5\x03\x04\x00\x00\x02-" + // 0x00F50304: 0x0000022D - "\x00O\x03\a\x00\x00\x02." + // 0x004F0307: 0x0000022E - "\x00o\x03\a\x00\x00\x02/" + // 0x006F0307: 0x0000022F - "\x02.\x03\x04\x00\x00\x020" + // 0x022E0304: 0x00000230 - "\x02/\x03\x04\x00\x00\x021" + // 0x022F0304: 0x00000231 - "\x00Y\x03\x04\x00\x00\x022" + // 0x00590304: 0x00000232 - "\x00y\x03\x04\x00\x00\x023" + // 0x00790304: 0x00000233 - "\x00\xa8\x03\x01\x00\x00\x03\x85" + // 0x00A80301: 0x00000385 - "\x03\x91\x03\x01\x00\x00\x03\x86" + // 0x03910301: 0x00000386 - "\x03\x95\x03\x01\x00\x00\x03\x88" + // 0x03950301: 0x00000388 - "\x03\x97\x03\x01\x00\x00\x03\x89" + // 0x03970301: 0x00000389 - "\x03\x99\x03\x01\x00\x00\x03\x8a" + // 0x03990301: 0x0000038A - "\x03\x9f\x03\x01\x00\x00\x03\x8c" + // 0x039F0301: 0x0000038C - "\x03\xa5\x03\x01\x00\x00\x03\x8e" + // 0x03A50301: 0x0000038E - "\x03\xa9\x03\x01\x00\x00\x03\x8f" + // 0x03A90301: 0x0000038F - "\x03\xca\x03\x01\x00\x00\x03\x90" + // 0x03CA0301: 0x00000390 - "\x03\x99\x03\b\x00\x00\x03\xaa" + // 0x03990308: 0x000003AA - "\x03\xa5\x03\b\x00\x00\x03\xab" + // 0x03A50308: 0x000003AB - "\x03\xb1\x03\x01\x00\x00\x03\xac" + // 0x03B10301: 0x000003AC - "\x03\xb5\x03\x01\x00\x00\x03\xad" + // 0x03B50301: 0x000003AD - "\x03\xb7\x03\x01\x00\x00\x03\xae" + // 0x03B70301: 0x000003AE - "\x03\xb9\x03\x01\x00\x00\x03\xaf" + // 0x03B90301: 0x000003AF - "\x03\xcb\x03\x01\x00\x00\x03\xb0" + // 0x03CB0301: 0x000003B0 - "\x03\xb9\x03\b\x00\x00\x03\xca" + // 0x03B90308: 0x000003CA - "\x03\xc5\x03\b\x00\x00\x03\xcb" + // 0x03C50308: 0x000003CB - "\x03\xbf\x03\x01\x00\x00\x03\xcc" + // 0x03BF0301: 0x000003CC - "\x03\xc5\x03\x01\x00\x00\x03\xcd" + // 0x03C50301: 0x000003CD - "\x03\xc9\x03\x01\x00\x00\x03\xce" + // 0x03C90301: 0x000003CE - "\x03\xd2\x03\x01\x00\x00\x03\xd3" + // 0x03D20301: 0x000003D3 - "\x03\xd2\x03\b\x00\x00\x03\xd4" + // 0x03D20308: 0x000003D4 - "\x04\x15\x03\x00\x00\x00\x04\x00" + // 0x04150300: 0x00000400 - "\x04\x15\x03\b\x00\x00\x04\x01" + // 0x04150308: 0x00000401 - "\x04\x13\x03\x01\x00\x00\x04\x03" + // 0x04130301: 0x00000403 - "\x04\x06\x03\b\x00\x00\x04\a" + // 0x04060308: 0x00000407 - "\x04\x1a\x03\x01\x00\x00\x04\f" + // 0x041A0301: 0x0000040C - "\x04\x18\x03\x00\x00\x00\x04\r" + // 0x04180300: 0x0000040D - "\x04#\x03\x06\x00\x00\x04\x0e" + // 0x04230306: 0x0000040E - "\x04\x18\x03\x06\x00\x00\x04\x19" + // 0x04180306: 0x00000419 - "\x048\x03\x06\x00\x00\x049" + // 0x04380306: 0x00000439 - "\x045\x03\x00\x00\x00\x04P" + // 0x04350300: 0x00000450 - "\x045\x03\b\x00\x00\x04Q" + // 0x04350308: 0x00000451 - "\x043\x03\x01\x00\x00\x04S" + // 0x04330301: 0x00000453 - "\x04V\x03\b\x00\x00\x04W" + // 0x04560308: 0x00000457 - "\x04:\x03\x01\x00\x00\x04\\" + // 0x043A0301: 0x0000045C - "\x048\x03\x00\x00\x00\x04]" + // 0x04380300: 0x0000045D - "\x04C\x03\x06\x00\x00\x04^" + // 0x04430306: 0x0000045E - "\x04t\x03\x0f\x00\x00\x04v" + // 0x0474030F: 0x00000476 - "\x04u\x03\x0f\x00\x00\x04w" + // 0x0475030F: 0x00000477 - "\x04\x16\x03\x06\x00\x00\x04\xc1" + // 0x04160306: 0x000004C1 - "\x046\x03\x06\x00\x00\x04\xc2" + // 0x04360306: 0x000004C2 - "\x04\x10\x03\x06\x00\x00\x04\xd0" + // 0x04100306: 0x000004D0 - "\x040\x03\x06\x00\x00\x04\xd1" + // 0x04300306: 0x000004D1 - "\x04\x10\x03\b\x00\x00\x04\xd2" + // 0x04100308: 0x000004D2 - "\x040\x03\b\x00\x00\x04\xd3" + // 0x04300308: 0x000004D3 - "\x04\x15\x03\x06\x00\x00\x04\xd6" + // 0x04150306: 0x000004D6 - "\x045\x03\x06\x00\x00\x04\xd7" + // 0x04350306: 0x000004D7 - "\x04\xd8\x03\b\x00\x00\x04\xda" + // 0x04D80308: 0x000004DA - "\x04\xd9\x03\b\x00\x00\x04\xdb" + // 0x04D90308: 0x000004DB - "\x04\x16\x03\b\x00\x00\x04\xdc" + // 0x04160308: 0x000004DC - "\x046\x03\b\x00\x00\x04\xdd" + // 0x04360308: 0x000004DD - "\x04\x17\x03\b\x00\x00\x04\xde" + // 0x04170308: 0x000004DE - "\x047\x03\b\x00\x00\x04\xdf" + // 0x04370308: 0x000004DF - "\x04\x18\x03\x04\x00\x00\x04\xe2" + // 0x04180304: 0x000004E2 - "\x048\x03\x04\x00\x00\x04\xe3" + // 0x04380304: 0x000004E3 - "\x04\x18\x03\b\x00\x00\x04\xe4" + // 0x04180308: 0x000004E4 - "\x048\x03\b\x00\x00\x04\xe5" + // 0x04380308: 0x000004E5 - "\x04\x1e\x03\b\x00\x00\x04\xe6" + // 0x041E0308: 0x000004E6 - "\x04>\x03\b\x00\x00\x04\xe7" + // 0x043E0308: 0x000004E7 - "\x04\xe8\x03\b\x00\x00\x04\xea" + // 0x04E80308: 0x000004EA - "\x04\xe9\x03\b\x00\x00\x04\xeb" + // 0x04E90308: 0x000004EB - "\x04-\x03\b\x00\x00\x04\xec" + // 0x042D0308: 0x000004EC - "\x04M\x03\b\x00\x00\x04\xed" + // 0x044D0308: 0x000004ED - "\x04#\x03\x04\x00\x00\x04\xee" + // 0x04230304: 0x000004EE - "\x04C\x03\x04\x00\x00\x04\xef" + // 0x04430304: 0x000004EF - "\x04#\x03\b\x00\x00\x04\xf0" + // 0x04230308: 0x000004F0 - "\x04C\x03\b\x00\x00\x04\xf1" + // 0x04430308: 0x000004F1 - "\x04#\x03\v\x00\x00\x04\xf2" + // 0x0423030B: 0x000004F2 - "\x04C\x03\v\x00\x00\x04\xf3" + // 0x0443030B: 0x000004F3 - "\x04'\x03\b\x00\x00\x04\xf4" + // 0x04270308: 0x000004F4 - "\x04G\x03\b\x00\x00\x04\xf5" + // 0x04470308: 0x000004F5 - "\x04+\x03\b\x00\x00\x04\xf8" + // 0x042B0308: 0x000004F8 - "\x04K\x03\b\x00\x00\x04\xf9" + // 0x044B0308: 0x000004F9 - "\x06'\x06S\x00\x00\x06\"" + // 0x06270653: 0x00000622 - "\x06'\x06T\x00\x00\x06#" + // 0x06270654: 0x00000623 - "\x06H\x06T\x00\x00\x06$" + // 0x06480654: 0x00000624 - "\x06'\x06U\x00\x00\x06%" + // 0x06270655: 0x00000625 - "\x06J\x06T\x00\x00\x06&" + // 0x064A0654: 0x00000626 - "\x06\xd5\x06T\x00\x00\x06\xc0" + // 0x06D50654: 0x000006C0 - "\x06\xc1\x06T\x00\x00\x06\xc2" + // 0x06C10654: 0x000006C2 - "\x06\xd2\x06T\x00\x00\x06\xd3" + // 0x06D20654: 0x000006D3 - "\t(\t<\x00\x00\t)" + // 0x0928093C: 0x00000929 - "\t0\t<\x00\x00\t1" + // 0x0930093C: 0x00000931 - "\t3\t<\x00\x00\t4" + // 0x0933093C: 0x00000934 - "\t\xc7\t\xbe\x00\x00\t\xcb" + // 0x09C709BE: 0x000009CB - "\t\xc7\t\xd7\x00\x00\t\xcc" + // 0x09C709D7: 0x000009CC - "\vG\vV\x00\x00\vH" + // 0x0B470B56: 0x00000B48 - "\vG\v>\x00\x00\vK" + // 0x0B470B3E: 0x00000B4B - "\vG\vW\x00\x00\vL" + // 0x0B470B57: 0x00000B4C - "\v\x92\v\xd7\x00\x00\v\x94" + // 0x0B920BD7: 0x00000B94 - "\v\xc6\v\xbe\x00\x00\v\xca" + // 0x0BC60BBE: 0x00000BCA - "\v\xc7\v\xbe\x00\x00\v\xcb" + // 0x0BC70BBE: 0x00000BCB - "\v\xc6\v\xd7\x00\x00\v\xcc" + // 0x0BC60BD7: 0x00000BCC - "\fF\fV\x00\x00\fH" + // 0x0C460C56: 0x00000C48 - "\f\xbf\f\xd5\x00\x00\f\xc0" + // 0x0CBF0CD5: 0x00000CC0 - "\f\xc6\f\xd5\x00\x00\f\xc7" + // 0x0CC60CD5: 0x00000CC7 - "\f\xc6\f\xd6\x00\x00\f\xc8" + // 0x0CC60CD6: 0x00000CC8 - "\f\xc6\f\xc2\x00\x00\f\xca" + // 0x0CC60CC2: 0x00000CCA - "\f\xca\f\xd5\x00\x00\f\xcb" + // 0x0CCA0CD5: 0x00000CCB - "\rF\r>\x00\x00\rJ" + // 0x0D460D3E: 0x00000D4A - "\rG\r>\x00\x00\rK" + // 0x0D470D3E: 0x00000D4B - "\rF\rW\x00\x00\rL" + // 0x0D460D57: 0x00000D4C - "\r\xd9\r\xca\x00\x00\r\xda" + // 0x0DD90DCA: 0x00000DDA - "\r\xd9\r\xcf\x00\x00\r\xdc" + // 0x0DD90DCF: 0x00000DDC - "\r\xdc\r\xca\x00\x00\r\xdd" + // 0x0DDC0DCA: 0x00000DDD - "\r\xd9\r\xdf\x00\x00\r\xde" + // 0x0DD90DDF: 0x00000DDE - "\x10%\x10.\x00\x00\x10&" + // 0x1025102E: 0x00001026 - "\x1b\x05\x1b5\x00\x00\x1b\x06" + // 0x1B051B35: 0x00001B06 - "\x1b\a\x1b5\x00\x00\x1b\b" + // 0x1B071B35: 0x00001B08 - "\x1b\t\x1b5\x00\x00\x1b\n" + // 0x1B091B35: 0x00001B0A - "\x1b\v\x1b5\x00\x00\x1b\f" + // 0x1B0B1B35: 0x00001B0C - "\x1b\r\x1b5\x00\x00\x1b\x0e" + // 0x1B0D1B35: 0x00001B0E - "\x1b\x11\x1b5\x00\x00\x1b\x12" + // 0x1B111B35: 0x00001B12 - "\x1b:\x1b5\x00\x00\x1b;" + // 0x1B3A1B35: 0x00001B3B - "\x1b<\x1b5\x00\x00\x1b=" + // 0x1B3C1B35: 0x00001B3D - "\x1b>\x1b5\x00\x00\x1b@" + // 0x1B3E1B35: 0x00001B40 - "\x1b?\x1b5\x00\x00\x1bA" + // 0x1B3F1B35: 0x00001B41 - "\x1bB\x1b5\x00\x00\x1bC" + // 0x1B421B35: 0x00001B43 - "\x00A\x03%\x00\x00\x1e\x00" + // 0x00410325: 0x00001E00 - "\x00a\x03%\x00\x00\x1e\x01" + // 0x00610325: 0x00001E01 - "\x00B\x03\a\x00\x00\x1e\x02" + // 0x00420307: 0x00001E02 - "\x00b\x03\a\x00\x00\x1e\x03" + // 0x00620307: 0x00001E03 - "\x00B\x03#\x00\x00\x1e\x04" + // 0x00420323: 0x00001E04 - "\x00b\x03#\x00\x00\x1e\x05" + // 0x00620323: 0x00001E05 - "\x00B\x031\x00\x00\x1e\x06" + // 0x00420331: 0x00001E06 - "\x00b\x031\x00\x00\x1e\a" + // 0x00620331: 0x00001E07 - "\x00\xc7\x03\x01\x00\x00\x1e\b" + // 0x00C70301: 0x00001E08 - "\x00\xe7\x03\x01\x00\x00\x1e\t" + // 0x00E70301: 0x00001E09 - "\x00D\x03\a\x00\x00\x1e\n" + // 0x00440307: 0x00001E0A - "\x00d\x03\a\x00\x00\x1e\v" + // 0x00640307: 0x00001E0B - "\x00D\x03#\x00\x00\x1e\f" + // 0x00440323: 0x00001E0C - "\x00d\x03#\x00\x00\x1e\r" + // 0x00640323: 0x00001E0D - "\x00D\x031\x00\x00\x1e\x0e" + // 0x00440331: 0x00001E0E - "\x00d\x031\x00\x00\x1e\x0f" + // 0x00640331: 0x00001E0F - "\x00D\x03'\x00\x00\x1e\x10" + // 0x00440327: 0x00001E10 - "\x00d\x03'\x00\x00\x1e\x11" + // 0x00640327: 0x00001E11 - "\x00D\x03-\x00\x00\x1e\x12" + // 0x0044032D: 0x00001E12 - "\x00d\x03-\x00\x00\x1e\x13" + // 0x0064032D: 0x00001E13 - "\x01\x12\x03\x00\x00\x00\x1e\x14" + // 0x01120300: 0x00001E14 - "\x01\x13\x03\x00\x00\x00\x1e\x15" + // 0x01130300: 0x00001E15 - "\x01\x12\x03\x01\x00\x00\x1e\x16" + // 0x01120301: 0x00001E16 - "\x01\x13\x03\x01\x00\x00\x1e\x17" + // 0x01130301: 0x00001E17 - "\x00E\x03-\x00\x00\x1e\x18" + // 0x0045032D: 0x00001E18 - "\x00e\x03-\x00\x00\x1e\x19" + // 0x0065032D: 0x00001E19 - "\x00E\x030\x00\x00\x1e\x1a" + // 0x00450330: 0x00001E1A - "\x00e\x030\x00\x00\x1e\x1b" + // 0x00650330: 0x00001E1B - "\x02(\x03\x06\x00\x00\x1e\x1c" + // 0x02280306: 0x00001E1C - "\x02)\x03\x06\x00\x00\x1e\x1d" + // 0x02290306: 0x00001E1D - "\x00F\x03\a\x00\x00\x1e\x1e" + // 0x00460307: 0x00001E1E - "\x00f\x03\a\x00\x00\x1e\x1f" + // 0x00660307: 0x00001E1F - "\x00G\x03\x04\x00\x00\x1e " + // 0x00470304: 0x00001E20 - "\x00g\x03\x04\x00\x00\x1e!" + // 0x00670304: 0x00001E21 - "\x00H\x03\a\x00\x00\x1e\"" + // 0x00480307: 0x00001E22 - "\x00h\x03\a\x00\x00\x1e#" + // 0x00680307: 0x00001E23 - "\x00H\x03#\x00\x00\x1e$" + // 0x00480323: 0x00001E24 - "\x00h\x03#\x00\x00\x1e%" + // 0x00680323: 0x00001E25 - "\x00H\x03\b\x00\x00\x1e&" + // 0x00480308: 0x00001E26 - "\x00h\x03\b\x00\x00\x1e'" + // 0x00680308: 0x00001E27 - "\x00H\x03'\x00\x00\x1e(" + // 0x00480327: 0x00001E28 - "\x00h\x03'\x00\x00\x1e)" + // 0x00680327: 0x00001E29 - "\x00H\x03.\x00\x00\x1e*" + // 0x0048032E: 0x00001E2A - "\x00h\x03.\x00\x00\x1e+" + // 0x0068032E: 0x00001E2B - "\x00I\x030\x00\x00\x1e," + // 0x00490330: 0x00001E2C - "\x00i\x030\x00\x00\x1e-" + // 0x00690330: 0x00001E2D - "\x00\xcf\x03\x01\x00\x00\x1e." + // 0x00CF0301: 0x00001E2E - "\x00\xef\x03\x01\x00\x00\x1e/" + // 0x00EF0301: 0x00001E2F - "\x00K\x03\x01\x00\x00\x1e0" + // 0x004B0301: 0x00001E30 - "\x00k\x03\x01\x00\x00\x1e1" + // 0x006B0301: 0x00001E31 - "\x00K\x03#\x00\x00\x1e2" + // 0x004B0323: 0x00001E32 - "\x00k\x03#\x00\x00\x1e3" + // 0x006B0323: 0x00001E33 - "\x00K\x031\x00\x00\x1e4" + // 0x004B0331: 0x00001E34 - "\x00k\x031\x00\x00\x1e5" + // 0x006B0331: 0x00001E35 - "\x00L\x03#\x00\x00\x1e6" + // 0x004C0323: 0x00001E36 - "\x00l\x03#\x00\x00\x1e7" + // 0x006C0323: 0x00001E37 - "\x1e6\x03\x04\x00\x00\x1e8" + // 0x1E360304: 0x00001E38 - "\x1e7\x03\x04\x00\x00\x1e9" + // 0x1E370304: 0x00001E39 - "\x00L\x031\x00\x00\x1e:" + // 0x004C0331: 0x00001E3A - "\x00l\x031\x00\x00\x1e;" + // 0x006C0331: 0x00001E3B - "\x00L\x03-\x00\x00\x1e<" + // 0x004C032D: 0x00001E3C - "\x00l\x03-\x00\x00\x1e=" + // 0x006C032D: 0x00001E3D - "\x00M\x03\x01\x00\x00\x1e>" + // 0x004D0301: 0x00001E3E - "\x00m\x03\x01\x00\x00\x1e?" + // 0x006D0301: 0x00001E3F - "\x00M\x03\a\x00\x00\x1e@" + // 0x004D0307: 0x00001E40 - "\x00m\x03\a\x00\x00\x1eA" + // 0x006D0307: 0x00001E41 - "\x00M\x03#\x00\x00\x1eB" + // 0x004D0323: 0x00001E42 - "\x00m\x03#\x00\x00\x1eC" + // 0x006D0323: 0x00001E43 - "\x00N\x03\a\x00\x00\x1eD" + // 0x004E0307: 0x00001E44 - "\x00n\x03\a\x00\x00\x1eE" + // 0x006E0307: 0x00001E45 - "\x00N\x03#\x00\x00\x1eF" + // 0x004E0323: 0x00001E46 - "\x00n\x03#\x00\x00\x1eG" + // 0x006E0323: 0x00001E47 - "\x00N\x031\x00\x00\x1eH" + // 0x004E0331: 0x00001E48 - "\x00n\x031\x00\x00\x1eI" + // 0x006E0331: 0x00001E49 - "\x00N\x03-\x00\x00\x1eJ" + // 0x004E032D: 0x00001E4A - "\x00n\x03-\x00\x00\x1eK" + // 0x006E032D: 0x00001E4B - "\x00\xd5\x03\x01\x00\x00\x1eL" + // 0x00D50301: 0x00001E4C - "\x00\xf5\x03\x01\x00\x00\x1eM" + // 0x00F50301: 0x00001E4D - "\x00\xd5\x03\b\x00\x00\x1eN" + // 0x00D50308: 0x00001E4E - "\x00\xf5\x03\b\x00\x00\x1eO" + // 0x00F50308: 0x00001E4F - "\x01L\x03\x00\x00\x00\x1eP" + // 0x014C0300: 0x00001E50 - "\x01M\x03\x00\x00\x00\x1eQ" + // 0x014D0300: 0x00001E51 - "\x01L\x03\x01\x00\x00\x1eR" + // 0x014C0301: 0x00001E52 - "\x01M\x03\x01\x00\x00\x1eS" + // 0x014D0301: 0x00001E53 - "\x00P\x03\x01\x00\x00\x1eT" + // 0x00500301: 0x00001E54 - "\x00p\x03\x01\x00\x00\x1eU" + // 0x00700301: 0x00001E55 - "\x00P\x03\a\x00\x00\x1eV" + // 0x00500307: 0x00001E56 - "\x00p\x03\a\x00\x00\x1eW" + // 0x00700307: 0x00001E57 - "\x00R\x03\a\x00\x00\x1eX" + // 0x00520307: 0x00001E58 - "\x00r\x03\a\x00\x00\x1eY" + // 0x00720307: 0x00001E59 - "\x00R\x03#\x00\x00\x1eZ" + // 0x00520323: 0x00001E5A - "\x00r\x03#\x00\x00\x1e[" + // 0x00720323: 0x00001E5B - "\x1eZ\x03\x04\x00\x00\x1e\\" + // 0x1E5A0304: 0x00001E5C - "\x1e[\x03\x04\x00\x00\x1e]" + // 0x1E5B0304: 0x00001E5D - "\x00R\x031\x00\x00\x1e^" + // 0x00520331: 0x00001E5E - "\x00r\x031\x00\x00\x1e_" + // 0x00720331: 0x00001E5F - "\x00S\x03\a\x00\x00\x1e`" + // 0x00530307: 0x00001E60 - "\x00s\x03\a\x00\x00\x1ea" + // 0x00730307: 0x00001E61 - "\x00S\x03#\x00\x00\x1eb" + // 0x00530323: 0x00001E62 - "\x00s\x03#\x00\x00\x1ec" + // 0x00730323: 0x00001E63 - "\x01Z\x03\a\x00\x00\x1ed" + // 0x015A0307: 0x00001E64 - "\x01[\x03\a\x00\x00\x1ee" + // 0x015B0307: 0x00001E65 - "\x01`\x03\a\x00\x00\x1ef" + // 0x01600307: 0x00001E66 - "\x01a\x03\a\x00\x00\x1eg" + // 0x01610307: 0x00001E67 - "\x1eb\x03\a\x00\x00\x1eh" + // 0x1E620307: 0x00001E68 - "\x1ec\x03\a\x00\x00\x1ei" + // 0x1E630307: 0x00001E69 - "\x00T\x03\a\x00\x00\x1ej" + // 0x00540307: 0x00001E6A - "\x00t\x03\a\x00\x00\x1ek" + // 0x00740307: 0x00001E6B - "\x00T\x03#\x00\x00\x1el" + // 0x00540323: 0x00001E6C - "\x00t\x03#\x00\x00\x1em" + // 0x00740323: 0x00001E6D - "\x00T\x031\x00\x00\x1en" + // 0x00540331: 0x00001E6E - "\x00t\x031\x00\x00\x1eo" + // 0x00740331: 0x00001E6F - "\x00T\x03-\x00\x00\x1ep" + // 0x0054032D: 0x00001E70 - "\x00t\x03-\x00\x00\x1eq" + // 0x0074032D: 0x00001E71 - "\x00U\x03$\x00\x00\x1er" + // 0x00550324: 0x00001E72 - "\x00u\x03$\x00\x00\x1es" + // 0x00750324: 0x00001E73 - "\x00U\x030\x00\x00\x1et" + // 0x00550330: 0x00001E74 - "\x00u\x030\x00\x00\x1eu" + // 0x00750330: 0x00001E75 - "\x00U\x03-\x00\x00\x1ev" + // 0x0055032D: 0x00001E76 - "\x00u\x03-\x00\x00\x1ew" + // 0x0075032D: 0x00001E77 - "\x01h\x03\x01\x00\x00\x1ex" + // 0x01680301: 0x00001E78 - "\x01i\x03\x01\x00\x00\x1ey" + // 0x01690301: 0x00001E79 - "\x01j\x03\b\x00\x00\x1ez" + // 0x016A0308: 0x00001E7A - "\x01k\x03\b\x00\x00\x1e{" + // 0x016B0308: 0x00001E7B - "\x00V\x03\x03\x00\x00\x1e|" + // 0x00560303: 0x00001E7C - "\x00v\x03\x03\x00\x00\x1e}" + // 0x00760303: 0x00001E7D - "\x00V\x03#\x00\x00\x1e~" + // 0x00560323: 0x00001E7E - "\x00v\x03#\x00\x00\x1e\x7f" + // 0x00760323: 0x00001E7F - "\x00W\x03\x00\x00\x00\x1e\x80" + // 0x00570300: 0x00001E80 - "\x00w\x03\x00\x00\x00\x1e\x81" + // 0x00770300: 0x00001E81 - "\x00W\x03\x01\x00\x00\x1e\x82" + // 0x00570301: 0x00001E82 - "\x00w\x03\x01\x00\x00\x1e\x83" + // 0x00770301: 0x00001E83 - "\x00W\x03\b\x00\x00\x1e\x84" + // 0x00570308: 0x00001E84 - "\x00w\x03\b\x00\x00\x1e\x85" + // 0x00770308: 0x00001E85 - "\x00W\x03\a\x00\x00\x1e\x86" + // 0x00570307: 0x00001E86 - "\x00w\x03\a\x00\x00\x1e\x87" + // 0x00770307: 0x00001E87 - "\x00W\x03#\x00\x00\x1e\x88" + // 0x00570323: 0x00001E88 - "\x00w\x03#\x00\x00\x1e\x89" + // 0x00770323: 0x00001E89 - "\x00X\x03\a\x00\x00\x1e\x8a" + // 0x00580307: 0x00001E8A - "\x00x\x03\a\x00\x00\x1e\x8b" + // 0x00780307: 0x00001E8B - "\x00X\x03\b\x00\x00\x1e\x8c" + // 0x00580308: 0x00001E8C - "\x00x\x03\b\x00\x00\x1e\x8d" + // 0x00780308: 0x00001E8D - "\x00Y\x03\a\x00\x00\x1e\x8e" + // 0x00590307: 0x00001E8E - "\x00y\x03\a\x00\x00\x1e\x8f" + // 0x00790307: 0x00001E8F - "\x00Z\x03\x02\x00\x00\x1e\x90" + // 0x005A0302: 0x00001E90 - "\x00z\x03\x02\x00\x00\x1e\x91" + // 0x007A0302: 0x00001E91 - "\x00Z\x03#\x00\x00\x1e\x92" + // 0x005A0323: 0x00001E92 - "\x00z\x03#\x00\x00\x1e\x93" + // 0x007A0323: 0x00001E93 - "\x00Z\x031\x00\x00\x1e\x94" + // 0x005A0331: 0x00001E94 - "\x00z\x031\x00\x00\x1e\x95" + // 0x007A0331: 0x00001E95 - "\x00h\x031\x00\x00\x1e\x96" + // 0x00680331: 0x00001E96 - "\x00t\x03\b\x00\x00\x1e\x97" + // 0x00740308: 0x00001E97 - "\x00w\x03\n\x00\x00\x1e\x98" + // 0x0077030A: 0x00001E98 - "\x00y\x03\n\x00\x00\x1e\x99" + // 0x0079030A: 0x00001E99 - "\x01\x7f\x03\a\x00\x00\x1e\x9b" + // 0x017F0307: 0x00001E9B - "\x00A\x03#\x00\x00\x1e\xa0" + // 0x00410323: 0x00001EA0 - "\x00a\x03#\x00\x00\x1e\xa1" + // 0x00610323: 0x00001EA1 - "\x00A\x03\t\x00\x00\x1e\xa2" + // 0x00410309: 0x00001EA2 - "\x00a\x03\t\x00\x00\x1e\xa3" + // 0x00610309: 0x00001EA3 - "\x00\xc2\x03\x01\x00\x00\x1e\xa4" + // 0x00C20301: 0x00001EA4 - "\x00\xe2\x03\x01\x00\x00\x1e\xa5" + // 0x00E20301: 0x00001EA5 - "\x00\xc2\x03\x00\x00\x00\x1e\xa6" + // 0x00C20300: 0x00001EA6 - "\x00\xe2\x03\x00\x00\x00\x1e\xa7" + // 0x00E20300: 0x00001EA7 - "\x00\xc2\x03\t\x00\x00\x1e\xa8" + // 0x00C20309: 0x00001EA8 - "\x00\xe2\x03\t\x00\x00\x1e\xa9" + // 0x00E20309: 0x00001EA9 - "\x00\xc2\x03\x03\x00\x00\x1e\xaa" + // 0x00C20303: 0x00001EAA - "\x00\xe2\x03\x03\x00\x00\x1e\xab" + // 0x00E20303: 0x00001EAB - "\x1e\xa0\x03\x02\x00\x00\x1e\xac" + // 0x1EA00302: 0x00001EAC - "\x1e\xa1\x03\x02\x00\x00\x1e\xad" + // 0x1EA10302: 0x00001EAD - "\x01\x02\x03\x01\x00\x00\x1e\xae" + // 0x01020301: 0x00001EAE - "\x01\x03\x03\x01\x00\x00\x1e\xaf" + // 0x01030301: 0x00001EAF - "\x01\x02\x03\x00\x00\x00\x1e\xb0" + // 0x01020300: 0x00001EB0 - "\x01\x03\x03\x00\x00\x00\x1e\xb1" + // 0x01030300: 0x00001EB1 - "\x01\x02\x03\t\x00\x00\x1e\xb2" + // 0x01020309: 0x00001EB2 - "\x01\x03\x03\t\x00\x00\x1e\xb3" + // 0x01030309: 0x00001EB3 - "\x01\x02\x03\x03\x00\x00\x1e\xb4" + // 0x01020303: 0x00001EB4 - "\x01\x03\x03\x03\x00\x00\x1e\xb5" + // 0x01030303: 0x00001EB5 - "\x1e\xa0\x03\x06\x00\x00\x1e\xb6" + // 0x1EA00306: 0x00001EB6 - "\x1e\xa1\x03\x06\x00\x00\x1e\xb7" + // 0x1EA10306: 0x00001EB7 - "\x00E\x03#\x00\x00\x1e\xb8" + // 0x00450323: 0x00001EB8 - "\x00e\x03#\x00\x00\x1e\xb9" + // 0x00650323: 0x00001EB9 - "\x00E\x03\t\x00\x00\x1e\xba" + // 0x00450309: 0x00001EBA - "\x00e\x03\t\x00\x00\x1e\xbb" + // 0x00650309: 0x00001EBB - "\x00E\x03\x03\x00\x00\x1e\xbc" + // 0x00450303: 0x00001EBC - "\x00e\x03\x03\x00\x00\x1e\xbd" + // 0x00650303: 0x00001EBD - "\x00\xca\x03\x01\x00\x00\x1e\xbe" + // 0x00CA0301: 0x00001EBE - "\x00\xea\x03\x01\x00\x00\x1e\xbf" + // 0x00EA0301: 0x00001EBF - "\x00\xca\x03\x00\x00\x00\x1e\xc0" + // 0x00CA0300: 0x00001EC0 - "\x00\xea\x03\x00\x00\x00\x1e\xc1" + // 0x00EA0300: 0x00001EC1 - "\x00\xca\x03\t\x00\x00\x1e\xc2" + // 0x00CA0309: 0x00001EC2 - "\x00\xea\x03\t\x00\x00\x1e\xc3" + // 0x00EA0309: 0x00001EC3 - "\x00\xca\x03\x03\x00\x00\x1e\xc4" + // 0x00CA0303: 0x00001EC4 - "\x00\xea\x03\x03\x00\x00\x1e\xc5" + // 0x00EA0303: 0x00001EC5 - "\x1e\xb8\x03\x02\x00\x00\x1e\xc6" + // 0x1EB80302: 0x00001EC6 - "\x1e\xb9\x03\x02\x00\x00\x1e\xc7" + // 0x1EB90302: 0x00001EC7 - "\x00I\x03\t\x00\x00\x1e\xc8" + // 0x00490309: 0x00001EC8 - "\x00i\x03\t\x00\x00\x1e\xc9" + // 0x00690309: 0x00001EC9 - "\x00I\x03#\x00\x00\x1e\xca" + // 0x00490323: 0x00001ECA - "\x00i\x03#\x00\x00\x1e\xcb" + // 0x00690323: 0x00001ECB - "\x00O\x03#\x00\x00\x1e\xcc" + // 0x004F0323: 0x00001ECC - "\x00o\x03#\x00\x00\x1e\xcd" + // 0x006F0323: 0x00001ECD - "\x00O\x03\t\x00\x00\x1e\xce" + // 0x004F0309: 0x00001ECE - "\x00o\x03\t\x00\x00\x1e\xcf" + // 0x006F0309: 0x00001ECF - "\x00\xd4\x03\x01\x00\x00\x1e\xd0" + // 0x00D40301: 0x00001ED0 - "\x00\xf4\x03\x01\x00\x00\x1e\xd1" + // 0x00F40301: 0x00001ED1 - "\x00\xd4\x03\x00\x00\x00\x1e\xd2" + // 0x00D40300: 0x00001ED2 - "\x00\xf4\x03\x00\x00\x00\x1e\xd3" + // 0x00F40300: 0x00001ED3 - "\x00\xd4\x03\t\x00\x00\x1e\xd4" + // 0x00D40309: 0x00001ED4 - "\x00\xf4\x03\t\x00\x00\x1e\xd5" + // 0x00F40309: 0x00001ED5 - "\x00\xd4\x03\x03\x00\x00\x1e\xd6" + // 0x00D40303: 0x00001ED6 - "\x00\xf4\x03\x03\x00\x00\x1e\xd7" + // 0x00F40303: 0x00001ED7 - "\x1e\xcc\x03\x02\x00\x00\x1e\xd8" + // 0x1ECC0302: 0x00001ED8 - "\x1e\xcd\x03\x02\x00\x00\x1e\xd9" + // 0x1ECD0302: 0x00001ED9 - "\x01\xa0\x03\x01\x00\x00\x1e\xda" + // 0x01A00301: 0x00001EDA - "\x01\xa1\x03\x01\x00\x00\x1e\xdb" + // 0x01A10301: 0x00001EDB - "\x01\xa0\x03\x00\x00\x00\x1e\xdc" + // 0x01A00300: 0x00001EDC - "\x01\xa1\x03\x00\x00\x00\x1e\xdd" + // 0x01A10300: 0x00001EDD - "\x01\xa0\x03\t\x00\x00\x1e\xde" + // 0x01A00309: 0x00001EDE - "\x01\xa1\x03\t\x00\x00\x1e\xdf" + // 0x01A10309: 0x00001EDF - "\x01\xa0\x03\x03\x00\x00\x1e\xe0" + // 0x01A00303: 0x00001EE0 - "\x01\xa1\x03\x03\x00\x00\x1e\xe1" + // 0x01A10303: 0x00001EE1 - "\x01\xa0\x03#\x00\x00\x1e\xe2" + // 0x01A00323: 0x00001EE2 - "\x01\xa1\x03#\x00\x00\x1e\xe3" + // 0x01A10323: 0x00001EE3 - "\x00U\x03#\x00\x00\x1e\xe4" + // 0x00550323: 0x00001EE4 - "\x00u\x03#\x00\x00\x1e\xe5" + // 0x00750323: 0x00001EE5 - "\x00U\x03\t\x00\x00\x1e\xe6" + // 0x00550309: 0x00001EE6 - "\x00u\x03\t\x00\x00\x1e\xe7" + // 0x00750309: 0x00001EE7 - "\x01\xaf\x03\x01\x00\x00\x1e\xe8" + // 0x01AF0301: 0x00001EE8 - "\x01\xb0\x03\x01\x00\x00\x1e\xe9" + // 0x01B00301: 0x00001EE9 - "\x01\xaf\x03\x00\x00\x00\x1e\xea" + // 0x01AF0300: 0x00001EEA - "\x01\xb0\x03\x00\x00\x00\x1e\xeb" + // 0x01B00300: 0x00001EEB - "\x01\xaf\x03\t\x00\x00\x1e\xec" + // 0x01AF0309: 0x00001EEC - "\x01\xb0\x03\t\x00\x00\x1e\xed" + // 0x01B00309: 0x00001EED - "\x01\xaf\x03\x03\x00\x00\x1e\xee" + // 0x01AF0303: 0x00001EEE - "\x01\xb0\x03\x03\x00\x00\x1e\xef" + // 0x01B00303: 0x00001EEF - "\x01\xaf\x03#\x00\x00\x1e\xf0" + // 0x01AF0323: 0x00001EF0 - "\x01\xb0\x03#\x00\x00\x1e\xf1" + // 0x01B00323: 0x00001EF1 - "\x00Y\x03\x00\x00\x00\x1e\xf2" + // 0x00590300: 0x00001EF2 - "\x00y\x03\x00\x00\x00\x1e\xf3" + // 0x00790300: 0x00001EF3 - "\x00Y\x03#\x00\x00\x1e\xf4" + // 0x00590323: 0x00001EF4 - "\x00y\x03#\x00\x00\x1e\xf5" + // 0x00790323: 0x00001EF5 - "\x00Y\x03\t\x00\x00\x1e\xf6" + // 0x00590309: 0x00001EF6 - "\x00y\x03\t\x00\x00\x1e\xf7" + // 0x00790309: 0x00001EF7 - "\x00Y\x03\x03\x00\x00\x1e\xf8" + // 0x00590303: 0x00001EF8 - "\x00y\x03\x03\x00\x00\x1e\xf9" + // 0x00790303: 0x00001EF9 - "\x03\xb1\x03\x13\x00\x00\x1f\x00" + // 0x03B10313: 0x00001F00 - "\x03\xb1\x03\x14\x00\x00\x1f\x01" + // 0x03B10314: 0x00001F01 - "\x1f\x00\x03\x00\x00\x00\x1f\x02" + // 0x1F000300: 0x00001F02 - "\x1f\x01\x03\x00\x00\x00\x1f\x03" + // 0x1F010300: 0x00001F03 - "\x1f\x00\x03\x01\x00\x00\x1f\x04" + // 0x1F000301: 0x00001F04 - "\x1f\x01\x03\x01\x00\x00\x1f\x05" + // 0x1F010301: 0x00001F05 - "\x1f\x00\x03B\x00\x00\x1f\x06" + // 0x1F000342: 0x00001F06 - "\x1f\x01\x03B\x00\x00\x1f\a" + // 0x1F010342: 0x00001F07 - "\x03\x91\x03\x13\x00\x00\x1f\b" + // 0x03910313: 0x00001F08 - "\x03\x91\x03\x14\x00\x00\x1f\t" + // 0x03910314: 0x00001F09 - "\x1f\b\x03\x00\x00\x00\x1f\n" + // 0x1F080300: 0x00001F0A - "\x1f\t\x03\x00\x00\x00\x1f\v" + // 0x1F090300: 0x00001F0B - "\x1f\b\x03\x01\x00\x00\x1f\f" + // 0x1F080301: 0x00001F0C - "\x1f\t\x03\x01\x00\x00\x1f\r" + // 0x1F090301: 0x00001F0D - "\x1f\b\x03B\x00\x00\x1f\x0e" + // 0x1F080342: 0x00001F0E - "\x1f\t\x03B\x00\x00\x1f\x0f" + // 0x1F090342: 0x00001F0F - "\x03\xb5\x03\x13\x00\x00\x1f\x10" + // 0x03B50313: 0x00001F10 - "\x03\xb5\x03\x14\x00\x00\x1f\x11" + // 0x03B50314: 0x00001F11 - "\x1f\x10\x03\x00\x00\x00\x1f\x12" + // 0x1F100300: 0x00001F12 - "\x1f\x11\x03\x00\x00\x00\x1f\x13" + // 0x1F110300: 0x00001F13 - "\x1f\x10\x03\x01\x00\x00\x1f\x14" + // 0x1F100301: 0x00001F14 - "\x1f\x11\x03\x01\x00\x00\x1f\x15" + // 0x1F110301: 0x00001F15 - "\x03\x95\x03\x13\x00\x00\x1f\x18" + // 0x03950313: 0x00001F18 - "\x03\x95\x03\x14\x00\x00\x1f\x19" + // 0x03950314: 0x00001F19 - "\x1f\x18\x03\x00\x00\x00\x1f\x1a" + // 0x1F180300: 0x00001F1A - "\x1f\x19\x03\x00\x00\x00\x1f\x1b" + // 0x1F190300: 0x00001F1B - "\x1f\x18\x03\x01\x00\x00\x1f\x1c" + // 0x1F180301: 0x00001F1C - "\x1f\x19\x03\x01\x00\x00\x1f\x1d" + // 0x1F190301: 0x00001F1D - "\x03\xb7\x03\x13\x00\x00\x1f " + // 0x03B70313: 0x00001F20 - "\x03\xb7\x03\x14\x00\x00\x1f!" + // 0x03B70314: 0x00001F21 - "\x1f \x03\x00\x00\x00\x1f\"" + // 0x1F200300: 0x00001F22 - "\x1f!\x03\x00\x00\x00\x1f#" + // 0x1F210300: 0x00001F23 - "\x1f \x03\x01\x00\x00\x1f$" + // 0x1F200301: 0x00001F24 - "\x1f!\x03\x01\x00\x00\x1f%" + // 0x1F210301: 0x00001F25 - "\x1f \x03B\x00\x00\x1f&" + // 0x1F200342: 0x00001F26 - "\x1f!\x03B\x00\x00\x1f'" + // 0x1F210342: 0x00001F27 - "\x03\x97\x03\x13\x00\x00\x1f(" + // 0x03970313: 0x00001F28 - "\x03\x97\x03\x14\x00\x00\x1f)" + // 0x03970314: 0x00001F29 - "\x1f(\x03\x00\x00\x00\x1f*" + // 0x1F280300: 0x00001F2A - "\x1f)\x03\x00\x00\x00\x1f+" + // 0x1F290300: 0x00001F2B - "\x1f(\x03\x01\x00\x00\x1f," + // 0x1F280301: 0x00001F2C - "\x1f)\x03\x01\x00\x00\x1f-" + // 0x1F290301: 0x00001F2D - "\x1f(\x03B\x00\x00\x1f." + // 0x1F280342: 0x00001F2E - "\x1f)\x03B\x00\x00\x1f/" + // 0x1F290342: 0x00001F2F - "\x03\xb9\x03\x13\x00\x00\x1f0" + // 0x03B90313: 0x00001F30 - "\x03\xb9\x03\x14\x00\x00\x1f1" + // 0x03B90314: 0x00001F31 - "\x1f0\x03\x00\x00\x00\x1f2" + // 0x1F300300: 0x00001F32 - "\x1f1\x03\x00\x00\x00\x1f3" + // 0x1F310300: 0x00001F33 - "\x1f0\x03\x01\x00\x00\x1f4" + // 0x1F300301: 0x00001F34 - "\x1f1\x03\x01\x00\x00\x1f5" + // 0x1F310301: 0x00001F35 - "\x1f0\x03B\x00\x00\x1f6" + // 0x1F300342: 0x00001F36 - "\x1f1\x03B\x00\x00\x1f7" + // 0x1F310342: 0x00001F37 - "\x03\x99\x03\x13\x00\x00\x1f8" + // 0x03990313: 0x00001F38 - "\x03\x99\x03\x14\x00\x00\x1f9" + // 0x03990314: 0x00001F39 - "\x1f8\x03\x00\x00\x00\x1f:" + // 0x1F380300: 0x00001F3A - "\x1f9\x03\x00\x00\x00\x1f;" + // 0x1F390300: 0x00001F3B - "\x1f8\x03\x01\x00\x00\x1f<" + // 0x1F380301: 0x00001F3C - "\x1f9\x03\x01\x00\x00\x1f=" + // 0x1F390301: 0x00001F3D - "\x1f8\x03B\x00\x00\x1f>" + // 0x1F380342: 0x00001F3E - "\x1f9\x03B\x00\x00\x1f?" + // 0x1F390342: 0x00001F3F - "\x03\xbf\x03\x13\x00\x00\x1f@" + // 0x03BF0313: 0x00001F40 - "\x03\xbf\x03\x14\x00\x00\x1fA" + // 0x03BF0314: 0x00001F41 - "\x1f@\x03\x00\x00\x00\x1fB" + // 0x1F400300: 0x00001F42 - "\x1fA\x03\x00\x00\x00\x1fC" + // 0x1F410300: 0x00001F43 - "\x1f@\x03\x01\x00\x00\x1fD" + // 0x1F400301: 0x00001F44 - "\x1fA\x03\x01\x00\x00\x1fE" + // 0x1F410301: 0x00001F45 - "\x03\x9f\x03\x13\x00\x00\x1fH" + // 0x039F0313: 0x00001F48 - "\x03\x9f\x03\x14\x00\x00\x1fI" + // 0x039F0314: 0x00001F49 - "\x1fH\x03\x00\x00\x00\x1fJ" + // 0x1F480300: 0x00001F4A - "\x1fI\x03\x00\x00\x00\x1fK" + // 0x1F490300: 0x00001F4B - "\x1fH\x03\x01\x00\x00\x1fL" + // 0x1F480301: 0x00001F4C - "\x1fI\x03\x01\x00\x00\x1fM" + // 0x1F490301: 0x00001F4D - "\x03\xc5\x03\x13\x00\x00\x1fP" + // 0x03C50313: 0x00001F50 - "\x03\xc5\x03\x14\x00\x00\x1fQ" + // 0x03C50314: 0x00001F51 - "\x1fP\x03\x00\x00\x00\x1fR" + // 0x1F500300: 0x00001F52 - "\x1fQ\x03\x00\x00\x00\x1fS" + // 0x1F510300: 0x00001F53 - "\x1fP\x03\x01\x00\x00\x1fT" + // 0x1F500301: 0x00001F54 - "\x1fQ\x03\x01\x00\x00\x1fU" + // 0x1F510301: 0x00001F55 - "\x1fP\x03B\x00\x00\x1fV" + // 0x1F500342: 0x00001F56 - "\x1fQ\x03B\x00\x00\x1fW" + // 0x1F510342: 0x00001F57 - "\x03\xa5\x03\x14\x00\x00\x1fY" + // 0x03A50314: 0x00001F59 - "\x1fY\x03\x00\x00\x00\x1f[" + // 0x1F590300: 0x00001F5B - "\x1fY\x03\x01\x00\x00\x1f]" + // 0x1F590301: 0x00001F5D - "\x1fY\x03B\x00\x00\x1f_" + // 0x1F590342: 0x00001F5F - "\x03\xc9\x03\x13\x00\x00\x1f`" + // 0x03C90313: 0x00001F60 - "\x03\xc9\x03\x14\x00\x00\x1fa" + // 0x03C90314: 0x00001F61 - "\x1f`\x03\x00\x00\x00\x1fb" + // 0x1F600300: 0x00001F62 - "\x1fa\x03\x00\x00\x00\x1fc" + // 0x1F610300: 0x00001F63 - "\x1f`\x03\x01\x00\x00\x1fd" + // 0x1F600301: 0x00001F64 - "\x1fa\x03\x01\x00\x00\x1fe" + // 0x1F610301: 0x00001F65 - "\x1f`\x03B\x00\x00\x1ff" + // 0x1F600342: 0x00001F66 - "\x1fa\x03B\x00\x00\x1fg" + // 0x1F610342: 0x00001F67 - "\x03\xa9\x03\x13\x00\x00\x1fh" + // 0x03A90313: 0x00001F68 - "\x03\xa9\x03\x14\x00\x00\x1fi" + // 0x03A90314: 0x00001F69 - "\x1fh\x03\x00\x00\x00\x1fj" + // 0x1F680300: 0x00001F6A - "\x1fi\x03\x00\x00\x00\x1fk" + // 0x1F690300: 0x00001F6B - "\x1fh\x03\x01\x00\x00\x1fl" + // 0x1F680301: 0x00001F6C - "\x1fi\x03\x01\x00\x00\x1fm" + // 0x1F690301: 0x00001F6D - "\x1fh\x03B\x00\x00\x1fn" + // 0x1F680342: 0x00001F6E - "\x1fi\x03B\x00\x00\x1fo" + // 0x1F690342: 0x00001F6F - "\x03\xb1\x03\x00\x00\x00\x1fp" + // 0x03B10300: 0x00001F70 - "\x03\xb5\x03\x00\x00\x00\x1fr" + // 0x03B50300: 0x00001F72 - "\x03\xb7\x03\x00\x00\x00\x1ft" + // 0x03B70300: 0x00001F74 - "\x03\xb9\x03\x00\x00\x00\x1fv" + // 0x03B90300: 0x00001F76 - "\x03\xbf\x03\x00\x00\x00\x1fx" + // 0x03BF0300: 0x00001F78 - "\x03\xc5\x03\x00\x00\x00\x1fz" + // 0x03C50300: 0x00001F7A - "\x03\xc9\x03\x00\x00\x00\x1f|" + // 0x03C90300: 0x00001F7C - "\x1f\x00\x03E\x00\x00\x1f\x80" + // 0x1F000345: 0x00001F80 - "\x1f\x01\x03E\x00\x00\x1f\x81" + // 0x1F010345: 0x00001F81 - "\x1f\x02\x03E\x00\x00\x1f\x82" + // 0x1F020345: 0x00001F82 - "\x1f\x03\x03E\x00\x00\x1f\x83" + // 0x1F030345: 0x00001F83 - "\x1f\x04\x03E\x00\x00\x1f\x84" + // 0x1F040345: 0x00001F84 - "\x1f\x05\x03E\x00\x00\x1f\x85" + // 0x1F050345: 0x00001F85 - "\x1f\x06\x03E\x00\x00\x1f\x86" + // 0x1F060345: 0x00001F86 - "\x1f\a\x03E\x00\x00\x1f\x87" + // 0x1F070345: 0x00001F87 - "\x1f\b\x03E\x00\x00\x1f\x88" + // 0x1F080345: 0x00001F88 - "\x1f\t\x03E\x00\x00\x1f\x89" + // 0x1F090345: 0x00001F89 - "\x1f\n\x03E\x00\x00\x1f\x8a" + // 0x1F0A0345: 0x00001F8A - "\x1f\v\x03E\x00\x00\x1f\x8b" + // 0x1F0B0345: 0x00001F8B - "\x1f\f\x03E\x00\x00\x1f\x8c" + // 0x1F0C0345: 0x00001F8C - "\x1f\r\x03E\x00\x00\x1f\x8d" + // 0x1F0D0345: 0x00001F8D - "\x1f\x0e\x03E\x00\x00\x1f\x8e" + // 0x1F0E0345: 0x00001F8E - "\x1f\x0f\x03E\x00\x00\x1f\x8f" + // 0x1F0F0345: 0x00001F8F - "\x1f \x03E\x00\x00\x1f\x90" + // 0x1F200345: 0x00001F90 - "\x1f!\x03E\x00\x00\x1f\x91" + // 0x1F210345: 0x00001F91 - "\x1f\"\x03E\x00\x00\x1f\x92" + // 0x1F220345: 0x00001F92 - "\x1f#\x03E\x00\x00\x1f\x93" + // 0x1F230345: 0x00001F93 - "\x1f$\x03E\x00\x00\x1f\x94" + // 0x1F240345: 0x00001F94 - "\x1f%\x03E\x00\x00\x1f\x95" + // 0x1F250345: 0x00001F95 - "\x1f&\x03E\x00\x00\x1f\x96" + // 0x1F260345: 0x00001F96 - "\x1f'\x03E\x00\x00\x1f\x97" + // 0x1F270345: 0x00001F97 - "\x1f(\x03E\x00\x00\x1f\x98" + // 0x1F280345: 0x00001F98 - "\x1f)\x03E\x00\x00\x1f\x99" + // 0x1F290345: 0x00001F99 - "\x1f*\x03E\x00\x00\x1f\x9a" + // 0x1F2A0345: 0x00001F9A - "\x1f+\x03E\x00\x00\x1f\x9b" + // 0x1F2B0345: 0x00001F9B - "\x1f,\x03E\x00\x00\x1f\x9c" + // 0x1F2C0345: 0x00001F9C - "\x1f-\x03E\x00\x00\x1f\x9d" + // 0x1F2D0345: 0x00001F9D - "\x1f.\x03E\x00\x00\x1f\x9e" + // 0x1F2E0345: 0x00001F9E - "\x1f/\x03E\x00\x00\x1f\x9f" + // 0x1F2F0345: 0x00001F9F - "\x1f`\x03E\x00\x00\x1f\xa0" + // 0x1F600345: 0x00001FA0 - "\x1fa\x03E\x00\x00\x1f\xa1" + // 0x1F610345: 0x00001FA1 - "\x1fb\x03E\x00\x00\x1f\xa2" + // 0x1F620345: 0x00001FA2 - "\x1fc\x03E\x00\x00\x1f\xa3" + // 0x1F630345: 0x00001FA3 - "\x1fd\x03E\x00\x00\x1f\xa4" + // 0x1F640345: 0x00001FA4 - "\x1fe\x03E\x00\x00\x1f\xa5" + // 0x1F650345: 0x00001FA5 - "\x1ff\x03E\x00\x00\x1f\xa6" + // 0x1F660345: 0x00001FA6 - "\x1fg\x03E\x00\x00\x1f\xa7" + // 0x1F670345: 0x00001FA7 - "\x1fh\x03E\x00\x00\x1f\xa8" + // 0x1F680345: 0x00001FA8 - "\x1fi\x03E\x00\x00\x1f\xa9" + // 0x1F690345: 0x00001FA9 - "\x1fj\x03E\x00\x00\x1f\xaa" + // 0x1F6A0345: 0x00001FAA - "\x1fk\x03E\x00\x00\x1f\xab" + // 0x1F6B0345: 0x00001FAB - "\x1fl\x03E\x00\x00\x1f\xac" + // 0x1F6C0345: 0x00001FAC - "\x1fm\x03E\x00\x00\x1f\xad" + // 0x1F6D0345: 0x00001FAD - "\x1fn\x03E\x00\x00\x1f\xae" + // 0x1F6E0345: 0x00001FAE - "\x1fo\x03E\x00\x00\x1f\xaf" + // 0x1F6F0345: 0x00001FAF - "\x03\xb1\x03\x06\x00\x00\x1f\xb0" + // 0x03B10306: 0x00001FB0 - "\x03\xb1\x03\x04\x00\x00\x1f\xb1" + // 0x03B10304: 0x00001FB1 - "\x1fp\x03E\x00\x00\x1f\xb2" + // 0x1F700345: 0x00001FB2 - "\x03\xb1\x03E\x00\x00\x1f\xb3" + // 0x03B10345: 0x00001FB3 - "\x03\xac\x03E\x00\x00\x1f\xb4" + // 0x03AC0345: 0x00001FB4 - "\x03\xb1\x03B\x00\x00\x1f\xb6" + // 0x03B10342: 0x00001FB6 - "\x1f\xb6\x03E\x00\x00\x1f\xb7" + // 0x1FB60345: 0x00001FB7 - "\x03\x91\x03\x06\x00\x00\x1f\xb8" + // 0x03910306: 0x00001FB8 - "\x03\x91\x03\x04\x00\x00\x1f\xb9" + // 0x03910304: 0x00001FB9 - "\x03\x91\x03\x00\x00\x00\x1f\xba" + // 0x03910300: 0x00001FBA - "\x03\x91\x03E\x00\x00\x1f\xbc" + // 0x03910345: 0x00001FBC - "\x00\xa8\x03B\x00\x00\x1f\xc1" + // 0x00A80342: 0x00001FC1 - "\x1ft\x03E\x00\x00\x1f\xc2" + // 0x1F740345: 0x00001FC2 - "\x03\xb7\x03E\x00\x00\x1f\xc3" + // 0x03B70345: 0x00001FC3 - "\x03\xae\x03E\x00\x00\x1f\xc4" + // 0x03AE0345: 0x00001FC4 - "\x03\xb7\x03B\x00\x00\x1f\xc6" + // 0x03B70342: 0x00001FC6 - "\x1f\xc6\x03E\x00\x00\x1f\xc7" + // 0x1FC60345: 0x00001FC7 - "\x03\x95\x03\x00\x00\x00\x1f\xc8" + // 0x03950300: 0x00001FC8 - "\x03\x97\x03\x00\x00\x00\x1f\xca" + // 0x03970300: 0x00001FCA - "\x03\x97\x03E\x00\x00\x1f\xcc" + // 0x03970345: 0x00001FCC - "\x1f\xbf\x03\x00\x00\x00\x1f\xcd" + // 0x1FBF0300: 0x00001FCD - "\x1f\xbf\x03\x01\x00\x00\x1f\xce" + // 0x1FBF0301: 0x00001FCE - "\x1f\xbf\x03B\x00\x00\x1f\xcf" + // 0x1FBF0342: 0x00001FCF - "\x03\xb9\x03\x06\x00\x00\x1f\xd0" + // 0x03B90306: 0x00001FD0 - "\x03\xb9\x03\x04\x00\x00\x1f\xd1" + // 0x03B90304: 0x00001FD1 - "\x03\xca\x03\x00\x00\x00\x1f\xd2" + // 0x03CA0300: 0x00001FD2 - "\x03\xb9\x03B\x00\x00\x1f\xd6" + // 0x03B90342: 0x00001FD6 - "\x03\xca\x03B\x00\x00\x1f\xd7" + // 0x03CA0342: 0x00001FD7 - "\x03\x99\x03\x06\x00\x00\x1f\xd8" + // 0x03990306: 0x00001FD8 - "\x03\x99\x03\x04\x00\x00\x1f\xd9" + // 0x03990304: 0x00001FD9 - "\x03\x99\x03\x00\x00\x00\x1f\xda" + // 0x03990300: 0x00001FDA - "\x1f\xfe\x03\x00\x00\x00\x1f\xdd" + // 0x1FFE0300: 0x00001FDD - "\x1f\xfe\x03\x01\x00\x00\x1f\xde" + // 0x1FFE0301: 0x00001FDE - "\x1f\xfe\x03B\x00\x00\x1f\xdf" + // 0x1FFE0342: 0x00001FDF - "\x03\xc5\x03\x06\x00\x00\x1f\xe0" + // 0x03C50306: 0x00001FE0 - "\x03\xc5\x03\x04\x00\x00\x1f\xe1" + // 0x03C50304: 0x00001FE1 - "\x03\xcb\x03\x00\x00\x00\x1f\xe2" + // 0x03CB0300: 0x00001FE2 - "\x03\xc1\x03\x13\x00\x00\x1f\xe4" + // 0x03C10313: 0x00001FE4 - "\x03\xc1\x03\x14\x00\x00\x1f\xe5" + // 0x03C10314: 0x00001FE5 - "\x03\xc5\x03B\x00\x00\x1f\xe6" + // 0x03C50342: 0x00001FE6 - "\x03\xcb\x03B\x00\x00\x1f\xe7" + // 0x03CB0342: 0x00001FE7 - "\x03\xa5\x03\x06\x00\x00\x1f\xe8" + // 0x03A50306: 0x00001FE8 - "\x03\xa5\x03\x04\x00\x00\x1f\xe9" + // 0x03A50304: 0x00001FE9 - "\x03\xa5\x03\x00\x00\x00\x1f\xea" + // 0x03A50300: 0x00001FEA - "\x03\xa1\x03\x14\x00\x00\x1f\xec" + // 0x03A10314: 0x00001FEC - "\x00\xa8\x03\x00\x00\x00\x1f\xed" + // 0x00A80300: 0x00001FED - "\x1f|\x03E\x00\x00\x1f\xf2" + // 0x1F7C0345: 0x00001FF2 - "\x03\xc9\x03E\x00\x00\x1f\xf3" + // 0x03C90345: 0x00001FF3 - "\x03\xce\x03E\x00\x00\x1f\xf4" + // 0x03CE0345: 0x00001FF4 - "\x03\xc9\x03B\x00\x00\x1f\xf6" + // 0x03C90342: 0x00001FF6 - "\x1f\xf6\x03E\x00\x00\x1f\xf7" + // 0x1FF60345: 0x00001FF7 - "\x03\x9f\x03\x00\x00\x00\x1f\xf8" + // 0x039F0300: 0x00001FF8 - "\x03\xa9\x03\x00\x00\x00\x1f\xfa" + // 0x03A90300: 0x00001FFA - "\x03\xa9\x03E\x00\x00\x1f\xfc" + // 0x03A90345: 0x00001FFC - "!\x90\x038\x00\x00!\x9a" + // 0x21900338: 0x0000219A - "!\x92\x038\x00\x00!\x9b" + // 0x21920338: 0x0000219B - "!\x94\x038\x00\x00!\xae" + // 0x21940338: 0x000021AE - "!\xd0\x038\x00\x00!\xcd" + // 0x21D00338: 0x000021CD - "!\xd4\x038\x00\x00!\xce" + // 0x21D40338: 0x000021CE - "!\xd2\x038\x00\x00!\xcf" + // 0x21D20338: 0x000021CF - "\"\x03\x038\x00\x00\"\x04" + // 0x22030338: 0x00002204 - "\"\b\x038\x00\x00\"\t" + // 0x22080338: 0x00002209 - "\"\v\x038\x00\x00\"\f" + // 0x220B0338: 0x0000220C - "\"#\x038\x00\x00\"$" + // 0x22230338: 0x00002224 - "\"%\x038\x00\x00\"&" + // 0x22250338: 0x00002226 - "\"<\x038\x00\x00\"A" + // 0x223C0338: 0x00002241 - "\"C\x038\x00\x00\"D" + // 0x22430338: 0x00002244 - "\"E\x038\x00\x00\"G" + // 0x22450338: 0x00002247 - "\"H\x038\x00\x00\"I" + // 0x22480338: 0x00002249 - "\x00=\x038\x00\x00\"`" + // 0x003D0338: 0x00002260 - "\"a\x038\x00\x00\"b" + // 0x22610338: 0x00002262 - "\"M\x038\x00\x00\"m" + // 0x224D0338: 0x0000226D - "\x00<\x038\x00\x00\"n" + // 0x003C0338: 0x0000226E - "\x00>\x038\x00\x00\"o" + // 0x003E0338: 0x0000226F - "\"d\x038\x00\x00\"p" + // 0x22640338: 0x00002270 - "\"e\x038\x00\x00\"q" + // 0x22650338: 0x00002271 - "\"r\x038\x00\x00\"t" + // 0x22720338: 0x00002274 - "\"s\x038\x00\x00\"u" + // 0x22730338: 0x00002275 - "\"v\x038\x00\x00\"x" + // 0x22760338: 0x00002278 - "\"w\x038\x00\x00\"y" + // 0x22770338: 0x00002279 - "\"z\x038\x00\x00\"\x80" + // 0x227A0338: 0x00002280 - "\"{\x038\x00\x00\"\x81" + // 0x227B0338: 0x00002281 - "\"\x82\x038\x00\x00\"\x84" + // 0x22820338: 0x00002284 - "\"\x83\x038\x00\x00\"\x85" + // 0x22830338: 0x00002285 - "\"\x86\x038\x00\x00\"\x88" + // 0x22860338: 0x00002288 - "\"\x87\x038\x00\x00\"\x89" + // 0x22870338: 0x00002289 - "\"\xa2\x038\x00\x00\"\xac" + // 0x22A20338: 0x000022AC - "\"\xa8\x038\x00\x00\"\xad" + // 0x22A80338: 0x000022AD - "\"\xa9\x038\x00\x00\"\xae" + // 0x22A90338: 0x000022AE - "\"\xab\x038\x00\x00\"\xaf" + // 0x22AB0338: 0x000022AF - "\"|\x038\x00\x00\"\xe0" + // 0x227C0338: 0x000022E0 - "\"}\x038\x00\x00\"\xe1" + // 0x227D0338: 0x000022E1 - "\"\x91\x038\x00\x00\"\xe2" + // 0x22910338: 0x000022E2 - "\"\x92\x038\x00\x00\"\xe3" + // 0x22920338: 0x000022E3 - "\"\xb2\x038\x00\x00\"\xea" + // 0x22B20338: 0x000022EA - "\"\xb3\x038\x00\x00\"\xeb" + // 0x22B30338: 0x000022EB - "\"\xb4\x038\x00\x00\"\xec" + // 0x22B40338: 0x000022EC - "\"\xb5\x038\x00\x00\"\xed" + // 0x22B50338: 0x000022ED - "0K0\x99\x00\x000L" + // 0x304B3099: 0x0000304C - "0M0\x99\x00\x000N" + // 0x304D3099: 0x0000304E - "0O0\x99\x00\x000P" + // 0x304F3099: 0x00003050 - "0Q0\x99\x00\x000R" + // 0x30513099: 0x00003052 - "0S0\x99\x00\x000T" + // 0x30533099: 0x00003054 - "0U0\x99\x00\x000V" + // 0x30553099: 0x00003056 - "0W0\x99\x00\x000X" + // 0x30573099: 0x00003058 - "0Y0\x99\x00\x000Z" + // 0x30593099: 0x0000305A - "0[0\x99\x00\x000\\" + // 0x305B3099: 0x0000305C - "0]0\x99\x00\x000^" + // 0x305D3099: 0x0000305E - "0_0\x99\x00\x000`" + // 0x305F3099: 0x00003060 - "0a0\x99\x00\x000b" + // 0x30613099: 0x00003062 - "0d0\x99\x00\x000e" + // 0x30643099: 0x00003065 - "0f0\x99\x00\x000g" + // 0x30663099: 0x00003067 - "0h0\x99\x00\x000i" + // 0x30683099: 0x00003069 - "0o0\x99\x00\x000p" + // 0x306F3099: 0x00003070 - "0o0\x9a\x00\x000q" + // 0x306F309A: 0x00003071 - "0r0\x99\x00\x000s" + // 0x30723099: 0x00003073 - "0r0\x9a\x00\x000t" + // 0x3072309A: 0x00003074 - "0u0\x99\x00\x000v" + // 0x30753099: 0x00003076 - "0u0\x9a\x00\x000w" + // 0x3075309A: 0x00003077 - "0x0\x99\x00\x000y" + // 0x30783099: 0x00003079 - "0x0\x9a\x00\x000z" + // 0x3078309A: 0x0000307A - "0{0\x99\x00\x000|" + // 0x307B3099: 0x0000307C - "0{0\x9a\x00\x000}" + // 0x307B309A: 0x0000307D - "0F0\x99\x00\x000\x94" + // 0x30463099: 0x00003094 - "0\x9d0\x99\x00\x000\x9e" + // 0x309D3099: 0x0000309E - "0\xab0\x99\x00\x000\xac" + // 0x30AB3099: 0x000030AC - "0\xad0\x99\x00\x000\xae" + // 0x30AD3099: 0x000030AE - "0\xaf0\x99\x00\x000\xb0" + // 0x30AF3099: 0x000030B0 - "0\xb10\x99\x00\x000\xb2" + // 0x30B13099: 0x000030B2 - "0\xb30\x99\x00\x000\xb4" + // 0x30B33099: 0x000030B4 - "0\xb50\x99\x00\x000\xb6" + // 0x30B53099: 0x000030B6 - "0\xb70\x99\x00\x000\xb8" + // 0x30B73099: 0x000030B8 - "0\xb90\x99\x00\x000\xba" + // 0x30B93099: 0x000030BA - "0\xbb0\x99\x00\x000\xbc" + // 0x30BB3099: 0x000030BC - "0\xbd0\x99\x00\x000\xbe" + // 0x30BD3099: 0x000030BE - "0\xbf0\x99\x00\x000\xc0" + // 0x30BF3099: 0x000030C0 - "0\xc10\x99\x00\x000\xc2" + // 0x30C13099: 0x000030C2 - "0\xc40\x99\x00\x000\xc5" + // 0x30C43099: 0x000030C5 - "0\xc60\x99\x00\x000\xc7" + // 0x30C63099: 0x000030C7 - "0\xc80\x99\x00\x000\xc9" + // 0x30C83099: 0x000030C9 - "0\xcf0\x99\x00\x000\xd0" + // 0x30CF3099: 0x000030D0 - "0\xcf0\x9a\x00\x000\xd1" + // 0x30CF309A: 0x000030D1 - "0\xd20\x99\x00\x000\xd3" + // 0x30D23099: 0x000030D3 - "0\xd20\x9a\x00\x000\xd4" + // 0x30D2309A: 0x000030D4 - "0\xd50\x99\x00\x000\xd6" + // 0x30D53099: 0x000030D6 - "0\xd50\x9a\x00\x000\xd7" + // 0x30D5309A: 0x000030D7 - "0\xd80\x99\x00\x000\xd9" + // 0x30D83099: 0x000030D9 - "0\xd80\x9a\x00\x000\xda" + // 0x30D8309A: 0x000030DA - "0\xdb0\x99\x00\x000\xdc" + // 0x30DB3099: 0x000030DC - "0\xdb0\x9a\x00\x000\xdd" + // 0x30DB309A: 0x000030DD - "0\xa60\x99\x00\x000\xf4" + // 0x30A63099: 0x000030F4 - "0\xef0\x99\x00\x000\xf7" + // 0x30EF3099: 0x000030F7 - "0\xf00\x99\x00\x000\xf8" + // 0x30F03099: 0x000030F8 - "0\xf10\x99\x00\x000\xf9" + // 0x30F13099: 0x000030F9 - "0\xf20\x99\x00\x000\xfa" + // 0x30F23099: 0x000030FA - "0\xfd0\x99\x00\x000\xfe" + // 0x30FD3099: 0x000030FE - "\x05\xd2\x03\a\x00\x01\x05\xc9" + // 0x05D20307: 0x000105C9 - "\x05\xda\x03\a\x00\x01\x05\xe4" + // 0x05DA0307: 0x000105E4 - "\x10\x99\x10\xba\x00\x01\x10\x9a" + // 0x109910BA: 0x0001109A - "\x10\x9b\x10\xba\x00\x01\x10\x9c" + // 0x109B10BA: 0x0001109C - "\x10\xa5\x10\xba\x00\x01\x10\xab" + // 0x10A510BA: 0x000110AB - "\x111\x11'\x00\x01\x11." + // 0x11311127: 0x0001112E - "\x112\x11'\x00\x01\x11/" + // 0x11321127: 0x0001112F - "\x13G\x13>\x00\x01\x13K" + // 0x1347133E: 0x0001134B - "\x13G\x13W\x00\x01\x13L" + // 0x13471357: 0x0001134C - "\x13\x82\x13\xc9\x00\x01\x13\x83" + // 0x138213C9: 0x00011383 - "\x13\x84\x13\xbb\x00\x01\x13\x85" + // 0x138413BB: 0x00011385 - "\x13\x8b\x13\xc2\x00\x01\x13\x8e" + // 0x138B13C2: 0x0001138E - "\x13\x90\x13\xc9\x00\x01\x13\x91" + // 0x139013C9: 0x00011391 - "\x13\xc2\x13\xc2\x00\x01\x13\xc5" + // 0x13C213C2: 0x000113C5 - "\x13\xc2\x13\xb8\x00\x01\x13\xc7" + // 0x13C213B8: 0x000113C7 - "\x13\xc2\x13\xc9\x00\x01\x13\xc8" + // 0x13C213C9: 0x000113C8 - "\x14\xb9\x14\xba\x00\x01\x14\xbb" + // 0x14B914BA: 0x000114BB - "\x14\xb9\x14\xb0\x00\x01\x14\xbc" + // 0x14B914B0: 0x000114BC - "\x14\xb9\x14\xbd\x00\x01\x14\xbe" + // 0x14B914BD: 0x000114BE - "\x15\xb8\x15\xaf\x00\x01\x15\xba" + // 0x15B815AF: 0x000115BA - "\x15\xb9\x15\xaf\x00\x01\x15\xbb" + // 0x15B915AF: 0x000115BB - "\x195\x190\x00\x01\x198" + // 0x19351930: 0x00011938 - "a\x1ea\x1e\x00\x01a!" + // 0x611E611E: 0x00016121 - "a\x1ea)\x00\x01a\"" + // 0x611E6129: 0x00016122 - "a\x1ea\x1f\x00\x01a#" + // 0x611E611F: 0x00016123 - "a)a\x1f\x00\x01a$" + // 0x6129611F: 0x00016124 - "a\x1ea \x00\x01a%" + // 0x611E6120: 0x00016125 - "a!a\x1f\x00\x01a&" + // 0x6121611F: 0x00016126 - "a\"a\x1f\x00\x01a'" + // 0x6122611F: 0x00016127 - "a!a \x00\x01a(" + // 0x61216120: 0x00016128 - "mgmg\x00\x01mh" + // 0x6D676D67: 0x00016D68 - "mcmg\x00\x01mi" + // 0x6D636D67: 0x00016D69 - "mimg\x00\x01mj" + // 0x6D696D67: 0x00016D6A + "\x00\x01\x04\x00`\x00\x00\xc0" + // 0x00041 0x00300: 0x000C0 + "\x00\x01\x04\x00` \x00\xc1" + // 0x00041 0x00301: 0x000C1 + "\x00\x01\x04\x00`@\x00\xc2" + // 0x00041 0x00302: 0x000C2 + "\x00\x01\x04\x00``\x00\xc3" + // 0x00041 0x00303: 0x000C3 + "\x00\x01\x04\x00a\x00\x00\xc4" + // 0x00041 0x00308: 0x000C4 + "\x00\x01\x04\x00a@\x00\xc5" + // 0x00041 0x0030A: 0x000C5 + "\x00\x01\f\x00d\xe0\x00\xc7" + // 0x00043 0x00327: 0x000C7 + "\x00\x01\x14\x00`\x00\x00\xc8" + // 0x00045 0x00300: 0x000C8 + "\x00\x01\x14\x00` \x00\xc9" + // 0x00045 0x00301: 0x000C9 + "\x00\x01\x14\x00`@\x00\xca" + // 0x00045 0x00302: 0x000CA + "\x00\x01\x14\x00a\x00\x00\xcb" + // 0x00045 0x00308: 0x000CB + "\x00\x01$\x00`\x00\x00\xcc" + // 0x00049 0x00300: 0x000CC + "\x00\x01$\x00` \x00\xcd" + // 0x00049 0x00301: 0x000CD + "\x00\x01$\x00`@\x00\xce" + // 0x00049 0x00302: 0x000CE + "\x00\x01$\x00a\x00\x00\xcf" + // 0x00049 0x00308: 0x000CF + "\x00\x018\x00``\x00\xd1" + // 0x0004E 0x00303: 0x000D1 + "\x00\x01<\x00`\x00\x00\xd2" + // 0x0004F 0x00300: 0x000D2 + "\x00\x01<\x00` \x00\xd3" + // 0x0004F 0x00301: 0x000D3 + "\x00\x01<\x00`@\x00\xd4" + // 0x0004F 0x00302: 0x000D4 + "\x00\x01<\x00``\x00\xd5" + // 0x0004F 0x00303: 0x000D5 + "\x00\x01<\x00a\x00\x00\xd6" + // 0x0004F 0x00308: 0x000D6 + "\x00\x01T\x00`\x00\x00\xd9" + // 0x00055 0x00300: 0x000D9 + "\x00\x01T\x00` \x00\xda" + // 0x00055 0x00301: 0x000DA + "\x00\x01T\x00`@\x00\xdb" + // 0x00055 0x00302: 0x000DB + "\x00\x01T\x00a\x00\x00\xdc" + // 0x00055 0x00308: 0x000DC + "\x00\x01d\x00` \x00\xdd" + // 0x00059 0x00301: 0x000DD + "\x00\x01\x84\x00`\x00\x00\xe0" + // 0x00061 0x00300: 0x000E0 + "\x00\x01\x84\x00` \x00\xe1" + // 0x00061 0x00301: 0x000E1 + "\x00\x01\x84\x00`@\x00\xe2" + // 0x00061 0x00302: 0x000E2 + "\x00\x01\x84\x00``\x00\xe3" + // 0x00061 0x00303: 0x000E3 + "\x00\x01\x84\x00a\x00\x00\xe4" + // 0x00061 0x00308: 0x000E4 + "\x00\x01\x84\x00a@\x00\xe5" + // 0x00061 0x0030A: 0x000E5 + "\x00\x01\x8c\x00d\xe0\x00\xe7" + // 0x00063 0x00327: 0x000E7 + "\x00\x01\x94\x00`\x00\x00\xe8" + // 0x00065 0x00300: 0x000E8 + "\x00\x01\x94\x00` \x00\xe9" + // 0x00065 0x00301: 0x000E9 + "\x00\x01\x94\x00`@\x00\xea" + // 0x00065 0x00302: 0x000EA + "\x00\x01\x94\x00a\x00\x00\xeb" + // 0x00065 0x00308: 0x000EB + "\x00\x01\xa4\x00`\x00\x00\xec" + // 0x00069 0x00300: 0x000EC + "\x00\x01\xa4\x00` \x00\xed" + // 0x00069 0x00301: 0x000ED + "\x00\x01\xa4\x00`@\x00\xee" + // 0x00069 0x00302: 0x000EE + "\x00\x01\xa4\x00a\x00\x00\xef" + // 0x00069 0x00308: 0x000EF + "\x00\x01\xb8\x00``\x00\xf1" + // 0x0006E 0x00303: 0x000F1 + "\x00\x01\xbc\x00`\x00\x00\xf2" + // 0x0006F 0x00300: 0x000F2 + "\x00\x01\xbc\x00` \x00\xf3" + // 0x0006F 0x00301: 0x000F3 + "\x00\x01\xbc\x00`@\x00\xf4" + // 0x0006F 0x00302: 0x000F4 + "\x00\x01\xbc\x00``\x00\xf5" + // 0x0006F 0x00303: 0x000F5 + "\x00\x01\xbc\x00a\x00\x00\xf6" + // 0x0006F 0x00308: 0x000F6 + "\x00\x01\xd4\x00`\x00\x00\xf9" + // 0x00075 0x00300: 0x000F9 + "\x00\x01\xd4\x00` \x00\xfa" + // 0x00075 0x00301: 0x000FA + "\x00\x01\xd4\x00`@\x00\xfb" + // 0x00075 0x00302: 0x000FB + "\x00\x01\xd4\x00a\x00\x00\xfc" + // 0x00075 0x00308: 0x000FC + "\x00\x01\xe4\x00` \x00\xfd" + // 0x00079 0x00301: 0x000FD + "\x00\x01\xe4\x00a\x00\x00\xff" + // 0x00079 0x00308: 0x000FF + "\x00\x01\x04\x00`\x80\x01\x00" + // 0x00041 0x00304: 0x00100 + "\x00\x01\x84\x00`\x80\x01\x01" + // 0x00061 0x00304: 0x00101 + "\x00\x01\x04\x00`\xc0\x01\x02" + // 0x00041 0x00306: 0x00102 + "\x00\x01\x84\x00`\xc0\x01\x03" + // 0x00061 0x00306: 0x00103 + "\x00\x01\x04\x00e\x00\x01\x04" + // 0x00041 0x00328: 0x00104 + "\x00\x01\x84\x00e\x00\x01\x05" + // 0x00061 0x00328: 0x00105 + "\x00\x01\f\x00` \x01\x06" + // 0x00043 0x00301: 0x00106 + "\x00\x01\x8c\x00` \x01\a" + // 0x00063 0x00301: 0x00107 + "\x00\x01\f\x00`@\x01\b" + // 0x00043 0x00302: 0x00108 + "\x00\x01\x8c\x00`@\x01\t" + // 0x00063 0x00302: 0x00109 + "\x00\x01\f\x00`\xe0\x01\n" + // 0x00043 0x00307: 0x0010A + "\x00\x01\x8c\x00`\xe0\x01\v" + // 0x00063 0x00307: 0x0010B + "\x00\x01\f\x00a\x80\x01\f" + // 0x00043 0x0030C: 0x0010C + "\x00\x01\x8c\x00a\x80\x01\r" + // 0x00063 0x0030C: 0x0010D + "\x00\x01\x10\x00a\x80\x01\x0e" + // 0x00044 0x0030C: 0x0010E + "\x00\x01\x90\x00a\x80\x01\x0f" + // 0x00064 0x0030C: 0x0010F + "\x00\x01\x14\x00`\x80\x01\x12" + // 0x00045 0x00304: 0x00112 + "\x00\x01\x94\x00`\x80\x01\x13" + // 0x00065 0x00304: 0x00113 + "\x00\x01\x14\x00`\xc0\x01\x14" + // 0x00045 0x00306: 0x00114 + "\x00\x01\x94\x00`\xc0\x01\x15" + // 0x00065 0x00306: 0x00115 + "\x00\x01\x14\x00`\xe0\x01\x16" + // 0x00045 0x00307: 0x00116 + "\x00\x01\x94\x00`\xe0\x01\x17" + // 0x00065 0x00307: 0x00117 + "\x00\x01\x14\x00e\x00\x01\x18" + // 0x00045 0x00328: 0x00118 + "\x00\x01\x94\x00e\x00\x01\x19" + // 0x00065 0x00328: 0x00119 + "\x00\x01\x14\x00a\x80\x01\x1a" + // 0x00045 0x0030C: 0x0011A + "\x00\x01\x94\x00a\x80\x01\x1b" + // 0x00065 0x0030C: 0x0011B + "\x00\x01\x1c\x00`@\x01\x1c" + // 0x00047 0x00302: 0x0011C + "\x00\x01\x9c\x00`@\x01\x1d" + // 0x00067 0x00302: 0x0011D + "\x00\x01\x1c\x00`\xc0\x01\x1e" + // 0x00047 0x00306: 0x0011E + "\x00\x01\x9c\x00`\xc0\x01\x1f" + // 0x00067 0x00306: 0x0011F + "\x00\x01\x1c\x00`\xe0\x01 " + // 0x00047 0x00307: 0x00120 + "\x00\x01\x9c\x00`\xe0\x01!" + // 0x00067 0x00307: 0x00121 + "\x00\x01\x1c\x00d\xe0\x01\"" + // 0x00047 0x00327: 0x00122 + "\x00\x01\x9c\x00d\xe0\x01#" + // 0x00067 0x00327: 0x00123 + "\x00\x01 \x00`@\x01$" + // 0x00048 0x00302: 0x00124 + "\x00\x01\xa0\x00`@\x01%" + // 0x00068 0x00302: 0x00125 + "\x00\x01$\x00``\x01(" + // 0x00049 0x00303: 0x00128 + "\x00\x01\xa4\x00``\x01)" + // 0x00069 0x00303: 0x00129 + "\x00\x01$\x00`\x80\x01*" + // 0x00049 0x00304: 0x0012A + "\x00\x01\xa4\x00`\x80\x01+" + // 0x00069 0x00304: 0x0012B + "\x00\x01$\x00`\xc0\x01," + // 0x00049 0x00306: 0x0012C + "\x00\x01\xa4\x00`\xc0\x01-" + // 0x00069 0x00306: 0x0012D + "\x00\x01$\x00e\x00\x01." + // 0x00049 0x00328: 0x0012E + "\x00\x01\xa4\x00e\x00\x01/" + // 0x00069 0x00328: 0x0012F + "\x00\x01$\x00`\xe0\x010" + // 0x00049 0x00307: 0x00130 + "\x00\x01(\x00`@\x014" + // 0x0004A 0x00302: 0x00134 + "\x00\x01\xa8\x00`@\x015" + // 0x0006A 0x00302: 0x00135 + "\x00\x01,\x00d\xe0\x016" + // 0x0004B 0x00327: 0x00136 + "\x00\x01\xac\x00d\xe0\x017" + // 0x0006B 0x00327: 0x00137 + "\x00\x010\x00` \x019" + // 0x0004C 0x00301: 0x00139 + "\x00\x01\xb0\x00` \x01:" + // 0x0006C 0x00301: 0x0013A + "\x00\x010\x00d\xe0\x01;" + // 0x0004C 0x00327: 0x0013B + "\x00\x01\xb0\x00d\xe0\x01<" + // 0x0006C 0x00327: 0x0013C + "\x00\x010\x00a\x80\x01=" + // 0x0004C 0x0030C: 0x0013D + "\x00\x01\xb0\x00a\x80\x01>" + // 0x0006C 0x0030C: 0x0013E + "\x00\x018\x00` \x01C" + // 0x0004E 0x00301: 0x00143 + "\x00\x01\xb8\x00` \x01D" + // 0x0006E 0x00301: 0x00144 + "\x00\x018\x00d\xe0\x01E" + // 0x0004E 0x00327: 0x00145 + "\x00\x01\xb8\x00d\xe0\x01F" + // 0x0006E 0x00327: 0x00146 + "\x00\x018\x00a\x80\x01G" + // 0x0004E 0x0030C: 0x00147 + "\x00\x01\xb8\x00a\x80\x01H" + // 0x0006E 0x0030C: 0x00148 + "\x00\x01<\x00`\x80\x01L" + // 0x0004F 0x00304: 0x0014C + "\x00\x01\xbc\x00`\x80\x01M" + // 0x0006F 0x00304: 0x0014D + "\x00\x01<\x00`\xc0\x01N" + // 0x0004F 0x00306: 0x0014E + "\x00\x01\xbc\x00`\xc0\x01O" + // 0x0006F 0x00306: 0x0014F + "\x00\x01<\x00a`\x01P" + // 0x0004F 0x0030B: 0x00150 + "\x00\x01\xbc\x00a`\x01Q" + // 0x0006F 0x0030B: 0x00151 + "\x00\x01H\x00` \x01T" + // 0x00052 0x00301: 0x00154 + "\x00\x01\xc8\x00` \x01U" + // 0x00072 0x00301: 0x00155 + "\x00\x01H\x00d\xe0\x01V" + // 0x00052 0x00327: 0x00156 + "\x00\x01\xc8\x00d\xe0\x01W" + // 0x00072 0x00327: 0x00157 + "\x00\x01H\x00a\x80\x01X" + // 0x00052 0x0030C: 0x00158 + "\x00\x01\xc8\x00a\x80\x01Y" + // 0x00072 0x0030C: 0x00159 + "\x00\x01L\x00` \x01Z" + // 0x00053 0x00301: 0x0015A + "\x00\x01\xcc\x00` \x01[" + // 0x00073 0x00301: 0x0015B + "\x00\x01L\x00`@\x01\\" + // 0x00053 0x00302: 0x0015C + "\x00\x01\xcc\x00`@\x01]" + // 0x00073 0x00302: 0x0015D + "\x00\x01L\x00d\xe0\x01^" + // 0x00053 0x00327: 0x0015E + "\x00\x01\xcc\x00d\xe0\x01_" + // 0x00073 0x00327: 0x0015F + "\x00\x01L\x00a\x80\x01`" + // 0x00053 0x0030C: 0x00160 + "\x00\x01\xcc\x00a\x80\x01a" + // 0x00073 0x0030C: 0x00161 + "\x00\x01P\x00d\xe0\x01b" + // 0x00054 0x00327: 0x00162 + "\x00\x01\xd0\x00d\xe0\x01c" + // 0x00074 0x00327: 0x00163 + "\x00\x01P\x00a\x80\x01d" + // 0x00054 0x0030C: 0x00164 + "\x00\x01\xd0\x00a\x80\x01e" + // 0x00074 0x0030C: 0x00165 + "\x00\x01T\x00``\x01h" + // 0x00055 0x00303: 0x00168 + "\x00\x01\xd4\x00``\x01i" + // 0x00075 0x00303: 0x00169 + "\x00\x01T\x00`\x80\x01j" + // 0x00055 0x00304: 0x0016A + "\x00\x01\xd4\x00`\x80\x01k" + // 0x00075 0x00304: 0x0016B + "\x00\x01T\x00`\xc0\x01l" + // 0x00055 0x00306: 0x0016C + "\x00\x01\xd4\x00`\xc0\x01m" + // 0x00075 0x00306: 0x0016D + "\x00\x01T\x00a@\x01n" + // 0x00055 0x0030A: 0x0016E + "\x00\x01\xd4\x00a@\x01o" + // 0x00075 0x0030A: 0x0016F + "\x00\x01T\x00a`\x01p" + // 0x00055 0x0030B: 0x00170 + "\x00\x01\xd4\x00a`\x01q" + // 0x00075 0x0030B: 0x00171 + "\x00\x01T\x00e\x00\x01r" + // 0x00055 0x00328: 0x00172 + "\x00\x01\xd4\x00e\x00\x01s" + // 0x00075 0x00328: 0x00173 + "\x00\x01\\\x00`@\x01t" + // 0x00057 0x00302: 0x00174 + "\x00\x01\xdc\x00`@\x01u" + // 0x00077 0x00302: 0x00175 + "\x00\x01d\x00`@\x01v" + // 0x00059 0x00302: 0x00176 + "\x00\x01\xe4\x00`@\x01w" + // 0x00079 0x00302: 0x00177 + "\x00\x01d\x00a\x00\x01x" + // 0x00059 0x00308: 0x00178 + "\x00\x01h\x00` \x01y" + // 0x0005A 0x00301: 0x00179 + "\x00\x01\xe8\x00` \x01z" + // 0x0007A 0x00301: 0x0017A + "\x00\x01h\x00`\xe0\x01{" + // 0x0005A 0x00307: 0x0017B + "\x00\x01\xe8\x00`\xe0\x01|" + // 0x0007A 0x00307: 0x0017C + "\x00\x01h\x00a\x80\x01}" + // 0x0005A 0x0030C: 0x0017D + "\x00\x01\xe8\x00a\x80\x01~" + // 0x0007A 0x0030C: 0x0017E + "\x00\x01<\x00c`\x01\xa0" + // 0x0004F 0x0031B: 0x001A0 + "\x00\x01\xbc\x00c`\x01\xa1" + // 0x0006F 0x0031B: 0x001A1 + "\x00\x01T\x00c`\x01\xaf" + // 0x00055 0x0031B: 0x001AF + "\x00\x01\xd4\x00c`\x01\xb0" + // 0x00075 0x0031B: 0x001B0 + "\x00\x01\x04\x00a\x80\x01\xcd" + // 0x00041 0x0030C: 0x001CD + "\x00\x01\x84\x00a\x80\x01\xce" + // 0x00061 0x0030C: 0x001CE + "\x00\x01$\x00a\x80\x01\xcf" + // 0x00049 0x0030C: 0x001CF + "\x00\x01\xa4\x00a\x80\x01\xd0" + // 0x00069 0x0030C: 0x001D0 + "\x00\x01<\x00a\x80\x01\xd1" + // 0x0004F 0x0030C: 0x001D1 + "\x00\x01\xbc\x00a\x80\x01\xd2" + // 0x0006F 0x0030C: 0x001D2 + "\x00\x01T\x00a\x80\x01\xd3" + // 0x00055 0x0030C: 0x001D3 + "\x00\x01\xd4\x00a\x80\x01\xd4" + // 0x00075 0x0030C: 0x001D4 + "\x00\x03p\x00`\x80\x01\xd5" + // 0x000DC 0x00304: 0x001D5 + "\x00\x03\xf0\x00`\x80\x01\xd6" + // 0x000FC 0x00304: 0x001D6 + "\x00\x03p\x00` \x01\xd7" + // 0x000DC 0x00301: 0x001D7 + "\x00\x03\xf0\x00` \x01\xd8" + // 0x000FC 0x00301: 0x001D8 + "\x00\x03p\x00a\x80\x01\xd9" + // 0x000DC 0x0030C: 0x001D9 + "\x00\x03\xf0\x00a\x80\x01\xda" + // 0x000FC 0x0030C: 0x001DA + "\x00\x03p\x00`\x00\x01\xdb" + // 0x000DC 0x00300: 0x001DB + "\x00\x03\xf0\x00`\x00\x01\xdc" + // 0x000FC 0x00300: 0x001DC + "\x00\x03\x10\x00`\x80\x01\xde" + // 0x000C4 0x00304: 0x001DE + "\x00\x03\x90\x00`\x80\x01\xdf" + // 0x000E4 0x00304: 0x001DF + "\x00\b\x98\x00`\x80\x01\xe0" + // 0x00226 0x00304: 0x001E0 + "\x00\b\x9c\x00`\x80\x01\xe1" + // 0x00227 0x00304: 0x001E1 + "\x00\x03\x18\x00`\x80\x01\xe2" + // 0x000C6 0x00304: 0x001E2 + "\x00\x03\x98\x00`\x80\x01\xe3" + // 0x000E6 0x00304: 0x001E3 + "\x00\x01\x1c\x00a\x80\x01\xe6" + // 0x00047 0x0030C: 0x001E6 + "\x00\x01\x9c\x00a\x80\x01\xe7" + // 0x00067 0x0030C: 0x001E7 + "\x00\x01,\x00a\x80\x01\xe8" + // 0x0004B 0x0030C: 0x001E8 + "\x00\x01\xac\x00a\x80\x01\xe9" + // 0x0006B 0x0030C: 0x001E9 + "\x00\x01<\x00e\x00\x01\xea" + // 0x0004F 0x00328: 0x001EA + "\x00\x01\xbc\x00e\x00\x01\xeb" + // 0x0006F 0x00328: 0x001EB + "\x00\a\xa8\x00`\x80\x01\xec" + // 0x001EA 0x00304: 0x001EC + "\x00\a\xac\x00`\x80\x01\xed" + // 0x001EB 0x00304: 0x001ED + "\x00\x06\xdc\x00a\x80\x01\xee" + // 0x001B7 0x0030C: 0x001EE + "\x00\nH\x00a\x80\x01\xef" + // 0x00292 0x0030C: 0x001EF + "\x00\x01\xa8\x00a\x80\x01\xf0" + // 0x0006A 0x0030C: 0x001F0 + "\x00\x01\x1c\x00` \x01\xf4" + // 0x00047 0x00301: 0x001F4 + "\x00\x01\x9c\x00` \x01\xf5" + // 0x00067 0x00301: 0x001F5 + "\x00\x018\x00`\x00\x01\xf8" + // 0x0004E 0x00300: 0x001F8 + "\x00\x01\xb8\x00`\x00\x01\xf9" + // 0x0006E 0x00300: 0x001F9 + "\x00\x03\x14\x00` \x01\xfa" + // 0x000C5 0x00301: 0x001FA + "\x00\x03\x94\x00` \x01\xfb" + // 0x000E5 0x00301: 0x001FB + "\x00\x03\x18\x00` \x01\xfc" + // 0x000C6 0x00301: 0x001FC + "\x00\x03\x98\x00` \x01\xfd" + // 0x000E6 0x00301: 0x001FD + "\x00\x03`\x00` \x01\xfe" + // 0x000D8 0x00301: 0x001FE + "\x00\x03\xe0\x00` \x01\xff" + // 0x000F8 0x00301: 0x001FF + "\x00\x01\x04\x00a\xe0\x02\x00" + // 0x00041 0x0030F: 0x00200 + "\x00\x01\x84\x00a\xe0\x02\x01" + // 0x00061 0x0030F: 0x00201 + "\x00\x01\x04\x00b \x02\x02" + // 0x00041 0x00311: 0x00202 + "\x00\x01\x84\x00b \x02\x03" + // 0x00061 0x00311: 0x00203 + "\x00\x01\x14\x00a\xe0\x02\x04" + // 0x00045 0x0030F: 0x00204 + "\x00\x01\x94\x00a\xe0\x02\x05" + // 0x00065 0x0030F: 0x00205 + "\x00\x01\x14\x00b \x02\x06" + // 0x00045 0x00311: 0x00206 + "\x00\x01\x94\x00b \x02\a" + // 0x00065 0x00311: 0x00207 + "\x00\x01$\x00a\xe0\x02\b" + // 0x00049 0x0030F: 0x00208 + "\x00\x01\xa4\x00a\xe0\x02\t" + // 0x00069 0x0030F: 0x00209 + "\x00\x01$\x00b \x02\n" + // 0x00049 0x00311: 0x0020A + "\x00\x01\xa4\x00b \x02\v" + // 0x00069 0x00311: 0x0020B + "\x00\x01<\x00a\xe0\x02\f" + // 0x0004F 0x0030F: 0x0020C + "\x00\x01\xbc\x00a\xe0\x02\r" + // 0x0006F 0x0030F: 0x0020D + "\x00\x01<\x00b \x02\x0e" + // 0x0004F 0x00311: 0x0020E + "\x00\x01\xbc\x00b \x02\x0f" + // 0x0006F 0x00311: 0x0020F + "\x00\x01H\x00a\xe0\x02\x10" + // 0x00052 0x0030F: 0x00210 + "\x00\x01\xc8\x00a\xe0\x02\x11" + // 0x00072 0x0030F: 0x00211 + "\x00\x01H\x00b \x02\x12" + // 0x00052 0x00311: 0x00212 + "\x00\x01\xc8\x00b \x02\x13" + // 0x00072 0x00311: 0x00213 + "\x00\x01T\x00a\xe0\x02\x14" + // 0x00055 0x0030F: 0x00214 + "\x00\x01\xd4\x00a\xe0\x02\x15" + // 0x00075 0x0030F: 0x00215 + "\x00\x01T\x00b \x02\x16" + // 0x00055 0x00311: 0x00216 + "\x00\x01\xd4\x00b \x02\x17" + // 0x00075 0x00311: 0x00217 + "\x00\x01L\x00d\xc0\x02\x18" + // 0x00053 0x00326: 0x00218 + "\x00\x01\xcc\x00d\xc0\x02\x19" + // 0x00073 0x00326: 0x00219 + "\x00\x01P\x00d\xc0\x02\x1a" + // 0x00054 0x00326: 0x0021A + "\x00\x01\xd0\x00d\xc0\x02\x1b" + // 0x00074 0x00326: 0x0021B + "\x00\x01 \x00a\x80\x02\x1e" + // 0x00048 0x0030C: 0x0021E + "\x00\x01\xa0\x00a\x80\x02\x1f" + // 0x00068 0x0030C: 0x0021F + "\x00\x01\x04\x00`\xe0\x02&" + // 0x00041 0x00307: 0x00226 + "\x00\x01\x84\x00`\xe0\x02'" + // 0x00061 0x00307: 0x00227 + "\x00\x01\x14\x00d\xe0\x02(" + // 0x00045 0x00327: 0x00228 + "\x00\x01\x94\x00d\xe0\x02)" + // 0x00065 0x00327: 0x00229 + "\x00\x03X\x00`\x80\x02*" + // 0x000D6 0x00304: 0x0022A + "\x00\x03\xd8\x00`\x80\x02+" + // 0x000F6 0x00304: 0x0022B + "\x00\x03T\x00`\x80\x02," + // 0x000D5 0x00304: 0x0022C + "\x00\x03\xd4\x00`\x80\x02-" + // 0x000F5 0x00304: 0x0022D + "\x00\x01<\x00`\xe0\x02." + // 0x0004F 0x00307: 0x0022E + "\x00\x01\xbc\x00`\xe0\x02/" + // 0x0006F 0x00307: 0x0022F + "\x00\b\xb8\x00`\x80\x020" + // 0x0022E 0x00304: 0x00230 + "\x00\b\xbc\x00`\x80\x021" + // 0x0022F 0x00304: 0x00231 + "\x00\x01d\x00`\x80\x022" + // 0x00059 0x00304: 0x00232 + "\x00\x01\xe4\x00`\x80\x023" + // 0x00079 0x00304: 0x00233 + "\x00\x02\xa0\x00` \x03\x85" + // 0x000A8 0x00301: 0x00385 + "\x00\x0eD\x00` \x03\x86" + // 0x00391 0x00301: 0x00386 + "\x00\x0eT\x00` \x03\x88" + // 0x00395 0x00301: 0x00388 + "\x00\x0e\\\x00` \x03\x89" + // 0x00397 0x00301: 0x00389 + "\x00\x0ed\x00` \x03\x8a" + // 0x00399 0x00301: 0x0038A + "\x00\x0e|\x00` \x03\x8c" + // 0x0039F 0x00301: 0x0038C + "\x00\x0e\x94\x00` \x03\x8e" + // 0x003A5 0x00301: 0x0038E + "\x00\x0e\xa4\x00` \x03\x8f" + // 0x003A9 0x00301: 0x0038F + "\x00\x0f(\x00` \x03\x90" + // 0x003CA 0x00301: 0x00390 + "\x00\x0ed\x00a\x00\x03\xaa" + // 0x00399 0x00308: 0x003AA + "\x00\x0e\x94\x00a\x00\x03\xab" + // 0x003A5 0x00308: 0x003AB + "\x00\x0e\xc4\x00` \x03\xac" + // 0x003B1 0x00301: 0x003AC + "\x00\x0e\xd4\x00` \x03\xad" + // 0x003B5 0x00301: 0x003AD + "\x00\x0e\xdc\x00` \x03\xae" + // 0x003B7 0x00301: 0x003AE + "\x00\x0e\xe4\x00` \x03\xaf" + // 0x003B9 0x00301: 0x003AF + "\x00\x0f,\x00` \x03\xb0" + // 0x003CB 0x00301: 0x003B0 + "\x00\x0e\xe4\x00a\x00\x03\xca" + // 0x003B9 0x00308: 0x003CA + "\x00\x0f\x14\x00a\x00\x03\xcb" + // 0x003C5 0x00308: 0x003CB + "\x00\x0e\xfc\x00` \x03\xcc" + // 0x003BF 0x00301: 0x003CC + "\x00\x0f\x14\x00` \x03\xcd" + // 0x003C5 0x00301: 0x003CD + "\x00\x0f$\x00` \x03\xce" + // 0x003C9 0x00301: 0x003CE + "\x00\x0fH\x00` \x03\xd3" + // 0x003D2 0x00301: 0x003D3 + "\x00\x0fH\x00a\x00\x03\xd4" + // 0x003D2 0x00308: 0x003D4 + "\x00\x10T\x00`\x00\x04\x00" + // 0x00415 0x00300: 0x00400 + "\x00\x10T\x00a\x00\x04\x01" + // 0x00415 0x00308: 0x00401 + "\x00\x10L\x00` \x04\x03" + // 0x00413 0x00301: 0x00403 + "\x00\x10\x18\x00a\x00\x04\a" + // 0x00406 0x00308: 0x00407 + "\x00\x10h\x00` \x04\f" + // 0x0041A 0x00301: 0x0040C + "\x00\x10`\x00`\x00\x04\r" + // 0x00418 0x00300: 0x0040D + "\x00\x10\x8c\x00`\xc0\x04\x0e" + // 0x00423 0x00306: 0x0040E + "\x00\x10`\x00`\xc0\x04\x19" + // 0x00418 0x00306: 0x00419 + "\x00\x10\xe0\x00`\xc0\x049" + // 0x00438 0x00306: 0x00439 + "\x00\x10\xd4\x00`\x00\x04P" + // 0x00435 0x00300: 0x00450 + "\x00\x10\xd4\x00a\x00\x04Q" + // 0x00435 0x00308: 0x00451 + "\x00\x10\xcc\x00` \x04S" + // 0x00433 0x00301: 0x00453 + "\x00\x11X\x00a\x00\x04W" + // 0x00456 0x00308: 0x00457 + "\x00\x10\xe8\x00` \x04\\" + // 0x0043A 0x00301: 0x0045C + "\x00\x10\xe0\x00`\x00\x04]" + // 0x00438 0x00300: 0x0045D + "\x00\x11\f\x00`\xc0\x04^" + // 0x00443 0x00306: 0x0045E + "\x00\x11\xd0\x00a\xe0\x04v" + // 0x00474 0x0030F: 0x00476 + "\x00\x11\xd4\x00a\xe0\x04w" + // 0x00475 0x0030F: 0x00477 + "\x00\x10X\x00`\xc0\x04\xc1" + // 0x00416 0x00306: 0x004C1 + "\x00\x10\xd8\x00`\xc0\x04\xc2" + // 0x00436 0x00306: 0x004C2 + "\x00\x10@\x00`\xc0\x04\xd0" + // 0x00410 0x00306: 0x004D0 + "\x00\x10\xc0\x00`\xc0\x04\xd1" + // 0x00430 0x00306: 0x004D1 + "\x00\x10@\x00a\x00\x04\xd2" + // 0x00410 0x00308: 0x004D2 + "\x00\x10\xc0\x00a\x00\x04\xd3" + // 0x00430 0x00308: 0x004D3 + "\x00\x10T\x00`\xc0\x04\xd6" + // 0x00415 0x00306: 0x004D6 + "\x00\x10\xd4\x00`\xc0\x04\xd7" + // 0x00435 0x00306: 0x004D7 + "\x00\x13`\x00a\x00\x04\xda" + // 0x004D8 0x00308: 0x004DA + "\x00\x13d\x00a\x00\x04\xdb" + // 0x004D9 0x00308: 0x004DB + "\x00\x10X\x00a\x00\x04\xdc" + // 0x00416 0x00308: 0x004DC + "\x00\x10\xd8\x00a\x00\x04\xdd" + // 0x00436 0x00308: 0x004DD + "\x00\x10\\\x00a\x00\x04\xde" + // 0x00417 0x00308: 0x004DE + "\x00\x10\xdc\x00a\x00\x04\xdf" + // 0x00437 0x00308: 0x004DF + "\x00\x10`\x00`\x80\x04\xe2" + // 0x00418 0x00304: 0x004E2 + "\x00\x10\xe0\x00`\x80\x04\xe3" + // 0x00438 0x00304: 0x004E3 + "\x00\x10`\x00a\x00\x04\xe4" + // 0x00418 0x00308: 0x004E4 + "\x00\x10\xe0\x00a\x00\x04\xe5" + // 0x00438 0x00308: 0x004E5 + "\x00\x10x\x00a\x00\x04\xe6" + // 0x0041E 0x00308: 0x004E6 + "\x00\x10\xf8\x00a\x00\x04\xe7" + // 0x0043E 0x00308: 0x004E7 + "\x00\x13\xa0\x00a\x00\x04\xea" + // 0x004E8 0x00308: 0x004EA + "\x00\x13\xa4\x00a\x00\x04\xeb" + // 0x004E9 0x00308: 0x004EB + "\x00\x10\xb4\x00a\x00\x04\xec" + // 0x0042D 0x00308: 0x004EC + "\x00\x114\x00a\x00\x04\xed" + // 0x0044D 0x00308: 0x004ED + "\x00\x10\x8c\x00`\x80\x04\xee" + // 0x00423 0x00304: 0x004EE + "\x00\x11\f\x00`\x80\x04\xef" + // 0x00443 0x00304: 0x004EF + "\x00\x10\x8c\x00a\x00\x04\xf0" + // 0x00423 0x00308: 0x004F0 + "\x00\x11\f\x00a\x00\x04\xf1" + // 0x00443 0x00308: 0x004F1 + "\x00\x10\x8c\x00a`\x04\xf2" + // 0x00423 0x0030B: 0x004F2 + "\x00\x11\f\x00a`\x04\xf3" + // 0x00443 0x0030B: 0x004F3 + "\x00\x10\x9c\x00a\x00\x04\xf4" + // 0x00427 0x00308: 0x004F4 + "\x00\x11\x1c\x00a\x00\x04\xf5" + // 0x00447 0x00308: 0x004F5 + "\x00\x10\xac\x00a\x00\x04\xf8" + // 0x0042B 0x00308: 0x004F8 + "\x00\x11,\x00a\x00\x04\xf9" + // 0x0044B 0x00308: 0x004F9 + "\x00\x18\x9c\x00\xca`\x06\"" + // 0x00627 0x00653: 0x00622 + "\x00\x18\x9c\x00ʀ\x06#" + // 0x00627 0x00654: 0x00623 + "\x00\x19 \x00ʀ\x06$" + // 0x00648 0x00654: 0x00624 + "\x00\x18\x9c\x00ʠ\x06%" + // 0x00627 0x00655: 0x00625 + "\x00\x19(\x00ʀ\x06&" + // 0x0064A 0x00654: 0x00626 + "\x00\x1bT\x00ʀ\x06\xc0" + // 0x006D5 0x00654: 0x006C0 + "\x00\x1b\x04\x00ʀ\x06\xc2" + // 0x006C1 0x00654: 0x006C2 + "\x00\x1bH\x00ʀ\x06\xd3" + // 0x006D2 0x00654: 0x006D3 + "\x00$\xa0\x01'\x80\t)" + // 0x00928 0x0093C: 0x00929 + "\x00$\xc0\x01'\x80\t1" + // 0x00930 0x0093C: 0x00931 + "\x00$\xcc\x01'\x80\t4" + // 0x00933 0x0093C: 0x00934 + "\x00'\x1c\x017\xc0\t\xcb" + // 0x009C7 0x009BE: 0x009CB + "\x00'\x1c\x01:\xe0\t\xcc" + // 0x009C7 0x009D7: 0x009CC + "\x00-\x1c\x01j\xc0\vH" + // 0x00B47 0x00B56: 0x00B48 + "\x00-\x1c\x01g\xc0\vK" + // 0x00B47 0x00B3E: 0x00B4B + "\x00-\x1c\x01j\xe0\vL" + // 0x00B47 0x00B57: 0x00B4C + "\x00.H\x01z\xe0\v\x94" + // 0x00B92 0x00BD7: 0x00B94 + "\x00/\x18\x01w\xc0\v\xca" + // 0x00BC6 0x00BBE: 0x00BCA + "\x00/\x1c\x01w\xc0\v\xcb" + // 0x00BC7 0x00BBE: 0x00BCB + "\x00/\x18\x01z\xe0\v\xcc" + // 0x00BC6 0x00BD7: 0x00BCC + "\x001\x18\x01\x8a\xc0\fH" + // 0x00C46 0x00C56: 0x00C48 + "\x002\xfc\x01\x9a\xa0\f\xc0" + // 0x00CBF 0x00CD5: 0x00CC0 + "\x003\x18\x01\x9a\xa0\f\xc7" + // 0x00CC6 0x00CD5: 0x00CC7 + "\x003\x18\x01\x9a\xc0\f\xc8" + // 0x00CC6 0x00CD6: 0x00CC8 + "\x003\x18\x01\x98@\f\xca" + // 0x00CC6 0x00CC2: 0x00CCA + "\x003(\x01\x9a\xa0\f\xcb" + // 0x00CCA 0x00CD5: 0x00CCB + "\x005\x18\x01\xa7\xc0\rJ" + // 0x00D46 0x00D3E: 0x00D4A + "\x005\x1c\x01\xa7\xc0\rK" + // 0x00D47 0x00D3E: 0x00D4B + "\x005\x18\x01\xaa\xe0\rL" + // 0x00D46 0x00D57: 0x00D4C + "\x007d\x01\xb9@\r\xda" + // 0x00DD9 0x00DCA: 0x00DDA + "\x007d\x01\xb9\xe0\r\xdc" + // 0x00DD9 0x00DCF: 0x00DDC + "\x007p\x01\xb9@\r\xdd" + // 0x00DDC 0x00DCA: 0x00DDD + "\x007d\x01\xbb\xe0\r\xde" + // 0x00DD9 0x00DDF: 0x00DDE + "\x00@\x94\x02\x05\xc0\x10&" + // 0x01025 0x0102E: 0x01026 + "\x00l\x14\x03f\xa0\x1b\x06" + // 0x01B05 0x01B35: 0x01B06 + "\x00l\x1c\x03f\xa0\x1b\b" + // 0x01B07 0x01B35: 0x01B08 + "\x00l$\x03f\xa0\x1b\n" + // 0x01B09 0x01B35: 0x01B0A + "\x00l,\x03f\xa0\x1b\f" + // 0x01B0B 0x01B35: 0x01B0C + "\x00l4\x03f\xa0\x1b\x0e" + // 0x01B0D 0x01B35: 0x01B0E + "\x00lD\x03f\xa0\x1b\x12" + // 0x01B11 0x01B35: 0x01B12 + "\x00l\xe8\x03f\xa0\x1b;" + // 0x01B3A 0x01B35: 0x01B3B + "\x00l\xf0\x03f\xa0\x1b=" + // 0x01B3C 0x01B35: 0x01B3D + "\x00l\xf8\x03f\xa0\x1b@" + // 0x01B3E 0x01B35: 0x01B40 + "\x00l\xfc\x03f\xa0\x1bA" + // 0x01B3F 0x01B35: 0x01B41 + "\x00m\b\x03f\xa0\x1bC" + // 0x01B42 0x01B35: 0x01B43 + "\x00\x01\x04\x00d\xa0\x1e\x00" + // 0x00041 0x00325: 0x01E00 + "\x00\x01\x84\x00d\xa0\x1e\x01" + // 0x00061 0x00325: 0x01E01 + "\x00\x01\b\x00`\xe0\x1e\x02" + // 0x00042 0x00307: 0x01E02 + "\x00\x01\x88\x00`\xe0\x1e\x03" + // 0x00062 0x00307: 0x01E03 + "\x00\x01\b\x00d`\x1e\x04" + // 0x00042 0x00323: 0x01E04 + "\x00\x01\x88\x00d`\x1e\x05" + // 0x00062 0x00323: 0x01E05 + "\x00\x01\b\x00f \x1e\x06" + // 0x00042 0x00331: 0x01E06 + "\x00\x01\x88\x00f \x1e\a" + // 0x00062 0x00331: 0x01E07 + "\x00\x03\x1c\x00` \x1e\b" + // 0x000C7 0x00301: 0x01E08 + "\x00\x03\x9c\x00` \x1e\t" + // 0x000E7 0x00301: 0x01E09 + "\x00\x01\x10\x00`\xe0\x1e\n" + // 0x00044 0x00307: 0x01E0A + "\x00\x01\x90\x00`\xe0\x1e\v" + // 0x00064 0x00307: 0x01E0B + "\x00\x01\x10\x00d`\x1e\f" + // 0x00044 0x00323: 0x01E0C + "\x00\x01\x90\x00d`\x1e\r" + // 0x00064 0x00323: 0x01E0D + "\x00\x01\x10\x00f \x1e\x0e" + // 0x00044 0x00331: 0x01E0E + "\x00\x01\x90\x00f \x1e\x0f" + // 0x00064 0x00331: 0x01E0F + "\x00\x01\x10\x00d\xe0\x1e\x10" + // 0x00044 0x00327: 0x01E10 + "\x00\x01\x90\x00d\xe0\x1e\x11" + // 0x00064 0x00327: 0x01E11 + "\x00\x01\x10\x00e\xa0\x1e\x12" + // 0x00044 0x0032D: 0x01E12 + "\x00\x01\x90\x00e\xa0\x1e\x13" + // 0x00064 0x0032D: 0x01E13 + "\x00\x04H\x00`\x00\x1e\x14" + // 0x00112 0x00300: 0x01E14 + "\x00\x04L\x00`\x00\x1e\x15" + // 0x00113 0x00300: 0x01E15 + "\x00\x04H\x00` \x1e\x16" + // 0x00112 0x00301: 0x01E16 + "\x00\x04L\x00` \x1e\x17" + // 0x00113 0x00301: 0x01E17 + "\x00\x01\x14\x00e\xa0\x1e\x18" + // 0x00045 0x0032D: 0x01E18 + "\x00\x01\x94\x00e\xa0\x1e\x19" + // 0x00065 0x0032D: 0x01E19 + "\x00\x01\x14\x00f\x00\x1e\x1a" + // 0x00045 0x00330: 0x01E1A + "\x00\x01\x94\x00f\x00\x1e\x1b" + // 0x00065 0x00330: 0x01E1B + "\x00\b\xa0\x00`\xc0\x1e\x1c" + // 0x00228 0x00306: 0x01E1C + "\x00\b\xa4\x00`\xc0\x1e\x1d" + // 0x00229 0x00306: 0x01E1D + "\x00\x01\x18\x00`\xe0\x1e\x1e" + // 0x00046 0x00307: 0x01E1E + "\x00\x01\x98\x00`\xe0\x1e\x1f" + // 0x00066 0x00307: 0x01E1F + "\x00\x01\x1c\x00`\x80\x1e " + // 0x00047 0x00304: 0x01E20 + "\x00\x01\x9c\x00`\x80\x1e!" + // 0x00067 0x00304: 0x01E21 + "\x00\x01 \x00`\xe0\x1e\"" + // 0x00048 0x00307: 0x01E22 + "\x00\x01\xa0\x00`\xe0\x1e#" + // 0x00068 0x00307: 0x01E23 + "\x00\x01 \x00d`\x1e$" + // 0x00048 0x00323: 0x01E24 + "\x00\x01\xa0\x00d`\x1e%" + // 0x00068 0x00323: 0x01E25 + "\x00\x01 \x00a\x00\x1e&" + // 0x00048 0x00308: 0x01E26 + "\x00\x01\xa0\x00a\x00\x1e'" + // 0x00068 0x00308: 0x01E27 + "\x00\x01 \x00d\xe0\x1e(" + // 0x00048 0x00327: 0x01E28 + "\x00\x01\xa0\x00d\xe0\x1e)" + // 0x00068 0x00327: 0x01E29 + "\x00\x01 \x00e\xc0\x1e*" + // 0x00048 0x0032E: 0x01E2A + "\x00\x01\xa0\x00e\xc0\x1e+" + // 0x00068 0x0032E: 0x01E2B + "\x00\x01$\x00f\x00\x1e," + // 0x00049 0x00330: 0x01E2C + "\x00\x01\xa4\x00f\x00\x1e-" + // 0x00069 0x00330: 0x01E2D + "\x00\x03<\x00` \x1e." + // 0x000CF 0x00301: 0x01E2E + "\x00\x03\xbc\x00` \x1e/" + // 0x000EF 0x00301: 0x01E2F + "\x00\x01,\x00` \x1e0" + // 0x0004B 0x00301: 0x01E30 + "\x00\x01\xac\x00` \x1e1" + // 0x0006B 0x00301: 0x01E31 + "\x00\x01,\x00d`\x1e2" + // 0x0004B 0x00323: 0x01E32 + "\x00\x01\xac\x00d`\x1e3" + // 0x0006B 0x00323: 0x01E33 + "\x00\x01,\x00f \x1e4" + // 0x0004B 0x00331: 0x01E34 + "\x00\x01\xac\x00f \x1e5" + // 0x0006B 0x00331: 0x01E35 + "\x00\x010\x00d`\x1e6" + // 0x0004C 0x00323: 0x01E36 + "\x00\x01\xb0\x00d`\x1e7" + // 0x0006C 0x00323: 0x01E37 + "\x00x\xd8\x00`\x80\x1e8" + // 0x01E36 0x00304: 0x01E38 + "\x00x\xdc\x00`\x80\x1e9" + // 0x01E37 0x00304: 0x01E39 + "\x00\x010\x00f \x1e:" + // 0x0004C 0x00331: 0x01E3A + "\x00\x01\xb0\x00f \x1e;" + // 0x0006C 0x00331: 0x01E3B + "\x00\x010\x00e\xa0\x1e<" + // 0x0004C 0x0032D: 0x01E3C + "\x00\x01\xb0\x00e\xa0\x1e=" + // 0x0006C 0x0032D: 0x01E3D + "\x00\x014\x00` \x1e>" + // 0x0004D 0x00301: 0x01E3E + "\x00\x01\xb4\x00` \x1e?" + // 0x0006D 0x00301: 0x01E3F + "\x00\x014\x00`\xe0\x1e@" + // 0x0004D 0x00307: 0x01E40 + "\x00\x01\xb4\x00`\xe0\x1eA" + // 0x0006D 0x00307: 0x01E41 + "\x00\x014\x00d`\x1eB" + // 0x0004D 0x00323: 0x01E42 + "\x00\x01\xb4\x00d`\x1eC" + // 0x0006D 0x00323: 0x01E43 + "\x00\x018\x00`\xe0\x1eD" + // 0x0004E 0x00307: 0x01E44 + "\x00\x01\xb8\x00`\xe0\x1eE" + // 0x0006E 0x00307: 0x01E45 + "\x00\x018\x00d`\x1eF" + // 0x0004E 0x00323: 0x01E46 + "\x00\x01\xb8\x00d`\x1eG" + // 0x0006E 0x00323: 0x01E47 + "\x00\x018\x00f \x1eH" + // 0x0004E 0x00331: 0x01E48 + "\x00\x01\xb8\x00f \x1eI" + // 0x0006E 0x00331: 0x01E49 + "\x00\x018\x00e\xa0\x1eJ" + // 0x0004E 0x0032D: 0x01E4A + "\x00\x01\xb8\x00e\xa0\x1eK" + // 0x0006E 0x0032D: 0x01E4B + "\x00\x03T\x00` \x1eL" + // 0x000D5 0x00301: 0x01E4C + "\x00\x03\xd4\x00` \x1eM" + // 0x000F5 0x00301: 0x01E4D + "\x00\x03T\x00a\x00\x1eN" + // 0x000D5 0x00308: 0x01E4E + "\x00\x03\xd4\x00a\x00\x1eO" + // 0x000F5 0x00308: 0x01E4F + "\x00\x050\x00`\x00\x1eP" + // 0x0014C 0x00300: 0x01E50 + "\x00\x054\x00`\x00\x1eQ" + // 0x0014D 0x00300: 0x01E51 + "\x00\x050\x00` \x1eR" + // 0x0014C 0x00301: 0x01E52 + "\x00\x054\x00` \x1eS" + // 0x0014D 0x00301: 0x01E53 + "\x00\x01@\x00` \x1eT" + // 0x00050 0x00301: 0x01E54 + "\x00\x01\xc0\x00` \x1eU" + // 0x00070 0x00301: 0x01E55 + "\x00\x01@\x00`\xe0\x1eV" + // 0x00050 0x00307: 0x01E56 + "\x00\x01\xc0\x00`\xe0\x1eW" + // 0x00070 0x00307: 0x01E57 + "\x00\x01H\x00`\xe0\x1eX" + // 0x00052 0x00307: 0x01E58 + "\x00\x01\xc8\x00`\xe0\x1eY" + // 0x00072 0x00307: 0x01E59 + "\x00\x01H\x00d`\x1eZ" + // 0x00052 0x00323: 0x01E5A + "\x00\x01\xc8\x00d`\x1e[" + // 0x00072 0x00323: 0x01E5B + "\x00yh\x00`\x80\x1e\\" + // 0x01E5A 0x00304: 0x01E5C + "\x00yl\x00`\x80\x1e]" + // 0x01E5B 0x00304: 0x01E5D + "\x00\x01H\x00f \x1e^" + // 0x00052 0x00331: 0x01E5E + "\x00\x01\xc8\x00f \x1e_" + // 0x00072 0x00331: 0x01E5F + "\x00\x01L\x00`\xe0\x1e`" + // 0x00053 0x00307: 0x01E60 + "\x00\x01\xcc\x00`\xe0\x1ea" + // 0x00073 0x00307: 0x01E61 + "\x00\x01L\x00d`\x1eb" + // 0x00053 0x00323: 0x01E62 + "\x00\x01\xcc\x00d`\x1ec" + // 0x00073 0x00323: 0x01E63 + "\x00\x05h\x00`\xe0\x1ed" + // 0x0015A 0x00307: 0x01E64 + "\x00\x05l\x00`\xe0\x1ee" + // 0x0015B 0x00307: 0x01E65 + "\x00\x05\x80\x00`\xe0\x1ef" + // 0x00160 0x00307: 0x01E66 + "\x00\x05\x84\x00`\xe0\x1eg" + // 0x00161 0x00307: 0x01E67 + "\x00y\x88\x00`\xe0\x1eh" + // 0x01E62 0x00307: 0x01E68 + "\x00y\x8c\x00`\xe0\x1ei" + // 0x01E63 0x00307: 0x01E69 + "\x00\x01P\x00`\xe0\x1ej" + // 0x00054 0x00307: 0x01E6A + "\x00\x01\xd0\x00`\xe0\x1ek" + // 0x00074 0x00307: 0x01E6B + "\x00\x01P\x00d`\x1el" + // 0x00054 0x00323: 0x01E6C + "\x00\x01\xd0\x00d`\x1em" + // 0x00074 0x00323: 0x01E6D + "\x00\x01P\x00f \x1en" + // 0x00054 0x00331: 0x01E6E + "\x00\x01\xd0\x00f \x1eo" + // 0x00074 0x00331: 0x01E6F + "\x00\x01P\x00e\xa0\x1ep" + // 0x00054 0x0032D: 0x01E70 + "\x00\x01\xd0\x00e\xa0\x1eq" + // 0x00074 0x0032D: 0x01E71 + "\x00\x01T\x00d\x80\x1er" + // 0x00055 0x00324: 0x01E72 + "\x00\x01\xd4\x00d\x80\x1es" + // 0x00075 0x00324: 0x01E73 + "\x00\x01T\x00f\x00\x1et" + // 0x00055 0x00330: 0x01E74 + "\x00\x01\xd4\x00f\x00\x1eu" + // 0x00075 0x00330: 0x01E75 + "\x00\x01T\x00e\xa0\x1ev" + // 0x00055 0x0032D: 0x01E76 + "\x00\x01\xd4\x00e\xa0\x1ew" + // 0x00075 0x0032D: 0x01E77 + "\x00\x05\xa0\x00` \x1ex" + // 0x00168 0x00301: 0x01E78 + "\x00\x05\xa4\x00` \x1ey" + // 0x00169 0x00301: 0x01E79 + "\x00\x05\xa8\x00a\x00\x1ez" + // 0x0016A 0x00308: 0x01E7A + "\x00\x05\xac\x00a\x00\x1e{" + // 0x0016B 0x00308: 0x01E7B + "\x00\x01X\x00``\x1e|" + // 0x00056 0x00303: 0x01E7C + "\x00\x01\xd8\x00``\x1e}" + // 0x00076 0x00303: 0x01E7D + "\x00\x01X\x00d`\x1e~" + // 0x00056 0x00323: 0x01E7E + "\x00\x01\xd8\x00d`\x1e\x7f" + // 0x00076 0x00323: 0x01E7F + "\x00\x01\\\x00`\x00\x1e\x80" + // 0x00057 0x00300: 0x01E80 + "\x00\x01\xdc\x00`\x00\x1e\x81" + // 0x00077 0x00300: 0x01E81 + "\x00\x01\\\x00` \x1e\x82" + // 0x00057 0x00301: 0x01E82 + "\x00\x01\xdc\x00` \x1e\x83" + // 0x00077 0x00301: 0x01E83 + "\x00\x01\\\x00a\x00\x1e\x84" + // 0x00057 0x00308: 0x01E84 + "\x00\x01\xdc\x00a\x00\x1e\x85" + // 0x00077 0x00308: 0x01E85 + "\x00\x01\\\x00`\xe0\x1e\x86" + // 0x00057 0x00307: 0x01E86 + "\x00\x01\xdc\x00`\xe0\x1e\x87" + // 0x00077 0x00307: 0x01E87 + "\x00\x01\\\x00d`\x1e\x88" + // 0x00057 0x00323: 0x01E88 + "\x00\x01\xdc\x00d`\x1e\x89" + // 0x00077 0x00323: 0x01E89 + "\x00\x01`\x00`\xe0\x1e\x8a" + // 0x00058 0x00307: 0x01E8A + "\x00\x01\xe0\x00`\xe0\x1e\x8b" + // 0x00078 0x00307: 0x01E8B + "\x00\x01`\x00a\x00\x1e\x8c" + // 0x00058 0x00308: 0x01E8C + "\x00\x01\xe0\x00a\x00\x1e\x8d" + // 0x00078 0x00308: 0x01E8D + "\x00\x01d\x00`\xe0\x1e\x8e" + // 0x00059 0x00307: 0x01E8E + "\x00\x01\xe4\x00`\xe0\x1e\x8f" + // 0x00079 0x00307: 0x01E8F + "\x00\x01h\x00`@\x1e\x90" + // 0x0005A 0x00302: 0x01E90 + "\x00\x01\xe8\x00`@\x1e\x91" + // 0x0007A 0x00302: 0x01E91 + "\x00\x01h\x00d`\x1e\x92" + // 0x0005A 0x00323: 0x01E92 + "\x00\x01\xe8\x00d`\x1e\x93" + // 0x0007A 0x00323: 0x01E93 + "\x00\x01h\x00f \x1e\x94" + // 0x0005A 0x00331: 0x01E94 + "\x00\x01\xe8\x00f \x1e\x95" + // 0x0007A 0x00331: 0x01E95 + "\x00\x01\xa0\x00f \x1e\x96" + // 0x00068 0x00331: 0x01E96 + "\x00\x01\xd0\x00a\x00\x1e\x97" + // 0x00074 0x00308: 0x01E97 + "\x00\x01\xdc\x00a@\x1e\x98" + // 0x00077 0x0030A: 0x01E98 + "\x00\x01\xe4\x00a@\x1e\x99" + // 0x00079 0x0030A: 0x01E99 + "\x00\x05\xfc\x00`\xe0\x1e\x9b" + // 0x0017F 0x00307: 0x01E9B + "\x00\x01\x04\x00d`\x1e\xa0" + // 0x00041 0x00323: 0x01EA0 + "\x00\x01\x84\x00d`\x1e\xa1" + // 0x00061 0x00323: 0x01EA1 + "\x00\x01\x04\x00a \x1e\xa2" + // 0x00041 0x00309: 0x01EA2 + "\x00\x01\x84\x00a \x1e\xa3" + // 0x00061 0x00309: 0x01EA3 + "\x00\x03\b\x00` \x1e\xa4" + // 0x000C2 0x00301: 0x01EA4 + "\x00\x03\x88\x00` \x1e\xa5" + // 0x000E2 0x00301: 0x01EA5 + "\x00\x03\b\x00`\x00\x1e\xa6" + // 0x000C2 0x00300: 0x01EA6 + "\x00\x03\x88\x00`\x00\x1e\xa7" + // 0x000E2 0x00300: 0x01EA7 + "\x00\x03\b\x00a \x1e\xa8" + // 0x000C2 0x00309: 0x01EA8 + "\x00\x03\x88\x00a \x1e\xa9" + // 0x000E2 0x00309: 0x01EA9 + "\x00\x03\b\x00``\x1e\xaa" + // 0x000C2 0x00303: 0x01EAA + "\x00\x03\x88\x00``\x1e\xab" + // 0x000E2 0x00303: 0x01EAB + "\x00z\x80\x00`@\x1e\xac" + // 0x01EA0 0x00302: 0x01EAC + "\x00z\x84\x00`@\x1e\xad" + // 0x01EA1 0x00302: 0x01EAD + "\x00\x04\b\x00` \x1e\xae" + // 0x00102 0x00301: 0x01EAE + "\x00\x04\f\x00` \x1e\xaf" + // 0x00103 0x00301: 0x01EAF + "\x00\x04\b\x00`\x00\x1e\xb0" + // 0x00102 0x00300: 0x01EB0 + "\x00\x04\f\x00`\x00\x1e\xb1" + // 0x00103 0x00300: 0x01EB1 + "\x00\x04\b\x00a \x1e\xb2" + // 0x00102 0x00309: 0x01EB2 + "\x00\x04\f\x00a \x1e\xb3" + // 0x00103 0x00309: 0x01EB3 + "\x00\x04\b\x00``\x1e\xb4" + // 0x00102 0x00303: 0x01EB4 + "\x00\x04\f\x00``\x1e\xb5" + // 0x00103 0x00303: 0x01EB5 + "\x00z\x80\x00`\xc0\x1e\xb6" + // 0x01EA0 0x00306: 0x01EB6 + "\x00z\x84\x00`\xc0\x1e\xb7" + // 0x01EA1 0x00306: 0x01EB7 + "\x00\x01\x14\x00d`\x1e\xb8" + // 0x00045 0x00323: 0x01EB8 + "\x00\x01\x94\x00d`\x1e\xb9" + // 0x00065 0x00323: 0x01EB9 + "\x00\x01\x14\x00a \x1e\xba" + // 0x00045 0x00309: 0x01EBA + "\x00\x01\x94\x00a \x1e\xbb" + // 0x00065 0x00309: 0x01EBB + "\x00\x01\x14\x00``\x1e\xbc" + // 0x00045 0x00303: 0x01EBC + "\x00\x01\x94\x00``\x1e\xbd" + // 0x00065 0x00303: 0x01EBD + "\x00\x03(\x00` \x1e\xbe" + // 0x000CA 0x00301: 0x01EBE + "\x00\x03\xa8\x00` \x1e\xbf" + // 0x000EA 0x00301: 0x01EBF + "\x00\x03(\x00`\x00\x1e\xc0" + // 0x000CA 0x00300: 0x01EC0 + "\x00\x03\xa8\x00`\x00\x1e\xc1" + // 0x000EA 0x00300: 0x01EC1 + "\x00\x03(\x00a \x1e\xc2" + // 0x000CA 0x00309: 0x01EC2 + "\x00\x03\xa8\x00a \x1e\xc3" + // 0x000EA 0x00309: 0x01EC3 + "\x00\x03(\x00``\x1e\xc4" + // 0x000CA 0x00303: 0x01EC4 + "\x00\x03\xa8\x00``\x1e\xc5" + // 0x000EA 0x00303: 0x01EC5 + "\x00z\xe0\x00`@\x1e\xc6" + // 0x01EB8 0x00302: 0x01EC6 + "\x00z\xe4\x00`@\x1e\xc7" + // 0x01EB9 0x00302: 0x01EC7 + "\x00\x01$\x00a \x1e\xc8" + // 0x00049 0x00309: 0x01EC8 + "\x00\x01\xa4\x00a \x1e\xc9" + // 0x00069 0x00309: 0x01EC9 + "\x00\x01$\x00d`\x1e\xca" + // 0x00049 0x00323: 0x01ECA + "\x00\x01\xa4\x00d`\x1e\xcb" + // 0x00069 0x00323: 0x01ECB + "\x00\x01<\x00d`\x1e\xcc" + // 0x0004F 0x00323: 0x01ECC + "\x00\x01\xbc\x00d`\x1e\xcd" + // 0x0006F 0x00323: 0x01ECD + "\x00\x01<\x00a \x1e\xce" + // 0x0004F 0x00309: 0x01ECE + "\x00\x01\xbc\x00a \x1e\xcf" + // 0x0006F 0x00309: 0x01ECF + "\x00\x03P\x00` \x1e\xd0" + // 0x000D4 0x00301: 0x01ED0 + "\x00\x03\xd0\x00` \x1e\xd1" + // 0x000F4 0x00301: 0x01ED1 + "\x00\x03P\x00`\x00\x1e\xd2" + // 0x000D4 0x00300: 0x01ED2 + "\x00\x03\xd0\x00`\x00\x1e\xd3" + // 0x000F4 0x00300: 0x01ED3 + "\x00\x03P\x00a \x1e\xd4" + // 0x000D4 0x00309: 0x01ED4 + "\x00\x03\xd0\x00a \x1e\xd5" + // 0x000F4 0x00309: 0x01ED5 + "\x00\x03P\x00``\x1e\xd6" + // 0x000D4 0x00303: 0x01ED6 + "\x00\x03\xd0\x00``\x1e\xd7" + // 0x000F4 0x00303: 0x01ED7 + "\x00{0\x00`@\x1e\xd8" + // 0x01ECC 0x00302: 0x01ED8 + "\x00{4\x00`@\x1e\xd9" + // 0x01ECD 0x00302: 0x01ED9 + "\x00\x06\x80\x00` \x1e\xda" + // 0x001A0 0x00301: 0x01EDA + "\x00\x06\x84\x00` \x1e\xdb" + // 0x001A1 0x00301: 0x01EDB + "\x00\x06\x80\x00`\x00\x1e\xdc" + // 0x001A0 0x00300: 0x01EDC + "\x00\x06\x84\x00`\x00\x1e\xdd" + // 0x001A1 0x00300: 0x01EDD + "\x00\x06\x80\x00a \x1e\xde" + // 0x001A0 0x00309: 0x01EDE + "\x00\x06\x84\x00a \x1e\xdf" + // 0x001A1 0x00309: 0x01EDF + "\x00\x06\x80\x00``\x1e\xe0" + // 0x001A0 0x00303: 0x01EE0 + "\x00\x06\x84\x00``\x1e\xe1" + // 0x001A1 0x00303: 0x01EE1 + "\x00\x06\x80\x00d`\x1e\xe2" + // 0x001A0 0x00323: 0x01EE2 + "\x00\x06\x84\x00d`\x1e\xe3" + // 0x001A1 0x00323: 0x01EE3 + "\x00\x01T\x00d`\x1e\xe4" + // 0x00055 0x00323: 0x01EE4 + "\x00\x01\xd4\x00d`\x1e\xe5" + // 0x00075 0x00323: 0x01EE5 + "\x00\x01T\x00a \x1e\xe6" + // 0x00055 0x00309: 0x01EE6 + "\x00\x01\xd4\x00a \x1e\xe7" + // 0x00075 0x00309: 0x01EE7 + "\x00\x06\xbc\x00` \x1e\xe8" + // 0x001AF 0x00301: 0x01EE8 + "\x00\x06\xc0\x00` \x1e\xe9" + // 0x001B0 0x00301: 0x01EE9 + "\x00\x06\xbc\x00`\x00\x1e\xea" + // 0x001AF 0x00300: 0x01EEA + "\x00\x06\xc0\x00`\x00\x1e\xeb" + // 0x001B0 0x00300: 0x01EEB + "\x00\x06\xbc\x00a \x1e\xec" + // 0x001AF 0x00309: 0x01EEC + "\x00\x06\xc0\x00a \x1e\xed" + // 0x001B0 0x00309: 0x01EED + "\x00\x06\xbc\x00``\x1e\xee" + // 0x001AF 0x00303: 0x01EEE + "\x00\x06\xc0\x00``\x1e\xef" + // 0x001B0 0x00303: 0x01EEF + "\x00\x06\xbc\x00d`\x1e\xf0" + // 0x001AF 0x00323: 0x01EF0 + "\x00\x06\xc0\x00d`\x1e\xf1" + // 0x001B0 0x00323: 0x01EF1 + "\x00\x01d\x00`\x00\x1e\xf2" + // 0x00059 0x00300: 0x01EF2 + "\x00\x01\xe4\x00`\x00\x1e\xf3" + // 0x00079 0x00300: 0x01EF3 + "\x00\x01d\x00d`\x1e\xf4" + // 0x00059 0x00323: 0x01EF4 + "\x00\x01\xe4\x00d`\x1e\xf5" + // 0x00079 0x00323: 0x01EF5 + "\x00\x01d\x00a \x1e\xf6" + // 0x00059 0x00309: 0x01EF6 + "\x00\x01\xe4\x00a \x1e\xf7" + // 0x00079 0x00309: 0x01EF7 + "\x00\x01d\x00``\x1e\xf8" + // 0x00059 0x00303: 0x01EF8 + "\x00\x01\xe4\x00``\x1e\xf9" + // 0x00079 0x00303: 0x01EF9 + "\x00\x0e\xc4\x00b`\x1f\x00" + // 0x003B1 0x00313: 0x01F00 + "\x00\x0e\xc4\x00b\x80\x1f\x01" + // 0x003B1 0x00314: 0x01F01 + "\x00|\x00\x00`\x00\x1f\x02" + // 0x01F00 0x00300: 0x01F02 + "\x00|\x04\x00`\x00\x1f\x03" + // 0x01F01 0x00300: 0x01F03 + "\x00|\x00\x00` \x1f\x04" + // 0x01F00 0x00301: 0x01F04 + "\x00|\x04\x00` \x1f\x05" + // 0x01F01 0x00301: 0x01F05 + "\x00|\x00\x00h@\x1f\x06" + // 0x01F00 0x00342: 0x01F06 + "\x00|\x04\x00h@\x1f\a" + // 0x01F01 0x00342: 0x01F07 + "\x00\x0eD\x00b`\x1f\b" + // 0x00391 0x00313: 0x01F08 + "\x00\x0eD\x00b\x80\x1f\t" + // 0x00391 0x00314: 0x01F09 + "\x00| \x00`\x00\x1f\n" + // 0x01F08 0x00300: 0x01F0A + "\x00|$\x00`\x00\x1f\v" + // 0x01F09 0x00300: 0x01F0B + "\x00| \x00` \x1f\f" + // 0x01F08 0x00301: 0x01F0C + "\x00|$\x00` \x1f\r" + // 0x01F09 0x00301: 0x01F0D + "\x00| \x00h@\x1f\x0e" + // 0x01F08 0x00342: 0x01F0E + "\x00|$\x00h@\x1f\x0f" + // 0x01F09 0x00342: 0x01F0F + "\x00\x0e\xd4\x00b`\x1f\x10" + // 0x003B5 0x00313: 0x01F10 + "\x00\x0e\xd4\x00b\x80\x1f\x11" + // 0x003B5 0x00314: 0x01F11 + "\x00|@\x00`\x00\x1f\x12" + // 0x01F10 0x00300: 0x01F12 + "\x00|D\x00`\x00\x1f\x13" + // 0x01F11 0x00300: 0x01F13 + "\x00|@\x00` \x1f\x14" + // 0x01F10 0x00301: 0x01F14 + "\x00|D\x00` \x1f\x15" + // 0x01F11 0x00301: 0x01F15 + "\x00\x0eT\x00b`\x1f\x18" + // 0x00395 0x00313: 0x01F18 + "\x00\x0eT\x00b\x80\x1f\x19" + // 0x00395 0x00314: 0x01F19 + "\x00|`\x00`\x00\x1f\x1a" + // 0x01F18 0x00300: 0x01F1A + "\x00|d\x00`\x00\x1f\x1b" + // 0x01F19 0x00300: 0x01F1B + "\x00|`\x00` \x1f\x1c" + // 0x01F18 0x00301: 0x01F1C + "\x00|d\x00` \x1f\x1d" + // 0x01F19 0x00301: 0x01F1D + "\x00\x0e\xdc\x00b`\x1f " + // 0x003B7 0x00313: 0x01F20 + "\x00\x0e\xdc\x00b\x80\x1f!" + // 0x003B7 0x00314: 0x01F21 + "\x00|\x80\x00`\x00\x1f\"" + // 0x01F20 0x00300: 0x01F22 + "\x00|\x84\x00`\x00\x1f#" + // 0x01F21 0x00300: 0x01F23 + "\x00|\x80\x00` \x1f$" + // 0x01F20 0x00301: 0x01F24 + "\x00|\x84\x00` \x1f%" + // 0x01F21 0x00301: 0x01F25 + "\x00|\x80\x00h@\x1f&" + // 0x01F20 0x00342: 0x01F26 + "\x00|\x84\x00h@\x1f'" + // 0x01F21 0x00342: 0x01F27 + "\x00\x0e\\\x00b`\x1f(" + // 0x00397 0x00313: 0x01F28 + "\x00\x0e\\\x00b\x80\x1f)" + // 0x00397 0x00314: 0x01F29 + "\x00|\xa0\x00`\x00\x1f*" + // 0x01F28 0x00300: 0x01F2A + "\x00|\xa4\x00`\x00\x1f+" + // 0x01F29 0x00300: 0x01F2B + "\x00|\xa0\x00` \x1f," + // 0x01F28 0x00301: 0x01F2C + "\x00|\xa4\x00` \x1f-" + // 0x01F29 0x00301: 0x01F2D + "\x00|\xa0\x00h@\x1f." + // 0x01F28 0x00342: 0x01F2E + "\x00|\xa4\x00h@\x1f/" + // 0x01F29 0x00342: 0x01F2F + "\x00\x0e\xe4\x00b`\x1f0" + // 0x003B9 0x00313: 0x01F30 + "\x00\x0e\xe4\x00b\x80\x1f1" + // 0x003B9 0x00314: 0x01F31 + "\x00|\xc0\x00`\x00\x1f2" + // 0x01F30 0x00300: 0x01F32 + "\x00|\xc4\x00`\x00\x1f3" + // 0x01F31 0x00300: 0x01F33 + "\x00|\xc0\x00` \x1f4" + // 0x01F30 0x00301: 0x01F34 + "\x00|\xc4\x00` \x1f5" + // 0x01F31 0x00301: 0x01F35 + "\x00|\xc0\x00h@\x1f6" + // 0x01F30 0x00342: 0x01F36 + "\x00|\xc4\x00h@\x1f7" + // 0x01F31 0x00342: 0x01F37 + "\x00\x0ed\x00b`\x1f8" + // 0x00399 0x00313: 0x01F38 + "\x00\x0ed\x00b\x80\x1f9" + // 0x00399 0x00314: 0x01F39 + "\x00|\xe0\x00`\x00\x1f:" + // 0x01F38 0x00300: 0x01F3A + "\x00|\xe4\x00`\x00\x1f;" + // 0x01F39 0x00300: 0x01F3B + "\x00|\xe0\x00` \x1f<" + // 0x01F38 0x00301: 0x01F3C + "\x00|\xe4\x00` \x1f=" + // 0x01F39 0x00301: 0x01F3D + "\x00|\xe0\x00h@\x1f>" + // 0x01F38 0x00342: 0x01F3E + "\x00|\xe4\x00h@\x1f?" + // 0x01F39 0x00342: 0x01F3F + "\x00\x0e\xfc\x00b`\x1f@" + // 0x003BF 0x00313: 0x01F40 + "\x00\x0e\xfc\x00b\x80\x1fA" + // 0x003BF 0x00314: 0x01F41 + "\x00}\x00\x00`\x00\x1fB" + // 0x01F40 0x00300: 0x01F42 + "\x00}\x04\x00`\x00\x1fC" + // 0x01F41 0x00300: 0x01F43 + "\x00}\x00\x00` \x1fD" + // 0x01F40 0x00301: 0x01F44 + "\x00}\x04\x00` \x1fE" + // 0x01F41 0x00301: 0x01F45 + "\x00\x0e|\x00b`\x1fH" + // 0x0039F 0x00313: 0x01F48 + "\x00\x0e|\x00b\x80\x1fI" + // 0x0039F 0x00314: 0x01F49 + "\x00} \x00`\x00\x1fJ" + // 0x01F48 0x00300: 0x01F4A + "\x00}$\x00`\x00\x1fK" + // 0x01F49 0x00300: 0x01F4B + "\x00} \x00` \x1fL" + // 0x01F48 0x00301: 0x01F4C + "\x00}$\x00` \x1fM" + // 0x01F49 0x00301: 0x01F4D + "\x00\x0f\x14\x00b`\x1fP" + // 0x003C5 0x00313: 0x01F50 + "\x00\x0f\x14\x00b\x80\x1fQ" + // 0x003C5 0x00314: 0x01F51 + "\x00}@\x00`\x00\x1fR" + // 0x01F50 0x00300: 0x01F52 + "\x00}D\x00`\x00\x1fS" + // 0x01F51 0x00300: 0x01F53 + "\x00}@\x00` \x1fT" + // 0x01F50 0x00301: 0x01F54 + "\x00}D\x00` \x1fU" + // 0x01F51 0x00301: 0x01F55 + "\x00}@\x00h@\x1fV" + // 0x01F50 0x00342: 0x01F56 + "\x00}D\x00h@\x1fW" + // 0x01F51 0x00342: 0x01F57 + "\x00\x0e\x94\x00b\x80\x1fY" + // 0x003A5 0x00314: 0x01F59 + "\x00}d\x00`\x00\x1f[" + // 0x01F59 0x00300: 0x01F5B + "\x00}d\x00` \x1f]" + // 0x01F59 0x00301: 0x01F5D + "\x00}d\x00h@\x1f_" + // 0x01F59 0x00342: 0x01F5F + "\x00\x0f$\x00b`\x1f`" + // 0x003C9 0x00313: 0x01F60 + "\x00\x0f$\x00b\x80\x1fa" + // 0x003C9 0x00314: 0x01F61 + "\x00}\x80\x00`\x00\x1fb" + // 0x01F60 0x00300: 0x01F62 + "\x00}\x84\x00`\x00\x1fc" + // 0x01F61 0x00300: 0x01F63 + "\x00}\x80\x00` \x1fd" + // 0x01F60 0x00301: 0x01F64 + "\x00}\x84\x00` \x1fe" + // 0x01F61 0x00301: 0x01F65 + "\x00}\x80\x00h@\x1ff" + // 0x01F60 0x00342: 0x01F66 + "\x00}\x84\x00h@\x1fg" + // 0x01F61 0x00342: 0x01F67 + "\x00\x0e\xa4\x00b`\x1fh" + // 0x003A9 0x00313: 0x01F68 + "\x00\x0e\xa4\x00b\x80\x1fi" + // 0x003A9 0x00314: 0x01F69 + "\x00}\xa0\x00`\x00\x1fj" + // 0x01F68 0x00300: 0x01F6A + "\x00}\xa4\x00`\x00\x1fk" + // 0x01F69 0x00300: 0x01F6B + "\x00}\xa0\x00` \x1fl" + // 0x01F68 0x00301: 0x01F6C + "\x00}\xa4\x00` \x1fm" + // 0x01F69 0x00301: 0x01F6D + "\x00}\xa0\x00h@\x1fn" + // 0x01F68 0x00342: 0x01F6E + "\x00}\xa4\x00h@\x1fo" + // 0x01F69 0x00342: 0x01F6F + "\x00\x0e\xc4\x00`\x00\x1fp" + // 0x003B1 0x00300: 0x01F70 + "\x00\x0e\xd4\x00`\x00\x1fr" + // 0x003B5 0x00300: 0x01F72 + "\x00\x0e\xdc\x00`\x00\x1ft" + // 0x003B7 0x00300: 0x01F74 + "\x00\x0e\xe4\x00`\x00\x1fv" + // 0x003B9 0x00300: 0x01F76 + "\x00\x0e\xfc\x00`\x00\x1fx" + // 0x003BF 0x00300: 0x01F78 + "\x00\x0f\x14\x00`\x00\x1fz" + // 0x003C5 0x00300: 0x01F7A + "\x00\x0f$\x00`\x00\x1f|" + // 0x003C9 0x00300: 0x01F7C + "\x00|\x00\x00h\xa0\x1f\x80" + // 0x01F00 0x00345: 0x01F80 + "\x00|\x04\x00h\xa0\x1f\x81" + // 0x01F01 0x00345: 0x01F81 + "\x00|\b\x00h\xa0\x1f\x82" + // 0x01F02 0x00345: 0x01F82 + "\x00|\f\x00h\xa0\x1f\x83" + // 0x01F03 0x00345: 0x01F83 + "\x00|\x10\x00h\xa0\x1f\x84" + // 0x01F04 0x00345: 0x01F84 + "\x00|\x14\x00h\xa0\x1f\x85" + // 0x01F05 0x00345: 0x01F85 + "\x00|\x18\x00h\xa0\x1f\x86" + // 0x01F06 0x00345: 0x01F86 + "\x00|\x1c\x00h\xa0\x1f\x87" + // 0x01F07 0x00345: 0x01F87 + "\x00| \x00h\xa0\x1f\x88" + // 0x01F08 0x00345: 0x01F88 + "\x00|$\x00h\xa0\x1f\x89" + // 0x01F09 0x00345: 0x01F89 + "\x00|(\x00h\xa0\x1f\x8a" + // 0x01F0A 0x00345: 0x01F8A + "\x00|,\x00h\xa0\x1f\x8b" + // 0x01F0B 0x00345: 0x01F8B + "\x00|0\x00h\xa0\x1f\x8c" + // 0x01F0C 0x00345: 0x01F8C + "\x00|4\x00h\xa0\x1f\x8d" + // 0x01F0D 0x00345: 0x01F8D + "\x00|8\x00h\xa0\x1f\x8e" + // 0x01F0E 0x00345: 0x01F8E + "\x00|<\x00h\xa0\x1f\x8f" + // 0x01F0F 0x00345: 0x01F8F + "\x00|\x80\x00h\xa0\x1f\x90" + // 0x01F20 0x00345: 0x01F90 + "\x00|\x84\x00h\xa0\x1f\x91" + // 0x01F21 0x00345: 0x01F91 + "\x00|\x88\x00h\xa0\x1f\x92" + // 0x01F22 0x00345: 0x01F92 + "\x00|\x8c\x00h\xa0\x1f\x93" + // 0x01F23 0x00345: 0x01F93 + "\x00|\x90\x00h\xa0\x1f\x94" + // 0x01F24 0x00345: 0x01F94 + "\x00|\x94\x00h\xa0\x1f\x95" + // 0x01F25 0x00345: 0x01F95 + "\x00|\x98\x00h\xa0\x1f\x96" + // 0x01F26 0x00345: 0x01F96 + "\x00|\x9c\x00h\xa0\x1f\x97" + // 0x01F27 0x00345: 0x01F97 + "\x00|\xa0\x00h\xa0\x1f\x98" + // 0x01F28 0x00345: 0x01F98 + "\x00|\xa4\x00h\xa0\x1f\x99" + // 0x01F29 0x00345: 0x01F99 + "\x00|\xa8\x00h\xa0\x1f\x9a" + // 0x01F2A 0x00345: 0x01F9A + "\x00|\xac\x00h\xa0\x1f\x9b" + // 0x01F2B 0x00345: 0x01F9B + "\x00|\xb0\x00h\xa0\x1f\x9c" + // 0x01F2C 0x00345: 0x01F9C + "\x00|\xb4\x00h\xa0\x1f\x9d" + // 0x01F2D 0x00345: 0x01F9D + "\x00|\xb8\x00h\xa0\x1f\x9e" + // 0x01F2E 0x00345: 0x01F9E + "\x00|\xbc\x00h\xa0\x1f\x9f" + // 0x01F2F 0x00345: 0x01F9F + "\x00}\x80\x00h\xa0\x1f\xa0" + // 0x01F60 0x00345: 0x01FA0 + "\x00}\x84\x00h\xa0\x1f\xa1" + // 0x01F61 0x00345: 0x01FA1 + "\x00}\x88\x00h\xa0\x1f\xa2" + // 0x01F62 0x00345: 0x01FA2 + "\x00}\x8c\x00h\xa0\x1f\xa3" + // 0x01F63 0x00345: 0x01FA3 + "\x00}\x90\x00h\xa0\x1f\xa4" + // 0x01F64 0x00345: 0x01FA4 + "\x00}\x94\x00h\xa0\x1f\xa5" + // 0x01F65 0x00345: 0x01FA5 + "\x00}\x98\x00h\xa0\x1f\xa6" + // 0x01F66 0x00345: 0x01FA6 + "\x00}\x9c\x00h\xa0\x1f\xa7" + // 0x01F67 0x00345: 0x01FA7 + "\x00}\xa0\x00h\xa0\x1f\xa8" + // 0x01F68 0x00345: 0x01FA8 + "\x00}\xa4\x00h\xa0\x1f\xa9" + // 0x01F69 0x00345: 0x01FA9 + "\x00}\xa8\x00h\xa0\x1f\xaa" + // 0x01F6A 0x00345: 0x01FAA + "\x00}\xac\x00h\xa0\x1f\xab" + // 0x01F6B 0x00345: 0x01FAB + "\x00}\xb0\x00h\xa0\x1f\xac" + // 0x01F6C 0x00345: 0x01FAC + "\x00}\xb4\x00h\xa0\x1f\xad" + // 0x01F6D 0x00345: 0x01FAD + "\x00}\xb8\x00h\xa0\x1f\xae" + // 0x01F6E 0x00345: 0x01FAE + "\x00}\xbc\x00h\xa0\x1f\xaf" + // 0x01F6F 0x00345: 0x01FAF + "\x00\x0e\xc4\x00`\xc0\x1f\xb0" + // 0x003B1 0x00306: 0x01FB0 + "\x00\x0e\xc4\x00`\x80\x1f\xb1" + // 0x003B1 0x00304: 0x01FB1 + "\x00}\xc0\x00h\xa0\x1f\xb2" + // 0x01F70 0x00345: 0x01FB2 + "\x00\x0e\xc4\x00h\xa0\x1f\xb3" + // 0x003B1 0x00345: 0x01FB3 + "\x00\x0e\xb0\x00h\xa0\x1f\xb4" + // 0x003AC 0x00345: 0x01FB4 + "\x00\x0e\xc4\x00h@\x1f\xb6" + // 0x003B1 0x00342: 0x01FB6 + "\x00~\xd8\x00h\xa0\x1f\xb7" + // 0x01FB6 0x00345: 0x01FB7 + "\x00\x0eD\x00`\xc0\x1f\xb8" + // 0x00391 0x00306: 0x01FB8 + "\x00\x0eD\x00`\x80\x1f\xb9" + // 0x00391 0x00304: 0x01FB9 + "\x00\x0eD\x00`\x00\x1f\xba" + // 0x00391 0x00300: 0x01FBA + "\x00\x0eD\x00h\xa0\x1f\xbc" + // 0x00391 0x00345: 0x01FBC + "\x00\x02\xa0\x00h@\x1f\xc1" + // 0x000A8 0x00342: 0x01FC1 + "\x00}\xd0\x00h\xa0\x1f\xc2" + // 0x01F74 0x00345: 0x01FC2 + "\x00\x0e\xdc\x00h\xa0\x1f\xc3" + // 0x003B7 0x00345: 0x01FC3 + "\x00\x0e\xb8\x00h\xa0\x1f\xc4" + // 0x003AE 0x00345: 0x01FC4 + "\x00\x0e\xdc\x00h@\x1f\xc6" + // 0x003B7 0x00342: 0x01FC6 + "\x00\x7f\x18\x00h\xa0\x1f\xc7" + // 0x01FC6 0x00345: 0x01FC7 + "\x00\x0eT\x00`\x00\x1f\xc8" + // 0x00395 0x00300: 0x01FC8 + "\x00\x0e\\\x00`\x00\x1f\xca" + // 0x00397 0x00300: 0x01FCA + "\x00\x0e\\\x00h\xa0\x1f\xcc" + // 0x00397 0x00345: 0x01FCC + "\x00~\xfc\x00`\x00\x1f\xcd" + // 0x01FBF 0x00300: 0x01FCD + "\x00~\xfc\x00` \x1f\xce" + // 0x01FBF 0x00301: 0x01FCE + "\x00~\xfc\x00h@\x1f\xcf" + // 0x01FBF 0x00342: 0x01FCF + "\x00\x0e\xe4\x00`\xc0\x1f\xd0" + // 0x003B9 0x00306: 0x01FD0 + "\x00\x0e\xe4\x00`\x80\x1f\xd1" + // 0x003B9 0x00304: 0x01FD1 + "\x00\x0f(\x00`\x00\x1f\xd2" + // 0x003CA 0x00300: 0x01FD2 + "\x00\x0e\xe4\x00h@\x1f\xd6" + // 0x003B9 0x00342: 0x01FD6 + "\x00\x0f(\x00h@\x1f\xd7" + // 0x003CA 0x00342: 0x01FD7 + "\x00\x0ed\x00`\xc0\x1f\xd8" + // 0x00399 0x00306: 0x01FD8 + "\x00\x0ed\x00`\x80\x1f\xd9" + // 0x00399 0x00304: 0x01FD9 + "\x00\x0ed\x00`\x00\x1f\xda" + // 0x00399 0x00300: 0x01FDA + "\x00\x7f\xf8\x00`\x00\x1f\xdd" + // 0x01FFE 0x00300: 0x01FDD + "\x00\x7f\xf8\x00` \x1f\xde" + // 0x01FFE 0x00301: 0x01FDE + "\x00\x7f\xf8\x00h@\x1f\xdf" + // 0x01FFE 0x00342: 0x01FDF + "\x00\x0f\x14\x00`\xc0\x1f\xe0" + // 0x003C5 0x00306: 0x01FE0 + "\x00\x0f\x14\x00`\x80\x1f\xe1" + // 0x003C5 0x00304: 0x01FE1 + "\x00\x0f,\x00`\x00\x1f\xe2" + // 0x003CB 0x00300: 0x01FE2 + "\x00\x0f\x04\x00b`\x1f\xe4" + // 0x003C1 0x00313: 0x01FE4 + "\x00\x0f\x04\x00b\x80\x1f\xe5" + // 0x003C1 0x00314: 0x01FE5 + "\x00\x0f\x14\x00h@\x1f\xe6" + // 0x003C5 0x00342: 0x01FE6 + "\x00\x0f,\x00h@\x1f\xe7" + // 0x003CB 0x00342: 0x01FE7 + "\x00\x0e\x94\x00`\xc0\x1f\xe8" + // 0x003A5 0x00306: 0x01FE8 + "\x00\x0e\x94\x00`\x80\x1f\xe9" + // 0x003A5 0x00304: 0x01FE9 + "\x00\x0e\x94\x00`\x00\x1f\xea" + // 0x003A5 0x00300: 0x01FEA + "\x00\x0e\x84\x00b\x80\x1f\xec" + // 0x003A1 0x00314: 0x01FEC + "\x00\x02\xa0\x00`\x00\x1f\xed" + // 0x000A8 0x00300: 0x01FED + "\x00}\xf0\x00h\xa0\x1f\xf2" + // 0x01F7C 0x00345: 0x01FF2 + "\x00\x0f$\x00h\xa0\x1f\xf3" + // 0x003C9 0x00345: 0x01FF3 + "\x00\x0f8\x00h\xa0\x1f\xf4" + // 0x003CE 0x00345: 0x01FF4 + "\x00\x0f$\x00h@\x1f\xf6" + // 0x003C9 0x00342: 0x01FF6 + "\x00\x7f\xd8\x00h\xa0\x1f\xf7" + // 0x01FF6 0x00345: 0x01FF7 + "\x00\x0e|\x00`\x00\x1f\xf8" + // 0x0039F 0x00300: 0x01FF8 + "\x00\x0e\xa4\x00`\x00\x1f\xfa" + // 0x003A9 0x00300: 0x01FFA + "\x00\x0e\xa4\x00h\xa0\x1f\xfc" + // 0x003A9 0x00345: 0x01FFC + "\x00\x86@\x00g\x00!\x9a" + // 0x02190 0x00338: 0x0219A + "\x00\x86H\x00g\x00!\x9b" + // 0x02192 0x00338: 0x0219B + "\x00\x86P\x00g\x00!\xae" + // 0x02194 0x00338: 0x021AE + "\x00\x87@\x00g\x00!\xcd" + // 0x021D0 0x00338: 0x021CD + "\x00\x87P\x00g\x00!\xce" + // 0x021D4 0x00338: 0x021CE + "\x00\x87H\x00g\x00!\xcf" + // 0x021D2 0x00338: 0x021CF + "\x00\x88\f\x00g\x00\"\x04" + // 0x02203 0x00338: 0x02204 + "\x00\x88 \x00g\x00\"\t" + // 0x02208 0x00338: 0x02209 + "\x00\x88,\x00g\x00\"\f" + // 0x0220B 0x00338: 0x0220C + "\x00\x88\x8c\x00g\x00\"$" + // 0x02223 0x00338: 0x02224 + "\x00\x88\x94\x00g\x00\"&" + // 0x02225 0x00338: 0x02226 + "\x00\x88\xf0\x00g\x00\"A" + // 0x0223C 0x00338: 0x02241 + "\x00\x89\f\x00g\x00\"D" + // 0x02243 0x00338: 0x02244 + "\x00\x89\x14\x00g\x00\"G" + // 0x02245 0x00338: 0x02247 + "\x00\x89 \x00g\x00\"I" + // 0x02248 0x00338: 0x02249 + "\x00\x00\xf4\x00g\x00\"`" + // 0x0003D 0x00338: 0x02260 + "\x00\x89\x84\x00g\x00\"b" + // 0x02261 0x00338: 0x02262 + "\x00\x894\x00g\x00\"m" + // 0x0224D 0x00338: 0x0226D + "\x00\x00\xf0\x00g\x00\"n" + // 0x0003C 0x00338: 0x0226E + "\x00\x00\xf8\x00g\x00\"o" + // 0x0003E 0x00338: 0x0226F + "\x00\x89\x90\x00g\x00\"p" + // 0x02264 0x00338: 0x02270 + "\x00\x89\x94\x00g\x00\"q" + // 0x02265 0x00338: 0x02271 + "\x00\x89\xc8\x00g\x00\"t" + // 0x02272 0x00338: 0x02274 + "\x00\x89\xcc\x00g\x00\"u" + // 0x02273 0x00338: 0x02275 + "\x00\x89\xd8\x00g\x00\"x" + // 0x02276 0x00338: 0x02278 + "\x00\x89\xdc\x00g\x00\"y" + // 0x02277 0x00338: 0x02279 + "\x00\x89\xe8\x00g\x00\"\x80" + // 0x0227A 0x00338: 0x02280 + "\x00\x89\xec\x00g\x00\"\x81" + // 0x0227B 0x00338: 0x02281 + "\x00\x8a\b\x00g\x00\"\x84" + // 0x02282 0x00338: 0x02284 + "\x00\x8a\f\x00g\x00\"\x85" + // 0x02283 0x00338: 0x02285 + "\x00\x8a\x18\x00g\x00\"\x88" + // 0x02286 0x00338: 0x02288 + "\x00\x8a\x1c\x00g\x00\"\x89" + // 0x02287 0x00338: 0x02289 + "\x00\x8a\x88\x00g\x00\"\xac" + // 0x022A2 0x00338: 0x022AC + "\x00\x8a\xa0\x00g\x00\"\xad" + // 0x022A8 0x00338: 0x022AD + "\x00\x8a\xa4\x00g\x00\"\xae" + // 0x022A9 0x00338: 0x022AE + "\x00\x8a\xac\x00g\x00\"\xaf" + // 0x022AB 0x00338: 0x022AF + "\x00\x89\xf0\x00g\x00\"\xe0" + // 0x0227C 0x00338: 0x022E0 + "\x00\x89\xf4\x00g\x00\"\xe1" + // 0x0227D 0x00338: 0x022E1 + "\x00\x8aD\x00g\x00\"\xe2" + // 0x02291 0x00338: 0x022E2 + "\x00\x8aH\x00g\x00\"\xe3" + // 0x02292 0x00338: 0x022E3 + "\x00\x8a\xc8\x00g\x00\"\xea" + // 0x022B2 0x00338: 0x022EA + "\x00\x8a\xcc\x00g\x00\"\xeb" + // 0x022B3 0x00338: 0x022EB + "\x00\x8a\xd0\x00g\x00\"\xec" + // 0x022B4 0x00338: 0x022EC + "\x00\x8a\xd4\x00g\x00\"\xed" + // 0x022B5 0x00338: 0x022ED + "\x00\xc1,\x06\x13 0L" + // 0x0304B 0x03099: 0x0304C + "\x00\xc14\x06\x13 0N" + // 0x0304D 0x03099: 0x0304E + "\x00\xc1<\x06\x13 0P" + // 0x0304F 0x03099: 0x03050 + "\x00\xc1D\x06\x13 0R" + // 0x03051 0x03099: 0x03052 + "\x00\xc1L\x06\x13 0T" + // 0x03053 0x03099: 0x03054 + "\x00\xc1T\x06\x13 0V" + // 0x03055 0x03099: 0x03056 + "\x00\xc1\\\x06\x13 0X" + // 0x03057 0x03099: 0x03058 + "\x00\xc1d\x06\x13 0Z" + // 0x03059 0x03099: 0x0305A + "\x00\xc1l\x06\x13 0\\" + // 0x0305B 0x03099: 0x0305C + "\x00\xc1t\x06\x13 0^" + // 0x0305D 0x03099: 0x0305E + "\x00\xc1|\x06\x13 0`" + // 0x0305F 0x03099: 0x03060 + "\x00\xc1\x84\x06\x13 0b" + // 0x03061 0x03099: 0x03062 + "\x00\xc1\x90\x06\x13 0e" + // 0x03064 0x03099: 0x03065 + "\x00\xc1\x98\x06\x13 0g" + // 0x03066 0x03099: 0x03067 + "\x00\xc1\xa0\x06\x13 0i" + // 0x03068 0x03099: 0x03069 + "\x00\xc1\xbc\x06\x13 0p" + // 0x0306F 0x03099: 0x03070 + "\x00\xc1\xbc\x06\x13@0q" + // 0x0306F 0x0309A: 0x03071 + "\x00\xc1\xc8\x06\x13 0s" + // 0x03072 0x03099: 0x03073 + "\x00\xc1\xc8\x06\x13@0t" + // 0x03072 0x0309A: 0x03074 + "\x00\xc1\xd4\x06\x13 0v" + // 0x03075 0x03099: 0x03076 + "\x00\xc1\xd4\x06\x13@0w" + // 0x03075 0x0309A: 0x03077 + "\x00\xc1\xe0\x06\x13 0y" + // 0x03078 0x03099: 0x03079 + "\x00\xc1\xe0\x06\x13@0z" + // 0x03078 0x0309A: 0x0307A + "\x00\xc1\xec\x06\x13 0|" + // 0x0307B 0x03099: 0x0307C + "\x00\xc1\xec\x06\x13@0}" + // 0x0307B 0x0309A: 0x0307D + "\x00\xc1\x18\x06\x13 0\x94" + // 0x03046 0x03099: 0x03094 + "\x00\xc2t\x06\x13 0\x9e" + // 0x0309D 0x03099: 0x0309E + "\x00¬\x06\x13 0\xac" + // 0x030AB 0x03099: 0x030AC + "\x00´\x06\x13 0\xae" + // 0x030AD 0x03099: 0x030AE + "\x00¼\x06\x13 0\xb0" + // 0x030AF 0x03099: 0x030B0 + "\x00\xc2\xc4\x06\x13 0\xb2" + // 0x030B1 0x03099: 0x030B2 + "\x00\xc2\xcc\x06\x13 0\xb4" + // 0x030B3 0x03099: 0x030B4 + "\x00\xc2\xd4\x06\x13 0\xb6" + // 0x030B5 0x03099: 0x030B6 + "\x00\xc2\xdc\x06\x13 0\xb8" + // 0x030B7 0x03099: 0x030B8 + "\x00\xc2\xe4\x06\x13 0\xba" + // 0x030B9 0x03099: 0x030BA + "\x00\xc2\xec\x06\x13 0\xbc" + // 0x030BB 0x03099: 0x030BC + "\x00\xc2\xf4\x06\x13 0\xbe" + // 0x030BD 0x03099: 0x030BE + "\x00\xc2\xfc\x06\x13 0\xc0" + // 0x030BF 0x03099: 0x030C0 + "\x00\xc3\x04\x06\x13 0\xc2" + // 0x030C1 0x03099: 0x030C2 + "\x00\xc3\x10\x06\x13 0\xc5" + // 0x030C4 0x03099: 0x030C5 + "\x00\xc3\x18\x06\x13 0\xc7" + // 0x030C6 0x03099: 0x030C7 + "\x00\xc3 \x06\x13 0\xc9" + // 0x030C8 0x03099: 0x030C9 + "\x00\xc3<\x06\x13 0\xd0" + // 0x030CF 0x03099: 0x030D0 + "\x00\xc3<\x06\x13@0\xd1" + // 0x030CF 0x0309A: 0x030D1 + "\x00\xc3H\x06\x13 0\xd3" + // 0x030D2 0x03099: 0x030D3 + "\x00\xc3H\x06\x13@0\xd4" + // 0x030D2 0x0309A: 0x030D4 + "\x00\xc3T\x06\x13 0\xd6" + // 0x030D5 0x03099: 0x030D6 + "\x00\xc3T\x06\x13@0\xd7" + // 0x030D5 0x0309A: 0x030D7 + "\x00\xc3`\x06\x13 0\xd9" + // 0x030D8 0x03099: 0x030D9 + "\x00\xc3`\x06\x13@0\xda" + // 0x030D8 0x0309A: 0x030DA + "\x00\xc3l\x06\x13 0\xdc" + // 0x030DB 0x03099: 0x030DC + "\x00\xc3l\x06\x13@0\xdd" + // 0x030DB 0x0309A: 0x030DD + "\x00\u0098\x06\x13 0\xf4" + // 0x030A6 0x03099: 0x030F4 + "\x00ü\x06\x13 0\xf7" + // 0x030EF 0x03099: 0x030F7 + "\x00\xc3\xc0\x06\x13 0\xf8" + // 0x030F0 0x03099: 0x030F8 + "\x00\xc3\xc4\x06\x13 0\xf9" + // 0x030F1 0x03099: 0x030F9 + "\x00\xc3\xc8\x06\x13 0\xfa" + // 0x030F2 0x03099: 0x030FA + "\x00\xc3\xf4\x06\x13 0\xfe" + // 0x030FD 0x03099: 0x030FE + "\x04\x17H\x00`\xe1\x05\xc9" + // 0x105D2 0x00307: 0x105C9 + "\x04\x17h\x00`\xe1\x05\xe4" + // 0x105DA 0x00307: 0x105E4 + "\x04Bd\"\x17A\x10\x9a" + // 0x11099 0x110BA: 0x1109A + "\x04Bl\"\x17A\x10\x9c" + // 0x1109B 0x110BA: 0x1109C + "\x04B\x94\"\x17A\x10\xab" + // 0x110A5 0x110BA: 0x110AB + "\x04D\xc4\"$\xe1\x11." + // 0x11131 0x11127: 0x1112E + "\x04D\xc8\"$\xe1\x11/" + // 0x11132 0x11127: 0x1112F + "\x04M\x1c\"g\xc1\x13K" + // 0x11347 0x1133E: 0x1134B + "\x04M\x1c\"j\xe1\x13L" + // 0x11347 0x11357: 0x1134C + "\x04N\b\"y!\x13\x83" + // 0x11382 0x113C9: 0x11383 + "\x04N\x10\"wa\x13\x85" + // 0x11384 0x113BB: 0x11385 + "\x04N,\"xA\x13\x8e" + // 0x1138B 0x113C2: 0x1138E + "\x04N@\"y!\x13\x91" + // 0x11390 0x113C9: 0x11391 + "\x04O\b\"xA\x13\xc5" + // 0x113C2 0x113C2: 0x113C5 + "\x04O\b\"w\x01\x13\xc7" + // 0x113C2 0x113B8: 0x113C7 + "\x04O\b\"y!\x13\xc8" + // 0x113C2 0x113C9: 0x113C8 + "\x04R\xe4\"\x97A\x14\xbb" + // 0x114B9 0x114BA: 0x114BB + "\x04R\xe4\"\x96\x01\x14\xbc" + // 0x114B9 0x114B0: 0x114BC + "\x04R\xe4\"\x97\xa1\x14\xbe" + // 0x114B9 0x114BD: 0x114BE + "\x04V\xe0\"\xb5\xe1\x15\xba" + // 0x115B8 0x115AF: 0x115BA + "\x04V\xe4\"\xb5\xe1\x15\xbb" + // 0x115B9 0x115AF: 0x115BB + "\x04d\xd4#&\x01\x198" + // 0x11935 0x11930: 0x11938 + "\x05\x84x,#\xc1a!" + // 0x1611E 0x1611E: 0x16121 + "\x05\x84x,%!a\"" + // 0x1611E 0x16129: 0x16122 + "\x05\x84x,#\xe1a#" + // 0x1611E 0x1611F: 0x16123 + "\x05\x84\xa4,#\xe1a$" + // 0x16129 0x1611F: 0x16124 + "\x05\x84x,$\x01a%" + // 0x1611E 0x16120: 0x16125 + "\x05\x84\x84,#\xe1a&" + // 0x16121 0x1611F: 0x16126 + "\x05\x84\x88,#\xe1a'" + // 0x16122 0x1611F: 0x16127 + "\x05\x84\x84,$\x01a(" + // 0x16121 0x16120: 0x16128 + "\x05\xb5\x9c-\xac\xe1mh" + // 0x16D67 0x16D67: 0x16D68 + "\x05\xb5\x8c-\xac\xe1mi" + // 0x16D63 0x16D67: 0x16D69 + "\x05\xb5\xa4-\xac\xe1mj" + // 0x16D69 0x16D67: 0x16D6A "" // Total size of tables: 57KB (58086 bytes) diff --git a/vendor/golang.org/x/text/unicode/norm/transform.go b/vendor/golang.org/x/text/unicode/norm/transform.go index a1d366ae487..583230d4dfa 100644 --- a/vendor/golang.org/x/text/unicode/norm/transform.go +++ b/vendor/golang.org/x/text/unicode/norm/transform.go @@ -33,7 +33,7 @@ func (f Form) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) return nDst + n, nSrc + n, err } - if err == nil && n < len(src) && !atEOF { + if err == nil && n < len(src) { err = transform.ErrShortSrc } return n, n, err @@ -67,6 +67,7 @@ func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) nSrc = end // Next quickSpan. + var err error end = rb.nsrc eof := atEOF if n := nSrc + len(dst) - nDst; n < end { @@ -79,7 +80,7 @@ func (f Form) transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) nSrc += n nDst += n if ok { - if err == nil && n < rb.nsrc && !atEOF { + if err == nil && nSrc < rb.nsrc { err = transform.ErrShortSrc } return nDst, nSrc, err diff --git a/vendor/golang.org/x/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE deleted file mode 100644 index 2a7cf70da6e..00000000000 --- a/vendor/golang.org/x/tools/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2009 The Go Authors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google LLC nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/tools/PATENTS b/vendor/golang.org/x/tools/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/golang.org/x/tools/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/tools/go/ast/edge/edge.go b/vendor/golang.org/x/tools/go/ast/edge/edge.go deleted file mode 100644 index 8dc4dd1502b..00000000000 --- a/vendor/golang.org/x/tools/go/ast/edge/edge.go +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package edge defines identifiers for each field of an ast.Node -// struct type that refers to another Node. -package edge - -import ( - "fmt" - "go/ast" - "reflect" -) - -// A Kind describes a field of an [ast.Node] struct. -type Kind uint8 - -// String returns a description of the edge kind. -func (k Kind) String() string { - if k == Invalid { - return "" - } - info := fieldInfos[k] - return fmt.Sprintf("%v.%s", info.nodeType.Elem().Name(), info.name) -} - -// NodeType returns the pointer-to-struct type of the ast.Node implementation. -func (k Kind) NodeType() reflect.Type { return fieldInfos[k].nodeType } - -// FieldName returns the name of the field. -func (k Kind) FieldName() string { return fieldInfos[k].name } - -// FieldType returns the declared type of the field. -func (k Kind) FieldType() reflect.Type { return fieldInfos[k].fieldType } - -// Get returns the direct child of n identified by (k, idx). -// n's type must match k.NodeType(). -// idx must be a valid slice index, or -1 for a non-slice. -func (k Kind) Get(n ast.Node, idx int) ast.Node { - if k.NodeType() != reflect.TypeOf(n) { - panic(fmt.Sprintf("%v.Get(%T): invalid node type", k, n)) - } - v := reflect.ValueOf(n).Elem().Field(fieldInfos[k].index) - - if v.Kind() == reflect.Slice { - v = v.Index(idx) // asserts valid idx - } else if idx != -1 { - panic(fmt.Sprintf("%v, Get(%T, %d): cannot index non-slice", v, n, idx)) - } - - out, _ := v.Interface().(ast.Node) // may be nil - return out -} - -// Each [Kind] is named Type_Field, where Type is the -// [ast.Node] struct type and Field is the name of the field -const ( - Invalid Kind = iota // for nodes at the root of the traversal - - // As of Go1.26 these kinds are sorted alphabetically, but - // numbering must be stable, so any new addition of const should - // use a new value (be added at the end of the list). - - ArrayType_Elt - ArrayType_Len - AssignStmt_Lhs - AssignStmt_Rhs - BinaryExpr_X - BinaryExpr_Y - BlockStmt_List - BranchStmt_Label - CallExpr_Args - CallExpr_Fun - CaseClause_Body - CaseClause_List - ChanType_Value - CommClause_Body - CommClause_Comm - CommentGroup_List - CompositeLit_Elts - CompositeLit_Type - DeclStmt_Decl - DeferStmt_Call - Ellipsis_Elt - ExprStmt_X - FieldList_List - Field_Comment - Field_Doc - Field_Names - Field_Tag - Field_Type - File_Decls - File_Doc - File_Name - ForStmt_Body - ForStmt_Cond - ForStmt_Init - ForStmt_Post - FuncDecl_Body - FuncDecl_Doc - FuncDecl_Name - FuncDecl_Recv - FuncDecl_Type - FuncLit_Body - FuncLit_Type - FuncType_Params - FuncType_Results - FuncType_TypeParams - GenDecl_Doc - GenDecl_Specs - GoStmt_Call - IfStmt_Body - IfStmt_Cond - IfStmt_Else - IfStmt_Init - ImportSpec_Comment - ImportSpec_Doc - ImportSpec_Name - ImportSpec_Path - IncDecStmt_X - IndexExpr_Index - IndexExpr_X - IndexListExpr_Indices - IndexListExpr_X - InterfaceType_Methods - KeyValueExpr_Key - KeyValueExpr_Value - LabeledStmt_Label - LabeledStmt_Stmt - MapType_Key - MapType_Value - ParenExpr_X - RangeStmt_Body - RangeStmt_Key - RangeStmt_Value - RangeStmt_X - ReturnStmt_Results - SelectStmt_Body - SelectorExpr_Sel - SelectorExpr_X - SendStmt_Chan - SendStmt_Value - SliceExpr_High - SliceExpr_Low - SliceExpr_Max - SliceExpr_X - StarExpr_X - StructType_Fields - SwitchStmt_Body - SwitchStmt_Init - SwitchStmt_Tag - TypeAssertExpr_Type - TypeAssertExpr_X - TypeSpec_Comment - TypeSpec_Doc - TypeSpec_Name - TypeSpec_Type - TypeSpec_TypeParams - TypeSwitchStmt_Assign - TypeSwitchStmt_Body - TypeSwitchStmt_Init - UnaryExpr_X - ValueSpec_Comment - ValueSpec_Doc - ValueSpec_Names - ValueSpec_Type - ValueSpec_Values - - maxKind -) - -// Assert that the encoding fits in 7 bits, -// as the inspector relies on this. -// (We are currently at 104.) -var _ = [1 << 7]struct{}{}[maxKind] - -type fieldInfo struct { - nodeType reflect.Type // pointer-to-struct type of ast.Node implementation - name string - index int - fieldType reflect.Type -} - -func info[N ast.Node](fieldName string) fieldInfo { - nodePtrType := reflect.TypeFor[N]() - f, ok := nodePtrType.Elem().FieldByName(fieldName) - if !ok { - panic(fieldName) - } - return fieldInfo{nodePtrType, fieldName, f.Index[0], f.Type} -} - -var fieldInfos = [...]fieldInfo{ - Invalid: {}, - ArrayType_Elt: info[*ast.ArrayType]("Elt"), - ArrayType_Len: info[*ast.ArrayType]("Len"), - AssignStmt_Lhs: info[*ast.AssignStmt]("Lhs"), - AssignStmt_Rhs: info[*ast.AssignStmt]("Rhs"), - BinaryExpr_X: info[*ast.BinaryExpr]("X"), - BinaryExpr_Y: info[*ast.BinaryExpr]("Y"), - BlockStmt_List: info[*ast.BlockStmt]("List"), - BranchStmt_Label: info[*ast.BranchStmt]("Label"), - CallExpr_Args: info[*ast.CallExpr]("Args"), - CallExpr_Fun: info[*ast.CallExpr]("Fun"), - CaseClause_Body: info[*ast.CaseClause]("Body"), - CaseClause_List: info[*ast.CaseClause]("List"), - ChanType_Value: info[*ast.ChanType]("Value"), - CommClause_Body: info[*ast.CommClause]("Body"), - CommClause_Comm: info[*ast.CommClause]("Comm"), - CommentGroup_List: info[*ast.CommentGroup]("List"), - CompositeLit_Elts: info[*ast.CompositeLit]("Elts"), - CompositeLit_Type: info[*ast.CompositeLit]("Type"), - DeclStmt_Decl: info[*ast.DeclStmt]("Decl"), - DeferStmt_Call: info[*ast.DeferStmt]("Call"), - Ellipsis_Elt: info[*ast.Ellipsis]("Elt"), - ExprStmt_X: info[*ast.ExprStmt]("X"), - FieldList_List: info[*ast.FieldList]("List"), - Field_Comment: info[*ast.Field]("Comment"), - Field_Doc: info[*ast.Field]("Doc"), - Field_Names: info[*ast.Field]("Names"), - Field_Tag: info[*ast.Field]("Tag"), - Field_Type: info[*ast.Field]("Type"), - File_Decls: info[*ast.File]("Decls"), - File_Doc: info[*ast.File]("Doc"), - File_Name: info[*ast.File]("Name"), - ForStmt_Body: info[*ast.ForStmt]("Body"), - ForStmt_Cond: info[*ast.ForStmt]("Cond"), - ForStmt_Init: info[*ast.ForStmt]("Init"), - ForStmt_Post: info[*ast.ForStmt]("Post"), - FuncDecl_Body: info[*ast.FuncDecl]("Body"), - FuncDecl_Doc: info[*ast.FuncDecl]("Doc"), - FuncDecl_Name: info[*ast.FuncDecl]("Name"), - FuncDecl_Recv: info[*ast.FuncDecl]("Recv"), - FuncDecl_Type: info[*ast.FuncDecl]("Type"), - FuncLit_Body: info[*ast.FuncLit]("Body"), - FuncLit_Type: info[*ast.FuncLit]("Type"), - FuncType_Params: info[*ast.FuncType]("Params"), - FuncType_Results: info[*ast.FuncType]("Results"), - FuncType_TypeParams: info[*ast.FuncType]("TypeParams"), - GenDecl_Doc: info[*ast.GenDecl]("Doc"), - GenDecl_Specs: info[*ast.GenDecl]("Specs"), - GoStmt_Call: info[*ast.GoStmt]("Call"), - IfStmt_Body: info[*ast.IfStmt]("Body"), - IfStmt_Cond: info[*ast.IfStmt]("Cond"), - IfStmt_Else: info[*ast.IfStmt]("Else"), - IfStmt_Init: info[*ast.IfStmt]("Init"), - ImportSpec_Comment: info[*ast.ImportSpec]("Comment"), - ImportSpec_Doc: info[*ast.ImportSpec]("Doc"), - ImportSpec_Name: info[*ast.ImportSpec]("Name"), - ImportSpec_Path: info[*ast.ImportSpec]("Path"), - IncDecStmt_X: info[*ast.IncDecStmt]("X"), - IndexExpr_Index: info[*ast.IndexExpr]("Index"), - IndexExpr_X: info[*ast.IndexExpr]("X"), - IndexListExpr_Indices: info[*ast.IndexListExpr]("Indices"), - IndexListExpr_X: info[*ast.IndexListExpr]("X"), - InterfaceType_Methods: info[*ast.InterfaceType]("Methods"), - KeyValueExpr_Key: info[*ast.KeyValueExpr]("Key"), - KeyValueExpr_Value: info[*ast.KeyValueExpr]("Value"), - LabeledStmt_Label: info[*ast.LabeledStmt]("Label"), - LabeledStmt_Stmt: info[*ast.LabeledStmt]("Stmt"), - MapType_Key: info[*ast.MapType]("Key"), - MapType_Value: info[*ast.MapType]("Value"), - ParenExpr_X: info[*ast.ParenExpr]("X"), - RangeStmt_Body: info[*ast.RangeStmt]("Body"), - RangeStmt_Key: info[*ast.RangeStmt]("Key"), - RangeStmt_Value: info[*ast.RangeStmt]("Value"), - RangeStmt_X: info[*ast.RangeStmt]("X"), - ReturnStmt_Results: info[*ast.ReturnStmt]("Results"), - SelectStmt_Body: info[*ast.SelectStmt]("Body"), - SelectorExpr_Sel: info[*ast.SelectorExpr]("Sel"), - SelectorExpr_X: info[*ast.SelectorExpr]("X"), - SendStmt_Chan: info[*ast.SendStmt]("Chan"), - SendStmt_Value: info[*ast.SendStmt]("Value"), - SliceExpr_High: info[*ast.SliceExpr]("High"), - SliceExpr_Low: info[*ast.SliceExpr]("Low"), - SliceExpr_Max: info[*ast.SliceExpr]("Max"), - SliceExpr_X: info[*ast.SliceExpr]("X"), - StarExpr_X: info[*ast.StarExpr]("X"), - StructType_Fields: info[*ast.StructType]("Fields"), - SwitchStmt_Body: info[*ast.SwitchStmt]("Body"), - SwitchStmt_Init: info[*ast.SwitchStmt]("Init"), - SwitchStmt_Tag: info[*ast.SwitchStmt]("Tag"), - TypeAssertExpr_Type: info[*ast.TypeAssertExpr]("Type"), - TypeAssertExpr_X: info[*ast.TypeAssertExpr]("X"), - TypeSpec_Comment: info[*ast.TypeSpec]("Comment"), - TypeSpec_Doc: info[*ast.TypeSpec]("Doc"), - TypeSpec_Name: info[*ast.TypeSpec]("Name"), - TypeSpec_Type: info[*ast.TypeSpec]("Type"), - TypeSpec_TypeParams: info[*ast.TypeSpec]("TypeParams"), - TypeSwitchStmt_Assign: info[*ast.TypeSwitchStmt]("Assign"), - TypeSwitchStmt_Body: info[*ast.TypeSwitchStmt]("Body"), - TypeSwitchStmt_Init: info[*ast.TypeSwitchStmt]("Init"), - UnaryExpr_X: info[*ast.UnaryExpr]("X"), - ValueSpec_Comment: info[*ast.ValueSpec]("Comment"), - ValueSpec_Doc: info[*ast.ValueSpec]("Doc"), - ValueSpec_Names: info[*ast.ValueSpec]("Names"), - ValueSpec_Type: info[*ast.ValueSpec]("Type"), - ValueSpec_Values: info[*ast.ValueSpec]("Values"), -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/cursor.go b/vendor/golang.org/x/tools/go/ast/inspector/cursor.go deleted file mode 100644 index 1c482252da8..00000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/cursor.go +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package inspector - -import ( - "fmt" - "go/ast" - "go/token" - "iter" - "reflect" - "strings" - - "golang.org/x/tools/go/ast/edge" -) - -// A Cursor represents an [ast.Node]. It is immutable. -// -// Two Cursors compare equal if they represent the same node. -// -// The zero value of Cursor is not valid. -// -// Call [Inspector.Root] to obtain a cursor for the virtual root node -// of the traversal. This is the sole valid cursor for which [Cursor.Node] -// returns nil. -// -// Use the following methods to navigate efficiently around the tree: -// - for ancestors, use [Cursor.Parent] and [Cursor.Enclosing]; -// - for children, use [Cursor.Child], [Cursor.Children], -// [Cursor.FirstChild], and [Cursor.LastChild]; -// - for siblings, use [Cursor.PrevSibling] and [Cursor.NextSibling]; -// - for descendants, use [Cursor.FindByPos], [Cursor.FindNode], -// [Cursor.Inspect], and [Cursor.Preorder]. -// -// Use the [Cursor.ChildAt] and [Cursor.ParentEdge] methods for -// information about the edges in a tree: which field (and slice -// element) of the parent node holds the child. -type Cursor struct { - in *Inspector - index int32 // index of push node; -1 for virtual root node -} - -// Root returns a valid cursor for the virtual root node, -// whose children are the files provided to [New]. -// -// Its [Cursor.Node] method return nil. -func (in *Inspector) Root() Cursor { - return Cursor{in, -1} -} - -// At returns the cursor at the specified index in the traversal, -// which must have been obtained from [Cursor.Index] on a Cursor -// belonging to the same Inspector (see [Cursor.Inspector]). -func (in *Inspector) At(index int32) Cursor { - if index < 0 { - panic("negative index") - } - if int(index) >= len(in.events) { - panic("index out of range for this inspector") - } - if in.events[index].index < index { - panic("invalid index") // (a push, not a pop) - } - return Cursor{in, index} -} - -// Valid reports whether the cursor is valid. -// The zero value of cursor is invalid. -// Unless otherwise documented, it is not safe to call -// any other method on an invalid cursor. -func (c Cursor) Valid() bool { - return c.in != nil -} - -// Inspector returns the cursor's Inspector. -// It returns nil if the Cursor is not valid. -func (c Cursor) Inspector() *Inspector { return c.in } - -// Index returns the index of this cursor position within the package. -// -// Clients should not assume anything about the numeric Index value -// except that it increases monotonically throughout the traversal. -// It is provided for use with [Inspector.At]. -// -// Index must not be called on the Root node. -func (c Cursor) Index() int32 { - if c.index < 0 { - panic("Index called on Root node") - } - return c.index -} - -// Node returns the node at the current cursor position, -// or nil for the cursor returned by [Inspector.Root]. -func (c Cursor) Node() ast.Node { - if c.index < 0 { - return nil - } - return c.in.events[c.index].node -} - -// String returns information about the cursor's node, if any. -func (c Cursor) String() string { - if !c.Valid() { - return "(invalid)" - } - if c.index < 0 { - return "(root)" - } - return reflect.TypeOf(c.Node()).String() -} - -// GoString returns a string describing the cursor's path from the -// root, if any. -func (c Cursor) GoString() string { - if !c.Valid() { - return "(invalid)" - } - if c.index < 0 { - return "(root)" - } - // e.g "File.Decls[1].(*ast.GenDecl).Specs[0].(*ast.TypeSpec)" - // - // In hindsight even the File node should have reported a - // virtual ParentEdge of (Root_Files, i) where i is the index - // among the files passed to NewInspector. Then the path would - // read "(root).Files[i]", etc; but we missed the boat. - var buf strings.Builder - buf.WriteString("File") - var visit func(Cursor) - visit = func(c Cursor) { - ek, idx := c.ParentEdge() - if ek == edge.Invalid { - return // File - } - visit(c.Parent()) - fmt.Fprintf(&buf, ".%s", ek.FieldName()) - if idx >= 0 { - fmt.Fprintf(&buf, "[%d]", idx) - } - ftype := ek.FieldType() - if idx >= 0 { - ftype = ftype.Elem() // []T -> T - } - if ftype.Kind() == reflect.Interface { - fmt.Fprintf(&buf, ".(%T)", c.Node()) - } - } - visit(c) - return buf.String() -} - -// indices return the [start, end) half-open interval of event indices. -func (c Cursor) indices() (int32, int32) { - if c.index < 0 { - return 0, int32(len(c.in.events)) // root: all events - } else { - return c.index, c.in.events[c.index].index + 1 // just one subtree - } -} - -// Preorder returns an iterator over the nodes of the subtree -// represented by c in depth-first order. Each node in the sequence is -// represented by a Cursor that allows access to the Node, but may -// also be used to start a new traversal, or to obtain the stack of -// nodes enclosing the cursor. -// -// The traversal sequence is determined by [ast.Inspect]. The types -// argument, if non-empty, enables type-based filtering of events. The -// function f if is called only for nodes whose type matches an -// element of the types slice. -// -// If you need control over descent into subtrees, -// or need both pre- and post-order notifications, use [Cursor.Inspect] -func (c Cursor) Preorder(types ...ast.Node) iter.Seq[Cursor] { - mask := maskOf(types) - - return func(yield func(Cursor) bool) { - events := c.in.events - - for i, limit := c.indices(); i < limit; { - ev := events[i] - if ev.index > i { // push? - if ev.typ&mask != 0 && !yield(Cursor{c.in, i}) { - break - } - pop := ev.index - if events[pop].typ&mask == 0 { - // Subtree does not contain types: skip. - i = pop + 1 - continue - } - } - i++ - } - } -} - -// Inspect visits the nodes of the subtree represented by c in -// depth-first order. It calls f(n) for each node n before it -// visits n's children. If f returns true, Inspect invokes f -// recursively for each of the non-nil children of the node. -// -// Each node is represented by a Cursor that allows access to the -// Node, but may also be used to start a new traversal, or to obtain -// the stack of nodes enclosing the cursor. -// -// The complete traversal sequence is determined by [ast.Inspect]. -// The types argument, if non-empty, enables type-based filtering of -// events. The function f if is called only for nodes whose type -// matches an element of the types slice. -func (c Cursor) Inspect(types []ast.Node, f func(c Cursor) (descend bool)) { - mask := maskOf(types) - events := c.in.events - for i, limit := c.indices(); i < limit; { - ev := events[i] - if ev.index > i { - // push - pop := ev.index - if ev.typ&mask != 0 && !f(Cursor{c.in, i}) || - events[pop].typ&mask == 0 { - // The user opted not to descend, or the - // subtree does not contain types: - // skip past the pop. - i = pop + 1 - continue - } - } - i++ - } -} - -// Enclosing returns an iterator over the nodes enclosing the current -// current node, starting with the Cursor itself. -// -// Enclosing must not be called on the Root node (whose [Cursor.Node] returns nil). -// -// The types argument, if non-empty, enables type-based filtering of -// events: the sequence includes only enclosing nodes whose type -// matches an element of the types slice. -func (c Cursor) Enclosing(types ...ast.Node) iter.Seq[Cursor] { - if c.index < 0 { - panic("Cursor.Enclosing called on Root node") - } - - mask := maskOf(types) - - return func(yield func(Cursor) bool) { - events := c.in.events - for i := c.index; i >= 0; i = events[i].parent { - if events[i].typ&mask != 0 && !yield(Cursor{c.in, i}) { - break - } - } - } -} - -// Parent returns the parent of the current node. -// -// Parent must not be called on the Root node (whose [Cursor.Node] returns nil). -func (c Cursor) Parent() Cursor { - if c.index < 0 { - panic("Cursor.Parent called on Root node") - } - - return Cursor{c.in, c.in.events[c.index].parent} -} - -// ParentEdge returns the identity of the field in the parent node -// that holds this cursor's node, and if it is a list, the index within it. -// -// For example, f(x, y) is a CallExpr whose three children are Idents. -// f has edge kind [edge.CallExpr_Fun] and index -1. -// x and y have kind [edge.CallExpr_Args] and indices 0 and 1, respectively. -// -// If called on a child of the Root node, it returns ([edge.Invalid], -1). -// -// ParentEdge must not be called on the Root node (whose [Cursor.Node] returns nil). -func (c Cursor) ParentEdge() (edge.Kind, int) { - if c.index < 0 { - panic("Cursor.ParentEdge called on Root node") - } - events := c.in.events - pop := events[c.index].index - return unpackEdgeKindAndIndex(events[pop].parent) -} - -// ParentEdgeKind returns the kind component of the result of [Cursor.ParentEdge]. -func (c Cursor) ParentEdgeKind() edge.Kind { - ek, _ := c.ParentEdge() - return ek -} - -// ParentEdgeIndex returns the index component of the result of [Cursor.ParentEdge]. -func (c Cursor) ParentEdgeIndex() int { - _, index := c.ParentEdge() - return index -} - -// ChildAt returns the cursor for the child of the -// current node identified by its edge and index. -// The index must be -1 if the edge.Kind is not a slice. -// The indicated child node must exist. -// -// ChildAt must not be called on the Root node (whose [Cursor.Node] returns nil). -// -// Invariant: c.Parent().ChildAt(c.ParentEdge()) == c. -func (c Cursor) ChildAt(k edge.Kind, idx int) Cursor { - target := packEdgeKindAndIndex(k, idx) - - // Unfortunately there's no shortcut to looping. - events := c.in.events - i := c.index + 1 - for { - pop := events[i].index - if pop < i { - break - } - if events[pop].parent == target { - return Cursor{c.in, i} - } - i = pop + 1 - } - panic(fmt.Sprintf("ChildAt(%v, %d): no such child of %v", k, idx, c)) -} - -// Child returns the cursor for n, which must be a direct child of c's Node. -// -// Child must not be called on the Root node (whose [Cursor.Node] returns nil). -func (c Cursor) Child(n ast.Node) Cursor { - if c.index < 0 { - panic("Cursor.Child called on Root node") - } - - if false { - // reference implementation - for child := range c.Children() { - if child.Node() == n { - return child - } - } - - } else { - // optimized implementation - events := c.in.events - for i := c.index + 1; events[i].index > i; i = events[i].index + 1 { - if events[i].node == n { - return Cursor{c.in, i} - } - } - } - panic(fmt.Sprintf("Child(%T): not a child of %v", n, c)) -} - -// NextSibling returns the cursor for the next sibling node in the same list -// (for example, of files, decls, specs, statements, fields, or expressions) as -// the current node. It returns (zero, false) if the node is the last node in -// the list, or is not part of a list. -// -// NextSibling must not be called on the Root node. -// -// See note at [Cursor.Children]. -func (c Cursor) NextSibling() (Cursor, bool) { - if c.index < 0 { - panic("Cursor.NextSibling called on Root node") - } - - events := c.in.events - i := events[c.index].index + 1 // after corresponding pop - if i < int32(len(events)) { - if events[i].index > i { // push? - return Cursor{c.in, i}, true - } - } - return Cursor{}, false -} - -// PrevSibling returns the cursor for the previous sibling node in the -// same list (for example, of files, decls, specs, statements, fields, -// or expressions) as the current node. It returns zero if the node is -// the first node in the list, or is not part of a list. -// -// It must not be called on the Root node. -// -// See note at [Cursor.Children]. -func (c Cursor) PrevSibling() (Cursor, bool) { - if c.index < 0 { - panic("Cursor.PrevSibling called on Root node") - } - - events := c.in.events - i := c.index - 1 - if i >= 0 { - if j := events[i].index; j < i { // pop? - return Cursor{c.in, j}, true - } - } - return Cursor{}, false -} - -// FirstChild returns the first direct child of the current node, -// or zero if it has no children. -func (c Cursor) FirstChild() (Cursor, bool) { - events := c.in.events - i := c.index + 1 // i=0 if c is root - if i < int32(len(events)) && events[i].index > i { // push? - return Cursor{c.in, i}, true - } - return Cursor{}, false -} - -// LastChild returns the last direct child of the current node, -// or zero if it has no children. -func (c Cursor) LastChild() (Cursor, bool) { - events := c.in.events - if c.index < 0 { // root? - if len(events) > 0 { - // return push of final event (a pop) - return Cursor{c.in, events[len(events)-1].index}, true - } - } else { - j := events[c.index].index - 1 // before corresponding pop - // Inv: j == c.index if c has no children - // or j is last child's pop. - if j > c.index { // c has children - return Cursor{c.in, events[j].index}, true - } - } - return Cursor{}, false -} - -// Children returns an iterator over the direct children of the -// current node, if any. -// -// When using Children, NextChild, and PrevChild, bear in mind that a -// Node's children may come from different fields, some of which may -// be lists of nodes without a distinguished intervening container -// such as [ast.BlockStmt]. -// -// For example, [ast.CaseClause] has a field List of expressions and a -// field Body of statements, so the children of a CaseClause are a mix -// of expressions and statements. Other nodes that have "uncontained" -// list fields include: -// -// - [ast.ValueSpec] (Names, Values) -// - [ast.CompositeLit] (Type, Elts) -// - [ast.IndexListExpr] (X, Indices) -// - [ast.CallExpr] (Fun, Args) -// - [ast.AssignStmt] (Lhs, Rhs) -// -// So, do not assume that the previous sibling of an ast.Stmt is also -// an ast.Stmt, or if it is, that they are executed sequentially, -// unless you have established that, say, its parent is a BlockStmt -// or its [Cursor.ParentEdge] is [edge.BlockStmt_List]. -// For example, given "for S1; ; S2 {}", the predecessor of S2 is S1, -// even though they are not executed in sequence. -func (c Cursor) Children() iter.Seq[Cursor] { - return func(yield func(Cursor) bool) { - c, ok := c.FirstChild() - for ok && yield(c) { - c, ok = c.NextSibling() - } - } -} - -// Contains reports whether c contains or is equal to c2. -// -// Both Cursors must belong to the same [Inspector]; -// neither may be its Root node. -func (c Cursor) Contains(c2 Cursor) bool { - if c.in != c2.in { - panic("different inspectors") - } - events := c.in.events - return c.index <= c2.index && events[c2.index].index <= events[c.index].index -} - -// FindNode returns the cursor for node n if it belongs to the subtree -// rooted at c. It returns zero if n is not found. -func (c Cursor) FindNode(n ast.Node) (Cursor, bool) { - - // FindNode is equivalent to this code, - // but more convenient and 15-20% faster: - if false { - for candidate := range c.Preorder(n) { - if candidate.Node() == n { - return candidate, true - } - } - return Cursor{}, false - } - - // TODO(adonovan): opt: should we assume Node.Pos is accurate - // and combine type-based filtering with position filtering - // like FindByPos? - - mask := maskOf([]ast.Node{n}) - events := c.in.events - - for i, limit := c.indices(); i < limit; i++ { - ev := events[i] - if ev.index > i { // push? - if ev.typ&mask != 0 && ev.node == n { - return Cursor{c.in, i}, true - } - pop := ev.index - if events[pop].typ&mask == 0 { - // Subtree does not contain type of n: skip. - i = pop - } - } - } - return Cursor{}, false -} - -// FindByPos returns the cursor for the innermost node n in the tree -// rooted at c such that n.Pos() <= start && end <= n.End(). -// (For an *ast.File, it uses the bounds n.FileStart-n.FileEnd.) -// -// An empty range (start == end) between two adjacent nodes is -// considered to belong to the first node. -// -// It returns zero if none is found. -// Precondition: start <= end. -// -// See also [astutil.PathEnclosingInterval], which -// tolerates adjoining whitespace. -func (c Cursor) FindByPos(start, end token.Pos) (Cursor, bool) { - if end < start { - panic("end < start") - } - events := c.in.events - - // This algorithm could be implemented using c.Inspect, - // but it is about 2.5x slower. - - // best is the push-index of the latest (=innermost) node containing range. - // (Beware: latest is not always innermost because FuncDecl.{Name,Type} overlap.) - best := int32(-1) - for i, limit := c.indices(); i < limit; i++ { - ev := events[i] - if ev.index > i { // push? - n := ev.node - var nodeEnd token.Pos - if file, ok := n.(*ast.File); ok { - nodeEnd = file.FileEnd - // Note: files may be out of Pos order. - if file.FileStart > start { - i = ev.index // disjoint, after; skip to next file - continue - } - } else { - // Edge case: FuncDecl.Name and .Type overlap: - // Don't update best from Name to FuncDecl.Type. - // - // The condition can be read as: - // - n is FuncType - // - n.parent is FuncDecl - // - best is strictly beneath the FuncDecl - if ev.typ == 1< ev.parent { - continue - } - - nodeEnd = n.End() - if n.Pos() > start { - break // disjoint, after; stop - } - } - - // Inv: node.{Pos,FileStart} <= start - if end <= nodeEnd { - // node fully contains target range - best = i - - // Don't search beyond end of the first match. - // This is important only for an empty range (start=end) - // between two adjoining nodes, which would otherwise - // match both nodes; we want to match only the first. - limit = ev.index - } else if nodeEnd < start { - i = ev.index // disjoint, before; skip forward - } - } - } - if best >= 0 { - return Cursor{c.in, best}, true - } - return Cursor{}, false -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/inspector.go b/vendor/golang.org/x/tools/go/ast/inspector/inspector.go deleted file mode 100644 index b414d17ebd7..00000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/inspector.go +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package inspector provides helper functions for traversal over the -// syntax trees of a package, including node filtering by type, and -// materialization of the traversal stack. -// -// During construction, the inspector does a complete traversal and -// builds a list of push/pop events and their node type. Subsequent -// method calls that request a traversal scan this list, rather than walk -// the AST, and perform type filtering using efficient bit sets. -// This representation is sometimes called a "balanced parenthesis tree." -// -// Experiments suggest the inspector's traversals are about 2.5x faster -// than [ast.Inspect], but it may take around 5 traversals for this -// benefit to amortize the inspector's construction cost. -// If efficiency is the primary concern, do not use Inspector for -// one-off traversals. -// -// The [Cursor] type provides a more flexible API for efficient -// navigation of syntax trees in all four "cardinal directions". For -// example, traversals may be nested, so you can find each node of -// type A and then search within it for nodes of type B. Or you can -// traverse from a node to its immediate neighbors: its parent, its -// previous and next sibling, or its first and last child. We -// recommend using methods of Cursor in preference to Inspector where -// possible. -package inspector - -// There are four orthogonal features in a traversal: -// 1 type filtering -// 2 pruning -// 3 postorder calls to f -// 4 stack -// Rather than offer all of them in the API, -// only a few combinations are exposed: -// - Preorder is the fastest and has fewest features, -// but is the most commonly needed traversal. -// - Nodes and WithStack both provide pruning and postorder calls, -// even though few clients need it, because supporting two versions -// is not justified. -// More combinations could be supported by expressing them as -// wrappers around a more generic traversal, but this was measured -// and found to degrade performance significantly (30%). - -import ( - "go/ast" - - "golang.org/x/tools/go/ast/edge" -) - -// An Inspector provides methods for inspecting -// (traversing) the syntax trees of a package. -type Inspector struct { - events []event -} - -func packEdgeKindAndIndex(ek edge.Kind, index int) int32 { - return int32(uint32(index+1)<<7 | uint32(ek)) -} - -// unpackEdgeKindAndIndex unpacks the edge kind and edge index (within -// an []ast.Node slice) from the parent field of a pop event. -func unpackEdgeKindAndIndex(x int32) (edge.Kind, int) { - // The "parent" field of a pop node holds the - // edge Kind in the lower 7 bits and the index+1 - // in the upper 25. - return edge.Kind(x & 0x7f), int(x>>7) - 1 -} - -// New returns an Inspector for the specified syntax trees. -func New(files []*ast.File) *Inspector { - return &Inspector{traverse(files)} -} - -// An event represents a push or a pop -// of an ast.Node during a traversal. -type event struct { - node ast.Node - typ uint64 // typeOf(node) on push event, or union of typ strictly between push and pop events on pop events - index int32 // index of corresponding push or pop event - parent int32 // index of parent's push node (push nodes only), or packed edge kind/index (pop nodes only) -} - -// TODO: Experiment with storing only the second word of event.node (unsafe.Pointer). -// Type can be recovered from the sole bit in typ. -// [Tried this, wasn't faster. --adonovan] - -// Preorder visits all the nodes of the files supplied to [New] in -// depth-first order. It calls f(n) for each node n before it visits -// n's children. -// -// The complete traversal sequence is determined by [ast.Inspect]. -// The types argument, if non-empty, enables type-based filtering of -// events. The function f is called only for nodes whose type -// matches an element of the types slice. -// -// The [Cursor.Preorder] method provides a richer alternative interface. -// Example: -// -// for c := range in.Root().Preorder(types) { ... } -func (in *Inspector) Preorder(types []ast.Node, f func(ast.Node)) { - // Because it avoids postorder calls to f, and the pruning - // check, Preorder is almost twice as fast as Nodes. The two - // features seem to contribute similar slowdowns (~1.4x each). - - // This function is equivalent to the PreorderSeq call below, - // but to avoid the additional dynamic call (which adds 13-35% - // to the benchmarks), we expand it out. - // - // in.PreorderSeq(types...)(func(n ast.Node) bool { - // f(n) - // return true - // }) - - mask := maskOf(types) - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - if ev.typ&mask != 0 { - f(ev.node) - } - pop := ev.index - if in.events[pop].typ&mask == 0 { - // Subtrees do not contain types: skip them and pop. - i = pop + 1 - continue - } - } - i++ - } -} - -// Nodes visits the nodes of the files supplied to [New] in depth-first -// order. It calls f(n, true) for each node n before it visits n's -// children. If f returns true, Nodes invokes f recursively for each -// of the non-nil children of the node, followed by a call of -// f(n, false). -// -// The complete traversal sequence is determined by [ast.Inspect]. -// The types argument, if non-empty, enables type-based filtering of -// events. The function f if is called only for nodes whose type -// matches an element of the types slice. -// -// The [Cursor.Inspect] method provides a richer alternative interface. -// Example: -// -// in.Root().Inspect(types, func(c Cursor) bool { -// ... -// return true -// } -func (in *Inspector) Nodes(types []ast.Node, f func(n ast.Node, push bool) (proceed bool)) { - mask := maskOf(types) - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - pop := ev.index - if ev.typ&mask != 0 { - if !f(ev.node, true) { - i = pop + 1 // jump to corresponding pop + 1 - continue - } - } - if in.events[pop].typ&mask == 0 { - // Subtrees do not contain types: skip them. - i = pop - continue - } - } else { - // pop - push := ev.index - if in.events[push].typ&mask != 0 { - f(ev.node, false) - } - } - i++ - } -} - -// WithStack visits nodes in a similar manner to Nodes, but it -// supplies each call to f an additional argument, the current -// traversal stack. The stack's first element is the outermost node, -// an *ast.File; its last is the innermost, n. -// -// The [Cursor.Inspect] method provides a richer alternative interface. -// Example: -// -// in.Root().Inspect(types, func(c Cursor) bool { -// stack := slices.Collect(c.Enclosing()) -// ... -// return true -// }) -func (in *Inspector) WithStack(types []ast.Node, f func(n ast.Node, push bool, stack []ast.Node) (proceed bool)) { - mask := maskOf(types) - var stack []ast.Node - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - pop := ev.index - stack = append(stack, ev.node) - if ev.typ&mask != 0 { - if !f(ev.node, true, stack) { - i = pop + 1 - stack = stack[:len(stack)-1] - continue - } - } - if in.events[pop].typ&mask == 0 { - // Subtrees does not contain types: skip them. - i = pop - continue - } - } else { - // pop - push := ev.index - if in.events[push].typ&mask != 0 { - f(ev.node, false, stack) - } - stack = stack[:len(stack)-1] - } - i++ - } -} - -// traverse builds the table of events representing a traversal. -func traverse(files []*ast.File) []event { - // Preallocate approximate number of events - // based on source file extent of the declarations. - // (We use End-Pos not FileStart-FileEnd to neglect - // the effect of long doc comments.) - // This makes traverse faster by 4x (!). - var extent int - for _, f := range files { - extent += int(f.End() - f.Pos()) - } - // This estimate is based on the net/http package. - capacity := min(extent*33/100, 1e6) // impose some reasonable maximum (1M) - - v := &visitor{ - events: make([]event, 0, capacity), - stack: []item{{index: -1}}, // include an extra event so file nodes have a parent - } - for _, file := range files { - walk(v, edge.Invalid, -1, file) - } - return v.events -} - -type visitor struct { - events []event - stack []item -} - -type item struct { - index int32 // index of current node's push event - parentIndex int32 // index of parent node's push event - typAccum uint64 // accumulated type bits of current node's descendants - edgeKindAndIndex int32 // edge.Kind and index, bit packed -} - -func (v *visitor) push(ek edge.Kind, eindex int, node ast.Node) { - var ( - index = int32(len(v.events)) - parentIndex = v.stack[len(v.stack)-1].index - ) - v.events = append(v.events, event{ - node: node, - parent: parentIndex, - typ: typeOf(node), - index: 0, // (pop index is set later by visitor.pop) - }) - v.stack = append(v.stack, item{ - index: index, - parentIndex: parentIndex, - edgeKindAndIndex: packEdgeKindAndIndex(ek, eindex), - }) - - // 2B nodes ought to be enough for anyone! - if int32(len(v.events)) < 0 { - panic("event index exceeded int32") - } - - // 32M elements in an []ast.Node ought to be enough for anyone! - if ek2, eindex2 := unpackEdgeKindAndIndex(packEdgeKindAndIndex(ek, eindex)); ek2 != ek || eindex2 != eindex { - panic("Node slice index exceeded uint25") - } -} - -func (v *visitor) pop(node ast.Node) { - top := len(v.stack) - 1 - current := v.stack[top] - - push := &v.events[current.index] - parent := &v.stack[top-1] - - push.index = int32(len(v.events)) // make push event refer to pop - parent.typAccum |= current.typAccum | push.typ // accumulate type bits into parent - - v.stack = v.stack[:top] - - v.events = append(v.events, event{ - node: node, - typ: current.typAccum, - index: current.index, - parent: current.edgeKindAndIndex, // see [unpackEdgeKindAndIndex] - }) -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/iter.go b/vendor/golang.org/x/tools/go/ast/inspector/iter.go deleted file mode 100644 index b68c553d413..00000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/iter.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.23 - -package inspector - -import ( - "go/ast" - "iter" -) - -// PreorderSeq returns an iterator that visits all the -// nodes of the files supplied to [New] in depth-first order. -// It visits each node n before n's children. -// The complete traversal sequence is determined by ast.Inspect. -// -// The types argument, if non-empty, enables type-based filtering: -// only nodes whose type matches an element of the types slice are -// included in the sequence. -// -// Example: -// -// for call := range in.PreorderSeq((*ast.CallExpr)(nil)) { ... } -// -// The [All] function is more convenient if there is exactly one node type: -// -// for call := range All[*ast.CallExpr](in) { ... } -// -// See also the newer and more flexible [Cursor] API, which lets you -// start the traversal at an arbitrary node, and reports each matching -// node by its Cursor, enabling easier navigation. -// The above example would be written thus: -// -// for curCall := range in.Root().Preorder((*ast.CallExpr)(nil)) { -// call := curCall.Node().(*ast.CallExpr) -// ... -// } -func (in *Inspector) PreorderSeq(types ...ast.Node) iter.Seq[ast.Node] { - - // This implementation is identical to Preorder, - // except that it supports breaking out of the loop. - - return func(yield func(ast.Node) bool) { - mask := maskOf(types) - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - if ev.typ&mask != 0 { - if !yield(ev.node) { - break - } - } - pop := ev.index - if in.events[pop].typ&mask == 0 { - // Subtrees do not contain types: skip them and pop. - i = pop + 1 - continue - } - } - i++ - } - } -} - -// All[N] returns an iterator over all the nodes of type N. -// N must be a pointer-to-struct type that implements ast.Node. -// -// Example: -// -// for call := range All[*ast.CallExpr](in) { ... } -// -// See also the newer and more flexible [Cursor] API, which lets you -// start the traversal at an arbitrary node, and reports each matching -// node by its Cursor, enabling easier navigation. -// The above example would be written thus: -// -// for curCall := range in.Root().Preorder((*ast.CallExpr)(nil)) { -// call := curCall.Node().(*ast.CallExpr) -// ... -// } -func All[N interface { - *S - ast.Node -}, S any](in *Inspector) iter.Seq[N] { - - // To avoid additional dynamic call overheads, - // we duplicate rather than call the logic of PreorderSeq. - - mask := typeOf((N)(nil)) - return func(yield func(N) bool) { - for i := int32(0); i < int32(len(in.events)); { - ev := in.events[i] - if ev.index > i { - // push - if ev.typ&mask != 0 { - if !yield(ev.node.(N)) { - break - } - } - pop := ev.index - if in.events[pop].typ&mask == 0 { - // Subtrees do not contain types: skip them and pop. - i = pop + 1 - continue - } - } - i++ - } - } -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/typeof.go b/vendor/golang.org/x/tools/go/ast/inspector/typeof.go deleted file mode 100644 index 9852331a3db..00000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/typeof.go +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package inspector - -// This file defines func typeOf(ast.Node) uint64. -// -// The initial map-based implementation was too slow; -// see https://go-review.googlesource.com/c/tools/+/135655/1/go/ast/inspector/inspector.go#196 - -import ( - "go/ast" - "math" -) - -const ( - nArrayType = iota - nAssignStmt - nBadDecl - nBadExpr - nBadStmt - nBasicLit - nBinaryExpr - nBlockStmt - nBranchStmt - nCallExpr - nCaseClause - nChanType - nCommClause - nComment - nCommentGroup - nCompositeLit - nDeclStmt - nDeferStmt - nEllipsis - nEmptyStmt - nExprStmt - nField - nFieldList - nFile - nForStmt - nFuncDecl - nFuncLit - nFuncType - nGenDecl - nGoStmt - nIdent - nIfStmt - nImportSpec - nIncDecStmt - nIndexExpr - nIndexListExpr - nInterfaceType - nKeyValueExpr - nLabeledStmt - nMapType - nPackage - nParenExpr - nRangeStmt - nReturnStmt - nSelectStmt - nSelectorExpr - nSendStmt - nSliceExpr - nStarExpr - nStructType - nSwitchStmt - nTypeAssertExpr - nTypeSpec - nTypeSwitchStmt - nUnaryExpr - nValueSpec -) - -// typeOf returns a distinct single-bit value that represents the type of n. -// -// Various implementations were benchmarked with BenchmarkNewInspector: -// -// GOGC=off -// - type switch 4.9-5.5ms 2.1ms -// - binary search over a sorted list of types 5.5-5.9ms 2.5ms -// - linear scan, frequency-ordered list 5.9-6.1ms 2.7ms -// - linear scan, unordered list 6.4ms 2.7ms -// - hash table 6.5ms 3.1ms -// -// A perfect hash seemed like overkill. -// -// The compiler's switch statement is the clear winner -// as it produces a binary tree in code, -// with constant conditions and good branch prediction. -// (Sadly it is the most verbose in source code.) -// Binary search suffered from poor branch prediction. -func typeOf(n ast.Node) uint64 { - // Fast path: nearly half of all nodes are identifiers. - if _, ok := n.(*ast.Ident); ok { - return 1 << nIdent - } - - // These cases include all nodes encountered by ast.Inspect. - switch n.(type) { - case *ast.ArrayType: - return 1 << nArrayType - case *ast.AssignStmt: - return 1 << nAssignStmt - case *ast.BadDecl: - return 1 << nBadDecl - case *ast.BadExpr: - return 1 << nBadExpr - case *ast.BadStmt: - return 1 << nBadStmt - case *ast.BasicLit: - return 1 << nBasicLit - case *ast.BinaryExpr: - return 1 << nBinaryExpr - case *ast.BlockStmt: - return 1 << nBlockStmt - case *ast.BranchStmt: - return 1 << nBranchStmt - case *ast.CallExpr: - return 1 << nCallExpr - case *ast.CaseClause: - return 1 << nCaseClause - case *ast.ChanType: - return 1 << nChanType - case *ast.CommClause: - return 1 << nCommClause - case *ast.Comment: - return 1 << nComment - case *ast.CommentGroup: - return 1 << nCommentGroup - case *ast.CompositeLit: - return 1 << nCompositeLit - case *ast.DeclStmt: - return 1 << nDeclStmt - case *ast.DeferStmt: - return 1 << nDeferStmt - case *ast.Ellipsis: - return 1 << nEllipsis - case *ast.EmptyStmt: - return 1 << nEmptyStmt - case *ast.ExprStmt: - return 1 << nExprStmt - case *ast.Field: - return 1 << nField - case *ast.FieldList: - return 1 << nFieldList - case *ast.File: - return 1 << nFile - case *ast.ForStmt: - return 1 << nForStmt - case *ast.FuncDecl: - return 1 << nFuncDecl - case *ast.FuncLit: - return 1 << nFuncLit - case *ast.FuncType: - return 1 << nFuncType - case *ast.GenDecl: - return 1 << nGenDecl - case *ast.GoStmt: - return 1 << nGoStmt - case *ast.Ident: - return 1 << nIdent - case *ast.IfStmt: - return 1 << nIfStmt - case *ast.ImportSpec: - return 1 << nImportSpec - case *ast.IncDecStmt: - return 1 << nIncDecStmt - case *ast.IndexExpr: - return 1 << nIndexExpr - case *ast.IndexListExpr: - return 1 << nIndexListExpr - case *ast.InterfaceType: - return 1 << nInterfaceType - case *ast.KeyValueExpr: - return 1 << nKeyValueExpr - case *ast.LabeledStmt: - return 1 << nLabeledStmt - case *ast.MapType: - return 1 << nMapType - case *ast.Package: - return 1 << nPackage - case *ast.ParenExpr: - return 1 << nParenExpr - case *ast.RangeStmt: - return 1 << nRangeStmt - case *ast.ReturnStmt: - return 1 << nReturnStmt - case *ast.SelectStmt: - return 1 << nSelectStmt - case *ast.SelectorExpr: - return 1 << nSelectorExpr - case *ast.SendStmt: - return 1 << nSendStmt - case *ast.SliceExpr: - return 1 << nSliceExpr - case *ast.StarExpr: - return 1 << nStarExpr - case *ast.StructType: - return 1 << nStructType - case *ast.SwitchStmt: - return 1 << nSwitchStmt - case *ast.TypeAssertExpr: - return 1 << nTypeAssertExpr - case *ast.TypeSpec: - return 1 << nTypeSpec - case *ast.TypeSwitchStmt: - return 1 << nTypeSwitchStmt - case *ast.UnaryExpr: - return 1 << nUnaryExpr - case *ast.ValueSpec: - return 1 << nValueSpec - } - return 0 -} - -func maskOf(nodes []ast.Node) uint64 { - if len(nodes) == 0 { - return math.MaxUint64 // match all node types - } - var mask uint64 - for _, n := range nodes { - mask |= typeOf(n) - } - return mask -} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/walk.go b/vendor/golang.org/x/tools/go/ast/inspector/walk.go deleted file mode 100644 index 5f1c93c8a73..00000000000 --- a/vendor/golang.org/x/tools/go/ast/inspector/walk.go +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package inspector - -// This file is a fork of ast.Inspect to reduce unnecessary dynamic -// calls and to gather edge information. -// -// Consistency with the original is ensured by TestInspectAllNodes. - -import ( - "fmt" - "go/ast" - - "golang.org/x/tools/go/ast/edge" -) - -func walkList[N ast.Node](v *visitor, ek edge.Kind, list []N) { - for i, node := range list { - walk(v, ek, i, node) - } -} - -func walk(v *visitor, ek edge.Kind, index int, node ast.Node) { - v.push(ek, index, node) - - // walk children - // (the order of the cases matches the order - // of the corresponding node types in ast.go) - switch n := node.(type) { - // Comments and fields - case *ast.Comment: - // nothing to do - - case *ast.CommentGroup: - walkList(v, edge.CommentGroup_List, n.List) - - case *ast.Field: - if n.Doc != nil { - walk(v, edge.Field_Doc, -1, n.Doc) - } - walkList(v, edge.Field_Names, n.Names) - if n.Type != nil { - walk(v, edge.Field_Type, -1, n.Type) - } - if n.Tag != nil { - walk(v, edge.Field_Tag, -1, n.Tag) - } - if n.Comment != nil { - walk(v, edge.Field_Comment, -1, n.Comment) - } - - case *ast.FieldList: - walkList(v, edge.FieldList_List, n.List) - - // Expressions - case *ast.BadExpr, *ast.Ident, *ast.BasicLit: - // nothing to do - - case *ast.Ellipsis: - if n.Elt != nil { - walk(v, edge.Ellipsis_Elt, -1, n.Elt) - } - - case *ast.FuncLit: - walk(v, edge.FuncLit_Type, -1, n.Type) - walk(v, edge.FuncLit_Body, -1, n.Body) - - case *ast.CompositeLit: - if n.Type != nil { - walk(v, edge.CompositeLit_Type, -1, n.Type) - } - walkList(v, edge.CompositeLit_Elts, n.Elts) - - case *ast.ParenExpr: - walk(v, edge.ParenExpr_X, -1, n.X) - - case *ast.SelectorExpr: - walk(v, edge.SelectorExpr_X, -1, n.X) - walk(v, edge.SelectorExpr_Sel, -1, n.Sel) - - case *ast.IndexExpr: - walk(v, edge.IndexExpr_X, -1, n.X) - walk(v, edge.IndexExpr_Index, -1, n.Index) - - case *ast.IndexListExpr: - walk(v, edge.IndexListExpr_X, -1, n.X) - walkList(v, edge.IndexListExpr_Indices, n.Indices) - - case *ast.SliceExpr: - walk(v, edge.SliceExpr_X, -1, n.X) - if n.Low != nil { - walk(v, edge.SliceExpr_Low, -1, n.Low) - } - if n.High != nil { - walk(v, edge.SliceExpr_High, -1, n.High) - } - if n.Max != nil { - walk(v, edge.SliceExpr_Max, -1, n.Max) - } - - case *ast.TypeAssertExpr: - walk(v, edge.TypeAssertExpr_X, -1, n.X) - if n.Type != nil { - walk(v, edge.TypeAssertExpr_Type, -1, n.Type) - } - - case *ast.CallExpr: - walk(v, edge.CallExpr_Fun, -1, n.Fun) - walkList(v, edge.CallExpr_Args, n.Args) - - case *ast.StarExpr: - walk(v, edge.StarExpr_X, -1, n.X) - - case *ast.UnaryExpr: - walk(v, edge.UnaryExpr_X, -1, n.X) - - case *ast.BinaryExpr: - walk(v, edge.BinaryExpr_X, -1, n.X) - walk(v, edge.BinaryExpr_Y, -1, n.Y) - - case *ast.KeyValueExpr: - walk(v, edge.KeyValueExpr_Key, -1, n.Key) - walk(v, edge.KeyValueExpr_Value, -1, n.Value) - - // Types - case *ast.ArrayType: - if n.Len != nil { - walk(v, edge.ArrayType_Len, -1, n.Len) - } - walk(v, edge.ArrayType_Elt, -1, n.Elt) - - case *ast.StructType: - walk(v, edge.StructType_Fields, -1, n.Fields) - - case *ast.FuncType: - if n.TypeParams != nil { - walk(v, edge.FuncType_TypeParams, -1, n.TypeParams) - } - if n.Params != nil { - walk(v, edge.FuncType_Params, -1, n.Params) - } - if n.Results != nil { - walk(v, edge.FuncType_Results, -1, n.Results) - } - - case *ast.InterfaceType: - walk(v, edge.InterfaceType_Methods, -1, n.Methods) - - case *ast.MapType: - walk(v, edge.MapType_Key, -1, n.Key) - walk(v, edge.MapType_Value, -1, n.Value) - - case *ast.ChanType: - walk(v, edge.ChanType_Value, -1, n.Value) - - // Statements - case *ast.BadStmt: - // nothing to do - - case *ast.DeclStmt: - walk(v, edge.DeclStmt_Decl, -1, n.Decl) - - case *ast.EmptyStmt: - // nothing to do - - case *ast.LabeledStmt: - walk(v, edge.LabeledStmt_Label, -1, n.Label) - walk(v, edge.LabeledStmt_Stmt, -1, n.Stmt) - - case *ast.ExprStmt: - walk(v, edge.ExprStmt_X, -1, n.X) - - case *ast.SendStmt: - walk(v, edge.SendStmt_Chan, -1, n.Chan) - walk(v, edge.SendStmt_Value, -1, n.Value) - - case *ast.IncDecStmt: - walk(v, edge.IncDecStmt_X, -1, n.X) - - case *ast.AssignStmt: - walkList(v, edge.AssignStmt_Lhs, n.Lhs) - walkList(v, edge.AssignStmt_Rhs, n.Rhs) - - case *ast.GoStmt: - walk(v, edge.GoStmt_Call, -1, n.Call) - - case *ast.DeferStmt: - walk(v, edge.DeferStmt_Call, -1, n.Call) - - case *ast.ReturnStmt: - walkList(v, edge.ReturnStmt_Results, n.Results) - - case *ast.BranchStmt: - if n.Label != nil { - walk(v, edge.BranchStmt_Label, -1, n.Label) - } - - case *ast.BlockStmt: - walkList(v, edge.BlockStmt_List, n.List) - - case *ast.IfStmt: - if n.Init != nil { - walk(v, edge.IfStmt_Init, -1, n.Init) - } - walk(v, edge.IfStmt_Cond, -1, n.Cond) - walk(v, edge.IfStmt_Body, -1, n.Body) - if n.Else != nil { - walk(v, edge.IfStmt_Else, -1, n.Else) - } - - case *ast.CaseClause: - walkList(v, edge.CaseClause_List, n.List) - walkList(v, edge.CaseClause_Body, n.Body) - - case *ast.SwitchStmt: - if n.Init != nil { - walk(v, edge.SwitchStmt_Init, -1, n.Init) - } - if n.Tag != nil { - walk(v, edge.SwitchStmt_Tag, -1, n.Tag) - } - walk(v, edge.SwitchStmt_Body, -1, n.Body) - - case *ast.TypeSwitchStmt: - if n.Init != nil { - walk(v, edge.TypeSwitchStmt_Init, -1, n.Init) - } - walk(v, edge.TypeSwitchStmt_Assign, -1, n.Assign) - walk(v, edge.TypeSwitchStmt_Body, -1, n.Body) - - case *ast.CommClause: - if n.Comm != nil { - walk(v, edge.CommClause_Comm, -1, n.Comm) - } - walkList(v, edge.CommClause_Body, n.Body) - - case *ast.SelectStmt: - walk(v, edge.SelectStmt_Body, -1, n.Body) - - case *ast.ForStmt: - if n.Init != nil { - walk(v, edge.ForStmt_Init, -1, n.Init) - } - if n.Cond != nil { - walk(v, edge.ForStmt_Cond, -1, n.Cond) - } - if n.Post != nil { - walk(v, edge.ForStmt_Post, -1, n.Post) - } - walk(v, edge.ForStmt_Body, -1, n.Body) - - case *ast.RangeStmt: - if n.Key != nil { - walk(v, edge.RangeStmt_Key, -1, n.Key) - } - if n.Value != nil { - walk(v, edge.RangeStmt_Value, -1, n.Value) - } - walk(v, edge.RangeStmt_X, -1, n.X) - walk(v, edge.RangeStmt_Body, -1, n.Body) - - // Declarations - case *ast.ImportSpec: - if n.Doc != nil { - walk(v, edge.ImportSpec_Doc, -1, n.Doc) - } - if n.Name != nil { - walk(v, edge.ImportSpec_Name, -1, n.Name) - } - walk(v, edge.ImportSpec_Path, -1, n.Path) - if n.Comment != nil { - walk(v, edge.ImportSpec_Comment, -1, n.Comment) - } - - case *ast.ValueSpec: - if n.Doc != nil { - walk(v, edge.ValueSpec_Doc, -1, n.Doc) - } - walkList(v, edge.ValueSpec_Names, n.Names) - if n.Type != nil { - walk(v, edge.ValueSpec_Type, -1, n.Type) - } - walkList(v, edge.ValueSpec_Values, n.Values) - if n.Comment != nil { - walk(v, edge.ValueSpec_Comment, -1, n.Comment) - } - - case *ast.TypeSpec: - if n.Doc != nil { - walk(v, edge.TypeSpec_Doc, -1, n.Doc) - } - walk(v, edge.TypeSpec_Name, -1, n.Name) - if n.TypeParams != nil { - walk(v, edge.TypeSpec_TypeParams, -1, n.TypeParams) - } - walk(v, edge.TypeSpec_Type, -1, n.Type) - if n.Comment != nil { - walk(v, edge.TypeSpec_Comment, -1, n.Comment) - } - - case *ast.BadDecl: - // nothing to do - - case *ast.GenDecl: - if n.Doc != nil { - walk(v, edge.GenDecl_Doc, -1, n.Doc) - } - walkList(v, edge.GenDecl_Specs, n.Specs) - - case *ast.FuncDecl: - if n.Doc != nil { - walk(v, edge.FuncDecl_Doc, -1, n.Doc) - } - if n.Recv != nil { - walk(v, edge.FuncDecl_Recv, -1, n.Recv) - } - walk(v, edge.FuncDecl_Name, -1, n.Name) - walk(v, edge.FuncDecl_Type, -1, n.Type) - if n.Body != nil { - walk(v, edge.FuncDecl_Body, -1, n.Body) - } - - case *ast.File: - if n.Doc != nil { - walk(v, edge.File_Doc, -1, n.Doc) - } - walk(v, edge.File_Name, -1, n.Name) - walkList(v, edge.File_Decls, n.Decls) - // don't walk n.Comments - they have been - // visited already through the individual - // nodes - - default: - // (includes *ast.Package) - panic(fmt.Sprintf("Walk: unexpected node type %T", n)) - } - - v.pop(node) -} diff --git a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go deleted file mode 100644 index 7b90bc92353..00000000000 --- a/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gcexportdata provides functions for reading and writing -// export data, which is a serialized description of the API of a Go -// package including the names, kinds, types, and locations of all -// exported declarations. -// -// The standard Go compiler (cmd/compile) writes an export data file -// for each package it compiles, which it later reads when compiling -// packages that import the earlier one. The compiler must thus -// contain logic to both write and read export data. -// (See the "Export" section in the cmd/compile/README file.) -// -// The [Read] function in this package can read files produced by the -// compiler, producing [go/types] data structures. As a matter of -// policy, Read supports export data files produced by only the last -// two Go releases plus tip; see https://go.dev/issue/68898. The -// export data files produced by the compiler contain additional -// details related to generics, inlining, and other optimizations that -// cannot be decoded by the [Read] function. -// -// In files written by the compiler, the export data is not at the -// start of the file. Before calling Read, use [NewReader] to locate -// the desired portion of the file. -// -// The [Write] function in this package encodes the exported API of a -// Go package ([types.Package]) as a file. Such files can be later -// decoded by Read, but cannot be consumed by the compiler. -// -// # Future changes -// -// Although Read supports the formats written by both Write and the -// compiler, the two are quite different, and there is an open -// proposal (https://go.dev/issue/69491) to separate these APIs. -// -// Under that proposal, this package would ultimately provide only the -// Read operation for compiler export data, which must be defined in -// this module (golang.org/x/tools), not in the standard library, to -// avoid version skew for developer tools that need to read compiler -// export data both before and after a Go release, such as from Go -// 1.23 to Go 1.24. Because this package lives in the tools module, -// clients can update their version of the module some time before the -// Go 1.24 release and rebuild and redeploy their tools, which will -// then be able to consume both Go 1.23 and Go 1.24 export data files, -// so they will work before and after the Go update. (See discussion -// at https://go.dev/issue/15651.) -// -// The operations to import and export [go/types] data structures -// would be defined in the go/types package as Import and Export. -// [Write] would (eventually) delegate to Export, -// and [Read], when it detects a file produced by Export, -// would delegate to Import. -// -// # Deprecations -// -// The [NewImporter] and [Find] functions are deprecated and should -// not be used in new code. The [WriteBundle] and [ReadBundle] -// functions are experimental, and there is an open proposal to -// deprecate them (https://go.dev/issue/69573). -package gcexportdata - -import ( - "bufio" - "bytes" - "encoding/json" - "fmt" - "go/token" - "go/types" - "io" - "os/exec" - - "golang.org/x/tools/internal/gcimporter" -) - -// Find returns the name of an object (.o) or archive (.a) file -// containing type information for the specified import path, -// using the go command. -// If no file was found, an empty filename is returned. -// -// A relative srcDir is interpreted relative to the current working directory. -// -// Find also returns the package's resolved (canonical) import path, -// reflecting the effects of srcDir and vendoring on importPath. -// -// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages, -// which is more efficient. -func Find(importPath, srcDir string) (filename, path string) { - cmd := exec.Command("go", "list", "-json", "-export", "--", importPath) - cmd.Dir = srcDir - out, err := cmd.Output() - if err != nil { - return "", "" - } - var data struct { - ImportPath string - Export string - } - json.Unmarshal(out, &data) - return data.Export, data.ImportPath -} - -// NewReader returns a reader for the export data section of an object -// (.o) or archive (.a) file read from r. The new reader may provide -// additional trailing data beyond the end of the export data. -func NewReader(r io.Reader) (io.Reader, error) { - buf := bufio.NewReader(r) - size, err := gcimporter.FindExportData(buf) - if err != nil { - return nil, err - } - - // We were given an archive and found the __.PKGDEF in it. - // This tells us the size of the export data, and we don't - // need to return the entire file. - return &io.LimitedReader{ - R: buf, - N: size, - }, nil -} - -// readAll works the same way as io.ReadAll, but avoids allocations and copies -// by preallocating a byte slice of the necessary size if the size is known up -// front. This is always possible when the input is an archive. In that case, -// NewReader will return the known size using an io.LimitedReader. -func readAll(r io.Reader) ([]byte, error) { - if lr, ok := r.(*io.LimitedReader); ok { - data := make([]byte, lr.N) - _, err := io.ReadFull(lr, data) - return data, err - } - return io.ReadAll(r) -} - -// Read reads export data from in, decodes it, and returns type -// information for the package. -// -// Read is capable of reading export data produced by [Write] at the -// same source code version, or by the last two Go releases (plus tip) -// of the standard Go compiler. Reading files from older compilers may -// produce an error. -// -// The package path (effectively its linker symbol prefix) is -// specified by path, since unlike the package name, this information -// may not be recorded in the export data. -// -// File position information is added to fset. -// -// Read may inspect and add to the imports map to ensure that references -// within the export data to other packages are consistent. The caller -// must ensure that imports[path] does not exist, or exists but is -// incomplete (see types.Package.Complete), and Read inserts the -// resulting package into this map entry. -// -// On return, the state of the reader is undefined. -func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) { - data, err := readAll(in) - if err != nil { - return nil, fmt.Errorf("reading export data for %q: %v", path, err) - } - - if bytes.HasPrefix(data, []byte("!")) { - return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path) - } - - // The indexed export format starts with an 'i'; the older - // binary export format starts with a 'c', 'd', or 'v' - // (from "version"). Select appropriate importer. - if len(data) > 0 { - switch data[0] { - case 'v', 'c', 'd': - // binary, produced by cmd/compile till go1.10 - return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0]) - - case 'i': - // indexed, produced by cmd/compile till go1.19, - // and also by [Write]. - // - // If proposal #69491 is accepted, go/types - // serialization will be implemented by - // types.Export, to which Write would eventually - // delegate (explicitly dropping any pretence at - // inter-version Write-Read compatibility). - // This [Read] function would delegate to types.Import - // when it detects that the file was produced by Export. - _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) - return pkg, err - - case 'u': - // unified, produced by cmd/compile since go1.20 - _, pkg, err := gcimporter.UImportData(fset, imports, data[1:], path) - return pkg, err - - default: - l := min(len(data), 10) - return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), path) - } - } - return nil, fmt.Errorf("empty export data for %s", path) -} - -// Write writes encoded type information for the specified package to out. -// The FileSet provides file position information for named objects. -func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - if _, err := io.WriteString(out, "i"); err != nil { - return err - } - return gcimporter.IExportData(out, fset, pkg) -} - -// ReadBundle reads an export bundle from in, decodes it, and returns type -// information for the packages. -// File position information is added to fset. -// -// ReadBundle may inspect and add to the imports map to ensure that references -// within the export bundle to other packages are consistent. -// -// On return, the state of the reader is undefined. -// -// Experimental: This API is experimental and may change in the future. -func ReadBundle(in io.Reader, fset *token.FileSet, imports map[string]*types.Package) ([]*types.Package, error) { - data, err := readAll(in) - if err != nil { - return nil, fmt.Errorf("reading export bundle: %v", err) - } - return gcimporter.IImportBundle(fset, imports, data) -} - -// WriteBundle writes encoded type information for the specified packages to out. -// The FileSet provides file position information for named objects. -// -// Experimental: This API is experimental and may change in the future. -func WriteBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { - return gcimporter.IExportBundle(out, fset, pkgs) -} diff --git a/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/vendor/golang.org/x/tools/go/gcexportdata/importer.go deleted file mode 100644 index 37a7247e268..00000000000 --- a/vendor/golang.org/x/tools/go/gcexportdata/importer.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcexportdata - -import ( - "fmt" - "go/token" - "go/types" - "os" -) - -// NewImporter returns a new instance of the types.Importer interface -// that reads type information from export data files written by gc. -// The Importer also satisfies types.ImporterFrom. -// -// Export data files are located using "go build" workspace conventions -// and the build.Default context. -// -// Use this importer instead of go/importer.For("gc", ...) to avoid the -// version-skew problems described in the documentation of this package, -// or to control the FileSet or access the imports map populated during -// package loading. -// -// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages, -// which is more efficient. -func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom { - return importer{fset, imports} -} - -type importer struct { - fset *token.FileSet - imports map[string]*types.Package -} - -func (imp importer) Import(importPath string) (*types.Package, error) { - return imp.ImportFrom(importPath, "", 0) -} - -func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) { - filename, path := Find(importPath, srcDir) - if filename == "" { - if importPath == "unsafe" { - // Even for unsafe, call Find first in case - // the package was vendored. - return types.Unsafe, nil - } - return nil, fmt.Errorf("can't find import: %s", importPath) - } - - if pkg, ok := imp.imports[path]; ok && pkg.Complete() { - return pkg, nil // cache hit - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - f.Close() - if err != nil { - // add file name to error - err = fmt.Errorf("reading export data: %s: %v", filename, err) - } - }() - - r, err := NewReader(f) - if err != nil { - return nil, err - } - - return Read(r, imp.fset, imp.imports, path) -} diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go deleted file mode 100644 index 366aab6b2ca..00000000000 --- a/vendor/golang.org/x/tools/go/packages/doc.go +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package packages loads Go packages for inspection and analysis. - -The [Load] function takes as input a list of patterns and returns a -list of [Package] values describing individual packages matched by those -patterns. -A [Config] specifies configuration options, the most important of which is -the [LoadMode], which controls the amount of detail in the loaded packages. - -Load passes most patterns directly to the underlying build tool. -The default build tool is the go command. -Its supported patterns are described at -https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns. -Other build systems may be supported by providing a "driver"; -see [The driver protocol]. - -All patterns with the prefix "query=", where query is a -non-empty string of letters from [a-z], are reserved and may be -interpreted as query operators. - -Two query operators are currently supported: "file" and "pattern". - -The query "file=path/to/file.go" matches the package or packages enclosing -the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go" -might return the packages "fmt" and "fmt [fmt.test]". - -The query "pattern=string" causes "string" to be passed directly to -the underlying build tool. In most cases this is unnecessary, -but an application can use Load("pattern=" + x) as an escaping mechanism -to ensure that x is not interpreted as a query operator if it contains '='. - -All other query operators are reserved for future use and currently -cause Load to report an error. - -The Package struct provides basic information about the package, including - - - ID, a unique identifier for the package in the returned set; - - GoFiles, the names of the package's Go source files; - - Imports, a map from source import strings to the Packages they name; - - Types, the type information for the package's exported symbols; - - Syntax, the parsed syntax trees for the package's source code; and - - TypesInfo, the result of a complete type-check of the package syntax trees. - -(See the documentation for type Package for the complete list of fields -and more detailed descriptions.) - -For example, - - Load(nil, "bytes", "unicode...") - -returns four Package structs describing the standard library packages -bytes, unicode, unicode/utf16, and unicode/utf8. Note that one pattern -can match multiple packages and that a package might be matched by -multiple patterns: in general it is not possible to determine which -packages correspond to which patterns. - -Note that the list returned by Load contains only the packages matched -by the patterns. Their dependencies can be found by walking the import -graph using the Imports fields. - -The Load function can be configured by passing a pointer to a Config as -the first argument. A nil Config is equivalent to the zero Config, which -causes Load to run in [LoadFiles] mode, collecting minimal information. -See the documentation for type Config for details. - -As noted earlier, the Config.Mode controls the amount of detail -reported about the loaded packages. See the documentation for type LoadMode -for details. - -Most tools should pass their command-line arguments (after any flags) -uninterpreted to Load, so that it can interpret them -according to the conventions of the underlying build system. - -See the Example function for typical usage. -See also [golang.org/x/tools/go/packages/internal/linecount] -for an example application. - -# The driver protocol - -Load may be used to load Go packages even in Go projects that use -alternative build systems, by installing an appropriate "driver" -program for the build system and specifying its location in the -GOPACKAGESDRIVER environment variable. -For example, -https://github.com/bazelbuild/rules_go/wiki/Editor-and-tool-integration -explains how to use the driver for Bazel. - -The driver program is responsible for interpreting patterns in its -preferred notation and reporting information about the packages that -those patterns identify. Drivers must also support the special "file=" -and "pattern=" patterns described above. - -The patterns are provided as positional command-line arguments. A -JSON-encoded [DriverRequest] message providing additional information -is written to the driver's standard input. The driver must write a -JSON-encoded [DriverResponse] message to its standard output. (This -message differs from the JSON schema produced by 'go list'.) - -The value of the PWD environment variable seen by the driver process -is the preferred name of its working directory. (The working directory -may have other aliases due to symbolic links; see the comment on the -Dir field of [exec.Cmd] for related information.) -When the driver process emits in its response the name of a file -that is a descendant of this directory, it must use an absolute path -that has the value of PWD as a prefix, to ensure that the returned -filenames satisfy the original query. -*/ -package packages // import "golang.org/x/tools/go/packages" - -/* - -Motivation and design considerations - -The new package's design solves problems addressed by two existing -packages: go/build, which locates and describes packages, and -golang.org/x/tools/go/loader, which loads, parses and type-checks them. -The go/build.Package structure encodes too much of the 'go build' way -of organizing projects, leaving us in need of a data type that describes a -package of Go source code independent of the underlying build system. -We wanted something that works equally well with go build and vgo, and -also other build systems such as Bazel and Blaze, making it possible to -construct analysis tools that work in all these environments. -Tools such as errcheck and staticcheck were essentially unavailable to -the Go community at Google, and some of Google's internal tools for Go -are unavailable externally. -This new package provides a uniform way to obtain package metadata by -querying each of these build systems, optionally supporting their -preferred command-line notations for packages, so that tools integrate -neatly with users' build environments. The Metadata query function -executes an external query tool appropriate to the current workspace. - -Loading packages always returns the complete import graph "all the way down", -even if all you want is information about a single package, because the query -mechanisms of all the build systems we currently support ({go,vgo} list, and -blaze/bazel aspect-based query) cannot provide detailed information -about one package without visiting all its dependencies too, so there is -no additional asymptotic cost to providing transitive information. -(This property might not be true of a hypothetical 5th build system.) - -In calls to TypeCheck, all initial packages, and any package that -transitively depends on one of them, must be loaded from source. -Consider A->B->C->D->E: if A,C are initial, A,B,C must be loaded from -source; D may be loaded from export data, and E may not be loaded at all -(though it's possible that D's export data mentions it, so a -types.Package may be created for it and exposed.) - -The old loader had a feature to suppress type-checking of function -bodies on a per-package basis, primarily intended to reduce the work of -obtaining type information for imported packages. Now that imports are -satisfied by export data, the optimization no longer seems necessary. - -Despite some early attempts, the old loader did not exploit export data, -instead always using the equivalent of WholeProgram mode. This was due -to the complexity of mixing source and export data packages (now -resolved by the upward traversal mentioned above), and because export data -files were nearly always missing or stale. Now that 'go build' supports -caching, all the underlying build systems can guarantee to produce -export data in a reasonable (amortized) time. - -Test "main" packages synthesized by the build system are now reported as -first-class packages, avoiding the need for clients (such as go/ssa) to -reinvent this generation logic. - -One way in which go/packages is simpler than the old loader is in its -treatment of in-package tests. In-package tests are packages that -consist of all the files of the library under test, plus the test files. -The old loader constructed in-package tests by a two-phase process of -mutation called "augmentation": first it would construct and type check -all the ordinary library packages and type-check the packages that -depend on them; then it would add more (test) files to the package and -type-check again. This two-phase approach had four major problems: -1) in processing the tests, the loader modified the library package, - leaving no way for a client application to see both the test - package and the library package; one would mutate into the other. -2) because test files can declare additional methods on types defined in - the library portion of the package, the dispatch of method calls in - the library portion was affected by the presence of the test files. - This should have been a clue that the packages were logically - different. -3) this model of "augmentation" assumed at most one in-package test - per library package, which is true of projects using 'go build', - but not other build systems. -4) because of the two-phase nature of test processing, all packages that - import the library package had to be processed before augmentation, - forcing a "one-shot" API and preventing the client from calling Load - in several times in sequence as is now possible in WholeProgram mode. - (TypeCheck mode has a similar one-shot restriction for a different reason.) - -Early drafts of this package supported "multi-shot" operation. -Although it allowed clients to make a sequence of calls (or concurrent -calls) to Load, building up the graph of Packages incrementally, -it was of marginal value: it complicated the API -(since it allowed some options to vary across calls but not others), -it complicated the implementation, -it cannot be made to work in Types mode, as explained above, -and it was less efficient than making one combined call (when this is possible). -Among the clients we have inspected, none made multiple calls to load -but could not be easily and satisfactorily modified to make only a single call. -However, applications changes may be required. -For example, the ssadump command loads the user-specified packages -and in addition the runtime package. It is tempting to simply append -"runtime" to the user-provided list, but that does not work if the user -specified an ad-hoc package such as [a.go b.go]. -Instead, ssadump no longer requests the runtime package, -but seeks it among the dependencies of the user-specified packages, -and emits an error if it is not found. - -Questions & Tasks - -- Add GOARCH/GOOS? - They are not portable concepts, but could be made portable. - Our goal has been to allow users to express themselves using the conventions - of the underlying build system: if the build system honors GOARCH - during a build and during a metadata query, then so should - applications built atop that query mechanism. - Conversely, if the target architecture of the build is determined by - command-line flags, the application can pass the relevant - flags through to the build system using a command such as: - myapp -query_flag="--cpu=amd64" -query_flag="--os=darwin" - However, this approach is low-level, unwieldy, and non-portable. - GOOS and GOARCH seem important enough to warrant a dedicated option. - -- How should we handle partial failures such as a mixture of good and - malformed patterns, existing and non-existent packages, successful and - failed builds, import failures, import cycles, and so on, in a call to - Load? - -- Support bazel, blaze, and go1.10 list, not just go1.11 list. - -- Handle (and test) various partial success cases, e.g. - a mixture of good packages and: - invalid patterns - nonexistent packages - empty packages - packages with malformed package or import declarations - unreadable files - import cycles - other parse errors - type errors - Make sure we record errors at the correct place in the graph. - -- Missing packages among initial arguments are not reported. - Return bogus packages for them, like golist does. - -- "undeclared name" errors (for example) are reported out of source file - order. I suspect this is due to the breadth-first resolution now used - by go/types. Is that a bug? Discuss with gri. - -*/ diff --git a/vendor/golang.org/x/tools/go/packages/external.go b/vendor/golang.org/x/tools/go/packages/external.go deleted file mode 100644 index f37bc651009..00000000000 --- a/vendor/golang.org/x/tools/go/packages/external.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -// This file defines the protocol that enables an external "driver" -// tool to supply package metadata in place of 'go list'. - -import ( - "bytes" - "encoding/json" - "fmt" - "os" - "os/exec" - "slices" - "strings" -) - -// DriverRequest defines the schema of a request for package metadata -// from an external driver program. The JSON-encoded DriverRequest -// message is provided to the driver program's standard input. The -// query patterns are provided as command-line arguments. -// -// See the package documentation for an overview. -type DriverRequest struct { - Mode LoadMode `json:"mode"` - - // Env specifies the environment the underlying build system should be run in. - Env []string `json:"env"` - - // BuildFlags are flags that should be passed to the underlying build system. - BuildFlags []string `json:"build_flags"` - - // Tests specifies whether the patterns should also return test packages. - Tests bool `json:"tests"` - - // Overlay maps file paths (relative to the driver's working directory) - // to the contents of overlay files (see Config.Overlay). - Overlay map[string][]byte `json:"overlay"` -} - -// DriverResponse defines the schema of a response from an external -// driver program, providing the results of a query for package -// metadata. The driver program must write a JSON-encoded -// DriverResponse message to its standard output. -// -// See the package documentation for an overview. -type DriverResponse struct { - // NotHandled is returned if the request can't be handled by the current - // driver. If an external driver returns a response with NotHandled, the - // rest of the DriverResponse is ignored, and go/packages will fallback - // to the next driver. If go/packages is extended in the future to support - // lists of multiple drivers, go/packages will fall back to the next driver. - NotHandled bool - - // Compiler and Arch are the arguments pass of types.SizesFor - // to get a types.Sizes to use when type checking. - Compiler string - Arch string - - // Roots is the set of package IDs that make up the root packages. - // We have to encode this separately because when we encode a single package - // we cannot know if it is one of the roots as that requires knowledge of the - // graph it is part of. - Roots []string `json:",omitempty"` - - // Packages is the full set of packages in the graph. - // The packages are not connected into a graph. - // The Imports if populated will be stubs that only have their ID set. - // Imports will be connected and then type and syntax information added in a - // later pass (see refine). - Packages []*Package - - // GoVersion is the minor version number used by the driver - // (e.g. the go command on the PATH) when selecting .go files. - // Zero means unknown. - GoVersion int -} - -// driver is the type for functions that query the build system for the -// packages named by the patterns. -type driver func(cfg *Config, patterns []string) (*DriverResponse, error) - -// findExternalDriver returns the file path of a tool that supplies -// the build system package structure, or "" if not found. -// If GOPACKAGESDRIVER is set in the environment findExternalTool returns its -// value, otherwise it searches for a binary named gopackagesdriver on the PATH. -func findExternalDriver(cfg *Config) driver { - const toolPrefix = "GOPACKAGESDRIVER=" - tool := "" - for _, env := range cfg.Env { - if val, ok := strings.CutPrefix(env, toolPrefix); ok { - tool = val - } - } - if tool != "" && tool == "off" { - return nil - } - if tool == "" { - var err error - tool, err = exec.LookPath("gopackagesdriver") - if err != nil { - return nil - } - } - return func(cfg *Config, patterns []string) (*DriverResponse, error) { - req, err := json.Marshal(DriverRequest{ - Mode: cfg.Mode, - Env: cfg.Env, - BuildFlags: cfg.BuildFlags, - Tests: cfg.Tests, - Overlay: cfg.Overlay, - }) - if err != nil { - return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) - } - - buf := new(bytes.Buffer) - stderr := new(bytes.Buffer) - cmd := exec.CommandContext(cfg.Context, tool, patterns...) - cmd.Dir = cfg.Dir - // The cwd gets resolved to the real path. On Darwin, where - // /tmp is a symlink, this breaks anything that expects the - // working directory to keep the original path, including the - // go command when dealing with modules. - // - // os.Getwd stdlib has a special feature where if the - // cwd and the PWD are the same node then it trusts - // the PWD, so by setting it in the env for the child - // process we fix up all the paths returned by the go - // command. - // - // (See similar trick in Invocation.run in ../../internal/gocommand/invoke.go) - cmd.Env = append(slices.Clip(cfg.Env), "PWD="+cfg.Dir) - cmd.Stdin = bytes.NewReader(req) - cmd.Stdout = buf - cmd.Stderr = stderr - - if err := cmd.Run(); err != nil { - return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) - } - if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTDRIVERERRORS") != "" { - fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd), stderr) - } - - var response DriverResponse - if err := json.Unmarshal(buf.Bytes(), &response); err != nil { - return nil, err - } - return &response, nil - } -} diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go deleted file mode 100644 index 8e60cbbed7b..00000000000 --- a/vendor/golang.org/x/tools/go/packages/golist.go +++ /dev/null @@ -1,1126 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "log" - "os" - "os/exec" - "path" - "path/filepath" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "unicode" - - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/packagesinternal" -) - -// debug controls verbose logging. -var debug, _ = strconv.ParseBool(os.Getenv("GOPACKAGESDEBUG")) - -// A goTooOldError reports that the go command -// found by exec.LookPath is too old to use the new go list behavior. -type goTooOldError struct { - error -} - -// responseDeduper wraps a DriverResponse, deduplicating its contents. -type responseDeduper struct { - seenRoots map[string]bool - seenPackages map[string]*Package - dr *DriverResponse -} - -func newDeduper() *responseDeduper { - return &responseDeduper{ - dr: &DriverResponse{}, - seenRoots: map[string]bool{}, - seenPackages: map[string]*Package{}, - } -} - -// addAll fills in r with a DriverResponse. -func (r *responseDeduper) addAll(dr *DriverResponse) { - for _, pkg := range dr.Packages { - r.addPackage(pkg) - } - for _, root := range dr.Roots { - r.addRoot(root) - } - r.dr.GoVersion = dr.GoVersion -} - -func (r *responseDeduper) addPackage(p *Package) { - if prev := r.seenPackages[p.ID]; prev != nil { - // Package already seen in a previous response. Merge the file lists, - // removing duplicates. This can happen when the same package appears - // in multiple driver responses that are being merged together. - prev.GoFiles = appendUniqueStrings(prev.GoFiles, p.GoFiles) - prev.CompiledGoFiles = appendUniqueStrings(prev.CompiledGoFiles, p.CompiledGoFiles) - prev.OtherFiles = appendUniqueStrings(prev.OtherFiles, p.OtherFiles) - prev.IgnoredFiles = appendUniqueStrings(prev.IgnoredFiles, p.IgnoredFiles) - prev.EmbedFiles = appendUniqueStrings(prev.EmbedFiles, p.EmbedFiles) - prev.EmbedPatterns = appendUniqueStrings(prev.EmbedPatterns, p.EmbedPatterns) - return - } - r.seenPackages[p.ID] = p - r.dr.Packages = append(r.dr.Packages, p) -} - -// appendUniqueStrings appends elements from src to dst, skipping duplicates. -func appendUniqueStrings(dst, src []string) []string { - if len(src) == 0 { - return dst - } - - seen := make(map[string]bool, len(dst)) - for _, s := range dst { - seen[s] = true - } - - for _, s := range src { - if !seen[s] { - dst = append(dst, s) - } - } - - return dst -} - -func (r *responseDeduper) addRoot(id string) { - if r.seenRoots[id] { - return - } - r.seenRoots[id] = true - r.dr.Roots = append(r.dr.Roots, id) -} - -type golistState struct { - cfg *Config - ctx context.Context - - runner *gocommand.Runner - - // overlay is the JSON file that encodes the Config.Overlay - // mapping, used by 'go list -overlay=...'. - overlay string - - envOnce sync.Once - goEnvError error - goEnv map[string]string - - rootsOnce sync.Once - rootDirsError error - rootDirs map[string]string - - goVersionOnce sync.Once - goVersionError error - goVersion int // The X in Go 1.X. - - // vendorDirs caches the (non)existence of vendor directories. - vendorDirs map[string]bool -} - -// getEnv returns Go environment variables. Only specific variables are -// populated -- computing all of them is slow. -func (state *golistState) getEnv() (map[string]string, error) { - state.envOnce.Do(func() { - var b *bytes.Buffer - b, state.goEnvError = state.invokeGo("env", "-json", "GOMOD", "GOPATH") - if state.goEnvError != nil { - return - } - - state.goEnv = make(map[string]string) - decoder := json.NewDecoder(b) - if state.goEnvError = decoder.Decode(&state.goEnv); state.goEnvError != nil { - return - } - }) - return state.goEnv, state.goEnvError -} - -// mustGetEnv is a convenience function that can be used if getEnv has already succeeded. -func (state *golistState) mustGetEnv() map[string]string { - env, err := state.getEnv() - if err != nil { - panic(fmt.Sprintf("mustGetEnv: %v", err)) - } - return env -} - -// goListDriver uses the go list command to interpret the patterns and produce -// the build system package structure. -// See driver for more details. -// -// overlay is the JSON file that encodes the cfg.Overlay -// mapping, used by 'go list -overlay=...' -func goListDriver(cfg *Config, runner *gocommand.Runner, overlay string, patterns []string) (_ *DriverResponse, err error) { - // Make sure that any asynchronous go commands are killed when we return. - parentCtx := cfg.Context - if parentCtx == nil { - parentCtx = context.Background() - } - ctx, cancel := context.WithCancel(parentCtx) - defer cancel() - - response := newDeduper() - - state := &golistState{ - cfg: cfg, - ctx: ctx, - vendorDirs: map[string]bool{}, - overlay: overlay, - runner: runner, - } - - // Fill in response.Sizes asynchronously if necessary. - if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 { - errCh := make(chan error) - go func() { - compiler, arch, err := getSizesForArgs(ctx, state.cfgInvocation(), runner) - response.dr.Compiler = compiler - response.dr.Arch = arch - errCh <- err - }() - defer func() { - if sizesErr := <-errCh; sizesErr != nil { - err = sizesErr - } - }() - } - - // Determine files requested in contains patterns - var containFiles []string - restPatterns := make([]string, 0, len(patterns)) - // Extract file= and other [querytype]= patterns. Report an error if querytype - // doesn't exist. -extractQueries: - for _, pattern := range patterns { - query, value, ok := strings.Cut(pattern, "=") - if !ok { - restPatterns = append(restPatterns, pattern) - } else { - switch query { - case "file": - containFiles = append(containFiles, value) - case "pattern": - restPatterns = append(restPatterns, value) - case "": // not a reserved query - restPatterns = append(restPatterns, pattern) - default: - for _, rune := range query { - if rune < 'a' || rune > 'z' { // not a reserved query - restPatterns = append(restPatterns, pattern) - continue extractQueries - } - } - // Reject all other patterns containing "=" - return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern) - } - } - } - - // See if we have any patterns to pass through to go list. Zero initial - // patterns also requires a go list call, since it's the equivalent of - // ".". - if len(restPatterns) > 0 || len(patterns) == 0 { - dr, err := state.createDriverResponse(restPatterns...) - if err != nil { - return nil, err - } - response.addAll(dr) - } - - if len(containFiles) != 0 { - if err := state.runContainsQueries(response, containFiles); err != nil { - return nil, err - } - } - - // (We may yet return an error due to defer.) - return response.dr, nil -} - -// abs returns an absolute representation of path, based on cfg.Dir. -func (cfg *Config) abs(path string) (string, error) { - if filepath.IsAbs(path) { - return path, nil - } - // In case cfg.Dir is relative, pass it to filepath.Abs. - return filepath.Abs(filepath.Join(cfg.Dir, path)) -} - -func (state *golistState) runContainsQueries(response *responseDeduper, queries []string) error { - for _, query := range queries { - // TODO(matloob): Do only one query per directory. - fdir := filepath.Dir(query) - // Pass absolute path of directory to go list so that it knows to treat it as a directory, - // not a package path. - pattern, err := state.cfg.abs(fdir) - if err != nil { - return fmt.Errorf("could not determine absolute path of file= query path %q: %v", query, err) - } - dirResponse, err := state.createDriverResponse(pattern) - - // If there was an error loading the package, or no packages are returned, - // or the package is returned with errors, try to load the file as an - // ad-hoc package. - // Usually the error will appear in a returned package, but may not if we're - // in module mode and the ad-hoc is located outside a module. - if err != nil || len(dirResponse.Packages) == 0 || len(dirResponse.Packages) == 1 && len(dirResponse.Packages[0].GoFiles) == 0 && - len(dirResponse.Packages[0].Errors) == 1 { - var queryErr error - if dirResponse, queryErr = state.adhocPackage(pattern, query); queryErr != nil { - return err // return the original error - } - } - isRoot := make(map[string]bool, len(dirResponse.Roots)) - for _, root := range dirResponse.Roots { - isRoot[root] = true - } - for _, pkg := range dirResponse.Packages { - // Add any new packages to the main set - // We don't bother to filter packages that will be dropped by the changes of roots, - // that will happen anyway during graph construction outside this function. - // Over-reporting packages is not a problem. - response.addPackage(pkg) - // if the package was not a root one, it cannot have the file - if !isRoot[pkg.ID] { - continue - } - for _, pkgFile := range pkg.GoFiles { - if filepath.Base(query) == filepath.Base(pkgFile) { - response.addRoot(pkg.ID) - break - } - } - } - } - return nil -} - -// adhocPackage attempts to load or construct an ad-hoc package for a given -// query, if the original call to the driver produced inadequate results. -func (state *golistState) adhocPackage(pattern, query string) (*DriverResponse, error) { - response, err := state.createDriverResponse(query) - if err != nil { - return nil, err - } - // If we get nothing back from `go list`, - // try to make this file into its own ad-hoc package. - // TODO(rstambler): Should this check against the original response? - if len(response.Packages) == 0 { - response.Packages = append(response.Packages, &Package{ - ID: "command-line-arguments", - PkgPath: query, - GoFiles: []string{query}, - CompiledGoFiles: []string{query}, - Imports: make(map[string]*Package), - }) - response.Roots = append(response.Roots, "command-line-arguments") - } - // Handle special cases. - if len(response.Packages) == 1 { - // golang/go#33482: If this is a file= query for ad-hoc packages where - // the file only exists on an overlay, and exists outside of a module, - // add the file to the package and remove the errors. - if response.Packages[0].ID == "command-line-arguments" || - filepath.ToSlash(response.Packages[0].PkgPath) == filepath.ToSlash(query) { - if len(response.Packages[0].GoFiles) == 0 { - filename := filepath.Join(pattern, filepath.Base(query)) // avoid recomputing abspath - // TODO(matloob): check if the file is outside of a root dir? - for path := range state.cfg.Overlay { - if path == filename { - response.Packages[0].Errors = nil - response.Packages[0].GoFiles = []string{path} - response.Packages[0].CompiledGoFiles = []string{path} - } - } - } - } - } - return response, nil -} - -// Fields must match go list; -// see $GOROOT/src/cmd/go/internal/load/pkg.go. -type jsonPackage struct { - ImportPath string - Dir string - Name string - Target string - Export string - GoFiles []string - CompiledGoFiles []string - IgnoredGoFiles []string - IgnoredOtherFiles []string - EmbedPatterns []string - EmbedFiles []string - CFiles []string - CgoFiles []string - CXXFiles []string - MFiles []string - HFiles []string - FFiles []string - SFiles []string - SwigFiles []string - SwigCXXFiles []string - SysoFiles []string - Imports []string - ImportMap map[string]string - Deps []string - Module *Module - TestGoFiles []string - TestImports []string - XTestGoFiles []string - XTestImports []string - ForTest string // q in a "p [q.test]" package, else "" - DepOnly bool - - Error *packagesinternal.PackageError - DepsErrors []*packagesinternal.PackageError -} - -func otherFiles(p *jsonPackage) [][]string { - return [][]string{p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.SwigFiles, p.SwigCXXFiles, p.SysoFiles} -} - -// createDriverResponse uses the "go list" command to expand the pattern -// words and return a response for the specified packages. -func (state *golistState) createDriverResponse(words ...string) (*DriverResponse, error) { - // go list uses the following identifiers in ImportPath and Imports: - // - // "p" -- importable package or main (command) - // "q.test" -- q's test executable - // "p [q.test]" -- variant of p as built for q's test executable - // "q_test [q.test]" -- q's external test package - // - // The packages p that are built differently for a test q.test - // are q itself, plus any helpers used by the external test q_test, - // typically including "testing" and all its dependencies. - - // Run "go list" for complete - // information on the specified packages. - goVersion, err := state.getGoVersion() - if err != nil { - return nil, err - } - buf, err := state.invokeGo("list", golistargs(state.cfg, words, goVersion)...) - if err != nil { - return nil, err - } - - seen := make(map[string]*jsonPackage) - pkgs := make(map[string]*Package) - additionalErrors := make(map[string][]Error) - // Decode the JSON and convert it to Package form. - response := &DriverResponse{ - GoVersion: goVersion, - } - for dec := json.NewDecoder(buf); dec.More(); { - p := new(jsonPackage) - if err := dec.Decode(p); err != nil { - return nil, fmt.Errorf("JSON decoding failed: %v", err) - } - - if p.ImportPath == "" { - // The documentation for go list says that “[e]rroneous packages will have - // a non-empty ImportPath”. If for some reason it comes back empty, we - // prefer to error out rather than silently discarding data or handing - // back a package without any way to refer to it. - if p.Error != nil { - return nil, Error{ - Pos: p.Error.Pos, - Msg: p.Error.Err, - } - } - return nil, fmt.Errorf("package missing import path: %+v", p) - } - - // Work around https://golang.org/issue/33157: - // go list -e, when given an absolute path, will find the package contained at - // that directory. But when no package exists there, it will return a fake package - // with an error and the ImportPath set to the absolute path provided to go list. - // Try to convert that absolute path to what its package path would be if it's - // contained in a known module or GOPATH entry. This will allow the package to be - // properly "reclaimed" when overlays are processed. - if filepath.IsAbs(p.ImportPath) && p.Error != nil { - pkgPath, ok, err := state.getPkgPath(p.ImportPath) - if err != nil { - return nil, err - } - if ok { - p.ImportPath = pkgPath - } - } - - if old, found := seen[p.ImportPath]; found { - // If one version of the package has an error, and the other doesn't, assume - // that this is a case where go list is reporting a fake dependency variant - // of the imported package: When a package tries to invalidly import another - // package, go list emits a variant of the imported package (with the same - // import path, but with an error on it, and the package will have a - // DepError set on it). An example of when this can happen is for imports of - // main packages: main packages can not be imported, but they may be - // separately matched and listed by another pattern. - // See golang.org/issue/36188 for more details. - - // The plan is that eventually, hopefully in Go 1.15, the error will be - // reported on the importing package rather than the duplicate "fake" - // version of the imported package. Once all supported versions of Go - // have the new behavior this logic can be deleted. - // TODO(matloob): delete the workaround logic once all supported versions of - // Go return the errors on the proper package. - - // There should be exactly one version of a package that doesn't have an - // error. - if old.Error == nil && p.Error == nil { - if !reflect.DeepEqual(p, old) { - return nil, fmt.Errorf("internal error: go list gives conflicting information for package %v", p.ImportPath) - } - continue - } - - // Determine if this package's error needs to be bubbled up. - // This is a hack, and we expect for go list to eventually set the error - // on the package. - if old.Error != nil { - var errkind string - if strings.Contains(old.Error.Err, "not an importable package") { - errkind = "not an importable package" - } else if strings.Contains(old.Error.Err, "use of internal package") && strings.Contains(old.Error.Err, "not allowed") { - errkind = "use of internal package not allowed" - } - if errkind != "" { - if len(old.Error.ImportStack) < 1 { - return nil, fmt.Errorf(`internal error: go list gave a %q error with empty import stack`, errkind) - } - importingPkg := old.Error.ImportStack[len(old.Error.ImportStack)-1] - if importingPkg == old.ImportPath { - // Using an older version of Go which put this package itself on top of import - // stack, instead of the importer. Look for importer in second from top - // position. - if len(old.Error.ImportStack) < 2 { - return nil, fmt.Errorf(`internal error: go list gave a %q error with an import stack without importing package`, errkind) - } - importingPkg = old.Error.ImportStack[len(old.Error.ImportStack)-2] - } - additionalErrors[importingPkg] = append(additionalErrors[importingPkg], Error{ - Pos: old.Error.Pos, - Msg: old.Error.Err, - Kind: ListError, - }) - } - } - - // Make sure that if there's a version of the package without an error, - // that's the one reported to the user. - if old.Error == nil { - continue - } - - // This package will replace the old one at the end of the loop. - } - seen[p.ImportPath] = p - - pkg := &Package{ - Name: p.Name, - ID: p.ImportPath, - Dir: p.Dir, - Target: p.Target, - GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles), - CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles), - OtherFiles: absJoin(p.Dir, otherFiles(p)...), - EmbedFiles: absJoin(p.Dir, p.EmbedFiles), - EmbedPatterns: absJoin(p.Dir, p.EmbedPatterns), - IgnoredFiles: absJoin(p.Dir, p.IgnoredGoFiles, p.IgnoredOtherFiles), - ForTest: p.ForTest, - depsErrors: p.DepsErrors, - Module: p.Module, - } - - if (state.cfg.Mode&typecheckCgo) != 0 && len(p.CgoFiles) != 0 { - if len(p.CompiledGoFiles) > len(p.GoFiles) { - // We need the cgo definitions, which are in the first - // CompiledGoFile after the non-cgo ones. This is a hack but there - // isn't currently a better way to find it. We also need the pure - // Go files and unprocessed cgo files, all of which are already - // in pkg.GoFiles. - cgoTypes := p.CompiledGoFiles[len(p.GoFiles)] - pkg.CompiledGoFiles = append([]string{cgoTypes}, pkg.GoFiles...) - } else { - // golang/go#38990: go list silently fails to do cgo processing - pkg.CompiledGoFiles = nil - - var msg strings.Builder - fmt.Fprintf(&msg, "go list failed to return CompiledGoFiles for %q.\n", p.Name) - - for _, err := range p.DepsErrors { - msg.WriteString(strings.TrimSpace(err.Err)) - msg.WriteByte('\n') - } - - msg.WriteString("This may indicate failure to perform cgo processing; try building at the command line. See https://golang.org/issue/38990.") - pkg.Errors = append(pkg.Errors, Error{ - Msg: msg.String(), - Kind: ListError, - }) - } - } - - // Work around https://golang.org/issue/28749: - // cmd/go puts assembly, C, and C++ files in CompiledGoFiles. - // Remove files from CompiledGoFiles that are non-go files - // (or are not files that look like they are from the cache). - if len(pkg.CompiledGoFiles) > 0 { - out := pkg.CompiledGoFiles[:0] - for _, f := range pkg.CompiledGoFiles { - if ext := filepath.Ext(f); ext != ".go" && ext != "" { // ext == "" means the file is from the cache, so probably cgo-processed file - continue - } - out = append(out, f) - } - pkg.CompiledGoFiles = out - } - - // Extract the PkgPath from the package's ID. - if i := strings.IndexByte(pkg.ID, ' '); i >= 0 { - pkg.PkgPath = pkg.ID[:i] - } else { - pkg.PkgPath = pkg.ID - } - - if pkg.PkgPath == "unsafe" { - pkg.CompiledGoFiles = nil // ignore fake unsafe.go file (#59929) - } else if len(pkg.CompiledGoFiles) == 0 { - // Work around for pre-go.1.11 versions of go list. - // TODO(matloob): they should be handled by the fallback. - // Can we delete this? - pkg.CompiledGoFiles = pkg.GoFiles - } - - // Assume go list emits only absolute paths for Dir. - if p.Dir != "" && !filepath.IsAbs(p.Dir) { - log.Fatalf("internal error: go list returned non-absolute Package.Dir: %s", p.Dir) - } - - if p.Export != "" && !filepath.IsAbs(p.Export) { - pkg.ExportFile = filepath.Join(p.Dir, p.Export) - } else { - pkg.ExportFile = p.Export - } - - // imports - // - // Imports contains the IDs of all imported packages. - // ImportsMap records (path, ID) only where they differ. - ids := make(map[string]bool) - for _, id := range p.Imports { - ids[id] = true - } - pkg.Imports = make(map[string]*Package) - for path, id := range p.ImportMap { - pkg.Imports[path] = &Package{ID: id} // non-identity import - delete(ids, id) - } - for id := range ids { - if id == "C" { - continue - } - - pkg.Imports[id] = &Package{ID: id} // identity import - } - if !p.DepOnly { - response.Roots = append(response.Roots, pkg.ID) - } - - // Temporary work-around for golang/go#39986. Parse filenames out of - // error messages. This happens if there are unrecoverable syntax - // errors in the source, so we can't match on a specific error message. - // - // TODO(rfindley): remove this heuristic, in favor of considering - // InvalidGoFiles from the list driver. - if err := p.Error; err != nil && state.shouldAddFilenameFromError(p) { - addFilenameFromPos := func(pos string) bool { - split := strings.Split(pos, ":") - if len(split) < 1 { - return false - } - filename := strings.TrimSpace(split[0]) - if filename == "" { - return false - } - if !filepath.IsAbs(filename) { - filename = filepath.Join(state.cfg.Dir, filename) - } - info, _ := os.Stat(filename) - if info == nil { - return false - } - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, filename) - pkg.GoFiles = append(pkg.GoFiles, filename) - return true - } - found := addFilenameFromPos(err.Pos) - // In some cases, go list only reports the error position in the - // error text, not the error position. One such case is when the - // file's package name is a keyword (see golang.org/issue/39763). - if !found { - addFilenameFromPos(err.Err) - } - } - - if p.Error != nil { - msg := strings.TrimSpace(p.Error.Err) // Trim to work around golang.org/issue/32363. - // Address golang.org/issue/35964 by appending import stack to error message. - if msg == "import cycle not allowed" && len(p.Error.ImportStack) != 0 { - msg += fmt.Sprintf(": import stack: %v", p.Error.ImportStack) - } - pkg.Errors = append(pkg.Errors, Error{ - Pos: p.Error.Pos, - Msg: msg, - Kind: ListError, - }) - } - - pkgs[pkg.ID] = pkg - } - - for id, errs := range additionalErrors { - if p, ok := pkgs[id]; ok { - p.Errors = append(p.Errors, errs...) - } - } - for _, pkg := range pkgs { - response.Packages = append(response.Packages, pkg) - } - sort.Slice(response.Packages, func(i, j int) bool { return response.Packages[i].ID < response.Packages[j].ID }) - - return response, nil -} - -func (state *golistState) shouldAddFilenameFromError(p *jsonPackage) bool { - if len(p.GoFiles) > 0 || len(p.CompiledGoFiles) > 0 { - return false - } - - goV, err := state.getGoVersion() - if err != nil { - return false - } - - // On Go 1.14 and earlier, only add filenames from errors if the import stack is empty. - // The import stack behaves differently for these versions than newer Go versions. - if goV < 15 { - return len(p.Error.ImportStack) == 0 - } - - // On Go 1.15 and later, only parse filenames out of error if there's no import stack, - // or the current package is at the top of the import stack. This is not guaranteed - // to work perfectly, but should avoid some cases where files in errors don't belong to this - // package. - return len(p.Error.ImportStack) == 0 || p.Error.ImportStack[len(p.Error.ImportStack)-1] == p.ImportPath -} - -// getGoVersion returns the effective minor version of the go command. -func (state *golistState) getGoVersion() (int, error) { - state.goVersionOnce.Do(func() { - state.goVersion, state.goVersionError = gocommand.GoVersion(state.ctx, state.cfgInvocation(), state.runner) - }) - return state.goVersion, state.goVersionError -} - -// getPkgPath finds the package path of a directory if it's relative to a root -// directory. -func (state *golistState) getPkgPath(dir string) (string, bool, error) { - if !filepath.IsAbs(dir) { - panic("non-absolute dir passed to getPkgPath") - } - roots, err := state.determineRootDirs() - if err != nil { - return "", false, err - } - - for rdir, rpath := range roots { - // Make sure that the directory is in the module, - // to avoid creating a path relative to another module. - if !strings.HasPrefix(dir, rdir) { - continue - } - // TODO(matloob): This doesn't properly handle symlinks. - r, err := filepath.Rel(rdir, dir) - if err != nil { - continue - } - if rpath != "" { - // We choose only one root even though the directory even it can belong in multiple modules - // or GOPATH entries. This is okay because we only need to work with absolute dirs when a - // file is missing from disk, for instance when gopls calls go/packages in an overlay. - // Once the file is saved, gopls, or the next invocation of the tool will get the correct - // result straight from golist. - // TODO(matloob): Implement module tiebreaking? - return path.Join(rpath, filepath.ToSlash(r)), true, nil - } - return filepath.ToSlash(r), true, nil - } - return "", false, nil -} - -// absJoin absolutizes and flattens the lists of files. -func absJoin(dir string, fileses ...[]string) (res []string) { - for _, files := range fileses { - for _, file := range files { - if !filepath.IsAbs(file) { - file = filepath.Join(dir, file) - } - res = append(res, file) - } - } - return res -} - -func jsonFlag(cfg *Config, goVersion int) string { - if goVersion < 19 { - return "-json" - } - var fields []string - added := make(map[string]bool) - addFields := func(fs ...string) { - for _, f := range fs { - if !added[f] { - added[f] = true - fields = append(fields, f) - } - } - } - addFields("Name", "ImportPath", "Error") // These fields are always needed - if cfg.Mode&NeedFiles != 0 || cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 { - addFields("Dir", "GoFiles", "IgnoredGoFiles", "IgnoredOtherFiles", "CFiles", - "CgoFiles", "CXXFiles", "MFiles", "HFiles", "FFiles", "SFiles", - "SwigFiles", "SwigCXXFiles", "SysoFiles") - if cfg.Tests { - addFields("TestGoFiles", "XTestGoFiles") - } - } - if cfg.Mode&(NeedTypes|NeedTypesInfo) != 0 { - // CompiledGoFiles seems to be required for the test case TestCgoNoSyntax, - // even when -compiled isn't passed in. - // TODO(#52435): Should we make the test ask for -compiled, or automatically - // request CompiledGoFiles in certain circumstances? - addFields("Dir", "CompiledGoFiles") - } - if cfg.Mode&NeedCompiledGoFiles != 0 { - addFields("Dir", "CompiledGoFiles", "Export") - } - if cfg.Mode&NeedImports != 0 { - // When imports are requested, DepOnly is used to distinguish between packages - // explicitly requested and transitive imports of those packages. - addFields("DepOnly", "Imports", "ImportMap") - if cfg.Tests { - addFields("TestImports", "XTestImports") - } - } - if cfg.Mode&NeedDeps != 0 { - addFields("DepOnly") - } - if usesExportData(cfg) { - // Request Dir in the unlikely case Export is not absolute. - addFields("Dir", "Export") - } - if cfg.Mode&NeedForTest != 0 { - addFields("ForTest") - } - if cfg.Mode&needInternalDepsErrors != 0 { - addFields("DepsErrors") - } - if cfg.Mode&NeedModule != 0 { - addFields("Module") - } - if cfg.Mode&NeedEmbedFiles != 0 { - addFields("EmbedFiles") - } - if cfg.Mode&NeedEmbedPatterns != 0 { - addFields("EmbedPatterns") - } - if cfg.Mode&NeedTarget != 0 { - addFields("Target") - } - return "-json=" + strings.Join(fields, ",") -} - -func golistargs(cfg *Config, words []string, goVersion int) []string { - const findFlags = NeedImports | NeedTypes | NeedSyntax | NeedTypesInfo - fullargs := []string{ - "-e", jsonFlag(cfg, goVersion), - fmt.Sprintf("-compiled=%t", cfg.Mode&(NeedCompiledGoFiles|NeedSyntax|NeedTypes|NeedTypesInfo|NeedTypesSizes) != 0), - fmt.Sprintf("-test=%t", cfg.Tests), - fmt.Sprintf("-export=%t", usesExportData(cfg)), - fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0), - // go list doesn't let you pass -test and -find together, - // probably because you'd just get the TestMain. - fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0 && !usesExportData(cfg)), - // VCS information is not needed when not printing Stale or StaleReason fields - "-buildvcs=false", - } - - // golang/go#60456: with go1.21 and later, go list serves pgo variants, which - // can be costly to compute and may result in redundant processing for the - // caller. Disable these variants. If someone wants to add e.g. a NeedPGO - // mode flag, that should be a separate proposal. - if goVersion >= 21 { - fullargs = append(fullargs, "-pgo=off") - } - - fullargs = append(fullargs, cfg.BuildFlags...) - fullargs = append(fullargs, "--") - fullargs = append(fullargs, words...) - return fullargs -} - -// cfgInvocation returns an Invocation that reflects cfg's settings. -func (state *golistState) cfgInvocation() gocommand.Invocation { - cfg := state.cfg - return gocommand.Invocation{ - BuildFlags: cfg.BuildFlags, - CleanEnv: cfg.Env != nil, - Env: cfg.Env, - Logf: cfg.Logf, - WorkingDir: cfg.Dir, - Overlay: state.overlay, - } -} - -// invokeGo returns the stdout of a go command invocation. -func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) { - cfg := state.cfg - - inv := state.cfgInvocation() - inv.Verb = verb - inv.Args = args - - stdout, stderr, friendlyErr, err := state.runner.RunRaw(cfg.Context, inv) - if err != nil { - // Check for 'go' executable not being found. - if ee, ok := err.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - return nil, fmt.Errorf("'go list' driver requires 'go', but %s", exec.ErrNotFound) - } - - exitErr, ok := err.(*exec.ExitError) - if !ok { - // Catastrophic error: - // - context cancellation - return nil, fmt.Errorf("couldn't run 'go': %w", err) - } - - // Old go version? - if strings.Contains(stderr.String(), "flag provided but not defined") { - return nil, goTooOldError{fmt.Errorf("unsupported version of go: %s: %s", exitErr, stderr)} - } - - // Related to #24854 - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "unexpected directory layout") { - return nil, friendlyErr - } - - // Return an error if 'go list' failed due to missing tools in - // $GOROOT/pkg/tool/$GOOS_$GOARCH (#69606). - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), `go: no such tool`) { - return nil, friendlyErr - } - - // Is there an error running the C compiler in cgo? This will be reported in the "Error" field - // and should be suppressed by go list -e. - // - // This condition is not perfect yet because the error message can include other error messages than runtime/cgo. - isPkgPathRune := func(r rune) bool { - // From https://golang.org/ref/spec#Import_declarations: - // Implementation restriction: A compiler may restrict ImportPaths to non-empty strings - // using only characters belonging to Unicode's L, M, N, P, and S general categories - // (the Graphic characters without spaces) and may also exclude the - // characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement character U+FFFD. - return unicode.IsOneOf([]*unicode.RangeTable{unicode.L, unicode.M, unicode.N, unicode.P, unicode.S}, r) && - !strings.ContainsRune("!\"#$%&'()*,:;<=>?[\\]^`{|}\uFFFD", r) - } - // golang/go#36770: Handle case where cmd/go prints module download messages before the error. - msg := stderr.String() - for strings.HasPrefix(msg, "go: downloading") { - msg = msg[strings.IndexRune(msg, '\n')+1:] - } - if len(stderr.String()) > 0 && strings.HasPrefix(stderr.String(), "# ") { - msg := msg[len("# "):] - if strings.HasPrefix(strings.TrimLeftFunc(msg, isPkgPathRune), "\n") { - return stdout, nil - } - // Treat pkg-config errors as a special case (golang.org/issue/36770). - if strings.HasPrefix(msg, "pkg-config") { - return stdout, nil - } - } - - // This error only appears in stderr. See golang.org/cl/166398 for a fix in go list to show - // the error in the Err section of stdout in case -e option is provided. - // This fix is provided for backwards compatibility. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Similar to the previous error, but currently lacks a fix in Go. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must all be in one directory") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Backwards compatibility for Go 1.11 because 1.12 and 1.13 put the directory in the ImportPath. - // If the package doesn't exist, put the absolute path of the directory into the error message, - // as Go 1.13 list does. - const noSuchDirectory = "no such directory" - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), noSuchDirectory) { - errstr := stderr.String() - abspath := strings.TrimSpace(errstr[strings.Index(errstr, noSuchDirectory)+len(noSuchDirectory):]) - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - abspath, strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for #29280: go list -e has incorrect behavior when an ad-hoc package doesn't exist. - // Note that the error message we look for in this case is different that the one looked for above. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no such file or directory") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for #34273. go list -e with GO111MODULE=on has incorrect behavior when listing a - // directory outside any module. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside available modules") { - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - // TODO(matloob): command-line-arguments isn't correct here. - "command-line-arguments", strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Another variation of the previous error - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside module root") { - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - // TODO(matloob): command-line-arguments isn't correct here. - "command-line-arguments", strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for an instance of golang.org/issue/26755: go list -e will return a non-zero exit - // status if there's a dependency on a package that doesn't exist. But it should return - // a zero exit status and set an error on that package. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no Go files in") { - // Don't clobber stdout if `go list` actually returned something. - if len(stdout.String()) > 0 { - return stdout, nil - } - // try to extract package name from string - stderrStr := stderr.String() - var importPath string - colon := strings.Index(stderrStr, ":") - if colon > 0 && strings.HasPrefix(stderrStr, "go build ") { - importPath = stderrStr[len("go build "):colon] - } - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - importPath, strings.Trim(stderrStr, "\n")) - return bytes.NewBufferString(output), nil - } - - // Export mode entails a build. - // If that build fails, errors appear on stderr - // (despite the -e flag) and the Export field is blank. - // Do not fail in that case. - // The same is true if an ad-hoc package given to go list doesn't exist. - // TODO(matloob): Remove these once we can depend on go list to exit with a zero status with -e even when - // packages don't exist or a build fails. - if !usesExportData(cfg) && !containsGoFile(args) { - return nil, friendlyErr - } - } - return stdout, nil -} - -func containsGoFile(s []string) bool { - for _, f := range s { - if strings.HasSuffix(f, ".go") { - return true - } - } - return false -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.SplitN(kv, "=", 2) - k, v := split[0], split[1] - env[k] = v - } - - var args []string - for _, arg := range cmd.Args { - quoted := strconv.Quote(arg) - if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { - args = append(args, quoted) - } else { - args = append(args, arg) - } - } - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) -} - -// getSizesForArgs queries 'go list' for the appropriate -// Compiler and GOARCH arguments to pass to [types.SizesFor]. -func getSizesForArgs(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) { - inv.Verb = "list" - inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} - stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) - var goarch, compiler string - if rawErr != nil { - rawErrMsg := rawErr.Error() - if strings.Contains(rawErrMsg, "cannot find main module") || - strings.Contains(rawErrMsg, "go.mod file not found") { - // User's running outside of a module. - // All bets are off. Get GOARCH and guess compiler is gc. - // TODO(matloob): Is this a problem in practice? - inv.Verb = "env" - inv.Args = []string{"GOARCH"} - envout, enverr := gocmdRunner.Run(ctx, inv) - if enverr != nil { - return "", "", enverr - } - goarch = strings.TrimSpace(envout.String()) - compiler = "gc" - } else if friendlyErr != nil { - return "", "", friendlyErr - } else { - // This should be unreachable, but be defensive - // in case RunRaw's error results are inconsistent. - return "", "", rawErr - } - } else { - fields := strings.Fields(stdout.String()) - if len(fields) < 2 { - return "", "", fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", - stdout.String(), stderr.String()) - } - goarch = fields[0] - compiler = fields[1] - } - return compiler, goarch, nil -} diff --git a/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/vendor/golang.org/x/tools/go/packages/golist_overlay.go deleted file mode 100644 index d9d5a45cd47..00000000000 --- a/vendor/golang.org/x/tools/go/packages/golist_overlay.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "encoding/json" - "path/filepath" - - "golang.org/x/tools/internal/gocommand" -) - -// determineRootDirs returns a mapping from absolute directories that could -// contain code to their corresponding import path prefixes. -func (state *golistState) determineRootDirs() (map[string]string, error) { - env, err := state.getEnv() - if err != nil { - return nil, err - } - if env["GOMOD"] != "" { - state.rootsOnce.Do(func() { - state.rootDirs, state.rootDirsError = state.determineRootDirsModules() - }) - } else { - state.rootsOnce.Do(func() { - state.rootDirs, state.rootDirsError = state.determineRootDirsGOPATH() - }) - } - return state.rootDirs, state.rootDirsError -} - -func (state *golistState) determineRootDirsModules() (map[string]string, error) { - // List all of the modules--the first will be the directory for the main - // module. Any replaced modules will also need to be treated as roots. - // Editing files in the module cache isn't a great idea, so we don't - // plan to ever support that. - out, err := state.invokeGo("list", "-m", "-json", "all") - if err != nil { - // 'go list all' will fail if we're outside of a module and - // GO111MODULE=on. Try falling back without 'all'. - var innerErr error - out, innerErr = state.invokeGo("list", "-m", "-json") - if innerErr != nil { - return nil, err - } - } - roots := map[string]string{} - modules := map[string]string{} - var i int - for dec := json.NewDecoder(out); dec.More(); { - mod := new(gocommand.ModuleJSON) - if err := dec.Decode(mod); err != nil { - return nil, err - } - if mod.Dir != "" && mod.Path != "" { - // This is a valid module; add it to the map. - absDir, err := state.cfg.abs(mod.Dir) - if err != nil { - return nil, err - } - modules[absDir] = mod.Path - // The first result is the main module. - if i == 0 || mod.Replace != nil && mod.Replace.Path != "" { - roots[absDir] = mod.Path - } - } - i++ - } - return roots, nil -} - -func (state *golistState) determineRootDirsGOPATH() (map[string]string, error) { - m := map[string]string{} - for _, dir := range filepath.SplitList(state.mustGetEnv()["GOPATH"]) { - absDir, err := filepath.Abs(dir) - if err != nil { - return nil, err - } - m[filepath.Join(absDir, "src")] = "" - } - return m, nil -} diff --git a/vendor/golang.org/x/tools/go/packages/loadmode_string.go b/vendor/golang.org/x/tools/go/packages/loadmode_string.go deleted file mode 100644 index 69eec9f44dd..00000000000 --- a/vendor/golang.org/x/tools/go/packages/loadmode_string.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "fmt" - "strings" -) - -var modes = [...]struct { - mode LoadMode - name string -}{ - {NeedName, "NeedName"}, - {NeedFiles, "NeedFiles"}, - {NeedCompiledGoFiles, "NeedCompiledGoFiles"}, - {NeedImports, "NeedImports"}, - {NeedDeps, "NeedDeps"}, - {NeedExportFile, "NeedExportFile"}, - {NeedTypes, "NeedTypes"}, - {NeedSyntax, "NeedSyntax"}, - {NeedTypesInfo, "NeedTypesInfo"}, - {NeedTypesSizes, "NeedTypesSizes"}, - {NeedForTest, "NeedForTest"}, - {NeedModule, "NeedModule"}, - {NeedEmbedFiles, "NeedEmbedFiles"}, - {NeedEmbedPatterns, "NeedEmbedPatterns"}, - {NeedTarget, "NeedTarget"}, -} - -func (mode LoadMode) String() string { - if mode == 0 { - return "LoadMode(0)" - } - var out []string - // named bits - for _, item := range modes { - if (mode & item.mode) != 0 { - mode ^= item.mode - out = append(out, item.name) - } - } - // unnamed residue - if mode != 0 { - if out == nil { - return fmt.Sprintf("LoadMode(%#x)", int(mode)) - } - out = append(out, fmt.Sprintf("%#x", int(mode))) - } - if len(out) == 1 { - return out[0] - } - return "(" + strings.Join(out, "|") + ")" -} diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go deleted file mode 100644 index 1e5549abe4b..00000000000 --- a/vendor/golang.org/x/tools/go/packages/packages.go +++ /dev/null @@ -1,1605 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -// See doc.go for package documentation and implementation notes. - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "go/ast" - "go/parser" - "go/scanner" - "go/token" - "go/types" - "log" - "os" - "path/filepath" - "runtime" - "strings" - "sync" - "sync/atomic" - "time" - - "golang.org/x/sync/errgroup" - - "golang.org/x/tools/go/gcexportdata" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/packagesinternal" - "golang.org/x/tools/internal/typesinternal" -) - -// A LoadMode controls the amount of detail to return when loading. -// The bits below can be combined to specify which fields should be -// filled in the result packages. -// -// The zero value is a special case, equivalent to combining -// the NeedName, NeedFiles, and NeedCompiledGoFiles bits. -// -// ID and Errors (if present) will always be filled. -// [Load] may return more information than requested. -// -// The Mode flag is a union of several bits named NeedName, -// NeedFiles, and so on, each of which determines whether -// a given field of Package (Name, Files, etc) should be -// populated. -// -// For convenience, we provide named constants for the most -// common combinations of Need flags: -// -// [LoadFiles] lists of files in each package -// [LoadImports] ... plus imports -// [LoadTypes] ... plus type information -// [LoadSyntax] ... plus type-annotated syntax -// [LoadAllSyntax] ... for all dependencies -// -// Unfortunately there are a number of open bugs related to -// interactions among the LoadMode bits: -// - https://go.dev/issue/56633 -// - https://go.dev/issue/56677 -// - https://go.dev/issue/58726 -// - https://go.dev/issue/63517 -type LoadMode int - -const ( - // NeedName adds Name and PkgPath. - NeedName LoadMode = 1 << iota - - // NeedFiles adds Dir, GoFiles, OtherFiles, and IgnoredFiles - NeedFiles - - // NeedCompiledGoFiles adds CompiledGoFiles. - NeedCompiledGoFiles - - // NeedImports adds Imports. If NeedDeps is not set, the Imports field will contain - // "placeholder" Packages with only the ID set. - NeedImports - - // NeedDeps adds the fields requested by the LoadMode in the packages in Imports. - NeedDeps - - // NeedExportFile adds ExportFile. - NeedExportFile - - // NeedTypes adds Types, Fset, and IllTyped. - NeedTypes - - // NeedSyntax adds Syntax and Fset. - NeedSyntax - - // NeedTypesInfo adds TypesInfo and Fset. - NeedTypesInfo - - // NeedTypesSizes adds TypesSizes. - NeedTypesSizes - - // needInternalDepsErrors adds the internal deps errors field for use by gopls. - needInternalDepsErrors - - // NeedForTest adds ForTest. - // - // Tests must also be set on the context for this field to be populated. - NeedForTest - - // typecheckCgo enables full support for type checking cgo. Requires Go 1.15+. - // Modifies CompiledGoFiles and Types, and has no effect on its own. - typecheckCgo - - // NeedModule adds Module. - NeedModule - - // NeedEmbedFiles adds EmbedFiles. - NeedEmbedFiles - - // NeedEmbedPatterns adds EmbedPatterns. - NeedEmbedPatterns - - // NeedTarget adds Target. - NeedTarget - - // Be sure to update loadmode_string.go when adding new items! -) - -const ( - // LoadFiles loads the name and file names for the initial packages. - LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles - - // LoadImports loads the name, file names, and import mapping for the initial packages. - LoadImports = LoadFiles | NeedImports - - // LoadTypes loads exported type information for the initial packages. - LoadTypes = LoadImports | NeedTypes | NeedTypesSizes - - // LoadSyntax loads typed syntax for the initial packages. - LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo - - // LoadAllSyntax loads typed syntax for the initial packages and all dependencies. - LoadAllSyntax = LoadSyntax | NeedDeps - - // Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile. - // - //go:fix inline - NeedExportsFile = NeedExportFile -) - -// A Config specifies details about how packages should be loaded. -// The zero value is a valid configuration. -// -// Calls to [Load] do not modify this struct. -type Config struct { - // Mode controls the level of information returned for each package. - Mode LoadMode - - // Context specifies the context for the load operation. - // Cancelling the context may cause [Load] to abort and - // return an error. - Context context.Context - - // Logf is the logger for the config. - // If the user provides a logger, debug logging is enabled. - // If the GOPACKAGESDEBUG environment variable is set to true, - // but the logger is nil, default to log.Printf. - Logf func(format string, args ...any) - - // Dir is the directory in which to run the build system's query tool - // that provides information about the packages. - // If Dir is empty, the tool is run in the current directory. - Dir string - - // Env is the environment to use when invoking the build system's query tool. - // If Env is nil, the current environment is used. - // As in os/exec's Cmd, only the last value in the slice for - // each environment key is used. To specify the setting of only - // a few variables, append to the current environment, as in: - // - // opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386") - // - Env []string - - // BuildFlags is a list of command-line flags to be passed through to - // the build system's query tool. - BuildFlags []string - - // Fset provides source position information for syntax trees and types. - // If Fset is nil, Load will use a new fileset, but preserve Fset's value. - Fset *token.FileSet - - // ParseFile is called to read and parse each file - // when preparing a package's type-checked syntax tree. - // It must be safe to call ParseFile simultaneously from multiple goroutines. - // If ParseFile is nil, the loader will uses parser.ParseFile. - // - // ParseFile should parse the source from src and use filename only for - // recording position information. - // - // An application may supply a custom implementation of ParseFile - // to change the effective file contents or the behavior of the parser, - // or to modify the syntax tree. For example, selectively eliminating - // unwanted function bodies can significantly accelerate type checking. - ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) - - // If Tests is set, the loader includes not just the packages - // matching a particular pattern but also any related test packages, - // including test-only variants of the package and the test executable. - // - // For example, when using the go command, loading "fmt" with Tests=true - // returns four packages, with IDs "fmt" (the standard package), - // "fmt [fmt.test]" (the package as compiled for the test), - // "fmt_test" (the test functions from source files in package fmt_test), - // and "fmt.test" (the test binary). - // - // In build systems with explicit names for tests, - // setting Tests may have no effect. - Tests bool - - // Overlay is a mapping from absolute file paths to file contents. - // - // For each map entry, [Load] uses the alternative file - // contents provided by the overlay mapping instead of reading - // from the file system. This mechanism can be used to enable - // editor-integrated tools to correctly analyze the contents - // of modified but unsaved buffers, for example. - // - // The overlay mapping is passed to the build system's driver - // (see "The driver protocol") so that it too can report - // consistent package metadata about unsaved files. However, - // drivers may vary in their level of support for overlays. - Overlay map[string][]byte -} - -// Load loads and returns the Go packages named by the given patterns. -// -// The cfg parameter specifies loading options; nil behaves the same as an empty [Config]. -// -// The [Config.Mode] field is a set of bits that determine what kinds -// of information should be computed and returned. Modes that require -// more information tend to be slower. See [LoadMode] for details -// and important caveats. Its zero value is equivalent to -// [NeedName] | [NeedFiles] | [NeedCompiledGoFiles]. -// -// Each call to Load returns a new set of [Package] instances. -// The Packages and their Imports form a directed acyclic graph. -// -// If the [NeedTypes] mode flag was set, each call to Load uses a new -// [types.Importer], so [types.Object] and [types.Type] values from -// different calls to Load must not be mixed as they will have -// inconsistent notions of type identity. -// -// If any of the patterns was invalid as defined by the -// underlying build system, Load returns an error. -// It may return an empty list of packages without an error, -// for instance for an empty expansion of a valid wildcard. -// Errors associated with a particular package are recorded in the -// corresponding Package's Errors list, and do not cause Load to -// return an error. Clients may need to handle such errors before -// proceeding with further analysis. The [PrintErrors] function is -// provided for convenient display of all errors. -func Load(cfg *Config, patterns ...string) ([]*Package, error) { - ld := newLoader(cfg) - response, external, err := defaultDriver(&ld.Config, patterns...) - if err != nil { - return nil, err - } - - ld.sizes = types.SizesFor(response.Compiler, response.Arch) - if ld.sizes == nil && ld.Config.Mode&(NeedTypes|NeedTypesSizes|NeedTypesInfo) != 0 { - // Type size information is needed but unavailable. - if external { - // An external driver may fail to populate the Compiler/GOARCH fields, - // especially since they are relatively new (see #63700). - // Provide a sensible fallback in this case. - ld.sizes = types.SizesFor("gc", runtime.GOARCH) - if ld.sizes == nil { // gccgo-only arch - ld.sizes = types.SizesFor("gc", "amd64") - } - } else { - // Go list should never fail to deliver accurate size information. - // Reject the whole Load since the error is the same for every package. - return nil, fmt.Errorf("can't determine type sizes for compiler %q on GOARCH %q", - response.Compiler, response.Arch) - } - } - - ld.externalDriver = external - - return ld.refine(response) -} - -// defaultDriver is a driver that implements go/packages' fallback behavior. -// It will try to request to an external driver, if one exists. If there's -// no external driver, or the driver returns a response with NotHandled set, -// defaultDriver will fall back to the go list driver. -// The boolean result indicates that an external driver handled the request. -func defaultDriver(cfg *Config, patterns ...string) (*DriverResponse, bool, error) { - const ( - // windowsArgMax specifies the maximum command line length for - // the Windows' CreateProcess function. - windowsArgMax = 32767 - // maxEnvSize is a very rough estimation of the maximum environment - // size of a user. - maxEnvSize = 16384 - // safeArgMax specifies the maximum safe command line length to use - // by the underlying driver excl. the environment. We choose the Windows' - // ARG_MAX as the starting point because it's one of the lowest ARG_MAX - // constants out of the different supported platforms, - // e.g., https://www.in-ulm.de/~mascheck/various/argmax/#results. - safeArgMax = windowsArgMax - maxEnvSize - ) - chunks, err := splitIntoChunks(patterns, safeArgMax) - if err != nil { - return nil, false, err - } - - if driver := findExternalDriver(cfg); driver != nil { - response, err := callDriverOnChunks(driver, cfg, chunks) - if err != nil { - return nil, false, err - } else if !response.NotHandled { - return response, true, nil - } - // not handled: fall through - } - - // go list fallback - - // Write overlays once, as there are many calls - // to 'go list' (one per chunk plus others too). - overlayFile, cleanupOverlay, err := gocommand.WriteOverlays(cfg.Overlay) - if err != nil { - return nil, false, err - } - defer cleanupOverlay() - - var runner gocommand.Runner // (shared across many 'go list' calls) - driver := func(cfg *Config, patterns []string) (*DriverResponse, error) { - return goListDriver(cfg, &runner, overlayFile, patterns) - } - response, err := callDriverOnChunks(driver, cfg, chunks) - if err != nil { - return nil, false, err - } - return response, false, err -} - -// splitIntoChunks chunks the slice so that the total number of characters -// in a chunk is no longer than argMax. -func splitIntoChunks(patterns []string, argMax int) ([][]string, error) { - if argMax <= 0 { - return nil, errors.New("failed to split patterns into chunks, negative safe argMax value") - } - var chunks [][]string - charsInChunk := 0 - nextChunkStart := 0 - for i, v := range patterns { - vChars := len(v) - if vChars > argMax { - // a single pattern is longer than the maximum safe ARG_MAX, hardly should happen - return nil, errors.New("failed to split patterns into chunks, a pattern is too long") - } - charsInChunk += vChars + 1 // +1 is for a whitespace between patterns that has to be counted too - if charsInChunk > argMax { - chunks = append(chunks, patterns[nextChunkStart:i]) - nextChunkStart = i - charsInChunk = vChars - } - } - // add the last chunk - if nextChunkStart < len(patterns) { - chunks = append(chunks, patterns[nextChunkStart:]) - } - return chunks, nil -} - -func callDriverOnChunks(driver driver, cfg *Config, chunks [][]string) (*DriverResponse, error) { - if len(chunks) == 0 { - return driver(cfg, nil) - } - responses := make([]*DriverResponse, len(chunks)) - errNotHandled := errors.New("driver returned NotHandled") - var g errgroup.Group - for i, chunk := range chunks { - g.Go(func() (err error) { - responses[i], err = driver(cfg, chunk) - if responses[i] != nil && responses[i].NotHandled { - err = errNotHandled - } - return err - }) - } - if err := g.Wait(); err != nil { - if errors.Is(err, errNotHandled) { - return &DriverResponse{NotHandled: true}, nil - } - return nil, err - } - return mergeResponses(responses...), nil -} - -func mergeResponses(responses ...*DriverResponse) *DriverResponse { - if len(responses) == 0 { - return nil - } - // No dedup needed - if len(responses) == 1 { - return responses[0] - } - response := newDeduper() - response.dr.NotHandled = false - response.dr.Compiler = responses[0].Compiler - response.dr.Arch = responses[0].Arch - response.dr.GoVersion = responses[0].GoVersion - for _, v := range responses { - response.addAll(v) - } - return response.dr -} - -// A Package describes a loaded Go package. -// -// It also defines part of the JSON schema of [DriverResponse]. -// See the package documentation for an overview. -type Package struct { - // ID is a unique identifier for a package, - // in a syntax provided by the underlying build system. - // - // Because the syntax varies based on the build system, - // clients should treat IDs as opaque and not attempt to - // interpret them. - ID string - - // Name is the package name as it appears in the package source code. - Name string - - // PkgPath is the package path as used by the go/types package. - PkgPath string - - // Dir is the directory associated with the package, if it exists. - // - // For packages listed by the go command, this is the directory containing - // the package files. - Dir string - - // Errors contains any errors encountered querying the metadata - // of the package, or while parsing or type-checking its files. - Errors []Error - - // TypeErrors contains the subset of errors produced during type checking. - TypeErrors []types.Error - - // GoFiles lists the absolute file paths of the package's Go source files. - // It may include files that should not be compiled, for example because - // they contain non-matching build tags, are documentary pseudo-files such as - // unsafe/unsafe.go or builtin/builtin.go, or are subject to cgo preprocessing. - GoFiles []string - - // CompiledGoFiles lists the absolute file paths of the package's source - // files that are suitable for type checking. - // This may differ from GoFiles if files are processed before compilation. - CompiledGoFiles []string - - // OtherFiles lists the absolute file paths of the package's non-Go source files, - // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on. - OtherFiles []string - - // EmbedFiles lists the absolute file paths of the package's files - // embedded with go:embed. - EmbedFiles []string - - // EmbedPatterns lists the absolute file patterns of the package's - // files embedded with go:embed. - EmbedPatterns []string - - // IgnoredFiles lists source files that are not part of the package - // using the current build configuration but that might be part of - // the package using other build configurations. - IgnoredFiles []string - - // ExportFile is the absolute path to a file containing type - // information for the package as provided by the build system. - ExportFile string - - // Target is the absolute install path of the .a file, for libraries, - // and of the executable file, for binaries. - Target string - - // Imports maps import paths appearing in the package's Go source files - // to corresponding loaded Packages. - Imports map[string]*Package - - // Module is the module information for the package if it exists. - // - // Note: it may be missing for std and cmd; see Go issue #65816. - Module *Module - - // -- The following fields are not part of the driver JSON schema. -- - - // Types provides type information for the package. - // The NeedTypes LoadMode bit sets this field for packages matching the - // patterns; type information for dependencies may be missing or incomplete, - // unless NeedDeps and NeedImports are also set. - // - // Each call to [Load] returns a consistent set of type - // symbols, as defined by the comment at [types.Identical]. - // Avoid mixing type information from two or more calls to [Load]. - Types *types.Package `json:"-"` - - // Fset provides position information for Types, TypesInfo, and Syntax. - // It is set only when Types is set. - Fset *token.FileSet `json:"-"` - - // IllTyped indicates whether the package or any dependency contains errors. - // It is set only when Types is set. - IllTyped bool `json:"-"` - - // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles. - // - // The NeedSyntax LoadMode bit populates this field for packages matching the patterns. - // If NeedDeps and NeedImports are also set, this field will also be populated - // for dependencies. - // - // Syntax is kept in the same order as CompiledGoFiles, with the caveat that nils are - // removed. If parsing returned nil, Syntax may be shorter than CompiledGoFiles. - Syntax []*ast.File `json:"-"` - - // TypesInfo provides type information about the package's syntax trees. - // It is set only when Syntax is set. - TypesInfo *types.Info `json:"-"` - - // TypesSizes provides the effective size function for types in TypesInfo. - TypesSizes types.Sizes `json:"-"` - - // -- internal -- - - // ForTest is the package under test, if any. - ForTest string - - // depsErrors is the DepsErrors field from the go list response, if any. - depsErrors []*packagesinternal.PackageError - - // exportDataError is the error encountered reading export data, if any. - // Decoding export data should ordinarily be infallible, so this typically - // indicates a producer/consumer version skew. - exportDataError error -} - -// Module provides module information for a package. -// -// It also defines part of the JSON schema of [DriverResponse]. -// See the package documentation for an overview. -type Module struct { - Path string // module path - Version string // module version - Replace *Module // replaced by this module - Time *time.Time // time version was created - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file used when loading this module, if any - GoVersion string // go version used in module - Error *ModuleError // error loading module -} - -// ModuleError holds errors loading a module. -type ModuleError struct { - Err string // the error itself -} - -func init() { - packagesinternal.GetDepsErrors = func(p any) []*packagesinternal.PackageError { - return p.(*Package).depsErrors - } - packagesinternal.TypecheckCgo = int(typecheckCgo) - packagesinternal.DepsErrors = int(needInternalDepsErrors) -} - -// An Error describes a problem with a package's metadata, syntax, or types. -type Error struct { - Pos string // "file:line:col" or "file:line" or "" or "-" - Msg string - Kind ErrorKind -} - -// ErrorKind describes the source of the error, allowing the user to -// differentiate between errors generated by the driver, the parser, or the -// type-checker. -type ErrorKind int - -const ( - UnknownError ErrorKind = iota - ListError - ParseError - TypeError -) - -func (err Error) Error() string { - pos := err.Pos - if pos == "" { - pos = "-" // like token.Position{}.String() - } - return pos + ": " + err.Msg -} - -// flatPackage is the JSON form of Package -// It drops all the type and syntax fields, and transforms the Imports -// -// TODO(adonovan): identify this struct with Package, effectively -// publishing the JSON protocol. -type flatPackage struct { - ID string - Name string `json:",omitempty"` - PkgPath string `json:",omitempty"` - Errors []Error `json:",omitempty"` - GoFiles []string `json:",omitempty"` - CompiledGoFiles []string `json:",omitempty"` - OtherFiles []string `json:",omitempty"` - EmbedFiles []string `json:",omitempty"` - EmbedPatterns []string `json:",omitempty"` - IgnoredFiles []string `json:",omitempty"` - ExportFile string `json:",omitempty"` - Imports map[string]string `json:",omitempty"` -} - -// MarshalJSON returns the Package in its JSON form. -// For the most part, the structure fields are written out unmodified, and -// the type and syntax fields are skipped. -// The imports are written out as just a map of path to package id. -// The errors are written using a custom type that tries to preserve the -// structure of error types we know about. -// -// This method exists to enable support for additional build systems. It is -// not intended for use by clients of the API and we may change the format. -func (p *Package) MarshalJSON() ([]byte, error) { - flat := &flatPackage{ - ID: p.ID, - Name: p.Name, - PkgPath: p.PkgPath, - Errors: p.Errors, - GoFiles: p.GoFiles, - CompiledGoFiles: p.CompiledGoFiles, - OtherFiles: p.OtherFiles, - EmbedFiles: p.EmbedFiles, - EmbedPatterns: p.EmbedPatterns, - IgnoredFiles: p.IgnoredFiles, - ExportFile: p.ExportFile, - } - if len(p.Imports) > 0 { - flat.Imports = make(map[string]string, len(p.Imports)) - for path, ipkg := range p.Imports { - flat.Imports[path] = ipkg.ID - } - } - return json.Marshal(flat) -} - -// UnmarshalJSON reads in a Package from its JSON format. -// See MarshalJSON for details about the format accepted. -func (p *Package) UnmarshalJSON(b []byte) error { - flat := &flatPackage{} - if err := json.Unmarshal(b, &flat); err != nil { - return err - } - *p = Package{ - ID: flat.ID, - Name: flat.Name, - PkgPath: flat.PkgPath, - Errors: flat.Errors, - GoFiles: flat.GoFiles, - CompiledGoFiles: flat.CompiledGoFiles, - OtherFiles: flat.OtherFiles, - EmbedFiles: flat.EmbedFiles, - EmbedPatterns: flat.EmbedPatterns, - IgnoredFiles: flat.IgnoredFiles, - ExportFile: flat.ExportFile, - } - if len(flat.Imports) > 0 { - p.Imports = make(map[string]*Package, len(flat.Imports)) - for path, id := range flat.Imports { - p.Imports[path] = &Package{ID: id} - } - } - return nil -} - -func (p *Package) String() string { return p.ID } - -// loaderPackage augments Package with state used during the loading phase -type loaderPackage struct { - *Package - importErrors map[string]error // maps each bad import to its error - preds []*loaderPackage // packages that import this one - unfinishedSuccs atomic.Int32 // number of direct imports not yet loaded - color uint8 // for cycle detection - needsrc bool // load from source (Mode >= LoadTypes) - needtypes bool // type information is either requested or depended on - initial bool // package was matched by a pattern - goVersion int // minor version number of go command on PATH -} - -// loader holds the working state of a single call to load. -type loader struct { - pkgs map[string]*loaderPackage // keyed by Package.ID - Config - sizes types.Sizes // non-nil if needed by mode - parseCache map[string]*parseValue - parseCacheMu sync.Mutex - exportMu sync.Mutex // enforces mutual exclusion of exportdata operations - externalDriver bool // true if an external GOPACKAGESDRIVER handled the request - - // Config.Mode contains the implied mode (see impliedLoadMode). - // Implied mode contains all the fields we need the data for. - // In requestedMode there are the actually requested fields. - // We'll zero them out before returning packages to the user. - // This makes it easier for us to get the conditions where - // we need certain modes right. - requestedMode LoadMode -} - -type parseValue struct { - f *ast.File - err error - ready chan struct{} -} - -func newLoader(cfg *Config) *loader { - ld := &loader{ - parseCache: map[string]*parseValue{}, - } - if cfg != nil { - ld.Config = *cfg - // If the user has provided a logger, use it. - ld.Config.Logf = cfg.Logf - } - if ld.Config.Logf == nil { - // If the GOPACKAGESDEBUG environment variable is set to true, - // but the user has not provided a logger, default to log.Printf. - if debug { - ld.Config.Logf = log.Printf - } else { - ld.Config.Logf = func(format string, args ...any) {} - } - } - if ld.Config.Mode == 0 { - ld.Config.Mode = NeedName | NeedFiles | NeedCompiledGoFiles // Preserve zero behavior of Mode for backwards compatibility. - } - if ld.Config.Env == nil { - ld.Config.Env = os.Environ() - } - if ld.Context == nil { - ld.Context = context.Background() - } - if ld.Dir == "" { - if dir, err := os.Getwd(); err == nil { - ld.Dir = dir - } - } - - // Save the actually requested fields. We'll zero them out before returning packages to the user. - ld.requestedMode = ld.Mode - ld.Mode = impliedLoadMode(ld.Mode) - - if ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0 { - if ld.Fset == nil { - ld.Fset = token.NewFileSet() - } - - // ParseFile is required even in LoadTypes mode - // because we load source if export data is missing. - if ld.ParseFile == nil { - ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) { - // We implicitly promise to keep doing ast.Object resolution. :( - const mode = parser.AllErrors | parser.ParseComments - return parser.ParseFile(fset, filename, src, mode) - } - } - } - - return ld -} - -// refine connects the supplied packages into a graph and then adds type -// and syntax information as requested by the LoadMode. -func (ld *loader) refine(response *DriverResponse) ([]*Package, error) { - roots := response.Roots - rootMap := make(map[string]int, len(roots)) - for i, root := range roots { - rootMap[root] = i - } - ld.pkgs = make(map[string]*loaderPackage) - // first pass, fixup and build the map and roots - var initial = make([]*loaderPackage, len(roots)) - for _, pkg := range response.Packages { - rootIndex := -1 - if i, found := rootMap[pkg.ID]; found { - rootIndex = i - } - - // Overlays can invalidate export data. - // TODO(matloob): make this check fine-grained based on dependencies on overlaid files - exportDataInvalid := len(ld.Overlay) > 0 || pkg.ExportFile == "" && pkg.PkgPath != "unsafe" - // This package needs type information if the caller requested types and the package is - // either a root, or it's a non-root and the user requested dependencies ... - needtypes := (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) - // This package needs source if the call requested source (or types info, which implies source) - // and the package is either a root, or itas a non- root and the user requested dependencies... - needsrc := ((ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) || - // ... or if we need types and the exportData is invalid. We fall back to (incompletely) - // typechecking packages from source if they fail to compile. - (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe" - lpkg := &loaderPackage{ - Package: pkg, - needtypes: needtypes, - needsrc: needsrc, - goVersion: response.GoVersion, - } - // Don't trust the driver to respond with duplicate-free - // package names (go.dev/issue/63822). - if _, ok := ld.pkgs[lpkg.ID]; ok { - return nil, fmt.Errorf("%s response contained duplicate packages for ID %q", - cond(ld.externalDriver, "go/packages driver", "go list"), lpkg.ID) - } - ld.pkgs[lpkg.ID] = lpkg - if rootIndex >= 0 { - initial[rootIndex] = lpkg - lpkg.initial = true - } - } - for i, root := range roots { - if initial[i] == nil { - return nil, fmt.Errorf("root package %v is missing", root) - } - } - - // Materialize the import graph if it is needed (NeedImports), - // or if we'll be using loadPackages (Need{Syntax|Types|TypesInfo}). - var leaves []*loaderPackage // packages with no unfinished successors - if ld.Mode&(NeedImports|NeedSyntax|NeedTypes|NeedTypesInfo) != 0 { - const ( - white = 0 // new - grey = 1 // in progress - black = 2 // complete - ) - - // visit traverses the import graph, depth-first, - // and materializes the graph as Packages.Imports. - // - // Valid imports are saved in the Packages.Import map. - // Invalid imports (cycles and missing nodes) are saved in the importErrors map. - // Thus, even in the presence of both kinds of errors, - // the Import graph remains a DAG. - // - // visit returns whether the package needs src or has a transitive - // dependency on a package that does. These are the only packages - // for which we load source code. - var stack []*loaderPackage - var visit func(from, lpkg *loaderPackage) bool - visit = func(from, lpkg *loaderPackage) bool { - if lpkg.color == grey { - panic("internal error: grey node") - } - if lpkg.color == white { - lpkg.color = grey - stack = append(stack, lpkg) // push - stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports - lpkg.Imports = make(map[string]*Package, len(stubs)) - for importPath, ipkg := range stubs { - var importErr error - imp := ld.pkgs[ipkg.ID] - if imp == nil { - // (includes package "C" when DisableCgo) - importErr = fmt.Errorf("missing package: %q", ipkg.ID) - } else if imp.color == grey { - importErr = fmt.Errorf("import cycle: %s", stack) - } - if importErr != nil { - if lpkg.importErrors == nil { - lpkg.importErrors = make(map[string]error) - } - lpkg.importErrors[importPath] = importErr - continue - } - - if visit(lpkg, imp) { - lpkg.needsrc = true - } - lpkg.Imports[importPath] = imp.Package - } - - // -- postorder -- - - // Complete type information is required for the - // immediate dependencies of each source package. - if lpkg.needsrc && ld.Mode&NeedTypes != 0 { - for _, ipkg := range lpkg.Imports { - ld.pkgs[ipkg.ID].needtypes = true - } - } - - // NeedTypeSizes causes TypeSizes to be set even - // on packages for which types aren't needed. - if ld.Mode&NeedTypesSizes != 0 { - lpkg.TypesSizes = ld.sizes - } - - // Add packages with no imports directly to the queue of leaves. - if len(lpkg.Imports) == 0 { - leaves = append(leaves, lpkg) - } - - stack = stack[:len(stack)-1] // pop - lpkg.color = black - } - - // Add edge from predecessor. - if from != nil { - from.unfinishedSuccs.Add(+1) // incref - lpkg.preds = append(lpkg.preds, from) - } - - return lpkg.needsrc - } - - // For each initial package, create its import DAG. - for _, lpkg := range initial { - visit(nil, lpkg) - } - - } else { - // !NeedImports: drop the stub (ID-only) import packages - // that we are not even going to try to resolve. - for _, lpkg := range initial { - lpkg.Imports = nil - } - } - - // Load type data and syntax if needed, starting at - // the initial packages (roots of the import DAG). - if ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0 { - - // We avoid using g.SetLimit to limit concurrency as - // it makes g.Go stop accepting work, which prevents - // workers from enqeuing, and thus finishing, and thus - // allowing the group to make progress: deadlock. - // - // Instead we use the ioLimit and cpuLimit semaphores. - g, _ := errgroup.WithContext(ld.Context) - - // enqueues adds a package to the type-checking queue. - // It must have no unfinished successors. - var enqueue func(*loaderPackage) - enqueue = func(lpkg *loaderPackage) { - g.Go(func() error { - // Parse and type-check. - ld.loadPackage(lpkg) - - // Notify each waiting predecessor, - // and enqueue it when it becomes a leaf. - for _, pred := range lpkg.preds { - if pred.unfinishedSuccs.Add(-1) == 0 { // decref - enqueue(pred) - } - } - - return nil - }) - } - - // Load leaves first, adding new packages - // to the queue as they become leaves. - for _, leaf := range leaves { - enqueue(leaf) - } - - if err := g.Wait(); err != nil { - return nil, err // cancelled - } - } - - // If the context is done, return its error and - // throw out [likely] incomplete packages. - if err := ld.Context.Err(); err != nil { - return nil, err - } - - result := make([]*Package, len(initial)) - for i, lpkg := range initial { - result[i] = lpkg.Package - } - for i := range ld.pkgs { - // Clear all unrequested fields, - // to catch programs that use more than they request. - if ld.requestedMode&NeedName == 0 { - ld.pkgs[i].Name = "" - ld.pkgs[i].PkgPath = "" - } - if ld.requestedMode&NeedFiles == 0 { - ld.pkgs[i].GoFiles = nil - ld.pkgs[i].OtherFiles = nil - ld.pkgs[i].IgnoredFiles = nil - } - if ld.requestedMode&NeedEmbedFiles == 0 { - ld.pkgs[i].EmbedFiles = nil - } - if ld.requestedMode&NeedEmbedPatterns == 0 { - ld.pkgs[i].EmbedPatterns = nil - } - if ld.requestedMode&NeedCompiledGoFiles == 0 { - ld.pkgs[i].CompiledGoFiles = nil - } - if ld.requestedMode&NeedImports == 0 { - ld.pkgs[i].Imports = nil - } - if ld.requestedMode&NeedExportFile == 0 { - ld.pkgs[i].ExportFile = "" - } - if ld.requestedMode&NeedTypes == 0 { - ld.pkgs[i].Types = nil - ld.pkgs[i].IllTyped = false - } - if ld.requestedMode&NeedSyntax == 0 { - ld.pkgs[i].Syntax = nil - } - if ld.requestedMode&(NeedSyntax|NeedTypes|NeedTypesInfo) == 0 { - ld.pkgs[i].Fset = nil - } - if ld.requestedMode&NeedTypesInfo == 0 { - ld.pkgs[i].TypesInfo = nil - } - if ld.requestedMode&NeedTypesSizes == 0 { - ld.pkgs[i].TypesSizes = nil - } - if ld.requestedMode&NeedModule == 0 { - ld.pkgs[i].Module = nil - } - } - - return result, nil -} - -// loadPackage loads/parses/typechecks the specified package. -// It must be called only once per Package, -// after immediate dependencies are loaded. -// Precondition: ld.Mode&(NeedSyntax|NeedTypes|NeedTypesInfo) != 0. -func (ld *loader) loadPackage(lpkg *loaderPackage) { - if lpkg.PkgPath == "unsafe" { - // To avoid surprises, fill in the blanks consistent - // with other packages. (For example, some analyzers - // assert that each needed types.Info map is non-nil - // even when there is no syntax that would cause them - // to consult the map.) - lpkg.Types = types.Unsafe - lpkg.Fset = ld.Fset - lpkg.Syntax = []*ast.File{} - lpkg.TypesInfo = ld.newTypesInfo() - lpkg.TypesSizes = ld.sizes - return - } - - // Call NewPackage directly with explicit name. - // This avoids skew between golist and go/types when the files' - // package declarations are inconsistent. - lpkg.Types = types.NewPackage(lpkg.PkgPath, lpkg.Name) - lpkg.Fset = ld.Fset - - // Start shutting down if the context is done and do not load - // source or export data files. - // Packages that import this one will have ld.Context.Err() != nil. - // ld.Context.Err() will be returned later by refine. - if ld.Context.Err() != nil { - return - } - - // Subtle: we populate all Types fields with an empty Package - // before loading export data so that export data processing - // never has to create a types.Package for an indirect dependency, - // which would then require that such created packages be explicitly - // inserted back into the Import graph as a final step after export data loading. - // (Hence this return is after the Types assignment.) - // The Diamond test exercises this case. - if !lpkg.needtypes && !lpkg.needsrc { - return - } - - // TODO(adonovan): this condition looks wrong: - // I think it should be lpkg.needtypes && !lpkg.needsrc, - // so that NeedSyntax without NeedTypes can be satisfied by export data. - if !lpkg.needsrc { - if err := ld.loadFromExportData(lpkg); err != nil { - lpkg.exportDataError = err - lpkg.Errors = append(lpkg.Errors, Error{ - Pos: "-", - Msg: err.Error(), - Kind: UnknownError, // e.g. can't find/open/parse export data - }) - } - return // not a source package, don't get syntax trees - } - - appendError := func(err error) { - // Convert various error types into the one true Error. - var errs []Error - switch err := err.(type) { - case Error: - // from driver - errs = append(errs, err) - - case *os.PathError: - // from parser - errs = append(errs, Error{ - Pos: err.Path + ":1", - Msg: err.Err.Error(), - Kind: ParseError, - }) - - case scanner.ErrorList: - // from parser - for _, err := range err { - errs = append(errs, Error{ - Pos: err.Pos.String(), - Msg: err.Msg, - Kind: ParseError, - }) - } - - case types.Error: - // from type checker - lpkg.TypeErrors = append(lpkg.TypeErrors, err) - errs = append(errs, Error{ - Pos: err.Fset.Position(err.Pos).String(), - Msg: err.Msg, - Kind: TypeError, - }) - - default: - // unexpected impoverished error from parser? - errs = append(errs, Error{ - Pos: "-", - Msg: err.Error(), - Kind: UnknownError, - }) - - // If you see this error message, please file a bug. - log.Printf("internal error: error %q (%T) without position", err, err) - } - - lpkg.Errors = append(lpkg.Errors, errs...) - } - - // If the go command on the PATH is newer than the runtime, - // then the go/{scanner,ast,parser,types} packages from the - // standard library may be unable to process the files - // selected by go list. - // - // There is currently no way to downgrade the effective - // version of the go command (see issue 52078), so we proceed - // with the newer go command but, in case of parse or type - // errors, we emit an additional diagnostic. - // - // See: - // - golang.org/issue/52078 (flag to set release tags) - // - golang.org/issue/50825 (gopls legacy version support) - // - golang.org/issue/55883 (go/packages confusing error) - // - // Should we assert a hard minimum of (currently) go1.16 here? - var runtimeVersion int - if _, err := fmt.Sscanf(runtime.Version(), "go1.%d", &runtimeVersion); err == nil && runtimeVersion < lpkg.goVersion { - defer func() { - if len(lpkg.Errors) > 0 { - appendError(Error{ - Pos: "-", - Msg: fmt.Sprintf("This application uses version go1.%d of the source-processing packages but runs version go1.%d of 'go list'. It may fail to process source files that rely on newer language features. If so, rebuild the application using a newer version of Go.", runtimeVersion, lpkg.goVersion), - Kind: UnknownError, - }) - } - }() - } - - if ld.Config.Mode&NeedTypes != 0 && len(lpkg.CompiledGoFiles) == 0 && lpkg.ExportFile != "" { - // The config requested loading sources and types, but sources are missing. - // Add an error to the package and fall back to loading from export data. - appendError(Error{"-", fmt.Sprintf("sources missing for package %s", lpkg.ID), ParseError}) - _ = ld.loadFromExportData(lpkg) // ignore any secondary errors - - return // can't get syntax trees for this package - } - - files, errs := ld.parseFiles(lpkg.CompiledGoFiles) - for _, err := range errs { - appendError(err) - } - - lpkg.Syntax = files - if ld.Config.Mode&(NeedTypes|NeedTypesInfo) == 0 { - return - } - - // Start shutting down if the context is done and do not type check. - // Packages that import this one will have ld.Context.Err() != nil. - // ld.Context.Err() will be returned later by refine. - if ld.Context.Err() != nil { - return - } - - lpkg.TypesInfo = ld.newTypesInfo() - lpkg.TypesSizes = ld.sizes - - importer := importerFunc(func(path string) (*types.Package, error) { - if path == "unsafe" { - return types.Unsafe, nil - } - - // The imports map is keyed by import path. - ipkg := lpkg.Imports[path] - if ipkg == nil { - if err := lpkg.importErrors[path]; err != nil { - return nil, err - } - // There was skew between the metadata and the - // import declarations, likely due to an edit - // race, or because the ParseFile feature was - // used to supply alternative file contents. - return nil, fmt.Errorf("no metadata for %s", path) - } - - if ipkg.Types != nil && ipkg.Types.Complete() { - return ipkg.Types, nil - } - - // If types are unavailable, there must be an export data error. - if ipkg.exportDataError != nil { - return nil, ipkg.exportDataError - } - - log.Fatalf("internal error: expected complete types for package %q", path) - panic("unreachable") - }) - - // type-check - tc := &types.Config{ - Importer: importer, - - // Type-check bodies of functions only in initial packages. - // Example: for import graph A->B->C and initial packages {A,C}, - // we can ignore function bodies in B. - IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial, - - Error: appendError, - Sizes: ld.sizes, // may be nil - } - if lpkg.Module != nil && lpkg.Module.GoVersion != "" { - tc.GoVersion = "go" + lpkg.Module.GoVersion - } else if ld.externalDriver && lpkg.goVersion != 0 { - // Module information is missing when GOPACKAGESDRIVER is used, - // so use the go version from the driver response. - tc.GoVersion = fmt.Sprintf("go1.%d", lpkg.goVersion) - } - if (ld.Mode & typecheckCgo) != 0 { - if !typesinternal.SetUsesCgo(tc) { - appendError(Error{ - Msg: "typecheckCgo requires Go 1.15+", - Kind: ListError, - }) - return - } - } - - // Type-checking is CPU intensive. - cpuLimit <- unit{} // acquire a token - defer func() { <-cpuLimit }() // release a token - - typErr := types.NewChecker(tc, ld.Fset, lpkg.Types, lpkg.TypesInfo).Files(lpkg.Syntax) - lpkg.importErrors = nil // no longer needed - - // In go/types go1.21 and go1.22, Checker.Files failed fast with a - // a "too new" error, without calling tc.Error and without - // proceeding to type-check the package (#66525). - // We rely on the runtimeVersion error to give the suggested remedy. - if typErr != nil && len(lpkg.Errors) == 0 && len(lpkg.Syntax) > 0 { - if msg := typErr.Error(); strings.HasPrefix(msg, "package requires newer Go version") { - appendError(types.Error{ - Fset: ld.Fset, - Pos: lpkg.Syntax[0].Package, - Msg: msg, - }) - } - } - - // If !Cgo, the type-checker uses FakeImportC mode, so - // it doesn't invoke the importer for import "C", - // nor report an error for the import, - // or for any undefined C.f reference. - // We must detect this explicitly and correctly - // mark the package as IllTyped (by reporting an error). - // TODO(adonovan): if these errors are annoying, - // we could just set IllTyped quietly. - if tc.FakeImportC { - outer: - for _, f := range lpkg.Syntax { - for _, imp := range f.Imports { - if imp.Path.Value == `"C"` { - err := types.Error{Fset: ld.Fset, Pos: imp.Pos(), Msg: `import "C" ignored`} - appendError(err) - break outer - } - } - } - } - - // If types.Checker.Files had an error that was unreported, - // make sure to report the unknown error so the package is illTyped. - if typErr != nil && len(lpkg.Errors) == 0 { - appendError(typErr) - } - - // Record accumulated errors. - illTyped := len(lpkg.Errors) > 0 - if !illTyped { - for _, imp := range lpkg.Imports { - if imp.IllTyped { - illTyped = true - break - } - } - } - lpkg.IllTyped = illTyped -} - -func (ld *loader) newTypesInfo() *types.Info { - // Populate TypesInfo only if needed, as it - // causes the type checker to work much harder. - if ld.Config.Mode&NeedTypesInfo == 0 { - return nil - } - return &types.Info{ - Types: make(map[ast.Expr]types.TypeAndValue), - Defs: make(map[*ast.Ident]types.Object), - Uses: make(map[*ast.Ident]types.Object), - Implicits: make(map[ast.Node]types.Object), - Instances: make(map[*ast.Ident]types.Instance), - Scopes: make(map[ast.Node]*types.Scope), - Selections: make(map[*ast.SelectorExpr]*types.Selection), - FileVersions: make(map[*ast.File]string), - } -} - -// An importFunc is an implementation of the single-method -// types.Importer interface based on a function value. -type importerFunc func(path string) (*types.Package, error) - -func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } - -// We use a counting semaphore to limit -// the number of parallel I/O calls or CPU threads per process. -var ( - ioLimit = make(chan unit, 20) - cpuLimit = make(chan unit, runtime.GOMAXPROCS(0)) -) - -func (ld *loader) parseFile(filename string) (*ast.File, error) { - ld.parseCacheMu.Lock() - v, ok := ld.parseCache[filename] - if ok { - // cache hit - ld.parseCacheMu.Unlock() - <-v.ready - } else { - // cache miss - v = &parseValue{ready: make(chan struct{})} - ld.parseCache[filename] = v - ld.parseCacheMu.Unlock() - - var src []byte - for f, contents := range ld.Config.Overlay { - // TODO(adonovan): Inefficient for large overlays. - // Do an exact name-based map lookup - // (for nonexistent files) followed by a - // FileID-based map lookup (for existing ones). - if sameFile(f, filename) { - src = contents - break - } - } - var err error - if src == nil { - ioLimit <- unit{} // acquire a token - src, err = os.ReadFile(filename) - <-ioLimit // release a token - } - if err != nil { - v.err = err - } else { - // Parsing is CPU intensive. - cpuLimit <- unit{} // acquire a token - v.f, v.err = ld.ParseFile(ld.Fset, filename, src) - <-cpuLimit // release a token - } - - close(v.ready) - } - return v.f, v.err -} - -// parseFiles reads and parses the Go source files and returns the ASTs -// of the ones that could be at least partially parsed, along with a -// list of I/O and parse errors encountered. -// -// Because files are scanned in parallel, the token.Pos -// positions of the resulting ast.Files are not ordered. -func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) { - var ( - n = len(filenames) - parsed = make([]*ast.File, n) - errors = make([]error, n) - ) - var g errgroup.Group - for i, filename := range filenames { - // This creates goroutines unnecessarily in the - // cache-hit case, but that case is uncommon. - g.Go(func() error { - parsed[i], errors[i] = ld.parseFile(filename) - return nil - }) - } - g.Wait() - - // Eliminate nils, preserving order. - var o int - for _, f := range parsed { - if f != nil { - parsed[o] = f - o++ - } - } - parsed = parsed[:o] - - o = 0 - for _, err := range errors { - if err != nil { - errors[o] = err - o++ - } - } - errors = errors[:o] - - return parsed, errors -} - -// sameFile returns true if x and y have the same basename and denote -// the same file. -func sameFile(x, y string) bool { - if x == y { - // It could be the case that y doesn't exist. - // For instance, it may be an overlay file that - // hasn't been written to disk. To handle that case - // let x == y through. (We added the exact absolute path - // string to the CompiledGoFiles list, so the unwritten - // overlay case implies x==y.) - return true - } - if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation) - if xi, err := os.Stat(x); err == nil { - if yi, err := os.Stat(y); err == nil { - return os.SameFile(xi, yi) - } - } - } - return false -} - -// loadFromExportData ensures that type information is present for the specified -// package, loading it from an export data file on the first request. -// On success it sets lpkg.Types to a new Package. -func (ld *loader) loadFromExportData(lpkg *loaderPackage) error { - if lpkg.PkgPath == "" { - log.Fatalf("internal error: Package %s has no PkgPath", lpkg) - } - - // Because gcexportdata.Read has the potential to create or - // modify the types.Package for each node in the transitive - // closure of dependencies of lpkg, all exportdata operations - // must be sequential. (Finer-grained locking would require - // changes to the gcexportdata API.) - // - // The exportMu lock guards the lpkg.Types field and the - // types.Package it points to, for each loaderPackage in the graph. - // - // Not all accesses to Package.Pkg need to be protected by exportMu: - // graph ordering ensures that direct dependencies of source - // packages are fully loaded before the importer reads their Pkg field. - ld.exportMu.Lock() - defer ld.exportMu.Unlock() - - if tpkg := lpkg.Types; tpkg != nil && tpkg.Complete() { - return nil // cache hit - } - - lpkg.IllTyped = true // fail safe - - if lpkg.ExportFile == "" { - // Errors while building export data will have been printed to stderr. - return fmt.Errorf("no export data file") - } - f, err := os.Open(lpkg.ExportFile) - if err != nil { - return err - } - defer f.Close() - - // Read gc export data. - // - // We don't currently support gccgo export data because all - // underlying workspaces use the gc toolchain. (Even build - // systems that support gccgo don't use it for workspace - // queries.) - r, err := gcexportdata.NewReader(f) - if err != nil { - return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) - } - - // Build the view. - // - // The gcexportdata machinery has no concept of package ID. - // It identifies packages by their PkgPath, which although not - // globally unique is unique within the scope of one invocation - // of the linker, type-checker, or gcexportdata. - // - // So, we must build a PkgPath-keyed view of the global - // (conceptually ID-keyed) cache of packages and pass it to - // gcexportdata. The view must contain every existing - // package that might possibly be mentioned by the - // current package---its transitive closure. - // - // In loadPackage, we unconditionally create a types.Package for - // each dependency so that export data loading does not - // create new ones. - // - // TODO(adonovan): it would be simpler and more efficient - // if the export data machinery invoked a callback to - // get-or-create a package instead of a map. - // - view := make(map[string]*types.Package) // view seen by gcexportdata - seen := make(map[*loaderPackage]bool) // all visited packages - var visit func(pkgs map[string]*Package) - visit = func(pkgs map[string]*Package) { - for _, p := range pkgs { - lpkg := ld.pkgs[p.ID] - if !seen[lpkg] { - seen[lpkg] = true - view[lpkg.PkgPath] = lpkg.Types - visit(lpkg.Imports) - } - } - } - visit(lpkg.Imports) - - viewLen := len(view) + 1 // adding the self package - // Parse the export data. - // (May modify incomplete packages in view but not create new ones.) - tpkg, err := gcexportdata.Read(r, ld.Fset, view, lpkg.PkgPath) - if err != nil { - return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) - } - if _, ok := view["go.shape"]; ok { - // Account for the pseudopackage "go.shape" that gets - // created by generic code. - viewLen++ - } - if viewLen != len(view) { - log.Panicf("golang.org/x/tools/go/packages: unexpected new packages during load of %s", lpkg.PkgPath) - } - - lpkg.Types = tpkg - lpkg.IllTyped = false - return nil -} - -// impliedLoadMode returns loadMode with its dependencies. -func impliedLoadMode(loadMode LoadMode) LoadMode { - if loadMode&(NeedDeps|NeedTypes|NeedTypesInfo) != 0 { - // All these things require knowing the import graph. - loadMode |= NeedImports - } - if loadMode&NeedTypes != 0 { - // Types require the GoVersion from Module. - loadMode |= NeedModule - } - - return loadMode -} - -func usesExportData(cfg *Config) bool { - return cfg.Mode&NeedExportFile != 0 || cfg.Mode&NeedTypes != 0 && cfg.Mode&NeedDeps == 0 -} - -type unit struct{} - -func cond[T any](cond bool, t, f T) T { - if cond { - return t - } else { - return f - } -} diff --git a/vendor/golang.org/x/tools/go/packages/visit.go b/vendor/golang.org/x/tools/go/packages/visit.go deleted file mode 100644 index 06747a9df7f..00000000000 --- a/vendor/golang.org/x/tools/go/packages/visit.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "fmt" - "iter" - "os" - - "golang.org/x/tools/internal/moremaps" -) - -// Visit visits all the packages in the import graph whose roots are -// pkgs, calling the optional pre function the first time each package -// is encountered (preorder), and the optional post function after a -// package's dependencies have been visited (postorder). -// The boolean result of pre(pkg) determines whether -// the imports of package pkg are visited. -// -// Example: -// -// pkgs, err := Load(...) -// if err != nil { ... } -// Visit(pkgs, nil, func(pkg *Package) { -// log.Println(pkg) -// }) -// -// In most cases, it is more convenient to use [Postorder]: -// -// for pkg := range Postorder(pkgs) { -// log.Println(pkg) -// } -func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) { - seen := make(map[*Package]bool) - var visit func(*Package) - visit = func(pkg *Package) { - if !seen[pkg] { - seen[pkg] = true - - if pre == nil || pre(pkg) { - for _, imp := range moremaps.Sorted(pkg.Imports) { // for determinism - visit(imp) - } - } - - if post != nil { - post(pkg) - } - } - } - for _, pkg := range pkgs { - visit(pkg) - } -} - -// PrintErrors prints to os.Stderr the accumulated errors of all -// packages in the import graph rooted at pkgs, dependencies first. -// PrintErrors returns the number of errors printed. -func PrintErrors(pkgs []*Package) int { - var n int - errModules := make(map[*Module]bool) - for pkg := range Postorder(pkgs) { - for _, err := range pkg.Errors { - fmt.Fprintln(os.Stderr, err) - n++ - } - - // Print pkg.Module.Error once if present. - mod := pkg.Module - if mod != nil && mod.Error != nil && !errModules[mod] { - errModules[mod] = true - fmt.Fprintln(os.Stderr, mod.Error.Err) - n++ - } - } - return n -} - -// Postorder returns an iterator over the packages in -// the import graph whose roots are pkg. -// Packages are enumerated in dependencies-first order. -func Postorder(pkgs []*Package) iter.Seq[*Package] { - return func(yield func(*Package) bool) { - seen := make(map[*Package]bool) - var visit func(*Package) bool - visit = func(pkg *Package) bool { - if !seen[pkg] { - seen[pkg] = true - for _, imp := range moremaps.Sorted(pkg.Imports) { // for determinism - if !visit(imp) { - return false - } - } - if !yield(pkg) { - return false - } - } - return true - } - for _, pkg := range pkgs { - if !visit(pkg) { - break - } - } - } -} diff --git a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go deleted file mode 100644 index 9c7401c9ba5..00000000000 --- a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go +++ /dev/null @@ -1,952 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package objectpath defines a naming scheme for types.Objects -// (that is, named entities in Go programs) relative to their enclosing -// package. -// -// Type-checker objects are canonical, so they are usually identified by -// their address in memory (a pointer), but a pointer has meaning only -// within one address space. By contrast, objectpath names allow the -// identity of an object to be sent from one program to another, -// establishing a correspondence between types.Object variables that are -// distinct but logically equivalent. -// -// A single object may have multiple paths. In this example, -// -// type A struct{ X int } -// type B A -// -// the field X has two paths due to its membership of both A and B. -// The For(obj) function always returns one of these paths, arbitrarily -// but consistently. -package objectpath - -import ( - "encoding/binary" - "fmt" - "go/types" - "slices" - "strconv" - "strings" - "sync" - - "golang.org/x/tools/internal/typesinternal" -) - -// TODO(adonovan): think about generic aliases. - -// A Path is an opaque name that identifies a types.Object -// relative to its package. Conceptually, the name consists of a -// sequence of destructuring operations applied to the package scope -// to obtain the original object. -// The name does not include the package itself. -type Path string - -// Encoding -// -// An object path is a textual and (with training) human-readable encoding -// of a sequence of destructuring operators, starting from a types.Package. -// The sequences represent a path through the package/object/type graph. -// We classify these operators by their type: -// -// PO package->object Package.Scope.Lookup -// OT object->type Object.Type -// TT type->type Type.{Elem,Key,{,{,Recv}Type}Params,Results,Underlying,Rhs} [EKPRUTrCa] -// TO type->object Type.{At,Field,Method,Obj} [AFMO] -// -// All valid paths start with a package and end at an object -// and thus may be defined by the regular language: -// -// objectpath = PO (OT TT* TO)* -// -// The concrete encoding follows directly: -// - The only PO operator is Package.Scope.Lookup, which requires an identifier. -// - The only OT operator is Object.Type, -// which we encode as '.' because dot cannot appear in an identifier. -// - The TT operators are encoded as [EKPRUTrCa]; -// two of these ({,Recv}TypeParams) require an integer operand, -// which is encoded as a string of decimal digits. -// - The TO operators are encoded as [AFMO]; -// three of these (At,Field,Method) require an integer operand, -// which is encoded as a string of decimal digits. -// These indices are stable across different representations -// of the same package, even source and export data. -// The indices used are implementation specific and may not correspond to -// the argument to the go/types function. -// -// In the example below, -// -// package p -// -// type T interface { -// f() (a string, b struct{ X int }) -// } -// -// field X has the path "T.UM0.RA1.F0", -// representing the following sequence of operations: -// -// p.Lookup("T") T -// .Type().Underlying().Method(0). f -// .Type().Results().At(1) b -// .Type().Field(0) X -// -// The encoding is not maximally compact---every R or P is -// followed by an A, for example---but this simplifies the -// encoder and decoder. -const ( - // object->type operators - opType = '.' // .Type() (Object) - - // type->type operators - opElem = 'E' // .Elem() (Pointer, Slice, Array, Chan, Map) - opKey = 'K' // .Key() (Map) - opParams = 'P' // .Params() (Signature) - opResults = 'R' // .Results() (Signature) - opUnderlying = 'U' // .Underlying() (Named) - opTypeParam = 'T' // .TypeParams.At(i) (Named, Signature) - opRecvTypeParam = 'r' // .RecvTypeParams.At(i) (Signature) - opConstraint = 'C' // .Constraint() (TypeParam) - opRhs = 'a' // .Rhs() (Alias) - - // type->object operators - opAt = 'A' // .At(i) (Tuple) - opField = 'F' // .Field(i) (Struct) - opMethod = 'M' // .Method(i) (Named or Interface; not Struct: "promoted" names are ignored) - opObj = 'O' // .Obj() (Named, TypeParam) -) - -// For is equivalent to new(Encoder).For(obj). -// -// It may be more efficient to reuse a single Encoder across several calls. -func For(obj types.Object) (Path, error) { - return new(Encoder).For(obj) -} - -// An Encoder amortizes the cost of encoding the paths of multiple objects. -// The zero value of an Encoder is ready to use. -type Encoder struct { - pkgIndexMu sync.Mutex - pkgIndex map[*types.Package]*pkgIndex -} - -// A traversal encapsulates the state of a single traversal of the object/type graph. -type traversal struct { - pkg *types.Package - ix *pkgIndex // non-nil if we are building the index - - target types.Object // the sought symbol (if ix == nil) - found Path // the found path (if ix == nil) - - // These maps are used to short circuit cycles through - // interface methods, such as occur in the following example: - // - // type I interface { f() interface{I} } - // - // See golang/go#68046 for details. - seenTParamNames map[*types.TypeName]bool // global cycle breaking through type parameters - seenMethods map[*types.Func]bool // global cycle breaking through recursive interfaces -} - -// A pkgIndex holds a compressed index of objectpaths of all symbols -// (fields, methods, params) requiring search for an entire package. -// -// The first time a search for a given package is requested, we simply -// traverse the type graph for the target object, maintaining the -// current object path as a stack. If we find the target object, we -// save the path and terminate the main loop (but it's not worth -// breaking out of the current recursion). -// -// On the second search (a pkgIndex exists but its data is nil), we -// build an index of the traversal, which we use for all subsequent -// searches. -// -// The traversal index is encoded in the data field as a list of records, -// one per node, in preorder. Records are of two types: -// -// - A record for a package-level object consists of a pair -// (parent, nameIndex uvarint), where parent is zero and -// nameIndex is the index of the object's name in the sorted -// pkg.Scope().Names() slice. -// -// - A record for a nested node (a segment of an object path) -// consists of (parent uvarint, op byte, index uvarint), where -// parent is the index of the record for the parent node, -// op is the destructuring operator, and index (if op = [AFMTr]) -// is its integer operand. -// -// Since data[0] = 0 all nodes have positive offsets. In effect the -// encoding is a trie in which each node stores one path segment -// and points to the node for its prefix. -// -// TODO(adonovan): opt: evaluate an only 2-level tree with nodes for -// package-level objects and the-rest-of-the-path. One calculation -// suggested that it might be similar speed but 30% more compact. -type pkgIndex struct { - pkg *types.Package - data []byte // encoding of traversal; nil if not yet constructed - scopeNames []string // memo of pkg.Scope().Names() to avoid O(n) alloc/sort at lookup - offsets map[types.Object]uint32 // each object's node offset within encoded traversal data -} - -// For returns the path to an object relative to its package, -// or an error if the object is not accessible from the package's Scope. -// -// For is safe for concurrent use. -// -// The For function guarantees to return a path only for the following objects: -// - package-level types -// - exported package-level non-types -// - methods -// - parameter and result variables -// - struct fields -// These objects are sufficient to define the API of their package. -// The objects described by a package's export data are drawn from this set. -// -// The set of objects accessible from a package's Scope depends on -// whether the package was produced by type-checking syntax, or -// reading export data; the latter may have a smaller Scope since -// export data trims objects that are not reachable from an exported -// declaration. For example, the For function will return a path for -// an exported method of an unexported type that is not reachable -// from any public declaration; this path will cause the Object -// function to fail if called on a package loaded from export data. -// TODO(adonovan): is this a bug or feature? Should this package -// compute accessibility in the same way? -// -// For does not return a path for predeclared names, imported package -// names, local names, and unexported package-level names (except -// types). -// -// Example: given this definition, -// -// package p -// -// type T interface { -// f() (a string, b struct{ X int }) -// } -// -// For(X) would return a path that denotes the following sequence of operations: -// -// p.Scope().Lookup("T") (TypeName T) -// .Type().Underlying().Method(0). (method Func f) -// .Type().Results().At(1) (field Var b) -// .Type().Field(0) (field Var X) -// -// where p is the package (*types.Package) to which X belongs. -func (enc *Encoder) For(obj types.Object) (Path, error) { - pkg := obj.Pkg() - - // This table lists the cases of interest. - // - // Object Action - // ------ ------ - // nil reject - // builtin reject - // pkgname reject - // label reject - // var - // package-level accept - // func param/result accept - // local reject - // struct field accept - // const - // package-level accept - // local reject - // func - // package-level accept - // init functions reject - // concrete method accept - // interface method accept - // type - // package-level accept - // local reject - // - // The only accessible package-level objects are members of pkg itself. - // - // The cases are handled in four steps: - // - // 1. reject nil and builtin - // 2. accept package-level objects - // 3. reject obviously invalid objects - // 4. search the API for the path to the param/result/field/method. - - // 1. reference to nil or builtin? - if pkg == nil { - return "", fmt.Errorf("predeclared %s has no path", obj) - } - - // 2. package-level object? - if pkg.Scope().Lookup(obj.Name()) == obj { - // Only exported objects (and non-exported types) have a path. - // Non-exported types may be referenced by other objects. - if _, ok := obj.(*types.TypeName); !ok && !obj.Exported() { - return "", fmt.Errorf("no path for non-exported %v", obj) - } - return Path(obj.Name()), nil - } - - // 3. Not a package-level object. - // Reject obviously non-viable cases. - switch obj := obj.(type) { - case *types.TypeName: - if _, ok := types.Unalias(obj.Type()).(*types.TypeParam); !ok { - // With the exception of type parameters, only package-level type names - // have a path. - return "", fmt.Errorf("no path for %v", obj) - } - - case *types.Const, // Only package-level constants have a path. - *types.Label, // Labels are function-local. - *types.PkgName: // PkgNames are file-local. - return "", fmt.Errorf("no path for %v", obj) - - case *types.Var: - // A var, if not package-level, must be a - // parameter (incl. receiver) or result, or a struct field. - if obj.Kind() == types.LocalVar { - return "", fmt.Errorf("no path for local %v", obj) - } - - case *types.Func: - // A func, if not package-level, must be a method. - if recv := obj.Signature().Recv(); recv == nil { - return "", fmt.Errorf("func is not a method: %v", obj) - } - - if path, ok := enc.concreteMethod(obj); ok { - // Fast path for concrete methods that avoids looping over scope. - return path, nil - } - - default: - panic(obj) - } - - enc.pkgIndexMu.Lock() - defer enc.pkgIndexMu.Unlock() - - // 4. Search the object/type graph for the path to - // the var (field/param/result) or method. - ix, ok := enc.pkgIndex[pkg] - if !ok { - // First search: don't build an index, just traverse. - // This avoids allocation in [For], whose Encoder - // lives for a single call. - ix = &pkgIndex{pkg: pkg} - - if enc.pkgIndex == nil { - enc.pkgIndex = make(map[*types.Package]*pkgIndex) - } - enc.pkgIndex[pkg] = ix // build the index next time - - f := traversal{pkg: pkg, target: obj} - f.traverse() - - if f.found != "" { - return f.found, nil - } - } else { - // Second search: build an index while traversing. - if ix.data == nil { - ix.offsets = make(map[types.Object]uint32) - ix.data = []byte{0} // offset 0 is sentinel - (&traversal{pkg: pkg, ix: ix}).traverse() - } - - // Second and later searches: consult the index. - if offset, ok := ix.offsets[obj]; ok { - return ix.path(offset), nil - } - } - - return "", fmt.Errorf("can't find path for %v in %s", obj, pkg.Path()) -} - -// traverse performs a complete traversal of all symbols reachable from the package. -func (tr *traversal) traverse() { - scope := tr.pkg.Scope() - names := scope.Names() - if tr.ix != nil { - tr.ix.scopeNames = names - } - - empty := make([]byte, 0, 48) // initial space for stack (ix == nil) - - // First inspect package-level type names. - // In the presence of path aliases, these give - // the best paths because non-types may - // refer to types, but not the reverse. - for i, name := range names { - if tr.found != "" { - return // found (ix == nil) - } - - obj := scope.Lookup(name) - if _, ok := obj.(*types.TypeName); !ok { - continue // handle non-types in second pass - } - - // emit (name, opType) - var path []byte - var offset uint32 - if tr.ix == nil { - path = append(empty, name...) - path = append(path, opType) - } else { - offset = tr.ix.emitPackageLevel(i) - tr.ix.offsets[obj] = offset - offset = tr.ix.emitPathSegment(offset, opType, -1) - } - - // A TypeName (for Named or Alias) may have type parameters. - switch t := obj.Type().(type) { - case *types.Alias: - tr.tparams(t.TypeParams(), path, offset, opTypeParam) - tr.typ(path, offset, opRhs, -1, t.Rhs()) - case *types.Named: - tr.tparams(t.TypeParams(), path, offset, opTypeParam) - tr.typ(path, offset, opUnderlying, -1, t.Underlying()) - } - } - - // Then inspect everything else: - // exported non-types, and declared methods of defined types. - for i, name := range names { - if tr.found != "" { - return // found (ix == nil) - } - - obj := scope.Lookup(name) - - if tname, ok := obj.(*types.TypeName); !ok { - if obj.Exported() { - // exported non-type (const, var, func) - var path []byte - var offset uint32 - if tr.ix == nil { - path = append(empty, name...) - } else { - offset = tr.ix.emitPackageLevel(i) - tr.ix.offsets[obj] = offset - } - tr.typ(path, offset, opType, -1, obj.Type()) - } - - } else if T, ok := types.Unalias(tname.Type()).(*types.Named); ok { - // defined type - var path []byte - var offset uint32 - if tr.ix == nil { - path = append(empty, name...) - path = append(path, opType) - } else { - // Inv: map entry for obj was populated in first pass. - offset = tr.ix.emitPathSegment(tr.ix.offsets[obj], opType, -1) - } - - // Inspect declared methods of defined types. - // - // The method index here is always with respect - // to the underlying go/types data structures, - // which ultimately derives from source order - // and must be preserved by export data. - for i := 0; i < T.NumMethods(); i++ { - m := T.Method(i) - tr.object(path, offset, opMethod, i, m) - } - } - } -} - -func (tr *traversal) visitType(path []byte, offset uint32, T types.Type) { - switch T := T.(type) { - case *types.Alias: - tr.typ(path, offset, opRhs, -1, T.Rhs()) - - case *types.Basic, *types.Named: - // Named types belonging to pkg were handled already, - // so T must belong to another package. No path. - return - - case *types.Pointer, *types.Slice, *types.Array, *types.Chan: - type hasElem interface{ Elem() types.Type } // note: includes Map - tr.typ(path, offset, opElem, -1, T.(hasElem).Elem()) - - case *types.Map: - tr.typ(path, offset, opKey, -1, T.Key()) - tr.typ(path, offset, opElem, -1, T.Elem()) - - case *types.Signature: - tr.tparams(T.RecvTypeParams(), path, offset, opRecvTypeParam) - tr.tparams(T.TypeParams(), path, offset, opTypeParam) - tr.typ(path, offset, opParams, -1, T.Params()) - tr.typ(path, offset, opResults, -1, T.Results()) - - case *types.Struct: - for i := 0; i < T.NumFields(); i++ { - tr.object(path, offset, opField, i, T.Field(i)) - } - - case *types.Tuple: - for i := 0; i < T.Len(); i++ { - tr.object(path, offset, opAt, i, T.At(i)) - } - - case *types.Interface: - for i := 0; i < T.NumMethods(); i++ { - m := T.Method(i) - if m.Pkg() != nil && m.Pkg() != tr.pkg { - continue // embedded method from another package - } - if !tr.seenMethods[m] { - if tr.seenMethods == nil { - tr.seenMethods = make(map[*types.Func]bool) - } - tr.seenMethods[m] = true - tr.object(path, offset, opMethod, i, m) - } - } - - case *types.TypeParam: - tname := T.Obj() - if tname.Pkg() != nil && tname.Pkg() != tr.pkg { - return // type parameter from another package - } - if !tr.seenTParamNames[tname] { - if tr.seenTParamNames == nil { - tr.seenTParamNames = make(map[*types.TypeName]bool) - } - tr.seenTParamNames[tname] = true - tr.object(path, offset, opObj, -1, tname) - tr.typ(path, offset, opConstraint, -1, T.Constraint()) - } - } -} - -func (tr *traversal) tparams(list *types.TypeParamList, path []byte, offset uint32, op byte) { - for i := 0; i < list.Len(); i++ { - tr.typ(path, offset, op, i, list.At(i)) - } -} - -// typ descends the type graph edge (op, index), then proceeds to traverse type t. -func (tr *traversal) typ(path []byte, offset uint32, op byte, index int, t types.Type) { - if tr.ix == nil { - path = appendOpArg(path, op, index) - } else { - offset = tr.ix.emitPathSegment(offset, op, index) - } - tr.visitType(path, offset, t) -} - -// object descends the type graph edge (op, index), records object -// obj, then proceeds to traverse its type. -func (tr *traversal) object(path []byte, offset uint32, op byte, index int, obj types.Object) { - if tr.ix == nil { - path = appendOpArg(path, op, index) - if obj == tr.target && tr.found == "" { - tr.found = Path(path) - } - path = append(path, opType) - } else { - offset = tr.ix.emitPathSegment(offset, op, index) - if _, ok := tr.ix.offsets[obj]; !ok { - tr.ix.offsets[obj] = offset - } - offset = tr.ix.emitPathSegment(offset, opType, -1) - } - tr.visitType(path, offset, obj.Type()) -} - -// emitPackageLevel encodes a record for a package-level symbol, -// identified by its index in ix.scopeNames. -func (p *pkgIndex) emitPackageLevel(index int) uint32 { - off := uint32(len(p.data)) - p.data = append(p.data, 0) // zero varint => no parent - p.data = binary.AppendUvarint(p.data, uint64(index)) - return off -} - -// emitPathSegment emits a record for a non-initial object path segment. -func (p *pkgIndex) emitPathSegment(parent uint32, op byte, index int) uint32 { - off := uint32(len(p.data)) - p.data = binary.AppendUvarint(p.data, uint64(parent)) - p.data = append(p.data, op) - switch op { - case opAt, opField, opMethod, opTypeParam, opRecvTypeParam: - p.data = binary.AppendUvarint(p.data, uint64(index)) - } - return off -} - -// path returns the Path for the encoded node at the specified offset. -func (p *pkgIndex) path(offset uint32) Path { - var elems []string // path elements in reverse - for { - // Read parent index. - parent, n := binary.Uvarint(p.data[offset:]) - offset += uint32(n) - - if parent == 0 { - break // root (end of path) - } - - op := p.data[offset] - offset++ - - // The [AFMTr] operators have a numeric operand. - switch op { - case opAt, opField, opMethod, opTypeParam, opRecvTypeParam: - val, n := binary.Uvarint(p.data[offset:]) - offset += uint32(n) - elems = append(elems, strconv.Itoa(int(val))) - } - - elems = append(elems, string([]byte{op})) - - offset = uint32(parent) - } - idx, _ := binary.Uvarint(p.data[offset:]) - - // Convert index to Path string. - name := p.scopeNames[idx] - sz := len(name) - for _, elem := range elems { - sz += len(elem) - } - var buf strings.Builder - buf.Grow(sz) - buf.WriteString(name) - for _, elem := range slices.Backward(elems) { - buf.WriteString(elem) - } - return Path(buf.String()) -} - -// appendOpArg appends (op, index) to the object path. -// A negative index is ignored. -func appendOpArg(path []byte, op byte, index int) []byte { - path = append(path, op) - if index >= 0 { - path = strconv.AppendInt(path, int64(index), 10) - } - return path -} - -// concreteMethod returns the path for meth, which must have a non-nil receiver. -// The second return value indicates success and may be false if the method is -// an interface method or if it is an instantiated method. -// -// This function is just an optimization that avoids the general scope walking -// approach. You are expected to fall back to the general approach if this -// function fails. -func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) { - // Concrete methods can only be declared on package-scoped named types. For - // that reason we can skip the expensive walk over the package scope: the - // path will always be package -> named type -> method. We can trivially get - // the type name from the receiver, and only have to look over the type's - // methods to find the method index. - // - // Methods on generic types require special consideration, however. Consider - // the following package: - // - // L1: type S[T any] struct{} - // L2: func (recv S[A]) Foo() { recv.Bar() } - // L3: func (recv S[B]) Bar() { } - // L4: type Alias = S[int] - // L5: func _[T any]() { var s S[int]; s.Foo() } - // - // The receivers of methods on generic types are instantiations. L2 and L3 - // instantiate S with the type-parameters A and B, which are scoped to the - // respective methods. L4 and L5 each instantiate S with int. Each of these - // instantiations has its own method set, full of methods (and thus objects) - // with receivers whose types are the respective instantiations. In other - // words, we have - // - // S[A].Foo, S[A].Bar - // S[B].Foo, S[B].Bar - // S[int].Foo, S[int].Bar - // - // We may thus be trying to produce object paths for any of these objects. - // - // S[A].Foo and S[B].Bar are the origin methods, and their paths are S.Foo - // and S.Bar, which are the paths that this function naturally produces. - // - // S[A].Bar, S[B].Foo, and both methods on S[int] are instantiations that - // don't correspond to the origin methods. For S[int], this is significant. - // The most precise object path for S[int].Foo, for example, is Alias.Foo, - // not S.Foo. Our function, however, would produce S.Foo, which would - // resolve to a different object. - // - // For S[A].Bar and S[B].Foo it could be argued that S.Bar and S.Foo are - // still the correct paths, since only the origin methods have meaningful - // paths. But this is likely only true for trivial cases and has edge cases. - // Since this function is only an optimization, we err on the side of giving - // up, deferring to the slower but definitely correct algorithm. Most users - // of objectpath will only be giving us origin methods, anyway, as referring - // to instantiated methods is usually not useful. - - if meth.Origin() != meth { - return "", false - } - - _, named := typesinternal.ReceiverNamed(meth.Signature().Recv()) - if named == nil { - return "", false - } - - if types.IsInterface(named) { - // Named interfaces don't have to be package-scoped - // - // TODO(dominikh): opt: if scope.Lookup(name) == named, then we can apply this optimization to interface - // methods, too, I think. - return "", false - } - - // Preallocate space for the name, opType, opMethod, and some digits. - name := named.Obj().Name() - path := make([]byte, 0, len(name)+8) - path = append(path, name...) - path = append(path, opType) - - // Method indices are w.r.t. the go/types data structures, - // ultimately deriving from source order, - // which is preserved by export data. - for i := 0; i < named.NumMethods(); i++ { - if named.Method(i) == meth { - path = appendOpArg(path, opMethod, i) - return Path(path), true - } - } - - // Due to golang/go#59944, go/types fails to associate the receiver with - // certain methods on cgo types. - // - // TODO(rfindley): replace this panic once golang/go#59944 is fixed in all Go - // versions gopls supports. - return "", false - // panic(fmt.Sprintf("couldn't find method %s on type %s; methods: %#v", meth, named, enc.namedMethods(named))) -} - -// Object returns the object denoted by path p within the package pkg. -func Object(pkg *types.Package, p Path) (types.Object, error) { - pathstr := string(p) - if pathstr == "" { - return nil, fmt.Errorf("empty path") - } - - var pkgobj, suffix string - if dot := strings.IndexByte(pathstr, opType); dot < 0 { - pkgobj = pathstr - } else { - pkgobj = pathstr[:dot] - suffix = pathstr[dot:] // suffix starts with "." - } - - obj := pkg.Scope().Lookup(pkgobj) - if obj == nil { - return nil, fmt.Errorf("package %s does not contain %q", pkg.Path(), pkgobj) - } - - // abstraction of *types.{Pointer,Slice,Array,Chan,Map} - type hasElem interface { - Elem() types.Type - } - // abstraction of *types.{Named,Signature} - type hasTypeParams interface { - TypeParams() *types.TypeParamList - } - // abstraction of *types.{Alias,Named,TypeParam} - type hasObj interface { - Obj() *types.TypeName - } - - // The loop state is the pair (t, obj), - // exactly one of which is non-nil, initially obj. - // All suffixes start with '.' (the only object->type operation), - // followed by optional type->type operations, - // then a type->object operation. - // The cycle then repeats. - var t types.Type - for suffix != "" { - code := suffix[0] - suffix = suffix[1:] - - // Codes [AFMTr] have an integer operand. - var index int - switch code { - case opAt, opField, opMethod, opTypeParam, opRecvTypeParam: - rest := strings.TrimLeft(suffix, "0123456789") - numerals := suffix[:len(suffix)-len(rest)] - suffix = rest - i, err := strconv.Atoi(numerals) - if err != nil { - return nil, fmt.Errorf("invalid path: bad numeric operand %q for code %q", numerals, code) - } - index = int(i) - case opObj: - // no operand - default: - // The suffix must end with a type->object operation. - if suffix == "" { - return nil, fmt.Errorf("invalid path: ends with %q, want [AFMO]", code) - } - } - - if code == opType { - if t != nil { - return nil, fmt.Errorf("invalid path: unexpected %q in type context", opType) - } - t = obj.Type() - obj = nil - continue - } - - if t == nil { - return nil, fmt.Errorf("invalid path: code %q in object context", code) - } - - // Inv: t != nil, obj == nil - - t = types.Unalias(t) - switch code { - case opElem: - hasElem, ok := t.(hasElem) // Pointer, Slice, Array, Chan, Map - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want pointer, slice, array, chan or map)", code, t, t) - } - t = hasElem.Elem() - - case opKey: - mapType, ok := t.(*types.Map) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want map)", code, t, t) - } - t = mapType.Key() - - case opParams: - sig, ok := t.(*types.Signature) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) - } - t = sig.Params() - - case opResults: - sig, ok := t.(*types.Signature) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) - } - t = sig.Results() - - case opUnderlying: - named, ok := t.(*types.Named) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named)", code, t, t) - } - t = named.Underlying() - - case opRhs: - if alias, ok := t.(*types.Alias); ok { - t = alias.Rhs() - } else if false { - // Now that go1.24 is assured, we should be able to - // replace this with "if true {", but it causes objectpath - // tests to fail. TODO(adonovan): investigate. - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want alias)", code, t, t) - } - - case opTypeParam: - hasTypeParams, ok := t.(hasTypeParams) // Named, Signature - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or signature)", code, t, t) - } - tparams := hasTypeParams.TypeParams() - if n := tparams.Len(); index >= n { - return nil, fmt.Errorf("type parameter index %d out of range [0-%d)", index, n) - } - t = tparams.At(index) - - case opRecvTypeParam: - sig, ok := t.(*types.Signature) // Signature - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) - } - rtparams := sig.RecvTypeParams() - if n := rtparams.Len(); index >= n { - return nil, fmt.Errorf("receiver type parameter index %d out of range [0-%d)", index, n) - } - t = rtparams.At(index) - - case opConstraint: - tparam, ok := t.(*types.TypeParam) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want type parameter)", code, t, t) - } - t = tparam.Constraint() - - case opAt: - tuple, ok := t.(*types.Tuple) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want tuple)", code, t, t) - } - if n := tuple.Len(); index >= n { - return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) - } - obj = tuple.At(index) - t = nil - - case opField: - structType, ok := t.(*types.Struct) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want struct)", code, t, t) - } - if n := structType.NumFields(); index >= n { - return nil, fmt.Errorf("field index %d out of range [0-%d)", index, n) - } - obj = structType.Field(index) - t = nil - - case opMethod: - switch t := t.(type) { - case *types.Interface: - if index >= t.NumMethods() { - return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) - } - obj = t.Method(index) // Id-ordered - - case *types.Named: - if index >= t.NumMethods() { - return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) - } - obj = t.Method(index) - - default: - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want interface or named)", code, t, t) - } - t = nil - - case opObj: - hasObj, ok := t.(hasObj) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or type param)", code, t, t) - } - obj = hasObj.Obj() - t = nil - - default: - return nil, fmt.Errorf("invalid path: unknown code %q", code) - } - } - - if obj == nil { - panic(p) // path does not end in an object-valued operator - } - - if obj.Pkg() != pkg { - return nil, fmt.Errorf("path denotes %s, which belongs to a different package", obj) - } - - return obj, nil // success -} diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases.go b/vendor/golang.org/x/tools/internal/aliases/aliases.go deleted file mode 100644 index a4ae04bc71a..00000000000 --- a/vendor/golang.org/x/tools/internal/aliases/aliases.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package aliases - -import ( - "go/token" - "go/types" -) - -// New creates a new TypeName in Package pkg that -// is an alias for the type rhs. -func New(pos token.Pos, pkg *types.Package, name string, rhs types.Type, tparams []*types.TypeParam) *types.TypeName { - tname := types.NewTypeName(pos, pkg, name, nil) - types.NewAlias(tname, rhs).SetTypeParams(tparams) - return tname -} diff --git a/vendor/golang.org/x/tools/internal/event/core/event.go b/vendor/golang.org/x/tools/internal/event/core/event.go deleted file mode 100644 index 42c218818ab..00000000000 --- a/vendor/golang.org/x/tools/internal/event/core/event.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package core provides support for event based telemetry. -package core - -import ( - "fmt" - "iter" - "time" - - "golang.org/x/tools/internal/event/label" -) - -// Event holds the information about an event of note that occurred. -type Event struct { - at time.Time - - // As events are often on the stack, storing the first few labels directly - // in the event can avoid an allocation at all for the very common cases of - // simple events. - // The length needs to be large enough to cope with the majority of events - // but no so large as to cause undue stack pressure. - // A log message with two values will use 3 labels (one for each value and - // one for the message itself). - - static [3]label.Label // inline storage for the first few labels - dynamic []label.Label // dynamically sized storage for remaining labels -} - -func (ev Event) At() time.Time { return ev.at } - -func (ev Event) Format(f fmt.State, r rune) { - if !ev.at.IsZero() { - fmt.Fprint(f, ev.at.Format("2006/01/02 15:04:05 ")) - } - for l := range ev.Labels() { - fmt.Fprintf(f, "\n\t%v", l) - } -} - -func (ev Event) Valid(index int) bool { - return index >= 0 && index < len(ev.static)+len(ev.dynamic) -} - -func (ev Event) Label(index int) label.Label { - if index < len(ev.static) { - return ev.static[index] - } - return ev.dynamic[index-len(ev.static)] -} - -// Labels returns an iterator over the event's valid labels. -func (ev Event) Labels() iter.Seq[label.Label] { - return func(yield func(label.Label) bool) { - for _, l := range ev.static { - if l.Valid() && !yield(l) { - return - } - } - for _, l := range ev.dynamic { - if l.Valid() && !yield(l) { - return - } - } - } -} - -func (ev Event) Find(key label.Key) label.Label { - for _, l := range ev.static { - if l.Key() == key { - return l - } - } - for _, l := range ev.dynamic { - if l.Key() == key { - return l - } - } - return label.Label{} -} - -func MakeEvent(static [3]label.Label, labels []label.Label) Event { - return Event{ - static: static, - dynamic: labels, - } -} - -// CloneEvent event returns a copy of the event with the time adjusted to at. -func CloneEvent(ev Event, at time.Time) Event { - ev.at = at - return ev -} diff --git a/vendor/golang.org/x/tools/internal/event/core/export.go b/vendor/golang.org/x/tools/internal/event/core/export.go deleted file mode 100644 index 16ae6bb0211..00000000000 --- a/vendor/golang.org/x/tools/internal/event/core/export.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - "sync/atomic" - "time" - - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, Event, label.Map) context.Context - -var exporter atomic.Pointer[Exporter] - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - if e == nil { - // &e is always valid, and so p is always valid, but for the early abort - // of ProcessEvent to be efficient it needs to make the nil check on the - // pointer without having to dereference it, so we make the nil function - // also a nil pointer - exporter.Store(nil) - } else { - exporter.Store(&e) - } -} - -// deliver is called to deliver an event to the supplied exporter. -// it will fill in the time. -func deliver(ctx context.Context, exporter Exporter, ev Event) context.Context { - // add the current time to the event - ev.at = time.Now() - // hand the event off to the current exporter - return exporter(ctx, ev, ev) -} - -// Export is called to deliver an event to the global exporter if set. -func Export(ctx context.Context, ev Event) context.Context { - // get the global exporter and abort early if there is not one - exporterPtr := exporter.Load() - if exporterPtr == nil { - return ctx - } - return deliver(ctx, *exporterPtr, ev) -} - -// ExportPair is called to deliver a start event to the supplied exporter. -// It also returns a function that will deliver the end event to the same -// exporter. -// It will fill in the time. -func ExportPair(ctx context.Context, begin, end Event) (context.Context, func()) { - // get the global exporter and abort early if there is not one - exporterPtr := exporter.Load() - if exporterPtr == nil { - return ctx, func() {} - } - ctx = deliver(ctx, *exporterPtr, begin) - return ctx, func() { deliver(ctx, *exporterPtr, end) } -} diff --git a/vendor/golang.org/x/tools/internal/event/core/fast.go b/vendor/golang.org/x/tools/internal/event/core/fast.go deleted file mode 100644 index 06c1d4615e6..00000000000 --- a/vendor/golang.org/x/tools/internal/event/core/fast.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Log1 takes a message and one label delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log1(ctx context.Context, message string, t1 label.Label) { - Export(ctx, MakeEvent([3]label.Label{ - keys.Msg.Of(message), - t1, - }, nil)) -} - -// Log2 takes a message and two labels and delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log2(ctx context.Context, message string, t1 label.Label, t2 label.Label) { - Export(ctx, MakeEvent([3]label.Label{ - keys.Msg.Of(message), - t1, - t2, - }, nil)) -} - -// Metric1 sends a label event to the exporter with the supplied labels. -func Metric1(ctx context.Context, t1 label.Label) context.Context { - return Export(ctx, MakeEvent([3]label.Label{ - keys.Metric.New(), - t1, - }, nil)) -} - -// Metric2 sends a label event to the exporter with the supplied labels. -func Metric2(ctx context.Context, t1, t2 label.Label) context.Context { - return Export(ctx, MakeEvent([3]label.Label{ - keys.Metric.New(), - t1, - t2, - }, nil)) -} - -// Start1 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start1(ctx context.Context, name string, t1 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent([3]label.Label{ - keys.Start.Of(name), - t1, - }, nil), - MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} - -// Start2 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start2(ctx context.Context, name string, t1, t2 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent([3]label.Label{ - keys.Start.Of(name), - t1, - t2, - }, nil), - MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} diff --git a/vendor/golang.org/x/tools/internal/event/doc.go b/vendor/golang.org/x/tools/internal/event/doc.go deleted file mode 100644 index 5dc6e6babed..00000000000 --- a/vendor/golang.org/x/tools/internal/event/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package event provides a set of packages that cover the main -// concepts of telemetry in an implementation agnostic way. -package event diff --git a/vendor/golang.org/x/tools/internal/event/event.go b/vendor/golang.org/x/tools/internal/event/event.go deleted file mode 100644 index 4d55e577d1a..00000000000 --- a/vendor/golang.org/x/tools/internal/event/event.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package event - -import ( - "context" - - "golang.org/x/tools/internal/event/core" - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, core.Event, label.Map) context.Context - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - core.SetExporter(core.Exporter(e)) -} - -// Log takes a message and a label list and combines them into a single event -// before delivering them to the exporter. -func Log(ctx context.Context, message string, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Msg.Of(message), - }, labels)) -} - -// IsLog returns true if the event was built by the Log function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsLog(ev core.Event) bool { - return ev.Label(0).Key() == keys.Msg -} - -// Error takes a message and a label list and combines them into a single event -// before delivering them to the exporter. It captures the error in the -// delivered event. -func Error(ctx context.Context, message string, err error, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Msg.Of(message), - keys.Err.Of(err), - }, labels)) -} - -// IsError returns true if the event was built by the Error function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsError(ev core.Event) bool { - return ev.Label(0).Key() == keys.Msg && - ev.Label(1).Key() == keys.Err -} - -// Metric sends a label event to the exporter with the supplied labels. -func Metric(ctx context.Context, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Metric.New(), - }, labels)) -} - -// IsMetric returns true if the event was built by the Metric function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsMetric(ev core.Event) bool { - return ev.Label(0).Key() == keys.Metric -} - -// Label sends a label event to the exporter with the supplied labels. -func Label(ctx context.Context, labels ...label.Label) context.Context { - return core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Label.New(), - }, labels)) -} - -// IsLabel returns true if the event was built by the Label function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsLabel(ev core.Event) bool { - return ev.Label(0).Key() == keys.Label -} - -// Start sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start(ctx context.Context, name string, labels ...label.Label) (context.Context, func()) { - return core.ExportPair(ctx, - core.MakeEvent([3]label.Label{ - keys.Start.Of(name), - }, labels), - core.MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} - -// IsStart returns true if the event was built by the Start function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsStart(ev core.Event) bool { - return ev.Label(0).Key() == keys.Start -} - -// IsEnd returns true if the event was built by the End function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsEnd(ev core.Event) bool { - return ev.Label(0).Key() == keys.End -} - -// Detach returns a context without an associated span. -// This allows the creation of spans that are not children of the current span. -func Detach(ctx context.Context) context.Context { - return core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Detach.New(), - }, nil)) -} - -// IsDetach returns true if the event was built by the Detach function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsDetach(ev core.Event) bool { - return ev.Label(0).Key() == keys.Detach -} diff --git a/vendor/golang.org/x/tools/internal/event/keys/keys.go b/vendor/golang.org/x/tools/internal/event/keys/keys.go deleted file mode 100644 index ac78bc3b9cf..00000000000 --- a/vendor/golang.org/x/tools/internal/event/keys/keys.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -import ( - "fmt" - "math" - "strconv" - - "golang.org/x/tools/internal/event/label" -) - -// Value is a [label.Key] for untyped values. -type Value struct { - name string - description string -} - -// New creates a new Key for untyped values. -func New(name, description string) *Value { - return &Value{name: name, description: description} -} - -func (k *Value) Name() string { return k.name } -func (k *Value) Description() string { return k.description } - -func (k *Value) Append(buf []byte, l label.Label) []byte { - return fmt.Append(buf, k.From(l)) -} - -// Get returns the label for the key of a label.Map. -func (k *Value) Get(lm label.Map) any { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From returns the value of a Label. -func (k *Value) From(t label.Label) any { return t.UnpackValue() } - -// Of creates a new Label with this key and the supplied value. -func (k *Value) Of(value any) label.Label { return label.OfValue(k, value) } - -// Tag represents a key for tagging labels that have no value. -// These are used when the existence of the label is the entire information it -// carries, such as marking events to be of a specific kind, or from a specific -// package. -type Tag struct { - name string - description string -} - -// NewTag creates a new [label.Key] for tagging labels. -func NewTag(name, description string) *Tag { - return &Tag{name: name, description: description} -} - -func (k *Tag) Name() string { return k.name } -func (k *Tag) Description() string { return k.description } - -func (k *Tag) Append(buf []byte, l label.Label) []byte { return buf } - -// New creates a new Label with this key. -func (k *Tag) New() label.Label { return label.OfValue(k, nil) } - -// Int is a [label.Key] for signed integers. -type Int struct { - name string - description string -} - -// NewInt returns a new [label.Key] for int64 values. -func NewInt(name, description string) *Int { - return &Int{name: name, description: description} -} - -func (k *Int) Name() string { return k.name } -func (k *Int) Description() string { return k.description } - -func (k *Int) Append(buf []byte, l label.Label) []byte { - return strconv.AppendInt(buf, k.From(l), 10) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int) Of(v int) label.Label { return k.Of64(int64(v)) } - -// Of64 creates a new Label with this key and the supplied value. -func (k *Int) Of64(v int64) label.Label { return label.Of64(k, uint64(v)) } - -// Get returns the label for the key of a label.Map. -func (k *Int) Get(lm label.Map) int64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From returns the value of a Label. -func (k *Int) From(t label.Label) int64 { return int64(t.Unpack64()) } - -// Uint is a [label.Key] for unsigned integers. -type Uint struct { - name string - description string -} - -// NewUint creates a new [label.Key] for unsigned values. -func NewUint(name, description string) *Uint { - return &Uint{name: name, description: description} -} - -func (k *Uint) Name() string { return k.name } -func (k *Uint) Description() string { return k.description } - -func (k *Uint) Append(buf []byte, l label.Label) []byte { - return strconv.AppendUint(buf, k.From(l), 10) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Uint) Of(v uint64) label.Label { return label.Of64(k, v) } - -// Get returns the label for the key of a label.Map. -func (k *Uint) Get(lm label.Map) uint64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From returns the value of a Label. -func (k *Uint) From(t label.Label) uint64 { return t.Unpack64() } - -// Float is a label.Key for floating-point values. -type Float struct { - name string - description string -} - -// NewFloat creates a new [label.Key] for floating-point values. -func NewFloat(name, description string) *Float { - return &Float{name: name, description: description} -} - -func (k *Float) Name() string { return k.name } -func (k *Float) Description() string { return k.description } - -func (k *Float) Append(buf []byte, l label.Label) []byte { - return strconv.AppendFloat(buf, k.From(l), 'E', -1, 64) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Float) Of(v float64) label.Label { - return label.Of64(k, math.Float64bits(v)) -} - -// Get returns the label for the key of a label.Map. -func (k *Float) Get(lm label.Map) float64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From returns the value of a Label. -func (k *Float) From(t label.Label) float64 { - return math.Float64frombits(t.Unpack64()) -} - -// String represents a key -type String struct { - name string - description string -} - -// NewString creates a new Key for int64 values. -func NewString(name, description string) *String { - return &String{name: name, description: description} -} - -func (k *String) Name() string { return k.name } -func (k *String) Description() string { return k.description } - -func (k *String) Append(buf []byte, l label.Label) []byte { - return strconv.AppendQuote(buf, k.From(l)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *String) Of(v string) label.Label { return label.OfString(k, v) } - -// Get returns the label for the key of a label.Map. -func (k *String) Get(lm label.Map) string { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return "" -} - -// From returns the value of a Label. -func (k *String) From(t label.Label) string { return t.UnpackString() } - -// Error represents a key -type Error struct { - name string - description string -} - -// NewError returns a new [label.Key] for error values. -func NewError(name, description string) *Error { - return &Error{name: name, description: description} -} - -func (k *Error) Name() string { return k.name } -func (k *Error) Description() string { return k.description } - -func (k *Error) Append(buf []byte, l label.Label) []byte { - return append(buf, k.From(l).Error()...) -} - -// Of returns a new Label with this key and the supplied value. -func (k *Error) Of(v error) label.Label { return label.OfValue(k, v) } - -// Get returns the label for the key of a label.Map. -func (k *Error) Get(lm label.Map) error { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From returns the value of a Label. -func (k *Error) From(t label.Label) error { - err, _ := t.UnpackValue().(error) - return err -} diff --git a/vendor/golang.org/x/tools/internal/event/keys/standard.go b/vendor/golang.org/x/tools/internal/event/keys/standard.go deleted file mode 100644 index 7e958665921..00000000000 --- a/vendor/golang.org/x/tools/internal/event/keys/standard.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -var ( - // Msg is a key used to add message strings to label lists. - Msg = NewString("message", "a readable message") - // Label is a key used to indicate an event adds labels to the context. - Label = NewTag("label", "a label context marker") - // Start is used for things like traces that have a name. - Start = NewString("start", "span start") - // Metric is a key used to indicate an event records metrics. - End = NewTag("end", "a span end marker") - // Metric is a key used to indicate an event records metrics. - Detach = NewTag("detach", "a span detach marker") - // Err is a key used to add error values to label lists. - Err = NewError("error", "an error that occurred") - // Metric is a key used to indicate an event records metrics. - Metric = NewTag("metric", "a metric event marker") -) diff --git a/vendor/golang.org/x/tools/internal/event/keys/util.go b/vendor/golang.org/x/tools/internal/event/keys/util.go deleted file mode 100644 index c0e8e731c90..00000000000 --- a/vendor/golang.org/x/tools/internal/event/keys/util.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -import ( - "sort" - "strings" -) - -// Join returns a canonical join of the keys in S: -// a sorted comma-separated string list. -func Join[S ~[]T, T ~string](s S) string { - strs := make([]string, 0, len(s)) - for _, v := range s { - strs = append(strs, string(v)) - } - sort.Strings(strs) - return strings.Join(strs, ",") -} diff --git a/vendor/golang.org/x/tools/internal/event/label/label.go b/vendor/golang.org/x/tools/internal/event/label/label.go deleted file mode 100644 index e84226f879b..00000000000 --- a/vendor/golang.org/x/tools/internal/event/label/label.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package label - -import ( - "fmt" - "io" - "slices" - "unsafe" -) - -// Key is used as the identity of a Label. -// Keys are intended to be compared by pointer only, the name should be unique -// for communicating with external systems, but it is not required or enforced. -type Key interface { - // Name returns the key name. - Name() string - // Description returns a string that can be used to describe the value. - Description() string - // Append appends the formatted value of the label to the supplied buffer. - Append(buf []byte, l Label) []byte -} - -// Label holds a key and value pair. -// It is normally used when passing around lists of labels. -type Label struct { - key Key - packed uint64 - untyped any -} - -// Map is the interface to a collection of Labels indexed by key. -type Map interface { - // Find returns the label that matches the supplied key. - Find(key Key) Label -} - -// List is the interface to something that provides an iterable -// list of labels. -// Iteration should start from 0 and continue until Valid returns false. -type List interface { - // Valid returns true if the index is within range for the list. - // It does not imply the label at that index will itself be valid. - Valid(index int) bool - // Label returns the label at the given index. - Label(index int) Label -} - -// list implements LabelList for a list of Labels. -type list struct { - labels []Label -} - -// filter wraps a LabelList filtering out specific labels. -type filter struct { - keys []Key - underlying List -} - -// listMap implements LabelMap for a simple list of labels. -type listMap struct { - labels []Label -} - -// mapChain implements LabelMap for a list of underlying LabelMap. -type mapChain struct { - maps []Map -} - -// OfValue creates a new label from the key and value. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfValue(k Key, value any) Label { return Label{key: k, untyped: value} } - -// UnpackValue assumes the label was built using LabelOfValue and returns the value -// that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackValue() any { return t.untyped } - -// Of64 creates a new label from a key and a uint64. This is often -// used for non uint64 values that can be packed into a uint64. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func Of64(k Key, v uint64) Label { return Label{key: k, packed: v} } - -// Unpack64 assumes the label was built using LabelOf64 and returns the value that -// was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) Unpack64() uint64 { return t.packed } - -type stringptr unsafe.Pointer - -// OfString creates a new label from a key and a string. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfString(k Key, v string) Label { - return Label{ - key: k, - packed: uint64(len(v)), - untyped: stringptr(unsafe.StringData(v)), - } -} - -// UnpackString assumes the label was built using LabelOfString and returns the -// value that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackString() string { - return unsafe.String((*byte)(t.untyped.(stringptr)), int(t.packed)) -} - -// Valid returns true if the Label is a valid one (it has a key). -func (t Label) Valid() bool { return t.key != nil } - -// Key returns the key of this Label. -func (t Label) Key() Key { return t.key } - -// Format is used for debug printing of labels. -func (t Label) Format(f fmt.State, r rune) { - if !t.Valid() { - io.WriteString(f, `nil`) - return - } - io.WriteString(f, t.Key().Name()) - io.WriteString(f, "=") - f.Write(t.Key().Append(nil, t)) // ignore error -} - -func (l *list) Valid(index int) bool { - return index >= 0 && index < len(l.labels) -} - -func (l *list) Label(index int) Label { - return l.labels[index] -} - -func (f *filter) Valid(index int) bool { - return f.underlying.Valid(index) -} - -func (f *filter) Label(index int) Label { - l := f.underlying.Label(index) - if slices.Contains(f.keys, l.Key()) { - return Label{} - } - return l -} - -func (lm listMap) Find(key Key) Label { - for _, l := range lm.labels { - if l.Key() == key { - return l - } - } - return Label{} -} - -func (c mapChain) Find(key Key) Label { - for _, src := range c.maps { - l := src.Find(key) - if l.Valid() { - return l - } - } - return Label{} -} - -var emptyList = &list{} - -func NewList(labels ...Label) List { - if len(labels) == 0 { - return emptyList - } - return &list{labels: labels} -} - -func Filter(l List, keys ...Key) List { - if len(keys) == 0 { - return l - } - return &filter{keys: keys, underlying: l} -} - -func NewMap(labels ...Label) Map { - return listMap{labels: labels} -} - -func MergeMaps(srcs ...Map) Map { - var nonNil []Map - for _, src := range srcs { - if src != nil { - nonNil = append(nonNil, src) - } - } - if len(nonNil) == 1 { - return nonNil[0] - } - return mapChain{maps: nonNil} -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/bimport.go b/vendor/golang.org/x/tools/internal/gcimporter/bimport.go deleted file mode 100644 index 555ef626c00..00000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/bimport.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains the remaining vestiges of -// $GOROOT/src/go/internal/gcimporter/bimport.go. - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" - "sync" -) - -func errorf(format string, args ...any) { - panic(fmt.Sprintf(format, args...)) -} - -const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go - -// Synthesize a token.Pos -type fakeFileSet struct { - fset *token.FileSet - files map[string]*fileInfo -} - -type fileInfo struct { - file *token.File - lastline int -} - -const maxlines = 64 * 1024 - -func (s *fakeFileSet) pos(file string, line, column int) token.Pos { - _ = column // TODO(mdempsky): Make use of column. - - // Since we don't know the set of needed file positions, we reserve maxlines - // positions per file. We delay calling token.File.SetLines until all - // positions have been calculated (by way of fakeFileSet.setLines), so that - // we can avoid setting unnecessary lines. See also golang/go#46586. - f := s.files[file] - if f == nil { - f = &fileInfo{file: s.fset.AddFile(file, -1, maxlines)} - s.files[file] = f - } - if line > maxlines { - line = 1 - } - if line > f.lastline { - f.lastline = line - } - - // Return a fake position assuming that f.file consists only of newlines. - return token.Pos(f.file.Base() + line - 1) -} - -func (s *fakeFileSet) setLines() { - fakeLinesOnce.Do(func() { - fakeLines = make([]int, maxlines) - for i := range fakeLines { - fakeLines[i] = i - } - }) - for _, f := range s.files { - f.file.SetLines(fakeLines[:f.lastline]) - } -} - -var ( - fakeLines []int - fakeLinesOnce sync.Once -) - -func chanDir(d int) types.ChanDir { - // tag values must match the constants in cmd/compile/internal/gc/go.go - switch d { - case 1 /* Crecv */ : - return types.RecvOnly - case 2 /* Csend */ : - return types.SendOnly - case 3 /* Cboth */ : - return types.SendRecv - default: - errorf("unexpected channel dir %d", d) - return 0 - } -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go b/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go deleted file mode 100644 index 5662a311dac..00000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file should be kept in sync with $GOROOT/src/internal/exportdata/exportdata.go. -// This file also additionally implements FindExportData for gcexportdata.NewReader. - -package gcimporter - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "go/build" - "io" - "os" - "os/exec" - "path/filepath" - "strings" - "sync" -) - -// FindExportData positions the reader r at the beginning of the -// export data section of an underlying cmd/compile created archive -// file by reading from it. The reader must be positioned at the -// start of the file before calling this function. -// This returns the length of the export data in bytes. -// -// This function is needed by [gcexportdata.Read], which must -// accept inputs produced by the last two releases of cmd/compile, -// plus tip. -func FindExportData(r *bufio.Reader) (size int64, err error) { - arsize, err := FindPackageDefinition(r) - if err != nil { - return - } - size = int64(arsize) - - objapi, headers, err := ReadObjectHeaders(r) - if err != nil { - return - } - size -= int64(len(objapi)) - for _, h := range headers { - size -= int64(len(h)) - } - - // Check for the binary export data section header "$$B\n". - // TODO(taking): Unify with ReadExportDataHeader so that it stops at the 'u' instead of reading - line, err := r.ReadSlice('\n') - if err != nil { - return - } - hdr := string(line) - if hdr != "$$B\n" { - err = fmt.Errorf("unknown export data header: %q", hdr) - return - } - size -= int64(len(hdr)) - - // For files with a binary export data header "$$B\n", - // these are always terminated by an end-of-section marker "\n$$\n". - // So the last bytes must always be this constant. - // - // The end-of-section marker is not a part of the export data itself. - // Do not include these in size. - // - // It would be nice to have sanity check that the final bytes after - // the export data are indeed the end-of-section marker. The split - // of gcexportdata.NewReader and gcexportdata.Read make checking this - // ugly so gcimporter gives up enforcing this. The compiler and go/types - // importer do enforce this, which seems good enough. - const endofsection = "\n$$\n" - size -= int64(len(endofsection)) - - if size < 0 { - err = fmt.Errorf("invalid size (%d) in the archive file: %d bytes remain without section headers (recompile package)", arsize, size) - return - } - - return -} - -// ReadUnified reads the contents of the unified export data from a reader r -// that contains the contents of a GC-created archive file. -// -// On success, the reader will be positioned after the end-of-section marker "\n$$\n". -// -// Supported GC-created archive files have 4 layers of nesting: -// - An archive file containing a package definition file. -// - The package definition file contains headers followed by a data section. -// Headers are lines (≤ 4kb) that do not start with "$$". -// - The data section starts with "$$B\n" followed by export data followed -// by an end of section marker "\n$$\n". (The section start "$$\n" is no -// longer supported.) -// - The export data starts with a format byte ('u') followed by the in -// the given format. (See ReadExportDataHeader for older formats.) -// -// Putting this together, the bytes in a GC-created archive files are expected -// to look like the following. -// See cmd/internal/archive for more details on ar file headers. -// -// | \n | ar file signature -// | __.PKGDEF...size...\n | ar header for __.PKGDEF including size. -// | go object <...>\n | objabi header -// | \n | other headers such as build id -// | $$B\n | binary format marker -// | u\n | unified export -// | $$\n | end-of-section marker -// | [optional padding] | padding byte (0x0A) if size is odd -// | [ar file header] | other ar files -// | [ar file data] | -func ReadUnified(r *bufio.Reader) (data []byte, err error) { - // We historically guaranteed headers at the default buffer size (4096) work. - // This ensures we can use ReadSlice throughout. - const minBufferSize = 4096 - r = bufio.NewReaderSize(r, minBufferSize) - - size, err := FindPackageDefinition(r) - if err != nil { - return - } - n := size - - objapi, headers, err := ReadObjectHeaders(r) - if err != nil { - return - } - n -= len(objapi) - for _, h := range headers { - n -= len(h) - } - - hdrlen, err := ReadExportDataHeader(r) - if err != nil { - return - } - n -= hdrlen - - // size also includes the end of section marker. Remove that many bytes from the end. - const marker = "\n$$\n" - n -= len(marker) - - if n < 0 { - err = fmt.Errorf("invalid size (%d) in the archive file: %d bytes remain without section headers (recompile package)", size, n) - return - } - - // Read n bytes from buf. - data = make([]byte, n) - _, err = io.ReadFull(r, data) - if err != nil { - return - } - - // Check for marker at the end. - var suffix [len(marker)]byte - _, err = io.ReadFull(r, suffix[:]) - if err != nil { - return - } - if s := string(suffix[:]); s != marker { - err = fmt.Errorf("read %q instead of end-of-section marker (%q)", s, marker) - return - } - - return -} - -// FindPackageDefinition positions the reader r at the beginning of a package -// definition file ("__.PKGDEF") within a GC-created archive by reading -// from it, and returns the size of the package definition file in the archive. -// -// The reader must be positioned at the start of the archive file before calling -// this function, and "__.PKGDEF" is assumed to be the first file in the archive. -// -// See cmd/internal/archive for details on the archive format. -func FindPackageDefinition(r *bufio.Reader) (size int, err error) { - // Uses ReadSlice to limit risk of malformed inputs. - - // Read first line to make sure this is an object file. - line, err := r.ReadSlice('\n') - if err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - - // Is the first line an archive file signature? - if string(line) != "!\n" { - err = fmt.Errorf("not the start of an archive file (%q)", line) - return - } - - // package export block should be first - size = readArchiveHeader(r, "__.PKGDEF") - if size <= 0 { - err = fmt.Errorf("not a package file") - return - } - - return -} - -// ReadObjectHeaders reads object headers from the reader. Object headers are -// lines that do not start with an end-of-section marker "$$". The first header -// is the objabi header. On success, the reader will be positioned at the beginning -// of the end-of-section marker. -// -// It returns an error if any header does not fit in r.Size() bytes. -func ReadObjectHeaders(r *bufio.Reader) (objapi string, headers []string, err error) { - // line is a temporary buffer for headers. - // Use bounded reads (ReadSlice, Peek) to limit risk of malformed inputs. - var line []byte - - // objapi header should be the first line - if line, err = r.ReadSlice('\n'); err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - objapi = string(line) - - // objapi header begins with "go object ". - if !strings.HasPrefix(objapi, "go object ") { - err = fmt.Errorf("not a go object file: %s", objapi) - return - } - - // process remaining object header lines - for { - // check for an end of section marker "$$" - line, err = r.Peek(2) - if err != nil { - return - } - if string(line) == "$$" { - return // stop - } - - // read next header - line, err = r.ReadSlice('\n') - if err != nil { - return - } - headers = append(headers, string(line)) - } -} - -// ReadExportDataHeader reads the export data header and format from r. -// It returns the number of bytes read, or an error if the format is no longer -// supported or it failed to read. -// -// The only currently supported format is binary export data in the -// unified export format. -func ReadExportDataHeader(r *bufio.Reader) (n int, err error) { - // Read export data header. - line, err := r.ReadSlice('\n') - if err != nil { - return - } - - hdr := string(line) - switch hdr { - case "$$\n": - err = fmt.Errorf("old textual export format no longer supported (recompile package)") - return - - case "$$B\n": - var format byte - format, err = r.ReadByte() - if err != nil { - return - } - // The unified export format starts with a 'u'. - switch format { - case 'u': - default: - // Older no longer supported export formats include: - // indexed export format which started with an 'i'; and - // the older binary export format which started with a 'c', - // 'd', or 'v' (from "version"). - err = fmt.Errorf("binary export format %q is no longer supported (recompile package)", format) - return - } - - default: - err = fmt.Errorf("unknown export data header: %q", hdr) - return - } - - n = len(hdr) + 1 // + 1 is for 'u' - return -} - -// FindPkg returns the filename and unique package id for an import -// path based on package information provided by build.Import (using -// the build.Default build.Context). A relative srcDir is interpreted -// relative to the current working directory. -// -// FindPkg is only used in tests within x/tools. -func FindPkg(path, srcDir string) (filename, id string, err error) { - // TODO(taking): Move internal/exportdata.FindPkg into its own file, - // and then this copy into a _test package. - if path == "" { - return "", "", errors.New("path is empty") - } - - var noext string - switch { - default: - // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" - // Don't require the source files to be present. - if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282 - srcDir = abs - } - var bp *build.Package - bp, err = build.Import(path, srcDir, build.FindOnly|build.AllowBinary) - if bp.PkgObj == "" { - if bp.Goroot && bp.Dir != "" { - filename, err = lookupGorootExport(bp.Dir) - if err == nil { - _, err = os.Stat(filename) - } - if err == nil { - return filename, bp.ImportPath, nil - } - } - goto notfound - } else { - noext = strings.TrimSuffix(bp.PkgObj, ".a") - } - id = bp.ImportPath - - case build.IsLocalImport(path): - // "./x" -> "/this/directory/x.ext", "/this/directory/x" - noext = filepath.Join(srcDir, path) - id = noext - - case filepath.IsAbs(path): - // for completeness only - go/build.Import - // does not support absolute imports - // "/x" -> "/x.ext", "/x" - noext = path - id = path - } - - if false { // for debugging - if path != id { - fmt.Printf("%s -> %s\n", path, id) - } - } - - // try extensions - for _, ext := range pkgExts { - filename = noext + ext - f, statErr := os.Stat(filename) - if statErr == nil && !f.IsDir() { - return filename, id, nil - } - if err == nil { - err = statErr - } - } - -notfound: - if err == nil { - return "", path, fmt.Errorf("can't find import: %q", path) - } - return "", path, fmt.Errorf("can't find import: %q: %w", path, err) -} - -var pkgExts = [...]string{".a", ".o"} // a file from the build cache will have no extension - -var exportMap sync.Map // package dir → func() (string, error) - -// lookupGorootExport returns the location of the export data -// (normally found in the build cache, but located in GOROOT/pkg -// in prior Go releases) for the package located in pkgDir. -// -// (We use the package's directory instead of its import path -// mainly to simplify handling of the packages in src/vendor -// and cmd/vendor.) -// -// lookupGorootExport is only used in tests within x/tools. -func lookupGorootExport(pkgDir string) (string, error) { - f, ok := exportMap.Load(pkgDir) - if !ok { - var ( - listOnce sync.Once - exportPath string - err error - ) - f, _ = exportMap.LoadOrStore(pkgDir, func() (string, error) { - listOnce.Do(func() { - cmd := exec.Command(filepath.Join(build.Default.GOROOT, "bin", "go"), "list", "-export", "-f", "{{.Export}}", pkgDir) - cmd.Dir = build.Default.GOROOT - cmd.Env = append(os.Environ(), "PWD="+cmd.Dir, "GOROOT="+build.Default.GOROOT) - var output []byte - output, err = cmd.Output() - if err != nil { - if ee, ok := err.(*exec.ExitError); ok && len(ee.Stderr) > 0 { - err = errors.New(string(ee.Stderr)) - } - return - } - - exports := strings.Split(string(bytes.TrimSpace(output)), "\n") - if len(exports) != 1 { - err = fmt.Errorf("go list reported %d exports; expected 1", len(exports)) - return - } - - exportPath = exports[0] - }) - - return exportPath, err - }) - } - - return f.(func() (string, error))() -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go deleted file mode 100644 index 3dbd21d1b90..00000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a reduced copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go. - -// Package gcimporter provides various functions for reading -// gc-generated object files that can be used to implement the -// Importer interface defined by the Go 1.5 standard library package. -// -// The encoding is deterministic: if the encoder is applied twice to -// the same types.Package data structure, both encodings are equal. -// This property may be important to avoid spurious changes in -// applications such as build systems. -// -// However, the encoder is not necessarily idempotent. Importing an -// exported package may yield a types.Package that, while it -// represents the same set of Go types as the original, may differ in -// the details of its internal representation. Because of these -// differences, re-encoding the imported package may yield a -// different, but equally valid, encoding of the package. -package gcimporter // import "golang.org/x/tools/internal/gcimporter" - -import ( - "bufio" - "fmt" - "go/token" - "go/types" - "io" - "os" -) - -const ( - // Enable debug during development: it adds some additional checks, and - // prevents errors from being recovered. - debug = false - - // If trace is set, debugging output is printed to std out. - trace = false -) - -// Import imports a gc-generated package given its import path and srcDir, adds -// the corresponding package object to the packages map, and returns the object. -// The packages map must contain all packages already imported. -// -// Import is only used in tests. -func Import(fset *token.FileSet, packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { - var rc io.ReadCloser - var id string - if lookup != nil { - // With custom lookup specified, assume that caller has - // converted path to a canonical import path for use in the map. - if path == "unsafe" { - return types.Unsafe, nil - } - id = path - - // No need to re-import if the package was imported completely before. - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - f, err := lookup(path) - if err != nil { - return nil, err - } - rc = f - } else { - var filename string - filename, id, err = FindPkg(path, srcDir) - if filename == "" { - if path == "unsafe" { - return types.Unsafe, nil - } - return nil, err - } - - // no need to re-import if the package was imported completely before - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - if err != nil { - // add file name to error - err = fmt.Errorf("%s: %v", filename, err) - } - }() - rc = f - } - defer rc.Close() - - buf := bufio.NewReader(rc) - data, err := ReadUnified(buf) - if err != nil { - err = fmt.Errorf("import %q: %v", path, err) - return - } - - // unified: emitted by cmd/compile since go1.20. - _, pkg, err = UImportData(fset, packages, data, id) - - return -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go b/vendor/golang.org/x/tools/internal/gcimporter/iexport.go deleted file mode 100644 index 686f171d3bd..00000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/iexport.go +++ /dev/null @@ -1,1605 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed package export. -// -// The indexed export data format is an evolution of the previous -// binary export data format. Its chief contribution is introducing an -// index table, which allows efficient random access of individual -// declarations and inline function bodies. In turn, this allows -// avoiding unnecessary work for compilation units that import large -// packages. -// -// -// The top-level data format is structured as: -// -// Header struct { -// Tag byte // 'i' -// Version uvarint -// StringSize uvarint -// DataSize uvarint -// } -// -// Strings [StringSize]byte -// Data [DataSize]byte -// -// MainIndex []struct{ -// PkgPath stringOff -// PkgName stringOff -// PkgHeight uvarint -// -// Decls []struct{ -// Name stringOff -// Offset declOff -// } -// } -// -// Fingerprint [8]byte -// -// uvarint means a uint64 written out using uvarint encoding. -// -// []T means a uvarint followed by that many T objects. In other -// words: -// -// Len uvarint -// Elems [Len]T -// -// stringOff means a uvarint that indicates an offset within the -// Strings section. At that offset is another uvarint, followed by -// that many bytes, which form the string value. -// -// declOff means a uvarint that indicates an offset within the Data -// section where the associated declaration can be found. -// -// -// There are five kinds of declarations, distinguished by their first -// byte: -// -// type Var struct { -// Tag byte // 'V' -// Pos Pos -// Type typeOff -// } -// -// type Func struct { -// Tag byte // 'F' or 'G' -// Pos Pos -// TypeParams []typeOff // only present if Tag == 'G' -// Signature Signature -// } -// -// type Const struct { -// Tag byte // 'C' -// Pos Pos -// Value Value -// } -// -// type Type struct { -// Tag byte // 'T' or 'U' -// Pos Pos -// TypeParams []typeOff // only present if Tag == 'U' -// Underlying typeOff -// -// Methods []struct{ // omitted if Underlying is an interface type -// Pos Pos -// Name stringOff -// Recv Param -// Signature Signature -// } -// } -// -// type Alias struct { -// Tag byte // 'A' or 'B' -// Pos Pos -// TypeParams []typeOff // only present if Tag == 'B' -// Type typeOff -// } -// -// // "Automatic" declaration of each typeparam -// type TypeParam struct { -// Tag byte // 'P' -// Pos Pos -// Implicit bool -// Constraint typeOff -// } -// -// typeOff means a uvarint that either indicates a predeclared type, -// or an offset into the Data section. If the uvarint is less than -// predeclReserved, then it indicates the index into the predeclared -// types list (see predeclared in bexport.go for order). Otherwise, -// subtracting predeclReserved yields the offset of a type descriptor. -// -// Value means a type, kind, and type-specific value. See -// (*exportWriter).value for details. -// -// -// There are twelve kinds of type descriptors, distinguished by an itag: -// -// type DefinedType struct { -// Tag itag // definedType -// Name stringOff -// PkgPath stringOff -// } -// -// type PointerType struct { -// Tag itag // pointerType -// Elem typeOff -// } -// -// type SliceType struct { -// Tag itag // sliceType -// Elem typeOff -// } -// -// type ArrayType struct { -// Tag itag // arrayType -// Len uint64 -// Elem typeOff -// } -// -// type ChanType struct { -// Tag itag // chanType -// Dir uint64 // 1 RecvOnly; 2 SendOnly; 3 SendRecv -// Elem typeOff -// } -// -// type MapType struct { -// Tag itag // mapType -// Key typeOff -// Elem typeOff -// } -// -// type FuncType struct { -// Tag itag // signatureType -// PkgPath stringOff -// Signature Signature -// } -// -// type StructType struct { -// Tag itag // structType -// PkgPath stringOff -// Fields []struct { -// Pos Pos -// Name stringOff -// Type typeOff -// Embedded bool -// Note stringOff -// } -// } -// -// type InterfaceType struct { -// Tag itag // interfaceType -// PkgPath stringOff -// Embeddeds []struct { -// Pos Pos -// Type typeOff -// } -// Methods []struct { -// Pos Pos -// Name stringOff -// Signature Signature -// } -// } -// -// // Reference to a type param declaration -// type TypeParamType struct { -// Tag itag // typeParamType -// Name stringOff -// PkgPath stringOff -// } -// -// // Instantiation of a generic type (like List[T2] or List[int]) -// type InstanceType struct { -// Tag itag // instanceType -// Pos pos -// TypeArgs []typeOff -// BaseType typeOff -// } -// -// type UnionType struct { -// Tag itag // interfaceType -// Terms []struct { -// tilde bool -// Type typeOff -// } -// } -// -// -// -// type Signature struct { -// Params []Param -// Results []Param -// Variadic bool // omitted if Results is empty -// } -// -// type Param struct { -// Pos Pos -// Name stringOff -// Type typOff -// } -// -// -// Pos encodes a file:line:column triple, incorporating a simple delta -// encoding scheme within a data object. See exportWriter.pos for -// details. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "io" - "math/big" - "reflect" - "slices" - "sort" - "strconv" - "strings" - - "golang.org/x/tools/go/types/objectpath" -) - -// IExportShallow encodes "shallow" export data for the specified package. -// -// For types, we use "shallow" export data. Historically, the Go -// compiler always produced a summary of the types for a given package -// that included types from other packages that it indirectly -// referenced: "deep" export data. This had the advantage that the -// compiler (and analogous tools such as gopls) need only load one -// file per direct import. However, it meant that the files tended to -// get larger based on the level of the package in the import -// graph. For example, higher-level packages in the kubernetes module -// have over 1MB of "deep" export data, even when they have almost no -// content of their own, merely because they mention a major type that -// references many others. In pathological cases the export data was -// 300x larger than the source for a package due to this quadratic -// growth. -// -// "Shallow" export data means that the serialized types describe only -// a single package. If those types mention types from other packages, -// the type checker may need to request additional packages beyond -// just the direct imports. Type information for the entire transitive -// closure of imports is provided (lazily) by the DAG. -// -// No promises are made about the encoding other than that it can be decoded by -// the same version of IIExportShallow. If you plan to save export data in the -// file system, be sure to include a cryptographic digest of the executable in -// the key to avoid version skew. -// -// If the provided reportf func is non-nil, it is used for reporting -// bugs (e.g. recovered panics) encountered during export, enabling us -// to obtain via telemetry the stack that would otherwise be lost by -// merely returning an error. -func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) { - // In principle this operation can only fail if out.Write fails, - // but that's impossible for bytes.Buffer---and as a matter of - // fact iexportCommon doesn't even check for I/O errors. - // TODO(adonovan): handle I/O errors properly. - // TODO(adonovan): use byte slices throughout, avoiding copying. - const bundle, shallow = false, true - var out bytes.Buffer - err := iexportCommon(&out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}, reportf) - return out.Bytes(), err -} - -// IImportShallow decodes "shallow" types.Package data encoded by -// [IExportShallow] in the same executable. This function cannot import data -// from cmd/compile or gcexportdata.Write. -// -// The importer calls getPackages to obtain package symbols for all -// packages mentioned in the export data, including the one being -// decoded. -// -// If the provided reportf func is non-nil, it will be used for reporting bugs -// encountered during import. -// TODO(rfindley): remove reportf when we are confident enough in the new -// objectpath encoding. -func IImportShallow(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, path string, reportf ReportFunc) (*types.Package, error) { - const bundle = false - const shallow = true - pkgs, err := iimportCommon(fset, getPackages, data, bundle, path, shallow, reportf) - if err != nil { - return nil, err - } - return pkgs[0], nil -} - -// ReportFunc is the type of a function used to report formatted bugs. -type ReportFunc = func(string, ...any) - -// Current bundled export format version. Increase with each format change. -// 0: initial implementation -const bundleVersion = 0 - -// IExportData writes indexed export data for pkg to out. -// -// If no file set is provided, position info will be missing. -// The package path of the top-level package will not be recorded, -// so that calls to IImportData can override with a provided package path. -func IExportData(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - const bundle, shallow = false, false - return iexportCommon(out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}, nil) -} - -// IExportBundle writes an indexed export bundle for pkgs to out. -func IExportBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { - const bundle, shallow = true, false - return iexportCommon(out, fset, bundle, shallow, iexportVersion, pkgs, nil) -} - -func iexportCommon(out io.Writer, fset *token.FileSet, bundle, shallow bool, version int, pkgs []*types.Package, reportf ReportFunc) (err error) { - if !debug { - defer func() { - if e := recover(); e != nil { - // Report the stack via telemetry (see #71067). - if reportf != nil { - reportf("panic in exporter") - } - if ierr, ok := e.(internalError); ok { - // internalError usually means we exported a - // bad go/types data structure: a violation - // of an implicit precondition of Export. - err = ierr - return - } - // Not an internal error; panic again. - panic(e) - } - }() - } - - p := iexporter{ - fset: fset, - version: version, - shallow: shallow, - allPkgs: map[*types.Package]bool{}, - stringIndex: map[string]uint64{}, - declIndex: map[types.Object]uint64{}, - tparamNames: map[types.Object]string{}, - typIndex: map[types.Type]uint64{}, - } - if !bundle { - p.localpkg = pkgs[0] - } - - for i, pt := range predeclared() { - p.typIndex[pt] = uint64(i) - } - if len(p.typIndex) > predeclReserved { - panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved)) - } - - // Initialize work queue with exported declarations. - for _, pkg := range pkgs { - scope := pkg.Scope() - for _, name := range scope.Names() { - if token.IsExported(name) { - p.pushDecl(scope.Lookup(name)) - } - } - - if bundle { - // Ensure pkg and its imports are included in the index. - p.allPkgs[pkg] = true - for _, imp := range pkg.Imports() { - p.allPkgs[imp] = true - } - } - } - - // Loop until no more work. - for !p.declTodo.empty() { - p.doDecl(p.declTodo.popHead()) - } - - // Produce index of offset of each file record in files. - var files intWriter - var fileOffset []uint64 // fileOffset[i] is offset in files of file encoded as i - if p.shallow { - fileOffset = make([]uint64, len(p.fileInfos)) - for i, info := range p.fileInfos { - fileOffset[i] = uint64(files.Len()) - p.encodeFile(&files, info.file, info.needed) - } - } - - // Append indices to data0 section. - dataLen := uint64(p.data0.Len()) - w := p.newWriter() - w.writeIndex(p.declIndex) - - if bundle { - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.pkg(pkg) - imps := pkg.Imports() - w.uint64(uint64(len(imps))) - for _, imp := range imps { - w.pkg(imp) - } - } - } - w.flush() - - // Assemble header. - var hdr intWriter - if bundle { - hdr.uint64(bundleVersion) - } - hdr.uint64(uint64(p.version)) - hdr.uint64(uint64(p.strings.Len())) - if p.shallow { - hdr.uint64(uint64(files.Len())) - hdr.uint64(uint64(len(fileOffset))) - for _, offset := range fileOffset { - hdr.uint64(offset) - } - } - hdr.uint64(dataLen) - - // Flush output. - io.Copy(out, &hdr) - io.Copy(out, &p.strings) - if p.shallow { - io.Copy(out, &files) - } - io.Copy(out, &p.data0) - - return nil -} - -// encodeFile writes to w a representation of the file sufficient to -// faithfully restore position information about all needed offsets. -// Mutates the needed array. -func (p *iexporter) encodeFile(w *intWriter, file *token.File, needed []uint64) { - _ = needed[0] // precondition: needed is non-empty - - w.uint64(p.stringOff(file.Name())) - - size := uint64(file.Size()) - w.uint64(size) - - // Sort the set of needed offsets. Duplicates are harmless. - slices.Sort(needed) - - lines := file.Lines() // byte offset of each line start - w.uint64(uint64(len(lines))) - - // Rather than record the entire array of line start offsets, - // we save only a sparse list of (index, offset) pairs for - // the start of each line that contains a needed position. - var sparse [][2]int // (index, offset) pairs -outer: - for i, lineStart := range lines { - lineEnd := size - if i < len(lines)-1 { - lineEnd = uint64(lines[i+1]) - } - // Does this line contains a needed offset? - if needed[0] < lineEnd { - sparse = append(sparse, [2]int{i, lineStart}) - for needed[0] < lineEnd { - needed = needed[1:] - if len(needed) == 0 { - break outer - } - } - } - } - - // Delta-encode the columns. - w.uint64(uint64(len(sparse))) - var prev [2]int - for _, pair := range sparse { - w.uint64(uint64(pair[0] - prev[0])) - w.uint64(uint64(pair[1] - prev[1])) - prev = pair - } -} - -// writeIndex writes out an object index. mainIndex indicates whether -// we're writing out the main index, which is also read by -// non-compiler tools and includes a complete package description -// (i.e., name and height). -func (w *exportWriter) writeIndex(index map[types.Object]uint64) { - type pkgObj struct { - obj types.Object - name string // qualified name; differs from obj.Name for type params - } - // Build a map from packages to objects from that package. - pkgObjs := map[*types.Package][]pkgObj{} - - // For the main index, make sure to include every package that - // we reference, even if we're not exporting (or reexporting) - // any symbols from it. - if w.p.localpkg != nil { - pkgObjs[w.p.localpkg] = nil - } - for pkg := range w.p.allPkgs { - pkgObjs[pkg] = nil - } - - for obj := range index { - name := w.p.exportName(obj) - pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], pkgObj{obj, name}) - } - - var pkgs []*types.Package - for pkg, objs := range pkgObjs { - pkgs = append(pkgs, pkg) - - sort.Slice(objs, func(i, j int) bool { - return objs[i].name < objs[j].name - }) - } - - sort.Slice(pkgs, func(i, j int) bool { - return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j]) - }) - - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.string(w.exportPath(pkg)) - w.string(pkg.Name()) - w.uint64(uint64(0)) // package height is not needed for go/types - - objs := pkgObjs[pkg] - w.uint64(uint64(len(objs))) - for _, obj := range objs { - w.string(obj.name) - w.uint64(index[obj.obj]) - } - } -} - -// exportName returns the 'exported' name of an object. It differs from -// obj.Name() only for type parameters (see tparamExportName for details). -func (p *iexporter) exportName(obj types.Object) (res string) { - if name := p.tparamNames[obj]; name != "" { - return name - } - return obj.Name() -} - -type iexporter struct { - fset *token.FileSet - version int - - shallow bool // don't put types from other packages in the index - objEncoder *objectpath.Encoder // encodes objects from other packages in shallow mode; lazily allocated - localpkg *types.Package // (nil in bundle mode) - - // allPkgs tracks all packages that have been referenced by - // the export data, so we can ensure to include them in the - // main index. - allPkgs map[*types.Package]bool - - declTodo objQueue - - strings intWriter - stringIndex map[string]uint64 - - // In shallow mode, object positions are encoded as (file, offset). - // Each file is recorded as a line-number table. - // Only the lines of needed positions are saved faithfully. - fileInfo map[*token.File]uint64 // value is index in fileInfos - fileInfos []*filePositions - - data0 intWriter - declIndex map[types.Object]uint64 - tparamNames map[types.Object]string // typeparam->exported name - typIndex map[types.Type]uint64 - - indent int // for tracing support -} - -type filePositions struct { - file *token.File - needed []uint64 // unordered list of needed file offsets -} - -func (p *iexporter) trace(format string, args ...any) { - if !trace { - // Call sites should also be guarded, but having this check here allows - // easily enabling/disabling debug trace statements. - return - } - fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) -} - -// objectpathEncoder returns the lazily allocated objectpath.Encoder to use -// when encoding objects in other packages during shallow export. -// -// Using a shared Encoder amortizes some of cost of objectpath search. -func (p *iexporter) objectpathEncoder() *objectpath.Encoder { - if p.objEncoder == nil { - p.objEncoder = new(objectpath.Encoder) - } - return p.objEncoder -} - -// stringOff returns the offset of s within the string section. -// If not already present, it's added to the end. -func (p *iexporter) stringOff(s string) uint64 { - off, ok := p.stringIndex[s] - if !ok { - off = uint64(p.strings.Len()) - p.stringIndex[s] = off - - p.strings.uint64(uint64(len(s))) - p.strings.WriteString(s) - } - return off -} - -// fileIndexAndOffset returns the index of the token.File and the byte offset of pos within it. -func (p *iexporter) fileIndexAndOffset(file *token.File, pos token.Pos) (uint64, uint64) { - index, ok := p.fileInfo[file] - if !ok { - index = uint64(len(p.fileInfo)) - p.fileInfos = append(p.fileInfos, &filePositions{file: file}) - if p.fileInfo == nil { - p.fileInfo = make(map[*token.File]uint64) - } - p.fileInfo[file] = index - } - // Record each needed offset. - info := p.fileInfos[index] - offset := uint64(file.Offset(pos)) - info.needed = append(info.needed, offset) - - return index, offset -} - -// pushDecl adds n to the declaration work queue, if not already present. -func (p *iexporter) pushDecl(obj types.Object) { - // Package unsafe is known to the compiler and predeclared. - // Caller should not ask us to do export it. - if obj.Pkg() == types.Unsafe { - panic("cannot export package unsafe") - } - - // Shallow export data: don't index decls from other packages. - if p.shallow && obj.Pkg() != p.localpkg { - return - } - - if _, ok := p.declIndex[obj]; ok { - return - } - - p.declIndex[obj] = ^uint64(0) // mark obj present in work queue - p.declTodo.pushTail(obj) -} - -// exportWriter handles writing out individual data section chunks. -type exportWriter struct { - p *iexporter - - data intWriter - prevFile string - prevLine int64 - prevColumn int64 -} - -func (w *exportWriter) exportPath(pkg *types.Package) string { - if pkg == w.p.localpkg { - return "" - } - return pkg.Path() -} - -func (p *iexporter) doDecl(obj types.Object) { - if trace { - p.trace("exporting decl %v (%T)", obj, obj) - p.indent++ - defer func() { - p.indent-- - p.trace("=> %s", obj) - }() - } - w := p.newWriter() - - switch obj := obj.(type) { - case *types.Var: - w.tag(varTag) - w.pos(obj.Pos()) - w.typ(obj.Type(), obj.Pkg()) - - case *types.Func: - sig, _ := obj.Type().(*types.Signature) - if sig.Recv() != nil { - // We shouldn't see methods in the package scope, - // but the type checker may repair "func () F() {}" - // to "func (Invalid) F()" and then treat it like "func F()", - // so allow that. See golang/go#57729. - if sig.Recv().Type() != types.Typ[types.Invalid] { - panic(internalErrorf("unexpected method: %v", sig)) - } - } - - // Function. - if sig.TypeParams().Len() == 0 { - w.tag(funcTag) - } else { - w.tag(genericFuncTag) - } - w.pos(obj.Pos()) - // The tparam list of the function type is the declaration of the type - // params. So, write out the type params right now. Then those type params - // will be referenced via their type offset (via typOff) in all other - // places in the signature and function where they are used. - // - // While importing the type parameters, tparamList computes and records - // their export name, so that it can be later used when writing the index. - if tparams := sig.TypeParams(); tparams.Len() > 0 { - w.tparamList(obj.Name(), tparams, obj.Pkg()) - } - w.signature(sig) - - case *types.Const: - w.tag(constTag) - w.pos(obj.Pos()) - w.value(obj.Type(), obj.Val()) - - case *types.TypeName: - t := obj.Type() - - if tparam, ok := types.Unalias(t).(*types.TypeParam); ok { - w.tag(typeParamTag) - w.pos(obj.Pos()) - constraint := tparam.Constraint() - if p.version >= iexportVersionGo1_18 { - implicit := false - if iface, _ := types.Unalias(constraint).(*types.Interface); iface != nil { - implicit = iface.IsImplicit() - } - w.bool(implicit) - } - w.typ(constraint, obj.Pkg()) - break - } - - if obj.IsAlias() { - alias, materialized := t.(*types.Alias) // perhaps false for certain built-ins? - - var tparams *types.TypeParamList - if materialized { - tparams = alias.TypeParams() - } - if tparams.Len() == 0 { - w.tag(aliasTag) - } else { - w.tag(genericAliasTag) - } - w.pos(obj.Pos()) - if tparams.Len() > 0 { - w.tparamList(obj.Name(), tparams, obj.Pkg()) - } - if materialized { - // Preserve materialized aliases, - // even of non-exported types. - t = alias.Rhs() - } - w.typ(t, obj.Pkg()) - break - } - - // Defined type. - named, ok := t.(*types.Named) - if !ok { - panic(internalErrorf("%s is not a defined type", t)) - } - - if named.TypeParams().Len() == 0 { - w.tag(typeTag) - } else { - w.tag(genericTypeTag) - } - w.pos(obj.Pos()) - - if named.TypeParams().Len() > 0 { - // While importing the type parameters, tparamList computes and records - // their export name, so that it can be later used when writing the index. - w.tparamList(obj.Name(), named.TypeParams(), obj.Pkg()) - } - - underlying := named.Underlying() - w.typ(underlying, obj.Pkg()) - - if types.IsInterface(t) { - break - } - - n := named.NumMethods() - w.uint64(uint64(n)) - for i := range n { - m := named.Method(i) - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - if w.p.version >= iexportVersionGenericMethods && w.bool(sig.TypeParams().Len() > 0) { - w.tparamList(obj.Name()+"."+m.Name(), sig.TypeParams(), obj.Pkg()) - } - - // Receiver type parameters are type arguments of the receiver type, so - // their name must be qualified before exporting recv. - if rparams := sig.RecvTypeParams(); rparams.Len() > 0 { - prefix := obj.Name() + "." + m.Name() - for rparam := range rparams.TypeParams() { - name := tparamExportName(prefix, rparam) - w.p.tparamNames[rparam.Obj()] = name - } - } - w.param(sig.Recv()) - w.signature(sig) - } - - default: - panic(internalErrorf("unexpected object: %v", obj)) - } - - p.declIndex[obj] = w.flush() -} - -func (w *exportWriter) tag(tag byte) { - w.data.WriteByte(tag) -} - -func (w *exportWriter) pos(pos token.Pos) { - if w.p.shallow { - w.posV2(pos) - } else if w.p.version >= iexportVersionPosCol { - w.posV1(pos) - } else { - w.posV0(pos) - } -} - -// posV2 encoding (used only in shallow mode) records positions as -// (file, offset), where file is the index in the token.File table -// (which records the file name and newline offsets) and offset is a -// byte offset. It effectively ignores //line directives. -func (w *exportWriter) posV2(pos token.Pos) { - if pos == token.NoPos { - w.uint64(0) - return - } - file := w.p.fset.File(pos) // fset must be non-nil - index, offset := w.p.fileIndexAndOffset(file, pos) - w.uint64(1 + index) - w.uint64(offset) -} - -func (w *exportWriter) posV1(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - column := int64(p.Column) - - deltaColumn := (column - w.prevColumn) << 1 - deltaLine := (line - w.prevLine) << 1 - - if file != w.prevFile { - deltaLine |= 1 - } - if deltaLine != 0 { - deltaColumn |= 1 - } - - w.int64(deltaColumn) - if deltaColumn&1 != 0 { - w.int64(deltaLine) - if deltaLine&1 != 0 { - w.string(file) - } - } - - w.prevFile = file - w.prevLine = line - w.prevColumn = column -} - -func (w *exportWriter) posV0(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - - // When file is the same as the last position (common case), - // we can save a few bytes by delta encoding just the line - // number. - // - // Note: Because data objects may be read out of order (or not - // at all), we can only apply delta encoding within a single - // object. This is handled implicitly by tracking prevFile and - // prevLine as fields of exportWriter. - - if file == w.prevFile { - delta := line - w.prevLine - w.int64(delta) - if delta == deltaNewFile { - w.int64(-1) - } - } else { - w.int64(deltaNewFile) - w.int64(line) // line >= 0 - w.string(file) - w.prevFile = file - } - w.prevLine = line -} - -func (w *exportWriter) pkg(pkg *types.Package) { - if pkg == nil { - // [exportWriter.typ] accepts a nil pkg only for types - // of constants, which cannot contain named objects - // such as fields or methods and thus should never - // reach this method (#76222). - panic("nil package") - } - // Ensure any referenced packages are declared in the main index. - w.p.allPkgs[pkg] = true - - w.string(w.exportPath(pkg)) -} - -func (w *exportWriter) qualifiedType(obj *types.TypeName) { - name := w.p.exportName(obj) - - // Ensure any referenced declarations are written out too. - w.p.pushDecl(obj) - w.string(name) - w.pkg(obj.Pkg()) -} - -// typ emits the specified type. -// -// Objects within the type (struct fields and interface methods) are -// qualified by pkg. It may be nil if the type cannot contain objects, -// such as the type of a constant. -func (w *exportWriter) typ(t types.Type, pkg *types.Package) { - w.data.uint64(w.p.typOff(t, pkg)) -} - -func (p *iexporter) newWriter() *exportWriter { - return &exportWriter{p: p} -} - -func (w *exportWriter) flush() uint64 { - off := uint64(w.p.data0.Len()) - io.Copy(&w.p.data0, &w.data) - return off -} - -func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 { - off, ok := p.typIndex[t] - if !ok { - w := p.newWriter() - w.doTyp(t, pkg) - off = predeclReserved + w.flush() - p.typIndex[t] = off - } - return off -} - -func (w *exportWriter) startType(k itag) { - w.data.uint64(uint64(k)) -} - -// doTyp is the implementation of [exportWriter.typ]. -func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { - if trace { - w.p.trace("exporting type %s (%T)", t, t) - w.p.indent++ - defer func() { - w.p.indent-- - w.p.trace("=> %s", t) - }() - } - switch t := t.(type) { - case *types.Alias: - if targs := t.TypeArgs(); targs.Len() > 0 { - w.startType(instanceType) - w.pos(t.Obj().Pos()) - w.typeList(targs, pkg) - w.typ(t.Origin(), pkg) - return - } - w.startType(aliasType) - w.qualifiedType(t.Obj()) - - case *types.Named: - if targs := t.TypeArgs(); targs.Len() > 0 { - w.startType(instanceType) - // TODO(rfindley): investigate if this position is correct, and if it - // matters. - w.pos(t.Obj().Pos()) - w.typeList(targs, pkg) - w.typ(t.Origin(), pkg) - return - } - w.startType(definedType) - w.qualifiedType(t.Obj()) - - case *types.TypeParam: - w.startType(typeParamType) - w.qualifiedType(t.Obj()) - - case *types.Pointer: - w.startType(pointerType) - w.typ(t.Elem(), pkg) - - case *types.Slice: - w.startType(sliceType) - w.typ(t.Elem(), pkg) - - case *types.Array: - w.startType(arrayType) - w.uint64(uint64(t.Len())) - w.typ(t.Elem(), pkg) - - case *types.Chan: - w.startType(chanType) - // 1 RecvOnly; 2 SendOnly; 3 SendRecv - var dir uint64 - switch t.Dir() { - case types.RecvOnly: - dir = 1 - case types.SendOnly: - dir = 2 - case types.SendRecv: - dir = 3 - } - w.uint64(dir) - w.typ(t.Elem(), pkg) - - case *types.Map: - w.startType(mapType) - w.typ(t.Key(), pkg) - w.typ(t.Elem(), pkg) - - case *types.Signature: - w.startType(signatureType) - w.pkg(pkg) // qualifies param/result vars - w.signature(t) - - case *types.Struct: - w.startType(structType) - n := t.NumFields() - // Even for struct{} we must emit some qualifying package, because that's - // what the compiler does, and thus that's what the importer expects. - fieldPkg := pkg - if n > 0 { - fieldPkg = t.Field(0).Pkg() - } - if fieldPkg == nil { - // TODO(rfindley): improve this very hacky logic. - // - // The importer expects a package to be set for all struct types, even - // those with no fields. A better encoding might be to set NumFields - // before pkg. setPkg panics with a nil package, which may be possible - // to reach with invalid packages (and perhaps valid packages, too?), so - // (arbitrarily) set the localpkg if available. - // - // Alternatively, we may be able to simply guarantee that pkg != nil, by - // reconsidering the encoding of constant values. - if w.p.shallow { - fieldPkg = w.p.localpkg - } else { - panic(internalErrorf("no package to set for empty struct")) - } - } - w.pkg(fieldPkg) - w.uint64(uint64(n)) - - for i := range n { - f := t.Field(i) - if w.p.shallow { - w.objectPath(f) - } - w.pos(f.Pos()) - w.string(f.Name()) // unexported fields implicitly qualified by prior setPkg - w.typ(f.Type(), fieldPkg) - w.bool(f.Anonymous()) - w.string(t.Tag(i)) // note (or tag) - } - - case *types.Interface: - w.startType(interfaceType) - w.pkg(pkg) // qualifies unexported method funcs - - n := t.NumEmbeddeds() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - ft := t.EmbeddedType(i) - if named, _ := types.Unalias(ft).(*types.Named); named != nil { - w.pos(named.Obj().Pos()) - } else { - // e.g. ~int - w.pos(token.NoPos) - } - w.typ(ft, pkg) - } - - // See comment for struct fields. In shallow mode we change the encoding - // for interface methods that are promoted from other packages. - - n = t.NumExplicitMethods() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - m := t.ExplicitMethod(i) - if w.p.shallow { - w.objectPath(m) - } - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - w.signature(sig) - } - - case *types.Union: - w.startType(unionType) - nt := t.Len() - w.uint64(uint64(nt)) - for i := range nt { - term := t.Term(i) - w.bool(term.Tilde()) - w.typ(term.Type(), pkg) - } - - default: - panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t))) - } -} - -// objectPath writes the package and objectPath to use to look up obj in a -// different package, when encoding in "shallow" mode. -// -// When doing a shallow import, the importer creates only the local package, -// and requests package symbols for dependencies from the client. -// However, certain types defined in the local package may hold objects defined -// (perhaps deeply) within another package. -// -// For example, consider the following: -// -// package a -// func F() chan * map[string] struct { X int } -// -// package b -// import "a" -// var B = a.F() -// -// In this example, the type of b.B holds fields defined in package a. -// In order to have the correct canonical objects for the field defined in the -// type of B, they are encoded as objectPaths and later looked up in the -// importer. The same problem applies to interface methods. -func (w *exportWriter) objectPath(obj types.Object) { - if obj.Pkg() == nil || obj.Pkg() == w.p.localpkg { - // obj.Pkg() may be nil for the builtin error.Error. - // In this case, or if obj is declared in the local package, no need to - // encode. - w.string("") - return - } - objectPath, err := w.p.objectpathEncoder().For(obj) - if err != nil { - // Fall back to the empty string, which will cause the importer to create a - // new object, which matches earlier behavior. Creating a new object is - // sufficient for many purposes (such as type checking), but causes certain - // references algorithms to fail (golang/go#60819). However, we didn't - // notice this problem during months of gopls@v0.12.0 testing. - // - // TODO(golang/go#61674): this workaround is insufficient, as in the case - // where the field forwarded from an instantiated type that may not appear - // in the export data of the original package: - // - // // package a - // type A[P any] struct{ F P } - // - // // package b - // type B a.A[int] - // - // We need to update references algorithms not to depend on this - // de-duplication, at which point we may want to simply remove the - // workaround here. - w.string("") - return - } - w.string(string(objectPath)) - w.pkg(obj.Pkg()) -} - -func (w *exportWriter) signature(sig *types.Signature) { - w.paramList(sig.Params()) - w.paramList(sig.Results()) - if sig.Params().Len() > 0 { - w.bool(sig.Variadic()) - } -} - -func (w *exportWriter) typeList(ts *types.TypeList, pkg *types.Package) { - w.uint64(uint64(ts.Len())) - for t := range ts.Types() { - w.typ(t, pkg) - } -} - -func (w *exportWriter) tparamList(prefix string, list *types.TypeParamList, pkg *types.Package) { - ll := uint64(list.Len()) - w.uint64(ll) - for tparam := range list.TypeParams() { - // Set the type parameter exportName before exporting its type. - exportName := tparamExportName(prefix, tparam) - w.p.tparamNames[tparam.Obj()] = exportName - w.typ(tparam, pkg) - } -} - -const blankMarker = "$" - -// tparamExportName returns the 'exported' name of a type parameter, which -// differs from its actual object name: it is prefixed with a qualifier, and -// blank type parameter names are disambiguated by their index in the type -// parameter list. -func tparamExportName(prefix string, tparam *types.TypeParam) string { - assert(prefix != "") - name := tparam.Obj().Name() - if name == "_" { - name = blankMarker + strconv.Itoa(tparam.Index()) - } - return prefix + "." + name -} - -// tparamName returns the real name of a type parameter, after stripping its -// qualifying prefix and reverting blank-name encoding. See tparamExportName -// for details. -func tparamName(exportName string) string { - // Remove the "path" from the type param name that makes it unique. - ix := strings.LastIndex(exportName, ".") - if ix < 0 { - errorf("malformed type parameter export name %s: missing prefix", exportName) - } - name := exportName[ix+1:] - if strings.HasPrefix(name, blankMarker) { - return "_" - } - return name -} - -func (w *exportWriter) paramList(tup *types.Tuple) { - n := tup.Len() - w.uint64(uint64(n)) - for i := range n { - w.param(tup.At(i)) - } -} - -func (w *exportWriter) param(obj types.Object) { - w.pos(obj.Pos()) - w.localIdent(obj) - w.typ(obj.Type(), obj.Pkg()) -} - -func (w *exportWriter) value(typ types.Type, v constant.Value) { - w.typ(typ, nil) - if w.p.version >= iexportVersionGo1_18 { - w.int64(int64(v.Kind())) - } - - if v.Kind() == constant.Unknown { - // golang/go#60605: treat unknown constant values as if they have invalid type - // - // This loses some fidelity over the package type-checked from source, but that - // is acceptable. - // - // TODO(rfindley): we should switch on the recorded constant kind rather - // than the constant type - return - } - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - w.bool(constant.BoolVal(v)) - case types.IsInteger: - var i big.Int - if i64, exact := constant.Int64Val(v); exact { - i.SetInt64(i64) - } else if ui64, exact := constant.Uint64Val(v); exact { - i.SetUint64(ui64) - } else { - i.SetString(v.ExactString(), 10) - } - w.mpint(&i, typ) - case types.IsFloat: - f := constantToFloat(v) - w.mpfloat(f, typ) - case types.IsComplex: - w.mpfloat(constantToFloat(constant.Real(v)), typ) - w.mpfloat(constantToFloat(constant.Imag(v)), typ) - case types.IsString: - w.string(constant.StringVal(v)) - default: - if b.Kind() == types.Invalid { - // package contains type errors - break - } - panic(internalErrorf("unexpected type %v (%v)", typ, typ.Underlying())) - } -} - -// constantToFloat converts a constant.Value with kind constant.Float to a -// big.Float. -func constantToFloat(x constant.Value) *big.Float { - x = constant.ToFloat(x) - // Use the same floating-point precision (512) as cmd/compile - // (see Mpprec in cmd/compile/internal/gc/mpfloat.go). - const mpprec = 512 - var f big.Float - f.SetPrec(mpprec) - if v, exact := constant.Float64Val(x); exact { - // float64 - f.SetFloat64(v) - } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { - // TODO(gri): add big.Rat accessor to constant.Value. - n := valueToRat(num) - d := valueToRat(denom) - f.SetRat(n.Quo(n, d)) - } else { - // Value too large to represent as a fraction => inaccessible. - // TODO(gri): add big.Float accessor to constant.Value. - _, ok := f.SetString(x.ExactString()) - assert(ok) - } - return &f -} - -func valueToRat(x constant.Value) *big.Rat { - // Convert little-endian to big-endian. - // I can't believe this is necessary. - bytes := constant.Bytes(x) - for i := 0; i < len(bytes)/2; i++ { - bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i] - } - return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes)) -} - -// mpint exports a multi-precision integer. -// -// For unsigned types, small values are written out as a single -// byte. Larger values are written out as a length-prefixed big-endian -// byte string, where the length prefix is encoded as its complement. -// For example, bytes 0, 1, and 2 directly represent the integer -// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-, -// 2-, and 3-byte big-endian string follow. -// -// Encoding for signed types use the same general approach as for -// unsigned types, except small values use zig-zag encoding and the -// bottom bit of length prefix byte for large values is reserved as a -// sign bit. -// -// The exact boundary between small and large encodings varies -// according to the maximum number of bytes needed to encode a value -// of type typ. As a special case, 8-bit types are always encoded as a -// single byte. -// -// TODO(mdempsky): Is this level of complexity really worthwhile? -func (w *exportWriter) mpint(x *big.Int, typ types.Type) { - basic, ok := typ.Underlying().(*types.Basic) - if !ok { - panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying())) - } - - signed, maxBytes := intSize(basic) - - negative := x.Sign() < 0 - if !signed && negative { - panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x)) - } - - b := x.Bytes() - if len(b) > 0 && b[0] == 0 { - panic(internalErrorf("leading zeros")) - } - if uint(len(b)) > maxBytes { - panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x)) - } - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - // Check if x can use small value encoding. - if len(b) <= 1 { - var ux uint - if len(b) == 1 { - ux = uint(b[0]) - } - if signed { - ux <<= 1 - if negative { - ux-- - } - } - if ux < maxSmall { - w.data.WriteByte(byte(ux)) - return - } - } - - n := 256 - uint(len(b)) - if signed { - n = 256 - 2*uint(len(b)) - if negative { - n |= 1 - } - } - if n < maxSmall || n >= 256 { - panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n)) - } - - w.data.WriteByte(byte(n)) - w.data.Write(b) -} - -// mpfloat exports a multi-precision floating point number. -// -// The number's value is decomposed into mantissa × 2**exponent, where -// mantissa is an integer. The value is written out as mantissa (as a -// multi-precision integer) and then the exponent, except exponent is -// omitted if mantissa is zero. -func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) { - if f.IsInf() { - panic("infinite constant") - } - - // Break into f = mant × 2**exp, with 0.5 <= mant < 1. - var mant big.Float - exp := int64(f.MantExp(&mant)) - - // Scale so that mant is an integer. - prec := mant.MinPrec() - mant.SetMantExp(&mant, int(prec)) - exp -= int64(prec) - - manti, acc := mant.Int(nil) - if acc != big.Exact { - panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc)) - } - w.mpint(manti, typ) - if manti.Sign() != 0 { - w.int64(exp) - } -} - -func (w *exportWriter) bool(b bool) bool { - var x uint64 - if b { - x = 1 - } - w.uint64(x) - return b -} - -func (w *exportWriter) int64(x int64) { w.data.int64(x) } -func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) } -func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) } - -func (w *exportWriter) localIdent(obj types.Object) { - // Anonymous parameters. - if obj == nil { - w.string("") - return - } - - name := obj.Name() - if name == "_" { - w.string("_") - return - } - - w.string(name) -} - -type intWriter struct { - bytes.Buffer -} - -func (w *intWriter) int64(x int64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutVarint(buf[:], x) - w.Write(buf[:n]) -} - -func (w *intWriter) uint64(x uint64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutUvarint(buf[:], x) - w.Write(buf[:n]) -} - -func assert(cond bool) { - if !cond { - panic("internal error: assertion failed") - } -} - -// The below is copied from go/src/cmd/compile/internal/gc/syntax.go. - -// objQueue is a FIFO queue of types.Object. The zero value of objQueue is -// a ready-to-use empty queue. -type objQueue struct { - ring []types.Object - head, tail int -} - -// empty returns true if q contains no Nodes. -func (q *objQueue) empty() bool { - return q.head == q.tail -} - -// pushTail appends n to the tail of the queue. -func (q *objQueue) pushTail(obj types.Object) { - if len(q.ring) == 0 { - q.ring = make([]types.Object, 16) - } else if q.head+len(q.ring) == q.tail { - // Grow the ring. - nring := make([]types.Object, len(q.ring)*2) - // Copy the old elements. - part := q.ring[q.head%len(q.ring):] - if q.tail-q.head <= len(part) { - part = part[:q.tail-q.head] - copy(nring, part) - } else { - pos := copy(nring, part) - copy(nring[pos:], q.ring[:q.tail%len(q.ring)]) - } - q.ring, q.head, q.tail = nring, 0, q.tail-q.head - } - - q.ring[q.tail%len(q.ring)] = obj - q.tail++ -} - -// popHead pops a node from the head of the queue. It panics if q is empty. -func (q *objQueue) popHead() types.Object { - if q.empty() { - panic("dequeue empty") - } - obj := q.ring[q.head%len(q.ring)] - q.head++ - return obj -} - -// internalError represents an error generated inside this package. -type internalError string - -func (e internalError) Error() string { return "gcimporter: " + string(e) } - -// TODO(adonovan): make this call panic, so that it's symmetric with errorf. -// Otherwise it's easy to forget to do anything with the error. -// -// TODO(adonovan): also, consider switching the names "errorf" and -// "internalErrorf" as the former is used for bugs, whose cause is -// internal inconsistency, whereas the latter is used for ordinary -// situations like bad input, whose cause is external. -func internalErrorf(format string, args ...any) error { - return internalError(fmt.Sprintf(format, args...)) -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go b/vendor/golang.org/x/tools/internal/gcimporter/iimport.go deleted file mode 100644 index 7b1723e0fc7..00000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/iimport.go +++ /dev/null @@ -1,1122 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed package import. -// See iexport.go for the export data format. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "io" - "math/big" - "slices" - "sort" - "strings" - - "golang.org/x/tools/go/types/objectpath" - "golang.org/x/tools/internal/aliases" - "golang.org/x/tools/internal/typesinternal" -) - -type intReader struct { - *bytes.Reader - path string -} - -func (r *intReader) int64() int64 { - i, err := binary.ReadVarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -func (r *intReader) uint64() uint64 { - i, err := binary.ReadUvarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -// Keep this in sync with constants in iexport.go. -const ( - iexportVersionGo1_11 = 0 - iexportVersionPosCol = 1 - iexportVersionGo1_18 = 2 - iexportVersionGenerics = 2 - iexportVersionGenericMethods = 3 - iexportVersion = iexportVersionGenericMethods - - iexportVersionCurrent = 3 -) - -type ident struct { - pkg *types.Package - name string -} - -const predeclReserved = 32 - -type itag uint64 - -const ( - // Types - definedType itag = iota - pointerType - sliceType - arrayType - chanType - mapType - signatureType - structType - interfaceType - typeParamType - instanceType - unionType - aliasType -) - -// Object tags -const ( - varTag = 'V' - funcTag = 'F' - genericFuncTag = 'G' - constTag = 'C' - aliasTag = 'A' - genericAliasTag = 'B' - typeParamTag = 'P' - typeTag = 'T' - genericTypeTag = 'U' -) - -// IImportData imports a package from the serialized package data -// and returns 0 and a reference to the package. -// If the export data version is not recognized or the format is otherwise -// compromised, an error is returned. -func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) { - pkgs, err := iimportCommon(fset, GetPackagesFromMap(imports), data, false, path, false, nil) - if err != nil { - return 0, nil, err - } - return 0, pkgs[0], nil -} - -// IImportBundle imports a set of packages from the serialized package bundle. -func IImportBundle(fset *token.FileSet, imports map[string]*types.Package, data []byte) ([]*types.Package, error) { - return iimportCommon(fset, GetPackagesFromMap(imports), data, true, "", false, nil) -} - -// A GetPackagesFunc function obtains the non-nil symbols for a set of -// packages, creating and recursively importing them as needed. An -// implementation should store each package symbol is in the Pkg -// field of the items array. -// -// Any error causes importing to fail. This can be used to quickly read -// the import manifest of an export data file without fully decoding it. -type GetPackagesFunc = func(items []GetPackagesItem) error - -// A GetPackagesItem is a request from the importer for the package -// symbol of the specified name and path. -type GetPackagesItem struct { - Name, Path string - Pkg *types.Package // to be filled in by GetPackagesFunc call - - // private importer state - pathOffset uint64 - nameIndex map[string]uint64 -} - -// GetPackagesFromMap returns a GetPackagesFunc that retrieves -// packages from the given map of package path to package. -// -// The returned function may mutate m: each requested package that is not -// found is created with types.NewPackage and inserted into m. -func GetPackagesFromMap(m map[string]*types.Package) GetPackagesFunc { - return func(items []GetPackagesItem) error { - for i, item := range items { - pkg, ok := m[item.Path] - if !ok { - pkg = types.NewPackage(item.Path, item.Name) - m[item.Path] = pkg - } - items[i].Pkg = pkg - } - return nil - } -} - -func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, bundle bool, path string, shallow bool, reportf ReportFunc) (pkgs []*types.Package, err error) { - const currentVersion = iexportVersionCurrent - version := int64(-1) - if !debug { - defer func() { - if e := recover(); e != nil { - if bundle { - err = fmt.Errorf("%v", e) - } else if version > currentVersion { - err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) - } else { - err = fmt.Errorf("internal error while importing %q (%v); please report an issue", path, e) - } - } - }() - } - - r := &intReader{bytes.NewReader(data), path} - - if bundle { - if v := r.uint64(); v != bundleVersion { - errorf("unknown bundle format version %d", v) - } - } - - version = int64(r.uint64()) - switch version { - case iexportVersionGenericMethods, iexportVersionGo1_18, iexportVersionPosCol, iexportVersionGo1_11: - default: - if version > iexportVersionGenericMethods { - errorf("unstable iexport format version %d, just rebuild compiler and std library", version) - } else { - errorf("unknown iexport format version %d", version) - } - } - - sLen := int64(r.uint64()) - var fLen int64 - var fileOffset []uint64 - if shallow { - // Shallow mode uses a different position encoding. - fLen = int64(r.uint64()) - fileOffset = make([]uint64, r.uint64()) - for i := range fileOffset { - fileOffset[i] = r.uint64() - } - } - dLen := int64(r.uint64()) - - whence, _ := r.Seek(0, io.SeekCurrent) - stringData := data[whence : whence+sLen] - fileData := data[whence+sLen : whence+sLen+fLen] - declData := data[whence+sLen+fLen : whence+sLen+fLen+dLen] - r.Seek(sLen+fLen+dLen, io.SeekCurrent) - - p := iimporter{ - version: int(version), - ipath: path, - shallow: shallow, - reportf: reportf, - - stringData: stringData, - stringCache: make(map[uint64]string), - fileOffset: fileOffset, - fileData: fileData, - fileCache: make([]*token.File, len(fileOffset)), - pkgCache: make(map[uint64]*types.Package), - - declData: declData, - pkgIndex: make(map[*types.Package]map[string]uint64), - typCache: make(map[uint64]types.Type), - // Separate map for typeparams, keyed by their package and unique - // name. - tparamIndex: make(map[ident]types.Type), - - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*fileInfo), - }, - } - defer p.fake.setLines() // set lines for files in fset - - for i, pt := range predeclared() { - p.typCache[uint64(i)] = pt - } - - // Gather the relevant packages from the manifest. - items := make([]GetPackagesItem, r.uint64()) - uniquePkgPaths := make(map[string]bool) - for i := range items { - pkgPathOff := r.uint64() - pkgPath := p.stringAt(pkgPathOff) - pkgName := p.stringAt(r.uint64()) - _ = r.uint64() // package height; unused by go/types - - if pkgPath == "" { - pkgPath = path - } - items[i].Name = pkgName - items[i].Path = pkgPath - items[i].pathOffset = pkgPathOff - - // Read index for package. - nameIndex := make(map[string]uint64) - nSyms := r.uint64() - // In shallow mode, only the current package (i=0) has an index. - assert(!(shallow && i > 0 && nSyms != 0)) - for ; nSyms > 0; nSyms-- { - name := p.stringAt(r.uint64()) - nameIndex[name] = r.uint64() - } - - items[i].nameIndex = nameIndex - - uniquePkgPaths[pkgPath] = true - } - // Debugging #63822; hypothesis: there are duplicate PkgPaths. - if len(uniquePkgPaths) != len(items) { - reportf("found duplicate PkgPaths while reading export data manifest: %v", items) - } - - // Request packages all at once from the client, - // enabling a parallel implementation. - if err := getPackages(items); err != nil { - return nil, err // don't wrap this error - } - - // Check the results and complete the index. - pkgList := make([]*types.Package, len(items)) - for i, item := range items { - pkg := item.Pkg - if pkg == nil { - errorf("internal error: getPackages returned nil package for %q", item.Path) - } else if pkg.Path() != item.Path { - errorf("internal error: getPackages returned wrong path %q, want %q", pkg.Path(), item.Path) - } else if pkg.Name() != item.Name { - errorf("internal error: getPackages returned wrong name %s for package %q, want %s", pkg.Name(), item.Path, item.Name) - } - p.pkgCache[item.pathOffset] = pkg - p.pkgIndex[pkg] = item.nameIndex - pkgList[i] = pkg - } - - if bundle { - pkgs = make([]*types.Package, r.uint64()) - for i := range pkgs { - pkg := p.pkgAt(r.uint64()) - imps := make([]*types.Package, r.uint64()) - for j := range imps { - imps[j] = p.pkgAt(r.uint64()) - } - pkg.SetImports(imps) - pkgs[i] = pkg - } - } else { - if len(pkgList) == 0 { - errorf("no packages found for %s", path) - panic("unreachable") - } - pkgs = pkgList[:1] - - // record all referenced packages as imports - list := slices.Clone(pkgList[1:]) - sort.Sort(byPath(list)) - pkgs[0].SetImports(list) - } - - for _, pkg := range pkgs { - if pkg.Complete() { - continue - } - - names := make([]string, 0, len(p.pkgIndex[pkg])) - for name := range p.pkgIndex[pkg] { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - p.doDecl(pkg, name) - } - - // package was imported completely and without errors - pkg.MarkComplete() - } - - // SetConstraint can't be called if the constraint type is not yet complete. - // When type params are created in the typeParamTag case of (*importReader).obj(), - // the associated constraint type may not be complete due to recursion. - // Therefore, we defer calling SetConstraint there, and call it here instead - // after all types are complete. - for _, d := range p.later { - d.t.SetConstraint(d.constraint) - } - - for _, typ := range p.interfaceList { - typ.Complete() - } - - // Workaround for golang/go#61561. See the doc for instanceList for details. - for _, typ := range p.instanceList { - if iface, _ := typ.Underlying().(*types.Interface); iface != nil { - iface.Complete() - } - } - - return pkgs, nil -} - -type setConstraintArgs struct { - t *types.TypeParam - constraint types.Type -} - -type iimporter struct { - version int - ipath string - - shallow bool - reportf ReportFunc // if non-nil, used to report bugs - - stringData []byte - stringCache map[uint64]string - fileOffset []uint64 // fileOffset[i] is offset in fileData for info about file encoded as i - fileData []byte - fileCache []*token.File // memoized decoding of file encoded as i - pkgCache map[uint64]*types.Package - - declData []byte - pkgIndex map[*types.Package]map[string]uint64 - typCache map[uint64]types.Type - tparamIndex map[ident]types.Type - - fake fakeFileSet - interfaceList []*types.Interface - - // Workaround for the go/types bug golang/go#61561: instances produced during - // instantiation may contain incomplete interfaces. Here we only complete the - // underlying type of the instance, which is the most common case but doesn't - // handle parameterized interface literals defined deeper in the type. - instanceList []types.Type // instances for later completion (see golang/go#61561) - - // Arguments for calls to SetConstraint that are deferred due to recursive types - later []setConstraintArgs - - indent int // for tracing support -} - -func (p *iimporter) trace(format string, args ...any) { - if !trace { - // Call sites should also be guarded, but having this check here allows - // easily enabling/disabling debug trace statements. - return - } - fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) -} - -func (p *iimporter) doDecl(pkg *types.Package, name string) { - if debug { - p.trace("import decl %s", name) - p.indent++ - defer func() { - p.indent-- - p.trace("=> %s", name) - }() - } - // See if we've already imported this declaration. - if obj := pkg.Scope().Lookup(name); obj != nil { - return - } - - off, ok := p.pkgIndex[pkg][name] - if !ok { - // In deep mode, the index should be complete. In shallow - // mode, we should have already recursively loaded necessary - // dependencies so the above Lookup succeeds. - errorf("%v.%v not in index", pkg, name) - } - - r := &importReader{p: p} - r.declReader.Reset(p.declData[off:]) - - r.obj(pkg, name) -} - -func (p *iimporter) stringAt(off uint64) string { - if s, ok := p.stringCache[off]; ok { - return s - } - - slen, n := binary.Uvarint(p.stringData[off:]) - if n <= 0 { - errorf("varint failed") - } - spos := off + uint64(n) - s := string(p.stringData[spos : spos+slen]) - p.stringCache[off] = s - return s -} - -func (p *iimporter) fileAt(index uint64) *token.File { - file := p.fileCache[index] - if file == nil { - off := p.fileOffset[index] - file = p.decodeFile(intReader{bytes.NewReader(p.fileData[off:]), p.ipath}) - p.fileCache[index] = file - } - return file -} - -func (p *iimporter) decodeFile(rd intReader) *token.File { - filename := p.stringAt(rd.uint64()) - size := int(rd.uint64()) - file := p.fake.fset.AddFile(filename, -1, size) - - // SetLines requires a nondecreasing sequence. - // Because it is common for clients to derive the interval - // [start, start+len(name)] from a start position, and we - // want to ensure that the end offset is on the same line, - // we fill in the gaps of the sparse encoding with values - // that strictly increase by the largest possible amount. - // This allows us to avoid having to record the actual end - // offset of each needed line. - - lines := make([]int, int(rd.uint64())) - var index, offset int - for i, n := 0, int(rd.uint64()); i < n; i++ { - index += int(rd.uint64()) - offset += int(rd.uint64()) - lines[index] = offset - - // Ensure monotonicity between points. - for j := index - 1; j > 0 && lines[j] == 0; j-- { - lines[j] = lines[j+1] - 1 - } - } - - // Ensure monotonicity after last point. - for j := len(lines) - 1; j > 0 && lines[j] == 0; j-- { - size-- - lines[j] = size - } - - if !file.SetLines(lines) { - errorf("SetLines failed: %d", lines) // can't happen - } - return file -} - -func (p *iimporter) pkgAt(off uint64) *types.Package { - if pkg, ok := p.pkgCache[off]; ok { - return pkg - } - path := p.stringAt(off) - errorf("missing package %q in %q", path, p.ipath) - return nil -} - -func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { - if t, ok := p.typCache[off]; ok && canReuse(base, t) { - return t - } - - if off < predeclReserved { - errorf("predeclared type missing from cache: %v", off) - } - - r := &importReader{p: p} - r.declReader.Reset(p.declData[off-predeclReserved:]) - t := r.doType(base) - - if canReuse(base, t) { - p.typCache[off] = t - } - return t -} - -// canReuse reports whether the type rhs on the RHS of the declaration for def -// may be re-used. -// -// Specifically, if def is non-nil and rhs is an interface type with methods, it -// may not be re-used because we have a convention of setting the receiver type -// for interface methods to def. -func canReuse(def *types.Named, rhs types.Type) bool { - if def == nil { - return true - } - iface, _ := types.Unalias(rhs).(*types.Interface) - if iface == nil { - return true - } - // Don't use iface.Empty() here as iface may not be complete. - return iface.NumEmbeddeds() == 0 && iface.NumExplicitMethods() == 0 -} - -type importReader struct { - p *iimporter - declReader bytes.Reader - prevFile string - prevLine int64 - prevColumn int64 -} - -// markBlack is redefined in iimport_go123.go, to work around golang/go#69912. -// -// If TypeNames are not marked black (in the sense of go/types cycle -// detection), they may be mutated when dot-imported. Fix this by punching a -// hole through the type, when compiling with Go 1.23. (The bug has been fixed -// for 1.24, but the fix was not worth back-porting). -var markBlack = func(name *types.TypeName) {} - -// obj decodes and declares the package-level object denoted by (pkg, name). -func (r *importReader) obj(pkg *types.Package, name string) { - tag := r.byte() - pos := r.pos() - - switch tag { - case aliasTag, genericAliasTag: - var tparams []*types.TypeParam - if tag == genericAliasTag { - tparams = r.tparamList() - } - typ := r.typ() - obj := aliases.New(pos, pkg, name, typ, tparams) - markBlack(obj) // workaround for golang/go#69912 - r.declare(obj) - - case constTag: - typ, val := r.value() - - r.declare(types.NewConst(pos, pkg, name, typ, val)) - - case funcTag, genericFuncTag: - var tparams []*types.TypeParam - if tag == genericFuncTag { - tparams = r.tparamList() - } - sig := r.signature(pkg, nil, nil, tparams) - r.declare(types.NewFunc(pos, pkg, name, sig)) - - case typeTag, genericTypeTag: - // Types can be recursive. We need to setup a stub - // declaration before recursing. - obj := types.NewTypeName(pos, pkg, name, nil) - named := types.NewNamed(obj, nil, nil) - - markBlack(obj) // workaround for golang/go#69912 - - // Declare obj before calling r.tparamList, so the new type name is recognized - // if used in the constraint of one of its own typeparams (see #48280). - r.declare(obj) - if tag == genericTypeTag { - tparams := r.tparamList() - named.SetTypeParams(tparams) - } - - underlying := r.p.typAt(r.uint64(), named).Underlying() - named.SetUnderlying(underlying) - - if !isInterface(underlying) { - for n := r.uint64(); n > 0; n-- { - mpos := r.pos() - mname := r.ident() - var tpars []*types.TypeParam - if r.p.version >= iexportVersionGenericMethods && r.bool() { - tpars = r.tparamList() - } - recv := r.param(pkg) - - // If the receiver has any targs, set those as the - // rparams of the method (since those are the - // typeparams being used in the method sig/body). - _, recvNamed := typesinternal.ReceiverNamed(recv) - targs := recvNamed.TypeArgs() - var rparams []*types.TypeParam - if targs.Len() > 0 { - rparams = make([]*types.TypeParam, targs.Len()) - for i := range rparams { - rparams[i] = types.Unalias(targs.At(i)).(*types.TypeParam) - } - } - msig := r.signature(pkg, recv, rparams, tpars) - named.AddMethod(types.NewFunc(mpos, pkg, mname, msig)) - } - } - - case typeParamTag: - // We need to "declare" a typeparam in order to have a name that - // can be referenced recursively (if needed) in the type param's - // bound. - if r.p.version < iexportVersionGenerics { - errorf("unexpected type param type") - } - name0 := tparamName(name) - tn := types.NewTypeName(pos, pkg, name0, nil) - t := types.NewTypeParam(tn, nil) - - // To handle recursive references to the typeparam within its - // bound, save the partial type in tparamIndex before reading the bounds. - id := ident{pkg, name} - r.p.tparamIndex[id] = t - var implicit bool - if r.p.version >= iexportVersionGo1_18 { - implicit = r.bool() - } - constraint := r.typ() - if implicit { - iface, _ := types.Unalias(constraint).(*types.Interface) - if iface == nil { - errorf("non-interface constraint marked implicit") - } - iface.MarkImplicit() - } - // The constraint type may not be complete, if we - // are in the middle of a type recursion involving type - // constraints. So, we defer SetConstraint until we have - // completely set up all types in ImportData. - r.p.later = append(r.p.later, setConstraintArgs{t: t, constraint: constraint}) - - case varTag: - typ := r.typ() - - v := types.NewVar(pos, pkg, name, typ) - typesinternal.SetVarKind(v, typesinternal.PackageVar) - r.declare(v) - - default: - errorf("unexpected tag: %v", tag) - } -} - -func (r *importReader) declare(obj types.Object) { - obj.Pkg().Scope().Insert(obj) -} - -func (r *importReader) value() (typ types.Type, val constant.Value) { - typ = r.typ() - if r.p.version >= iexportVersionGo1_18 { - // TODO: add support for using the kind. - _ = constant.Kind(r.int64()) - } - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - val = constant.MakeBool(r.bool()) - - case types.IsString: - val = constant.MakeString(r.string()) - - case types.IsInteger: - var x big.Int - r.mpint(&x, b) - val = constant.Make(&x) - - case types.IsFloat: - val = r.mpfloat(b) - - case types.IsComplex: - re := r.mpfloat(b) - im := r.mpfloat(b) - val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - - default: - if b.Kind() == types.Invalid { - val = constant.MakeUnknown() - return - } - errorf("unexpected type %v", typ) // panics - panic("unreachable") - } - - return -} - -func intSize(b *types.Basic) (signed bool, maxBytes uint) { - if (b.Info() & types.IsUntyped) != 0 { - return true, 64 - } - - switch b.Kind() { - case types.Float32, types.Complex64: - return true, 3 - case types.Float64, types.Complex128: - return true, 7 - } - - signed = (b.Info() & types.IsUnsigned) == 0 - switch b.Kind() { - case types.Int8, types.Uint8: - maxBytes = 1 - case types.Int16, types.Uint16: - maxBytes = 2 - case types.Int32, types.Uint32: - maxBytes = 4 - default: - maxBytes = 8 - } - - return -} - -func (r *importReader) mpint(x *big.Int, typ *types.Basic) { - signed, maxBytes := intSize(typ) - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - n, _ := r.declReader.ReadByte() - if uint(n) < maxSmall { - v := int64(n) - if signed { - v >>= 1 - if n&1 != 0 { - v = ^v - } - } - x.SetInt64(v) - return - } - - v := -n - if signed { - v = -(n &^ 1) >> 1 - } - if v < 1 || uint(v) > maxBytes { - errorf("weird decoding: %v, %v => %v", n, signed, v) - } - b := make([]byte, v) - io.ReadFull(&r.declReader, b) - x.SetBytes(b) - if signed && n&1 != 0 { - x.Neg(x) - } -} - -func (r *importReader) mpfloat(typ *types.Basic) constant.Value { - var mant big.Int - r.mpint(&mant, typ) - var f big.Float - f.SetInt(&mant) - if f.Sign() != 0 { - f.SetMantExp(&f, int(r.int64())) - } - return constant.Make(&f) -} - -func (r *importReader) ident() string { - return r.string() -} - -func (r *importReader) qualifiedIdent() (*types.Package, string) { - name := r.string() - pkg := r.pkg() - return pkg, name -} - -func (r *importReader) pos() token.Pos { - if r.p.shallow { - // precise offsets are encoded only in shallow mode - return r.posv2() - } - if r.p.version >= iexportVersionPosCol { - r.posv1() - } else { - r.posv0() - } - - if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 { - return token.NoPos - } - return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn)) -} - -func (r *importReader) posv0() { - delta := r.int64() - if delta != deltaNewFile { - r.prevLine += delta - } else if l := r.int64(); l == -1 { - r.prevLine += deltaNewFile - } else { - r.prevFile = r.string() - r.prevLine = l - } -} - -func (r *importReader) posv1() { - delta := r.int64() - r.prevColumn += delta >> 1 - if delta&1 != 0 { - delta = r.int64() - r.prevLine += delta >> 1 - if delta&1 != 0 { - r.prevFile = r.string() - } - } -} - -func (r *importReader) posv2() token.Pos { - file := r.uint64() - if file == 0 { - return token.NoPos - } - tf := r.p.fileAt(file - 1) - return tf.Pos(int(r.uint64())) -} - -func (r *importReader) typ() types.Type { - return r.p.typAt(r.uint64(), nil) -} - -func isInterface(t types.Type) bool { - _, ok := types.Unalias(t).(*types.Interface) - return ok -} - -func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } -func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } - -func (r *importReader) doType(base *types.Named) (res types.Type) { - k := r.kind() - if debug { - r.p.trace("importing type %d (base: %v)", k, base) - r.p.indent++ - defer func() { - r.p.indent-- - r.p.trace("=> %s", res) - }() - } - switch k { - default: - errorf("unexpected kind tag in %q: %v", r.p.ipath, k) - return nil - - case aliasType, definedType: - pkg, name := r.qualifiedIdent() - r.p.doDecl(pkg, name) - return pkg.Scope().Lookup(name).(*types.TypeName).Type() - case pointerType: - return types.NewPointer(r.typ()) - case sliceType: - return types.NewSlice(r.typ()) - case arrayType: - n := r.uint64() - return types.NewArray(r.typ(), int64(n)) - case chanType: - dir := chanDir(int(r.uint64())) - return types.NewChan(dir, r.typ()) - case mapType: - return types.NewMap(r.typ(), r.typ()) - case signatureType: - paramPkg := r.pkg() - return r.signature(paramPkg, nil, nil, nil) - - case structType: - fieldPkg := r.pkg() - - fields := make([]*types.Var, r.uint64()) - tags := make([]string, len(fields)) - for i := range fields { - var field *types.Var - if r.p.shallow { - field, _ = r.objectPathObject().(*types.Var) - } - - fpos := r.pos() - fname := r.ident() - ftyp := r.typ() - emb := r.bool() - tag := r.string() - - // Either this is not a shallow import, the field is local, or the - // encoded objectPath failed to produce an object (a bug). - // - // Even in this last, buggy case, fall back on creating a new field. As - // discussed in iexport.go, this is not correct, but mostly works and is - // preferable to failing (for now at least). - if field == nil { - field = types.NewField(fpos, fieldPkg, fname, ftyp, emb) - } - - fields[i] = field - tags[i] = tag - } - return types.NewStruct(fields, tags) - - case interfaceType: - methodPkg := r.pkg() // qualifies methods and their param/result vars - - embeddeds := make([]types.Type, r.uint64()) - for i := range embeddeds { - _ = r.pos() - embeddeds[i] = r.typ() - } - - methods := make([]*types.Func, r.uint64()) - for i := range methods { - var method *types.Func - if r.p.shallow { - method, _ = r.objectPathObject().(*types.Func) - } - - mpos := r.pos() - mname := r.ident() - - // TODO(mdempsky): Matches bimport.go, but I - // don't agree with this. - var recv *types.Var - if base != nil { - recv = types.NewVar(token.NoPos, methodPkg, "", base) - } - msig := r.signature(methodPkg, recv, nil, nil) - - if method == nil { - method = types.NewFunc(mpos, methodPkg, mname, msig) - } - methods[i] = method - } - - typ := types.NewInterfaceType(methods, embeddeds) - r.p.interfaceList = append(r.p.interfaceList, typ) - return typ - - case typeParamType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected type param type") - } - pkg, name := r.qualifiedIdent() - id := ident{pkg, name} - if t, ok := r.p.tparamIndex[id]; ok { - // We're already in the process of importing this typeparam. - return t - } - // Otherwise, import the definition of the typeparam now. - r.p.doDecl(pkg, name) - return r.p.tparamIndex[id] - - case instanceType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected instantiation type") - } - // pos does not matter for instances: they are positioned on the original - // type. - _ = r.pos() - len := r.uint64() - targs := make([]types.Type, len) - for i := range targs { - targs[i] = r.typ() - } - baseType := r.typ() - // The imported instantiated type doesn't include any methods, so - // we must always use the methods of the base (orig) type. - // TODO provide a non-nil *Environment - t, _ := types.Instantiate(nil, baseType, targs, false) - - // Workaround for golang/go#61561. See the doc for instanceList for details. - r.p.instanceList = append(r.p.instanceList, t) - return t - - case unionType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected instantiation type") - } - terms := make([]*types.Term, r.uint64()) - for i := range terms { - terms[i] = types.NewTerm(r.bool(), r.typ()) - } - return types.NewUnion(terms) - } -} - -func (r *importReader) kind() itag { - return itag(r.uint64()) -} - -// objectPathObject is the inverse of exportWriter.objectPath. -// -// In shallow mode, certain fields and methods may need to be looked up in an -// imported package. See the doc for exportWriter.objectPath for a full -// explanation. -func (r *importReader) objectPathObject() types.Object { - objPath := objectpath.Path(r.string()) - if objPath == "" { - return nil - } - pkg := r.pkg() - obj, err := objectpath.Object(pkg, objPath) - if err != nil { - if r.p.reportf != nil { - r.p.reportf("failed to find object for objectPath %q: %v", objPath, err) - } - } - return obj -} - -func (r *importReader) signature(paramPkg *types.Package, recv *types.Var, rparams []*types.TypeParam, tparams []*types.TypeParam) *types.Signature { - params := r.paramList(paramPkg) - results := r.paramList(paramPkg) - variadic := params.Len() > 0 && r.bool() - return types.NewSignatureType(recv, rparams, tparams, params, results, variadic) -} - -func (r *importReader) tparamList() []*types.TypeParam { - n := r.uint64() - if n == 0 { - return nil - } - xs := make([]*types.TypeParam, n) - for i := range xs { - // Note: the standard library importer is tolerant of nil types here, - // though would panic in SetTypeParams. - xs[i] = types.Unalias(r.typ()).(*types.TypeParam) - } - return xs -} - -func (r *importReader) paramList(pkg *types.Package) *types.Tuple { - xs := make([]*types.Var, r.uint64()) - for i := range xs { - xs[i] = r.param(pkg) - } - return types.NewTuple(xs...) -} - -func (r *importReader) param(pkg *types.Package) *types.Var { - pos := r.pos() - name := r.ident() - typ := r.typ() - return types.NewParam(pos, pkg, name, typ) -} - -func (r *importReader) bool() bool { - return r.uint64() != 0 -} - -func (r *importReader) int64() int64 { - n, err := binary.ReadVarint(&r.declReader) - if err != nil { - errorf("readVarint: %v", err) - } - return n -} - -func (r *importReader) uint64() uint64 { - n, err := binary.ReadUvarint(&r.declReader) - if err != nil { - errorf("readUvarint: %v", err) - } - return n -} - -func (r *importReader) byte() byte { - x, err := r.declReader.ReadByte() - if err != nil { - errorf("declReader.ReadByte: %v", err) - } - return x -} - -type byPath []*types.Package - -func (a byPath) Len() int { return len(a) } -func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() } diff --git a/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go b/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go deleted file mode 100644 index 907c8557a54..00000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/predeclared.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcimporter - -import ( - "go/types" - "sync" -) - -// predecl is a cache for the predeclared types in types.Universe. -// -// Cache a distinct result based on the runtime value of any. -// The pointer value of the any type varies based on GODEBUG settings. -var predeclMu sync.Mutex -var predecl map[types.Type][]types.Type - -func predeclared() []types.Type { - anyt := types.Universe.Lookup("any").Type() - - predeclMu.Lock() - defer predeclMu.Unlock() - - if pre, ok := predecl[anyt]; ok { - return pre - } - - if predecl == nil { - predecl = make(map[types.Type][]types.Type) - } - - decls := []types.Type{ // basic types - types.Typ[types.Bool], - types.Typ[types.Int], - types.Typ[types.Int8], - types.Typ[types.Int16], - types.Typ[types.Int32], - types.Typ[types.Int64], - types.Typ[types.Uint], - types.Typ[types.Uint8], - types.Typ[types.Uint16], - types.Typ[types.Uint32], - types.Typ[types.Uint64], - types.Typ[types.Uintptr], - types.Typ[types.Float32], - types.Typ[types.Float64], - types.Typ[types.Complex64], - types.Typ[types.Complex128], - types.Typ[types.String], - - // basic type aliases - types.Universe.Lookup("byte").Type(), - types.Universe.Lookup("rune").Type(), - - // error - types.Universe.Lookup("error").Type(), - - // untyped types - types.Typ[types.UntypedBool], - types.Typ[types.UntypedInt], - types.Typ[types.UntypedRune], - types.Typ[types.UntypedFloat], - types.Typ[types.UntypedComplex], - types.Typ[types.UntypedString], - types.Typ[types.UntypedNil], - - // package unsafe - types.Typ[types.UnsafePointer], - - // invalid type - types.Typ[types.Invalid], // only appears in packages with errors - - // used internally by gc; never used by this package or in .a files - anyType{}, - - // comparable - types.Universe.Lookup("comparable").Type(), - - // any - anyt, - } - - predecl[anyt] = decls - return decls -} - -type anyType struct{} - -func (t anyType) Underlying() types.Type { return t } -func (t anyType) String() string { return "any" } diff --git a/vendor/golang.org/x/tools/internal/gcimporter/support.go b/vendor/golang.org/x/tools/internal/gcimporter/support.go deleted file mode 100644 index 4af810dc412..00000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/support.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcimporter - -import ( - "bufio" - "io" - "strconv" - "strings" -) - -// Copy of $GOROOT/src/cmd/internal/archive.ReadHeader. -func readArchiveHeader(b *bufio.Reader, name string) int { - // architecture-independent object file output - const HeaderSize = 60 - - var buf [HeaderSize]byte - if _, err := io.ReadFull(b, buf[:]); err != nil { - return -1 - } - aname := strings.Trim(string(buf[0:16]), " ") - if !strings.HasPrefix(aname, name) { - return -1 - } - asize := strings.Trim(string(buf[48:58]), " ") - i, _ := strconv.Atoi(asize) - return i -} diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader.go deleted file mode 100644 index 5d3b7c867a3..00000000000 --- a/vendor/golang.org/x/tools/internal/gcimporter/ureader.go +++ /dev/null @@ -1,813 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Derived from go/internal/gcimporter/ureader.go - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" - "sort" - "strings" - - "golang.org/x/tools/internal/aliases" - "golang.org/x/tools/internal/pkgbits" - "golang.org/x/tools/internal/typesinternal" -) - -// A pkgReader holds the shared state for reading a unified IR package -// description. -type pkgReader struct { - pkgbits.PkgDecoder - - fake fakeFileSet - - ctxt *types.Context - imports map[string]*types.Package // previously imported packages, indexed by path - - // lazily initialized arrays corresponding to the unified IR - // PosBase, Pkg, and Type sections, respectively. - posBases []string // position bases (i.e., file names) - pkgs []*types.Package - typs []types.Type - - // laterFns holds functions that need to be invoked at the end of - // import reading. - // - // TODO(mdempsky): Is it safe to have a single "later" slice or do - // we need to have multiple passes? See comments on CL 386002 and - // go.dev/issue/52104. - laterFns []func() - // laterFors is used in case of 'type A B' to ensure that B is processed before A. - laterFors map[types.Type]int - - // ifaces holds a list of constructed Interfaces, which need to have - // Complete called after importing is done. - ifaces []*types.Interface -} - -// later adds a function to be invoked at the end of import reading. -func (pr *pkgReader) later(fn func()) { - pr.laterFns = append(pr.laterFns, fn) -} - -// See cmd/compile/internal/noder.derivedInfo. -type derivedInfo struct { - idx pkgbits.Index -} - -// See cmd/compile/internal/noder.typeInfo. -type typeInfo struct { - idx pkgbits.Index - derived bool -} - -func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - if !debug { - defer func() { - if x := recover(); x != nil { - err = fmt.Errorf("internal error in importing %q (%v); please report an issue", path, x) - } - }() - } - - s := string(data) - input := pkgbits.NewPkgDecoder(path, s) - pkg = readUnifiedPackage(fset, nil, imports, input) - return -} - -// laterFor adds a function to be invoked at the end of import reading, and records the type that function is finishing. -func (pr *pkgReader) laterFor(t types.Type, fn func()) { - if pr.laterFors == nil { - pr.laterFors = make(map[types.Type]int) - } - pr.laterFors[t] = len(pr.laterFns) - pr.laterFns = append(pr.laterFns, fn) -} - -// readUnifiedPackage reads a package description from the given -// unified IR export data decoder. -func readUnifiedPackage(fset *token.FileSet, ctxt *types.Context, imports map[string]*types.Package, input pkgbits.PkgDecoder) *types.Package { - pr := pkgReader{ - PkgDecoder: input, - - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*fileInfo), - }, - - ctxt: ctxt, - imports: imports, - - posBases: make([]string, input.NumElems(pkgbits.RelocPosBase)), - pkgs: make([]*types.Package, input.NumElems(pkgbits.RelocPkg)), - typs: make([]types.Type, input.NumElems(pkgbits.RelocType)), - } - defer pr.fake.setLines() - - r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic) - pkg := r.pkg() - if r.Version().Has(pkgbits.HasInit) { - r.Bool() - } - - for i, n := 0, r.Len(); i < n; i++ { - // As if r.obj(), but avoiding the Scope.Lookup call, - // to avoid eager loading of imports. - r.Sync(pkgbits.SyncObject) - if r.Version().Has(pkgbits.DerivedFuncInstance) { - assert(!r.Bool()) - } - r.p.objIdx(r.Reloc(pkgbits.RelocObj)) - assert(r.Len() == 0) - } - - r.Sync(pkgbits.SyncEOF) - - for _, fn := range pr.laterFns { - fn() - } - - for _, iface := range pr.ifaces { - iface.Complete() - } - - // Imports() of pkg are all of the transitive packages that were loaded. - var imps []*types.Package - for _, imp := range pr.pkgs { - if imp != nil && imp != pkg { - imps = append(imps, imp) - } - } - sort.Sort(byPath(imps)) - pkg.SetImports(imps) - - pkg.MarkComplete() - return pkg -} - -// A reader holds the state for reading a single unified IR element -// within a package. -type reader struct { - pkgbits.Decoder - - p *pkgReader - - dict *readerDict -} - -// A readerDict holds the state for type parameters that parameterize -// the current unified IR element. -type readerDict struct { - rtbounds []typeInfo // contains constraint types for each parameter in rtparams - rtparams []*types.TypeParam // contains receiver type parameters for an element - - tbounds []typeInfo // contains constraint types for each parameter in tparams - tparams []*types.TypeParam // contains type parameters for an element - - // derived is a slice of types derived from tparams, which may be - // instantiated while reading the current element. - derived []derivedInfo - derivedTypes []types.Type // lazily instantiated from derived -} - -func (pr *pkgReader) newReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader { - return &reader{ - Decoder: pr.NewDecoder(k, idx, marker), - p: pr, - } -} - -func (pr *pkgReader) tempReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader { - return &reader{ - Decoder: pr.TempDecoder(k, idx, marker), - p: pr, - } -} - -func (pr *pkgReader) retireReader(r *reader) { - pr.RetireDecoder(&r.Decoder) -} - -// @@@ Positions - -func (r *reader) pos() token.Pos { - r.Sync(pkgbits.SyncPos) - if !r.Bool() { - return token.NoPos - } - - // TODO(mdempsky): Delta encoding. - posBase := r.posBase() - line := r.Uint() - col := r.Uint() - return r.p.fake.pos(posBase, int(line), int(col)) -} - -func (r *reader) posBase() string { - return r.p.posBaseIdx(r.Reloc(pkgbits.RelocPosBase)) -} - -func (pr *pkgReader) posBaseIdx(idx pkgbits.Index) string { - if b := pr.posBases[idx]; b != "" { - return b - } - - var filename string - { - r := pr.tempReader(pkgbits.RelocPosBase, idx, pkgbits.SyncPosBase) - - // Within types2, position bases have a lot more details (e.g., - // keeping track of where //line directives appeared exactly). - // - // For go/types, we just track the file name. - - filename = r.String() - - if r.Bool() { // file base - // Was: "b = token.NewTrimmedFileBase(filename, true)" - } else { // line base - pos := r.pos() - line := r.Uint() - col := r.Uint() - - // Was: "b = token.NewLineBase(pos, filename, true, line, col)" - _, _, _ = pos, line, col - } - pr.retireReader(r) - } - b := filename - pr.posBases[idx] = b - return b -} - -// @@@ Packages - -func (r *reader) pkg() *types.Package { - r.Sync(pkgbits.SyncPkg) - return r.p.pkgIdx(r.Reloc(pkgbits.RelocPkg)) -} - -func (pr *pkgReader) pkgIdx(idx pkgbits.Index) *types.Package { - // TODO(mdempsky): Consider using some non-nil pointer to indicate - // the universe scope, so we don't need to keep re-reading it. - if pkg := pr.pkgs[idx]; pkg != nil { - return pkg - } - - pkg := pr.newReader(pkgbits.RelocPkg, idx, pkgbits.SyncPkgDef).doPkg() - pr.pkgs[idx] = pkg - return pkg -} - -func (r *reader) doPkg() *types.Package { - path := r.String() - switch path { - // cmd/compile emits path="main" for main packages because - // that's the linker symbol prefix it used; but we need - // the package's path as it would be reported by go list, - // hence "main" below. - // See test at go/packages.TestMainPackagePathInModeTypes. - case "", "main": - path = r.p.PkgPath() - case "builtin": - return nil // universe - case "unsafe": - return types.Unsafe - } - - if pkg := r.p.imports[path]; pkg != nil { - return pkg - } - - name := r.String() - - pkg := types.NewPackage(path, name) - r.p.imports[path] = pkg - - return pkg -} - -// @@@ Types - -func (r *reader) typ() types.Type { - return r.p.typIdx(r.typInfo(), r.dict) -} - -func (r *reader) typInfo() typeInfo { - r.Sync(pkgbits.SyncType) - if r.Bool() { - return typeInfo{idx: pkgbits.Index(r.Len()), derived: true} - } - return typeInfo{idx: r.Reloc(pkgbits.RelocType), derived: false} -} - -func (pr *pkgReader) typIdx(info typeInfo, dict *readerDict) types.Type { - idx := info.idx - var where *types.Type - if info.derived { - where = &dict.derivedTypes[idx] - idx = dict.derived[idx].idx - } else { - where = &pr.typs[idx] - } - - if typ := *where; typ != nil { - return typ - } - - var typ types.Type - { - r := pr.tempReader(pkgbits.RelocType, idx, pkgbits.SyncTypeIdx) - r.dict = dict - - typ = r.doTyp() - assert(typ != nil) - pr.retireReader(r) - } - // See comment in pkgReader.typIdx explaining how this happens. - if prev := *where; prev != nil { - return prev - } - - *where = typ - return typ -} - -func (r *reader) doTyp() (res types.Type) { - switch tag := pkgbits.CodeType(r.Code(pkgbits.SyncType)); tag { - default: - errorf("unhandled type tag: %v", tag) - panic("unreachable") - - case pkgbits.TypeBasic: - return types.Typ[r.Len()] - - case pkgbits.TypeNamed: - obj, targs := r.obj() - name := obj.(*types.TypeName) - if len(targs) != 0 { - t, _ := types.Instantiate(r.p.ctxt, name.Type(), targs, false) - return t - } - return name.Type() - - case pkgbits.TypeTypeParam: - n := r.Len() - if n < len(r.dict.rtbounds) { - return r.dict.rtparams[n] - } - return r.dict.tparams[n-len(r.dict.rtbounds)] - - case pkgbits.TypeArray: - len := int64(r.Uint64()) - return types.NewArray(r.typ(), len) - case pkgbits.TypeChan: - dir := types.ChanDir(r.Len()) - return types.NewChan(dir, r.typ()) - case pkgbits.TypeMap: - return types.NewMap(r.typ(), r.typ()) - case pkgbits.TypePointer: - return types.NewPointer(r.typ()) - case pkgbits.TypeSignature: - return r.signature(nil, nil, nil) - case pkgbits.TypeSlice: - return types.NewSlice(r.typ()) - case pkgbits.TypeStruct: - return r.structType() - case pkgbits.TypeInterface: - return r.interfaceType() - case pkgbits.TypeUnion: - return r.unionType() - } -} - -func (r *reader) structType() *types.Struct { - fields := make([]*types.Var, r.Len()) - var tags []string - for i := range fields { - pos := r.pos() - pkg, name := r.selector() - ftyp := r.typ() - tag := r.String() - embedded := r.Bool() - - fields[i] = types.NewField(pos, pkg, name, ftyp, embedded) - if tag != "" { - for len(tags) < i { - tags = append(tags, "") - } - tags = append(tags, tag) - } - } - return types.NewStruct(fields, tags) -} - -func (r *reader) unionType() *types.Union { - terms := make([]*types.Term, r.Len()) - for i := range terms { - terms[i] = types.NewTerm(r.Bool(), r.typ()) - } - return types.NewUnion(terms) -} - -func (r *reader) interfaceType() *types.Interface { - methods := make([]*types.Func, r.Len()) - embeddeds := make([]types.Type, r.Len()) - implicit := len(methods) == 0 && len(embeddeds) == 1 && r.Bool() - - for i := range methods { - pos := r.pos() - pkg, name := r.selector() - mtyp := r.signature(nil, nil, nil) - methods[i] = types.NewFunc(pos, pkg, name, mtyp) - } - - for i := range embeddeds { - embeddeds[i] = r.typ() - } - - iface := types.NewInterfaceType(methods, embeddeds) - if implicit { - iface.MarkImplicit() - } - - // We need to call iface.Complete(), but if there are any embedded - // defined types, then we may not have set their underlying - // interface type yet. So we need to defer calling Complete until - // after we've called SetUnderlying everywhere. - // - // TODO(mdempsky): After CL 424876 lands, it should be safe to call - // iface.Complete() immediately. - r.p.ifaces = append(r.p.ifaces, iface) - - return iface -} - -func (r *reader) signature(recv *types.Var, rtparams, tparams []*types.TypeParam) *types.Signature { - r.Sync(pkgbits.SyncSignature) - - params := r.params() - results := r.params() - variadic := r.Bool() - - return types.NewSignatureType(recv, rtparams, tparams, params, results, variadic) -} - -func (r *reader) params() *types.Tuple { - r.Sync(pkgbits.SyncParams) - - params := make([]*types.Var, r.Len()) - for i := range params { - params[i] = r.param() - } - - return types.NewTuple(params...) -} - -func (r *reader) param() *types.Var { - r.Sync(pkgbits.SyncParam) - - pos := r.pos() - pkg, name := r.localIdent() - typ := r.typ() - - return types.NewParam(pos, pkg, name, typ) -} - -// @@@ Objects - -func (r *reader) obj() (types.Object, []types.Type) { - r.Sync(pkgbits.SyncObject) - - if r.Version().Has(pkgbits.DerivedFuncInstance) { - assert(!r.Bool()) - } - - pkg, name := r.p.objIdx(r.Reloc(pkgbits.RelocObj)) - obj := pkgScope(pkg).Lookup(name) - - targs := make([]types.Type, r.Len()) - for i := range targs { - targs[i] = r.typ() - } - - return obj, targs -} - -func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { - - var objPkg *types.Package - var objName string - var tag pkgbits.CodeObj - { - rname := pr.tempReader(pkgbits.RelocName, idx, pkgbits.SyncObject1) - - objPkg, objName = rname.qualifiedIdent() - assert(objName != "") - - tag = pkgbits.CodeObj(rname.Code(pkgbits.SyncCodeObj)) - pr.retireReader(rname) - } - - if tag == pkgbits.ObjStub { - assert(objPkg == nil || objPkg == types.Unsafe) - return objPkg, objName - } - - // Ignore local types promoted to global scope (#55110). - if _, suffix := splitVargenSuffix(objName); suffix != "" { - return objPkg, objName - } - - // TODO(mark): This, like the above splitVargenSuffix, is not ideal. - // Ignore generic methods promoted to global scope. - if strings.Contains(objName, ".") { - return objPkg, objName - } - - if objPkg.Scope().Lookup(objName) == nil { - dict := pr.objDictIdx(idx) - - r := pr.newReader(pkgbits.RelocObj, idx, pkgbits.SyncObject1) - r.dict = dict - - declare := func(obj types.Object) { - objPkg.Scope().Insert(obj) - } - - switch tag { - default: - panic("weird") - - case pkgbits.ObjAlias: - pos := r.pos() - var tparams []*types.TypeParam - if r.Version().Has(pkgbits.AliasTypeParamNames) { - tparams = r.typeParamNames(false) - } - typ := r.typ() - declare(aliases.New(pos, objPkg, objName, typ, tparams)) - - case pkgbits.ObjConst: - pos := r.pos() - typ := r.typ() - val := r.Value() - declare(types.NewConst(pos, objPkg, objName, typ, val)) - - case pkgbits.ObjFunc: - pos := r.pos() - if r.Version().Has(pkgbits.GenericMethods) { - assert(!r.Bool()) // generic methods are read in their defining type - } - tparams := r.typeParamNames(false) - sig := r.signature(nil, nil, tparams) - declare(types.NewFunc(pos, objPkg, objName, sig)) - - case pkgbits.ObjType: - pos := r.pos() - - obj := types.NewTypeName(pos, objPkg, objName, nil) - named := types.NewNamed(obj, nil, nil) - declare(obj) - - named.SetTypeParams(r.typeParamNames(false)) - - setUnderlying := func(underlying types.Type) { - // If the underlying type is an interface, we need to - // duplicate its methods so we can replace the receiver - // parameter's type (#49906). - if iface, ok := types.Unalias(underlying).(*types.Interface); ok && iface.NumExplicitMethods() != 0 { - methods := make([]*types.Func, iface.NumExplicitMethods()) - for i := range methods { - fn := iface.ExplicitMethod(i) - sig := fn.Type().(*types.Signature) - - recv := types.NewVar(fn.Pos(), fn.Pkg(), "", named) - typesinternal.SetVarKind(recv, typesinternal.RecvVar) - methods[i] = types.NewFunc(fn.Pos(), fn.Pkg(), fn.Name(), types.NewSignatureType(recv, nil, nil, sig.Params(), sig.Results(), sig.Variadic())) - } - - embeds := make([]types.Type, iface.NumEmbeddeds()) - for i := range embeds { - embeds[i] = iface.EmbeddedType(i) - } - - newIface := types.NewInterfaceType(methods, embeds) - r.p.ifaces = append(r.p.ifaces, newIface) - underlying = newIface - } - - named.SetUnderlying(underlying) - } - - // Since go.dev/cl/455279, we can assume rhs.Underlying() will - // always be non-nil. However, to temporarily support users of - // older snapshot releases, we continue to fallback to the old - // behavior for now. - // - // TODO(mdempsky): Remove fallback code and simplify after - // allowing time for snapshot users to upgrade. - rhs := r.typ() - if underlying := rhs.Underlying(); underlying != nil { - setUnderlying(underlying) - } else { - pk := r.p - pk.laterFor(named, func() { - // First be sure that the rhs is initialized, if it needs to be initialized. - delete(pk.laterFors, named) // prevent cycles - if i, ok := pk.laterFors[rhs]; ok { - f := pk.laterFns[i] - pk.laterFns[i] = func() {} // function is running now, so replace it with a no-op - f() // initialize RHS - } - setUnderlying(rhs.Underlying()) - }) - } - - for i, n := 0, r.Len(); i < n; i++ { - named.AddMethod(r.method()) - } - - if r.Version().Has(pkgbits.GenericMethods) { - for range r.Len() { - // Careful: objIdx is used to read in package-scoped declarations, which - // methods are not. Instead, decode it here. This makes it easier to - // associate it with the type and avoids the main objIdx loop. - idx := r.Reloc(pkgbits.RelocObj) - - r := pr.tempReader(pkgbits.RelocObj, idx, pkgbits.SyncObject1) - r.dict = pr.objDictIdx(idx) - - pos := r.pos() - assert(r.Bool()) // generic method - pkg, name := r.selector() - rtparams := r.typeParamNames(true) - recv := r.param() - tparams := r.typeParamNames(false) - sig := r.signature(recv, rtparams, tparams) - - pr.retireReader(r) - named.AddMethod(types.NewFunc(pos, pkg, name, sig)) - } - } - - case pkgbits.ObjVar: - pos := r.pos() - typ := r.typ() - v := types.NewVar(pos, objPkg, objName, typ) - typesinternal.SetVarKind(v, typesinternal.PackageVar) - declare(v) - } - } - - return objPkg, objName -} - -func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDict { - - var dict readerDict - - { - r := pr.tempReader(pkgbits.RelocObjDict, idx, pkgbits.SyncObject1) - if implicits := r.Len(); implicits != 0 { - errorf("unexpected object with %v implicit type parameter(s)", implicits) - } - - nreceivers := 0 - if r.Version().Has(pkgbits.GenericMethods) { - nreceivers = r.Len() - } - nexplicits := r.Len() - - dict.rtbounds = make([]typeInfo, nreceivers) - for i := range dict.rtbounds { - dict.rtbounds[i] = r.typInfo() - } - - dict.tbounds = make([]typeInfo, nexplicits) - for i := range dict.tbounds { - dict.tbounds[i] = r.typInfo() - } - - dict.derived = make([]derivedInfo, r.Len()) - dict.derivedTypes = make([]types.Type, len(dict.derived)) - for i := range dict.derived { - dict.derived[i] = derivedInfo{idx: r.Reloc(pkgbits.RelocType)} - if r.Version().Has(pkgbits.DerivedInfoNeeded) { - assert(!r.Bool()) - } - } - - pr.retireReader(r) - } - // function references follow, but reader doesn't need those - - return &dict -} - -func (r *reader) typeParamNames(isGenMeth bool) []*types.TypeParam { - r.Sync(pkgbits.SyncTypeParamNames) - - // Note: This code assumes there are no implicit type parameters. - // This is fine since it only reads exported declarations, which - // never have implicits. - - var in []typeInfo - var out *[]*types.TypeParam - if isGenMeth { - in = r.dict.rtbounds - out = &r.dict.rtparams - } else { - in = r.dict.tbounds - out = &r.dict.tparams - } - - if len(in) == 0 { - return nil - } - - // Careful: Type parameter lists may have cycles. To allow for this, - // we construct the type parameter list in two passes: first we - // create all the TypeNames and TypeParams, then we construct and - // set the bound type. - - // We have to save tparams outside of the closure, because typeParamNames - // can be called multiple times with the same dictionary instance. - tparams := make([]*types.TypeParam, len(in)) - *out = tparams - - for i := range in { - pos := r.pos() - pkg, name := r.localIdent() - - tname := types.NewTypeName(pos, pkg, name, nil) - tparams[i] = types.NewTypeParam(tname, nil) - } - - // The reader dictionary will continue mutating before we have time - // to call delayed functions; make a local copy of the constraints. - types := make([]types.Type, len(in)) - for i, info := range in { - types[i] = r.p.typIdx(info, r.dict) - } - - // This needs to happen later to make sure SetUnderlying has been called. - r.p.later(func() { - for i, typ := range types { - tparams[i].SetConstraint(typ) - } - }) - - return tparams -} - -func (r *reader) method() *types.Func { - r.Sync(pkgbits.SyncMethod) - pos := r.pos() - pkg, name := r.selector() - - rparams := r.typeParamNames(false) - sig := r.signature(r.param(), rparams, nil) - - _ = r.pos() // TODO(mdempsky): Remove; this is a hacker for linker.go. - return types.NewFunc(pos, pkg, name, sig) -} - -func (r *reader) qualifiedIdent() (*types.Package, string) { return r.ident(pkgbits.SyncSym) } -func (r *reader) localIdent() (*types.Package, string) { return r.ident(pkgbits.SyncLocalIdent) } -func (r *reader) selector() (*types.Package, string) { return r.ident(pkgbits.SyncSelector) } - -func (r *reader) ident(marker pkgbits.SyncMarker) (*types.Package, string) { - r.Sync(marker) - return r.pkg(), r.String() -} - -// pkgScope returns pkg.Scope(). -// If pkg is nil, it returns types.Universe instead. -// -// TODO(mdempsky): Remove after x/tools can depend on Go 1.19. -func pkgScope(pkg *types.Package) *types.Scope { - if pkg != nil { - return pkg.Scope() - } - return types.Universe -} - -// See cmd/compile/internal/types.SplitVargenSuffix. -func splitVargenSuffix(name string) (base, suffix string) { - i := len(name) - for i > 0 && name[i-1] >= '0' && name[i-1] <= '9' { - i-- - } - const dot = "·" - if i >= len(dot) && name[i-len(dot):i] == dot { - i -= len(dot) - return name[:i], name[i:] - } - return name, "" -} diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go deleted file mode 100644 index 58721202de7..00000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ /dev/null @@ -1,567 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gocommand is a helper for calling the go command. -package gocommand - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "log" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "strconv" - "strings" - "sync" - "time" - - "golang.org/x/tools/internal/event" - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// A Runner will run go command invocations and serialize -// them if it sees a concurrency error. -type Runner struct { - // once guards the runner initialization. - once sync.Once - - // inFlight tracks available workers. - inFlight chan struct{} - - // serialized guards the ability to run a go command serially, - // to avoid deadlocks when claiming workers. - serialized chan struct{} -} - -const maxInFlight = 10 - -func (runner *Runner) initialize() { - runner.once.Do(func() { - runner.inFlight = make(chan struct{}, maxInFlight) - runner.serialized = make(chan struct{}, 1) - }) -} - -// 1.13: go: updates to go.mod needed, but contents have changed -// 1.14: go: updating go.mod: existing contents have changed since last read -var modConcurrencyError = regexp.MustCompile(`go:.*go.mod.*contents have changed`) - -// event keys for go command invocations -var ( - verb = keys.NewString("verb", "go command verb") - directory = keys.NewString("directory", "") -) - -func invLabels(inv Invocation) []label.Label { - return []label.Label{verb.Of(inv.Verb), directory.Of(inv.WorkingDir)} -} - -// Run is a convenience wrapper around RunRaw. -// It returns only stdout and a "friendly" error. -func (runner *Runner) Run(ctx context.Context, inv Invocation) (*bytes.Buffer, error) { - ctx, done := event.Start(ctx, "gocommand.Runner.Run", invLabels(inv)...) - defer done() - - stdout, _, friendly, _ := runner.RunRaw(ctx, inv) - return stdout, friendly -} - -// RunPiped runs the invocation serially, always waiting for any concurrent -// invocations to complete first. -func (runner *Runner) RunPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) error { - ctx, done := event.Start(ctx, "gocommand.Runner.RunPiped", invLabels(inv)...) - defer done() - - _, err := runner.runPiped(ctx, inv, stdout, stderr) - return err -} - -// RunRaw runs the invocation, serializing requests only if they fight over -// go.mod changes. -// Postcondition: both error results have same nilness. -func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - ctx, done := event.Start(ctx, "gocommand.Runner.RunRaw", invLabels(inv)...) - defer done() - // Make sure the runner is always initialized. - runner.initialize() - - // First, try to run the go command concurrently. - stdout, stderr, friendlyErr, err := runner.runConcurrent(ctx, inv) - - // If we encounter a load concurrency error, we need to retry serially. - if friendlyErr != nil && modConcurrencyError.MatchString(friendlyErr.Error()) { - event.Error(ctx, "Load concurrency error, will retry serially", err) - - // Run serially by calling runPiped. - stdout.Reset() - stderr.Reset() - friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) - } - - return stdout, stderr, friendlyErr, err -} - -// Postcondition: both error results have same nilness. -func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - // Wait for 1 worker to become available. - select { - case <-ctx.Done(): - return nil, nil, ctx.Err(), ctx.Err() - case runner.inFlight <- struct{}{}: - defer func() { <-runner.inFlight }() - } - - stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{} - friendlyErr, err := inv.runWithFriendlyError(ctx, stdout, stderr) - return stdout, stderr, friendlyErr, err -} - -// Postcondition: both error results have same nilness. -func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) (error, error) { - // Make sure the runner is always initialized. - runner.initialize() - - // Acquire the serialization lock. This avoids deadlocks between two - // runPiped commands. - select { - case <-ctx.Done(): - return ctx.Err(), ctx.Err() - case runner.serialized <- struct{}{}: - defer func() { <-runner.serialized }() - } - - // Wait for all in-progress go commands to return before proceeding, - // to avoid load concurrency errors. - for range maxInFlight { - select { - case <-ctx.Done(): - return ctx.Err(), ctx.Err() - case runner.inFlight <- struct{}{}: - // Make sure we always "return" any workers we took. - defer func() { <-runner.inFlight }() - } - } - - return inv.runWithFriendlyError(ctx, stdout, stderr) -} - -// An Invocation represents a call to the go command. -type Invocation struct { - Verb string - Args []string - BuildFlags []string - - // If ModFlag is set, the go command is invoked with -mod=ModFlag. - // TODO(rfindley): remove, in favor of Args. - ModFlag string - - // If ModFile is set, the go command is invoked with -modfile=ModFile. - // TODO(rfindley): remove, in favor of Args. - ModFile string - - // Overlay is the name of the JSON overlay file that describes - // unsaved editor buffers; see [WriteOverlays]. - // If set, the go command is invoked with -overlay=Overlay. - // TODO(rfindley): remove, in favor of Args. - Overlay string - - // If CleanEnv is set, the invocation will run only with the environment - // in Env, not starting with os.Environ. - CleanEnv bool - Env []string - WorkingDir string - Logf func(format string, args ...any) -} - -// Postcondition: both error results have same nilness. -func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io.Writer) (friendlyError error, rawError error) { - rawError = i.run(ctx, stdout, stderr) - if rawError != nil { - friendlyError = rawError - // Check for 'go' executable not being found. - if ee, ok := rawError.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - friendlyError = fmt.Errorf("go command required, not found: %v", ee) - } - if ctx.Err() != nil { - friendlyError = ctx.Err() - } - friendlyError = fmt.Errorf("err: %v: stderr: %s", friendlyError, stderr) - } - return -} - -// logf logs if i.Logf is non-nil. -func (i *Invocation) logf(format string, args ...any) { - if i.Logf != nil { - i.Logf(format, args...) - } -} - -func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { - goArgs := []string{i.Verb} - - appendModFile := func() { - if i.ModFile != "" { - goArgs = append(goArgs, "-modfile="+i.ModFile) - } - } - appendModFlag := func() { - if i.ModFlag != "" { - goArgs = append(goArgs, "-mod="+i.ModFlag) - } - } - appendOverlayFlag := func() { - if i.Overlay != "" { - goArgs = append(goArgs, "-overlay="+i.Overlay) - } - } - - switch i.Verb { - case "env", "version": - goArgs = append(goArgs, i.Args...) - case "mod": - // mod needs the sub-verb before flags. - goArgs = append(goArgs, i.Args[0]) - appendModFile() - goArgs = append(goArgs, i.Args[1:]...) - case "get": - goArgs = append(goArgs, i.BuildFlags...) - appendModFile() - goArgs = append(goArgs, i.Args...) - - default: // notably list and build. - goArgs = append(goArgs, i.BuildFlags...) - appendModFile() - appendModFlag() - appendOverlayFlag() - goArgs = append(goArgs, i.Args...) - } - cmd := exec.Command("go", goArgs...) - cmd.Stdout = stdout - cmd.Stderr = stderr - - // https://go.dev/issue/59541: don't wait forever copying stderr - // after the command has exited. - // After CL 484741 we copy stdout manually, so we we'll stop reading that as - // soon as ctx is done. However, we also don't want to wait around forever - // for stderr. Give a much-longer-than-reasonable delay and then assume that - // something has wedged in the kernel or runtime. - cmd.WaitDelay = 30 * time.Second - - // The cwd gets resolved to the real path. On Darwin, where - // /tmp is a symlink, this breaks anything that expects the - // working directory to keep the original path, including the - // go command when dealing with modules. - // - // os.Getwd has a special feature where if the cwd and the PWD - // are the same node then it trusts the PWD, so by setting it - // in the env for the child process we fix up all the paths - // returned by the go command. - if !i.CleanEnv { - cmd.Env = os.Environ() - } - cmd.Env = append(cmd.Env, i.Env...) - if i.WorkingDir != "" { - cmd.Env = append(cmd.Env, "PWD="+i.WorkingDir) - cmd.Dir = i.WorkingDir - } - - debugStr := cmdDebugStr(cmd) - i.logf("starting %v", debugStr) - start := time.Now() - defer func() { - i.logf("%s for %v", time.Since(start), debugStr) - }() - - return runCmdContext(ctx, cmd) -} - -// DebugHangingGoCommands may be set by tests to enable additional -// instrumentation (including panics) for debugging hanging Go commands. -// -// See golang/go#54461 for details. -var DebugHangingGoCommands = false - -// runCmdContext is like exec.CommandContext except it sends os.Interrupt -// before os.Kill. -func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { - // If cmd.Stdout is not an *os.File, the exec package will create a pipe and - // copy it to the Writer in a goroutine until the process has finished and - // either the pipe reaches EOF or command's WaitDelay expires. - // - // However, the output from 'go list' can be quite large, and we don't want to - // keep reading (and allocating buffers) if we've already decided we don't - // care about the output. We don't want to wait for the process to finish, and - // we don't wait to wait for the WaitDelay to expire either. - // - // Instead, if cmd.Stdout requires a copying goroutine we explicitly replace - // it with a pipe (which is an *os.File), which we can close in order to stop - // copying output as soon as we realize we don't care about it. - var stdoutW *os.File - if cmd.Stdout != nil { - if _, ok := cmd.Stdout.(*os.File); !ok { - var stdoutR *os.File - stdoutR, stdoutW, err = os.Pipe() - if err != nil { - return err - } - prevStdout := cmd.Stdout - cmd.Stdout = stdoutW - - stdoutErr := make(chan error, 1) - go func() { - _, err := io.Copy(prevStdout, stdoutR) - if err != nil { - err = fmt.Errorf("copying stdout: %w", err) - } - stdoutErr <- err - }() - defer func() { - // We started a goroutine to copy a stdout pipe. - // Wait for it to finish, or terminate it if need be. - var err2 error - select { - case err2 = <-stdoutErr: - stdoutR.Close() - case <-ctx.Done(): - stdoutR.Close() - // Per https://pkg.go.dev/os#File.Close, the call to stdoutR.Close - // should cause the Read call in io.Copy to unblock and return - // immediately, but we still need to receive from stdoutErr to confirm - // that it has happened. - <-stdoutErr - err2 = ctx.Err() - } - if err == nil { - err = err2 - } - }() - - // Per https://pkg.go.dev/os/exec#Cmd, “If Stdout and Stderr are the - // same writer, and have a type that can be compared with ==, at most - // one goroutine at a time will call Write.” - // - // Since we're starting a goroutine that writes to cmd.Stdout, we must - // also update cmd.Stderr so that it still holds. - func() { - defer func() { recover() }() - if cmd.Stderr == prevStdout { - cmd.Stderr = cmd.Stdout - } - }() - } - } - - startTime := time.Now() - err = cmd.Start() - if stdoutW != nil { - // The child process has inherited the pipe file, - // so close the copy held in this process. - stdoutW.Close() - stdoutW = nil - } - if err != nil { - return err - } - - resChan := make(chan error, 1) - go func() { - resChan <- cmd.Wait() - }() - - // If we're interested in debugging hanging Go commands, stop waiting after a - // minute and panic with interesting information. - debug := DebugHangingGoCommands - if debug { - timer := time.NewTimer(1 * time.Minute) - defer timer.Stop() - select { - case err := <-resChan: - return err - case <-timer.C: - // HandleHangingGoCommand terminates this process. - // Pass off resChan in case we can collect the command error. - handleHangingGoCommand(startTime, cmd, resChan) - case <-ctx.Done(): - } - } else { - select { - case err := <-resChan: - return err - case <-ctx.Done(): - } - } - - // Cancelled. Interrupt and see if it ends voluntarily. - if err := cmd.Process.Signal(os.Interrupt); err == nil { - // (We used to wait only 1s but this proved - // fragile on loaded builder machines.) - timer := time.NewTimer(5 * time.Second) - defer timer.Stop() - select { - case err := <-resChan: - return err - case <-timer.C: - } - } - - // Didn't shut down in response to interrupt. Kill it hard. - if err := cmd.Process.Kill(); err != nil && !errors.Is(err, os.ErrProcessDone) && debug { - log.Printf("error killing the Go command: %v", err) - } - - return <-resChan -} - -// handleHangingGoCommand outputs debugging information to help diagnose the -// cause of a hanging Go command, and then exits with log.Fatalf. -func handleHangingGoCommand(start time.Time, cmd *exec.Cmd, resChan chan error) { - switch runtime.GOOS { - case "linux", "darwin", "freebsd", "netbsd", "openbsd": - fmt.Fprintln(os.Stderr, `DETECTED A HANGING GO COMMAND - - The gopls test runner has detected a hanging go command. In order to debug - this, the output of ps and lsof/fstat is printed below. - - See golang/go#54461 for more details.`) - - fmt.Fprintln(os.Stderr, "\nps axo ppid,pid,command:") - fmt.Fprintln(os.Stderr, "-------------------------") - psCmd := exec.Command("ps", "axo", "ppid,pid,command") - psCmd.Stdout = os.Stderr - psCmd.Stderr = os.Stderr - if err := psCmd.Run(); err != nil { - log.Printf("Handling hanging Go command: running ps: %v", err) - } - - listFiles := "lsof" - if runtime.GOOS == "freebsd" || runtime.GOOS == "netbsd" { - listFiles = "fstat" - } - - fmt.Fprintln(os.Stderr, "\n"+listFiles+":") - fmt.Fprintln(os.Stderr, "-----") - listFilesCmd := exec.Command(listFiles) - listFilesCmd.Stdout = os.Stderr - listFilesCmd.Stderr = os.Stderr - if err := listFilesCmd.Run(); err != nil { - log.Printf("Handling hanging Go command: running %s: %v", listFiles, err) - } - // Try to extract information about the slow go process by issuing a SIGQUIT. - if err := cmd.Process.Signal(sigStuckProcess); err == nil { - select { - case err := <-resChan: - stderr := "not a bytes.Buffer" - if buf, _ := cmd.Stderr.(*bytes.Buffer); buf != nil { - stderr = buf.String() - } - log.Printf("Quit hanging go command:\n\terr:%v\n\tstderr:\n%v\n\n", err, stderr) - case <-time.After(5 * time.Second): - } - } else { - log.Printf("Sending signal %d to hanging go command: %v", sigStuckProcess, err) - } - } - log.Fatalf("detected hanging go command (golang/go#54461); waited %s\n\tcommand:%s\n\tpid:%d", time.Since(start), cmd, cmd.Process.Pid) -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.SplitN(kv, "=", 2) - if len(split) == 2 { - k, v := split[0], split[1] - env[k] = v - } - } - - var args []string - for _, arg := range cmd.Args { - quoted := strconv.Quote(arg) - if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { - args = append(args, quoted) - } else { - args = append(args, arg) - } - } - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) -} - -// WriteOverlays writes each value in the overlay (see the Overlay -// field of go/packages.Config) to a temporary file and returns the name -// of a JSON file describing the mapping that is suitable for the "go -// list -overlay" flag. -// -// On success, the caller must call the cleanup function exactly once -// when the files are no longer needed. -func WriteOverlays(overlay map[string][]byte) (filename string, cleanup func(), err error) { - // Do nothing if there are no overlays in the config. - if len(overlay) == 0 { - return "", func() {}, nil - } - - dir, err := os.MkdirTemp("", "gocommand-*") - if err != nil { - return "", nil, err - } - - // The caller must clean up this directory, - // unless this function returns an error. - // (The cleanup operand of each return - // statement below is ignored.) - defer func() { - cleanup = func() { - os.RemoveAll(dir) - } - if err != nil { - cleanup() - cleanup = nil - } - }() - - // Write each map entry to a temporary file. - overlays := make(map[string]string) - for k, v := range overlay { - // Use a unique basename for each file (001-foo.go), - // to avoid creating nested directories. - base := fmt.Sprintf("%d-%s", 1+len(overlays), filepath.Base(k)) - filename := filepath.Join(dir, base) - err := os.WriteFile(filename, v, 0666) - if err != nil { - return "", nil, err - } - overlays[k] = filename - } - - // Write the JSON overlay file that maps logical file names to temp files. - // - // OverlayJSON is the format overlay files are expected to be in. - // The Replace map maps from overlaid paths to replacement paths: - // the Go command will forward all reads trying to open - // each overlaid path to its replacement path, or consider the overlaid - // path not to exist if the replacement path is empty. - // - // From golang/go#39958. - type OverlayJSON struct { - Replace map[string]string `json:"replace,omitempty"` - } - b, err := json.Marshal(OverlayJSON{Replace: overlays}) - if err != nil { - return "", nil, err - } - filename = filepath.Join(dir, "overlay.json") - if err := os.WriteFile(filename, b, 0666); err != nil { - return "", nil, err - } - - return filename, nil, nil -} diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.go b/vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.go deleted file mode 100644 index 469c648e4d8..00000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !unix - -package gocommand - -import "os" - -// sigStuckProcess is the signal to send to kill a hanging subprocess. -// On Unix we send SIGQUIT, but on non-Unix we only have os.Kill. -var sigStuckProcess = os.Kill diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke_unix.go b/vendor/golang.org/x/tools/internal/gocommand/invoke_unix.go deleted file mode 100644 index 169d37c8e93..00000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke_unix.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build unix - -package gocommand - -import "syscall" - -// Sigstuckprocess is the signal to send to kill a hanging subprocess. -// Send SIGQUIT to get a stack trace. -var sigStuckProcess = syscall.SIGQUIT diff --git a/vendor/golang.org/x/tools/internal/gocommand/vendor.go b/vendor/golang.org/x/tools/internal/gocommand/vendor.go deleted file mode 100644 index e38d1fb4888..00000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/vendor.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocommand - -import ( - "bytes" - "context" - "fmt" - "os" - "path/filepath" - "regexp" - "strings" - "time" - - "golang.org/x/mod/semver" -) - -// ModuleJSON holds information about a module. -type ModuleJSON struct { - Path string // module path - Version string // module version - Versions []string // available module versions (with -versions) - Replace *ModuleJSON // replaced by this module - Time *time.Time // time version was created - Update *ModuleJSON // available update, if any (with -u) - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file used when loading this module, if any - GoVersion string // go version used in module -} - -var modFlagRegexp = regexp.MustCompile(`-mod[ =](\w+)`) - -// VendorEnabled reports whether vendoring is enabled. It takes a *Runner to execute Go commands -// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, -// of which only Verb and Args are modified to run the appropriate Go command. -// Inspired by setDefaultBuildMod in modload/init.go -func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, *ModuleJSON, error) { - mainMod, go114, err := getMainModuleAnd114(ctx, inv, r) - if err != nil { - return false, nil, err - } - - // We check the GOFLAGS to see if there is anything overridden or not. - inv.Verb = "env" - inv.Args = []string{"GOFLAGS"} - stdout, err := r.Run(ctx, inv) - if err != nil { - return false, nil, err - } - goflags := string(bytes.TrimSpace(stdout.Bytes())) - matches := modFlagRegexp.FindStringSubmatch(goflags) - var modFlag string - if len(matches) != 0 { - modFlag = matches[1] - } - // Don't override an explicit '-mod=' argument. - if modFlag == "vendor" { - return true, mainMod, nil - } else if modFlag != "" { - return false, nil, nil - } - if mainMod == nil || !go114 { - return false, nil, nil - } - // Check 1.14's automatic vendor mode. - if fi, err := os.Stat(filepath.Join(mainMod.Dir, "vendor")); err == nil && fi.IsDir() { - if mainMod.GoVersion != "" && semver.Compare("v"+mainMod.GoVersion, "v1.14") >= 0 { - // The Go version is at least 1.14, and a vendor directory exists. - // Set -mod=vendor by default. - return true, mainMod, nil - } - } - return false, nil, nil -} - -// getMainModuleAnd114 gets one of the main modules' information and whether the -// go command in use is 1.14+. This is the information needed to figure out -// if vendoring should be enabled. -func getMainModuleAnd114(ctx context.Context, inv Invocation, r *Runner) (*ModuleJSON, bool, error) { - const format = `{{.Path}} -{{.Dir}} -{{.GoMod}} -{{.GoVersion}} -{{range context.ReleaseTags}}{{if eq . "go1.14"}}{{.}}{{end}}{{end}} -` - inv.Verb = "list" - inv.Args = []string{"-m", "-f", format} - stdout, err := r.Run(ctx, inv) - if err != nil { - return nil, false, err - } - - lines := strings.Split(stdout.String(), "\n") - if len(lines) < 5 { - return nil, false, fmt.Errorf("unexpected stdout: %q", stdout.String()) - } - mod := &ModuleJSON{ - Path: lines[0], - Dir: lines[1], - GoMod: lines[2], - GoVersion: lines[3], - Main: true, - } - return mod, lines[4] == "go1.14", nil -} - -// WorkspaceVendorEnabled reports whether workspace vendoring is enabled. It takes a *Runner to execute Go commands -// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, -// of which only Verb and Args are modified to run the appropriate Go command. -// Inspired by setDefaultBuildMod in modload/init.go -func WorkspaceVendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, []*ModuleJSON, error) { - inv.Verb = "env" - inv.Args = []string{"GOWORK"} - stdout, err := r.Run(ctx, inv) - if err != nil { - return false, nil, err - } - goWork := string(bytes.TrimSpace(stdout.Bytes())) - if fi, err := os.Stat(filepath.Join(filepath.Dir(goWork), "vendor")); err == nil && fi.IsDir() { - mainMods, err := getWorkspaceMainModules(ctx, inv, r) - if err != nil { - return false, nil, err - } - return true, mainMods, nil - } - return false, nil, nil -} - -// getWorkspaceMainModules gets the main modules' information. -// This is the information needed to figure out if vendoring should be enabled. -func getWorkspaceMainModules(ctx context.Context, inv Invocation, r *Runner) ([]*ModuleJSON, error) { - const format = `{{.Path}} -{{.Dir}} -{{.GoMod}} -{{.GoVersion}} -` - inv.Verb = "list" - inv.Args = []string{"-m", "-f", format} - stdout, err := r.Run(ctx, inv) - if err != nil { - return nil, err - } - - lines := strings.Split(strings.TrimSuffix(stdout.String(), "\n"), "\n") - if len(lines) < 4 { - return nil, fmt.Errorf("unexpected stdout: %q", stdout.String()) - } - mods := make([]*ModuleJSON, 0, len(lines)/4) - for i := 0; i < len(lines); i += 4 { - mods = append(mods, &ModuleJSON{ - Path: lines[i], - Dir: lines[i+1], - GoMod: lines[i+2], - GoVersion: lines[i+3], - Main: true, - }) - } - return mods, nil -} diff --git a/vendor/golang.org/x/tools/internal/gocommand/version.go b/vendor/golang.org/x/tools/internal/gocommand/version.go deleted file mode 100644 index d82f13a7e60..00000000000 --- a/vendor/golang.org/x/tools/internal/gocommand/version.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocommand - -import ( - "context" - "fmt" - "regexp" - "slices" - "strings" -) - -// GoVersion reports the minor version number of the highest release -// tag built into the go command on the PATH. -// -// Note that this may be higher than the version of the go tool used -// to build this application, and thus the versions of the standard -// go/{scanner,parser,ast,types} packages that are linked into it. -// In that case, callers should either downgrade to the version of -// go used to build the application, or report an error that the -// application is too old to use the go command on the PATH. -func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) { - inv.Verb = "list" - inv.Args = []string{"-e", "-f", `{{context.ReleaseTags}}`, `--`, `unsafe`} - inv.BuildFlags = nil // This is not a build command. - inv.ModFlag = "" - inv.ModFile = "" - // Set GO111MODULE=off so that we are immune to errors in go.{work,mod}. - // Unfortunately, this breaks the Go 1.21+ toolchain directive and - // may affect the set of ReleaseTags; see #68495. - inv.Env = append(inv.Env[:len(inv.Env):len(inv.Env)], "GO111MODULE=off") - - stdoutBytes, err := r.Run(ctx, inv) - if err != nil { - return 0, err - } - stdout := stdoutBytes.String() - if len(stdout) < 3 { - return 0, fmt.Errorf("bad ReleaseTags output: %q", stdout) - } - // Split up "[go1.1 go1.15]" and return highest go1.X value. - tags := strings.Fields(stdout[1 : len(stdout)-2]) - for _, tag := range slices.Backward(tags) { - var version int - if _, err := fmt.Sscanf(tag, "go1.%d", &version); err != nil { - continue - } - return version, nil - } - return 0, fmt.Errorf("no parseable ReleaseTags in %v", tags) -} - -// GoVersionOutput returns the complete output of the go version command. -func GoVersionOutput(ctx context.Context, inv Invocation, r *Runner) (string, error) { - inv.Verb = "version" - goVersion, err := r.Run(ctx, inv) - if err != nil { - return "", err - } - return goVersion.String(), nil -} - -// ParseGoVersionOutput extracts the Go version string -// from the output of the "go version" command. -// Given an unrecognized form, it returns an empty string. -func ParseGoVersionOutput(data string) string { - re := regexp.MustCompile(`^go version (go\S+|devel \S+)`) - m := re.FindStringSubmatch(data) - if len(m) != 2 { - return "" // unrecognized version - } - return m[1] -} diff --git a/vendor/golang.org/x/tools/internal/moremaps/maps.go b/vendor/golang.org/x/tools/internal/moremaps/maps.go deleted file mode 100644 index a1bae078b18..00000000000 --- a/vendor/golang.org/x/tools/internal/moremaps/maps.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package moremaps contains more functions for working with maps. -package moremaps - -import ( - "cmp" - "iter" - "maps" - "slices" -) - -// Arbitrary returns an arbitrary (key, value) entry from the map and ok is true, if -// the map is not empty. Otherwise, it returns zero values for K and V, and false. -func Arbitrary[K comparable, V any](m map[K]V) (_ K, _ V, ok bool) { - for k, v := range m { - return k, v, true - } - return -} - -// Group returns a new non-nil map containing the elements of s grouped by the -// keys returned from the key func. -func Group[K comparable, V any](s []V, key func(V) K) map[K][]V { - m := make(map[K][]V) - for _, v := range s { - k := key(v) - m[k] = append(m[k], v) - } - return m -} - -// KeySlice returns the keys of the map M, like slices.Collect(maps.Keys(m)). -func KeySlice[M ~map[K]V, K comparable, V any](m M) []K { - r := make([]K, 0, len(m)) - for k := range m { - r = append(r, k) - } - return r -} - -// ValueSlice returns the values of the map M, like slices.Collect(maps.Values(m)). -func ValueSlice[M ~map[K]V, K comparable, V any](m M) []V { - r := make([]V, 0, len(m)) - for _, v := range m { - r = append(r, v) - } - return r -} - -// SameKeys reports whether x and y have equal sets of keys. -func SameKeys[K comparable, V1, V2 any](x map[K]V1, y map[K]V2) bool { - ignoreValues := func(V1, V2) bool { return true } - return maps.EqualFunc(x, y, ignoreValues) -} - -// Sorted returns an iterator over the entries of m in key order. -func Sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V] { - // TODO(adonovan): use maps.Sorted if proposal #68598 is accepted. - return func(yield func(K, V) bool) { - keys := KeySlice(m) - slices.Sort(keys) - for _, k := range keys { - if !yield(k, m[k]) { - break - } - } - } -} - -// SortedFunc returns an iterator over the entries of m in the key order determined by cmp. -func SortedFunc[M ~map[K]V, K comparable, V any](m M, cmp func(x, y K) int) iter.Seq2[K, V] { - // TODO(adonovan): use maps.SortedFunc if proposal #68598 is accepted. - return func(yield func(K, V) bool) { - keys := KeySlice(m) - slices.SortFunc(keys, cmp) - for _, k := range keys { - if !yield(k, m[k]) { - break - } - } - } -} - -// Delete is like delete(m, k) but reports whether deletion occurred. -func Delete[M ~map[K]V, K comparable, V any](m M, k K) bool { - pre := len(m) - delete(m, k) - return pre != len(m) -} - -// Entry is a key-value pair obtained from a map. -type Entry[K comparable, V any] struct { - Key K - Value V -} - -// Entries returns a new unordered array of the entries of a map. -func Entries[M ~map[K]V, K comparable, V any](m M) []Entry[K, V] { - entries := make([]Entry[K, V], 0, len(m)) - for k, v := range m { - entries = append(entries, Entry[K, V]{k, v}) - } - return entries -} - -// FromEntries returns a new map into which the entries have been inserted in order. -func FromEntries[K comparable, V any](entries []Entry[K, V]) map[K]V { - m := make(map[K]V, len(entries)) - for _, e := range entries { - m[e.Key] = e.Value - } - return m -} diff --git a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go deleted file mode 100644 index 929b470bebe..00000000000 --- a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package packagesinternal exposes internal-only fields from go/packages. -package packagesinternal - -import "fmt" - -var GetDepsErrors = func(p any) []*PackageError { return nil } - -type PackageError struct { - ImportStack []string // shortest path from package named on command line to this one - Pos string // position of error (if present, file:line:col) - Err string // the error itself -} - -func (err PackageError) String() string { - return fmt.Sprintf("%s: %s (import stack: %s)", err.Pos, err.Err, err.ImportStack) -} - -var TypecheckCgo int -var DepsErrors int // must be set as a LoadMode to call GetDepsErrors diff --git a/vendor/golang.org/x/tools/internal/pkgbits/codes.go b/vendor/golang.org/x/tools/internal/pkgbits/codes.go deleted file mode 100644 index f0cabde96eb..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/codes.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -// A Code is an enum value that can be encoded into bitstreams. -// -// Code types are preferable for enum types, because they allow -// Decoder to detect desyncs. -type Code interface { - // Marker returns the SyncMarker for the Code's dynamic type. - Marker() SyncMarker - - // Value returns the Code's ordinal value. - Value() int -} - -// A CodeVal distinguishes among go/constant.Value encodings. -type CodeVal int - -func (c CodeVal) Marker() SyncMarker { return SyncVal } -func (c CodeVal) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - ValBool CodeVal = iota - ValString - ValInt64 - ValBigInt - ValBigRat - ValBigFloat -) - -// A CodeType distinguishes among go/types.Type encodings. -type CodeType int - -func (c CodeType) Marker() SyncMarker { return SyncType } -func (c CodeType) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - TypeBasic CodeType = iota - TypeNamed - TypePointer - TypeSlice - TypeArray - TypeChan - TypeMap - TypeSignature - TypeStruct - TypeInterface - TypeUnion - TypeTypeParam -) - -// A CodeObj distinguishes among go/types.Object encodings. -type CodeObj int - -func (c CodeObj) Marker() SyncMarker { return SyncCodeObj } -func (c CodeObj) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - ObjAlias CodeObj = iota - ObjConst - ObjType - ObjFunc - ObjVar - ObjStub -) diff --git a/vendor/golang.org/x/tools/internal/pkgbits/decoder.go b/vendor/golang.org/x/tools/internal/pkgbits/decoder.go deleted file mode 100644 index c0aba26c482..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/decoder.go +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "encoding/binary" - "errors" - "fmt" - "go/constant" - "go/token" - "io" - "math/big" - "os" - "runtime" - "strings" -) - -// A PkgDecoder provides methods for decoding a package's Unified IR -// export data. -type PkgDecoder struct { - // version is the file format version. - version Version - - // sync indicates whether the file uses sync markers. - sync bool - - // pkgPath is the package path for the package to be decoded. - // - // TODO(mdempsky): Remove; unneeded since CL 391014. - pkgPath string - - // elemData is the full data payload of the encoded package. - // Elements are densely and contiguously packed together. - // - // The last 8 bytes of elemData are the package fingerprint. - elemData string - - // elemEnds stores the byte-offset end positions of element - // bitstreams within elemData. - // - // For example, element I's bitstream data starts at elemEnds[I-1] - // (or 0, if I==0) and ends at elemEnds[I]. - // - // Note: elemEnds is indexed by absolute indices, not - // section-relative indices. - elemEnds []uint32 - - // elemEndsEnds stores the index-offset end positions of relocation - // sections within elemEnds. - // - // For example, section K's end positions start at elemEndsEnds[K-1] - // (or 0, if K==0) and end at elemEndsEnds[K]. - elemEndsEnds [numRelocs]uint32 - - scratchRelocEnt []RelocEnt -} - -// PkgPath returns the package path for the package -// -// TODO(mdempsky): Remove; unneeded since CL 391014. -func (pr *PkgDecoder) PkgPath() string { return pr.pkgPath } - -// SyncMarkers reports whether pr uses sync markers. -func (pr *PkgDecoder) SyncMarkers() bool { return pr.sync } - -// NewPkgDecoder returns a PkgDecoder initialized to read the Unified -// IR export data from input. pkgPath is the package path for the -// compilation unit that produced the export data. -func NewPkgDecoder(pkgPath, input string) PkgDecoder { - pr := PkgDecoder{ - pkgPath: pkgPath, - } - - // TODO(mdempsky): Implement direct indexing of input string to - // avoid copying the position information. - - r := strings.NewReader(input) - - var ver uint32 - assert(binary.Read(r, binary.LittleEndian, &ver) == nil) - pr.version = Version(ver) - - if pr.version >= numVersions { - panic(fmt.Errorf("cannot decode %q, export data version %d is greater than maximum supported version %d", pkgPath, pr.version, numVersions-1)) - } - - if pr.version.Has(Flags) { - var flags uint32 - assert(binary.Read(r, binary.LittleEndian, &flags) == nil) - pr.sync = flags&flagSyncMarkers != 0 - } - - assert(binary.Read(r, binary.LittleEndian, pr.elemEndsEnds[:]) == nil) - - pr.elemEnds = make([]uint32, pr.elemEndsEnds[len(pr.elemEndsEnds)-1]) - assert(binary.Read(r, binary.LittleEndian, pr.elemEnds[:]) == nil) - - pos, err := r.Seek(0, io.SeekCurrent) - assert(err == nil) - - pr.elemData = input[pos:] - - const fingerprintSize = 8 - assert(len(pr.elemData)-fingerprintSize == int(pr.elemEnds[len(pr.elemEnds)-1])) - - return pr -} - -// NumElems returns the number of elements in section k. -func (pr *PkgDecoder) NumElems(k RelocKind) int { - count := int(pr.elemEndsEnds[k]) - if k > 0 { - count -= int(pr.elemEndsEnds[k-1]) - } - return count -} - -// TotalElems returns the total number of elements across all sections. -func (pr *PkgDecoder) TotalElems() int { - return len(pr.elemEnds) -} - -// Fingerprint returns the package fingerprint. -func (pr *PkgDecoder) Fingerprint() [8]byte { - var fp [8]byte - copy(fp[:], pr.elemData[len(pr.elemData)-8:]) - return fp -} - -// AbsIdx returns the absolute index for the given (section, index) -// pair. -func (pr *PkgDecoder) AbsIdx(k RelocKind, idx Index) int { - absIdx := int(idx) - if k > 0 { - absIdx += int(pr.elemEndsEnds[k-1]) - } - if absIdx >= int(pr.elemEndsEnds[k]) { - panicf("%v:%v is out of bounds; %v", k, idx, pr.elemEndsEnds) - } - return absIdx -} - -// DataIdx returns the raw element bitstream for the given (section, -// index) pair. -func (pr *PkgDecoder) DataIdx(k RelocKind, idx Index) string { - absIdx := pr.AbsIdx(k, idx) - - var start uint32 - if absIdx > 0 { - start = pr.elemEnds[absIdx-1] - } - end := pr.elemEnds[absIdx] - - return pr.elemData[start:end] -} - -// StringIdx returns the string value for the given string index. -func (pr *PkgDecoder) StringIdx(idx Index) string { - return pr.DataIdx(RelocString, idx) -} - -// NewDecoder returns a Decoder for the given (section, index) pair, -// and decodes the given SyncMarker from the element bitstream. -func (pr *PkgDecoder) NewDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder { - r := pr.NewDecoderRaw(k, idx) - r.Sync(marker) - return r -} - -// TempDecoder returns a Decoder for the given (section, index) pair, -// and decodes the given SyncMarker from the element bitstream. -// If possible the Decoder should be RetireDecoder'd when it is no longer -// needed, this will avoid heap allocations. -func (pr *PkgDecoder) TempDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder { - r := pr.TempDecoderRaw(k, idx) - r.Sync(marker) - return r -} - -func (pr *PkgDecoder) RetireDecoder(d *Decoder) { - pr.scratchRelocEnt = d.Relocs - d.Relocs = nil -} - -// NewDecoderRaw returns a Decoder for the given (section, index) pair. -// -// Most callers should use NewDecoder instead. -func (pr *PkgDecoder) NewDecoderRaw(k RelocKind, idx Index) Decoder { - r := Decoder{ - common: pr, - k: k, - Idx: idx, - } - - r.Data.Reset(pr.DataIdx(k, idx)) - r.Sync(SyncRelocs) - r.Relocs = make([]RelocEnt, r.Len()) - for i := range r.Relocs { - r.Sync(SyncReloc) - r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())} - } - - return r -} - -func (pr *PkgDecoder) TempDecoderRaw(k RelocKind, idx Index) Decoder { - r := Decoder{ - common: pr, - k: k, - Idx: idx, - } - - r.Data.Reset(pr.DataIdx(k, idx)) - r.Sync(SyncRelocs) - l := r.Len() - if cap(pr.scratchRelocEnt) >= l { - r.Relocs = pr.scratchRelocEnt[:l] - pr.scratchRelocEnt = nil - } else { - r.Relocs = make([]RelocEnt, l) - } - for i := range r.Relocs { - r.Sync(SyncReloc) - r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())} - } - - return r -} - -// A Decoder provides methods for decoding an individual element's -// bitstream data. -type Decoder struct { - common *PkgDecoder - - Relocs []RelocEnt - Data strings.Reader - - k RelocKind - Idx Index -} - -func (r *Decoder) checkErr(err error) { - if err != nil { - panicf("unexpected decoding error: %w", err) - } -} - -func (r *Decoder) rawUvarint() uint64 { - x, err := readUvarint(&r.Data) - r.checkErr(err) - return x -} - -// readUvarint is a type-specialized copy of encoding/binary.ReadUvarint. -// This avoids the interface conversion and thus has better escape properties, -// which flows up the stack. -func readUvarint(r *strings.Reader) (uint64, error) { - var x uint64 - var s uint - for i := range binary.MaxVarintLen64 { - b, err := r.ReadByte() - if err != nil { - if i > 0 && err == io.EOF { - err = io.ErrUnexpectedEOF - } - return x, err - } - if b < 0x80 { - if i == binary.MaxVarintLen64-1 && b > 1 { - return x, overflow - } - return x | uint64(b)<> 1) - if ux&1 != 0 { - x = ^x - } - return x -} - -func (r *Decoder) rawReloc(k RelocKind, idx int) Index { - e := r.Relocs[idx] - assert(e.Kind == k) - return e.Idx -} - -// Sync decodes a sync marker from the element bitstream and asserts -// that it matches the expected marker. -// -// If r.common.sync is false, then Sync is a no-op. -func (r *Decoder) Sync(mWant SyncMarker) { - if !r.common.sync { - return - } - - pos, _ := r.Data.Seek(0, io.SeekCurrent) - mHave := SyncMarker(r.rawUvarint()) - writerPCs := make([]int, r.rawUvarint()) - for i := range writerPCs { - writerPCs[i] = int(r.rawUvarint()) - } - - if mHave == mWant { - return - } - - // There's some tension here between printing: - // - // (1) full file paths that tools can recognize (e.g., so emacs - // hyperlinks the "file:line" text for easy navigation), or - // - // (2) short file paths that are easier for humans to read (e.g., by - // omitting redundant or irrelevant details, so it's easier to - // focus on the useful bits that remain). - // - // The current formatting favors the former, as it seems more - // helpful in practice. But perhaps the formatting could be improved - // to better address both concerns. For example, use relative file - // paths if they would be shorter, or rewrite file paths to contain - // "$GOROOT" (like objabi.AbsFile does) if tools can be taught how - // to reliably expand that again. - - fmt.Printf("export data desync: package %q, section %v, index %v, offset %v\n", r.common.pkgPath, r.k, r.Idx, pos) - - fmt.Printf("\nfound %v, written at:\n", mHave) - if len(writerPCs) == 0 { - fmt.Printf("\t[stack trace unavailable; recompile package %q with -d=syncframes]\n", r.common.pkgPath) - } - for _, pc := range writerPCs { - fmt.Printf("\t%s\n", r.common.StringIdx(r.rawReloc(RelocString, pc))) - } - - fmt.Printf("\nexpected %v, reading at:\n", mWant) - var readerPCs [32]uintptr // TODO(mdempsky): Dynamically size? - n := runtime.Callers(2, readerPCs[:]) - for _, pc := range fmtFrames(readerPCs[:n]...) { - fmt.Printf("\t%s\n", pc) - } - - // We already printed a stack trace for the reader, so now we can - // simply exit. Printing a second one with panic or base.Fatalf - // would just be noise. - os.Exit(1) -} - -// Bool decodes and returns a bool value from the element bitstream. -func (r *Decoder) Bool() bool { - r.Sync(SyncBool) - x, err := r.Data.ReadByte() - r.checkErr(err) - assert(x < 2) - return x != 0 -} - -// Int64 decodes and returns an int64 value from the element bitstream. -func (r *Decoder) Int64() int64 { - r.Sync(SyncInt64) - return r.rawVarint() -} - -// Uint64 decodes and returns a uint64 value from the element bitstream. -func (r *Decoder) Uint64() uint64 { - r.Sync(SyncUint64) - return r.rawUvarint() -} - -// Len decodes and returns a non-negative int value from the element bitstream. -func (r *Decoder) Len() int { x := r.Uint64(); v := int(x); assert(uint64(v) == x); return v } - -// Int decodes and returns an int value from the element bitstream. -func (r *Decoder) Int() int { x := r.Int64(); v := int(x); assert(int64(v) == x); return v } - -// Uint decodes and returns a uint value from the element bitstream. -func (r *Decoder) Uint() uint { x := r.Uint64(); v := uint(x); assert(uint64(v) == x); return v } - -// Code decodes a Code value from the element bitstream and returns -// its ordinal value. It's the caller's responsibility to convert the -// result to an appropriate Code type. -// -// TODO(mdempsky): Ideally this method would have signature "Code[T -// Code] T" instead, but we don't allow generic methods and the -// compiler can't depend on generics yet anyway. -func (r *Decoder) Code(mark SyncMarker) int { - r.Sync(mark) - return r.Len() -} - -// Reloc decodes a relocation of expected section k from the element -// bitstream and returns an index to the referenced element. -func (r *Decoder) Reloc(k RelocKind) Index { - r.Sync(SyncUseReloc) - return r.rawReloc(k, r.Len()) -} - -// String decodes and returns a string value from the element -// bitstream. -func (r *Decoder) String() string { - r.Sync(SyncString) - return r.common.StringIdx(r.Reloc(RelocString)) -} - -// Strings decodes and returns a variable-length slice of strings from -// the element bitstream. -func (r *Decoder) Strings() []string { - res := make([]string, r.Len()) - for i := range res { - res[i] = r.String() - } - return res -} - -// Value decodes and returns a constant.Value from the element -// bitstream. -func (r *Decoder) Value() constant.Value { - r.Sync(SyncValue) - isComplex := r.Bool() - val := r.scalar() - if isComplex { - val = constant.BinaryOp(val, token.ADD, constant.MakeImag(r.scalar())) - } - return val -} - -func (r *Decoder) scalar() constant.Value { - switch tag := CodeVal(r.Code(SyncVal)); tag { - default: - panic(fmt.Errorf("unexpected scalar tag: %v", tag)) - - case ValBool: - return constant.MakeBool(r.Bool()) - case ValString: - return constant.MakeString(r.String()) - case ValInt64: - return constant.MakeInt64(r.Int64()) - case ValBigInt: - return constant.Make(r.bigInt()) - case ValBigRat: - num := r.bigInt() - denom := r.bigInt() - return constant.Make(new(big.Rat).SetFrac(num, denom)) - case ValBigFloat: - return constant.Make(r.bigFloat()) - } -} - -func (r *Decoder) bigInt() *big.Int { - v := new(big.Int).SetBytes([]byte(r.String())) - if r.Bool() { - v.Neg(v) - } - return v -} - -func (r *Decoder) bigFloat() *big.Float { - v := new(big.Float).SetPrec(512) - assert(v.UnmarshalText([]byte(r.String())) == nil) - return v -} - -// @@@ Helpers - -// TODO(mdempsky): These should probably be removed. I think they're a -// smell that the export data format is not yet quite right. - -// PeekPkgPath returns the package path for the specified package -// index. -func (pr *PkgDecoder) PeekPkgPath(idx Index) string { - var path string - { - r := pr.TempDecoder(RelocPkg, idx, SyncPkgDef) - path = r.String() - pr.RetireDecoder(&r) - } - if path == "" { - path = pr.pkgPath - } - return path -} - -// PeekObj returns the package path, object name, and CodeObj for the -// specified object index. -func (pr *PkgDecoder) PeekObj(idx Index) (string, string, CodeObj) { - var ridx Index - var name string - var rcode int - { - r := pr.TempDecoder(RelocName, idx, SyncObject1) - r.Sync(SyncSym) - r.Sync(SyncPkg) - ridx = r.Reloc(RelocPkg) - name = r.String() - rcode = r.Code(SyncCodeObj) - pr.RetireDecoder(&r) - } - - path := pr.PeekPkgPath(ridx) - assert(name != "") - - tag := CodeObj(rcode) - - return path, name, tag -} - -// Version reports the version of the bitstream. -func (w *Decoder) Version() Version { return w.common.version } diff --git a/vendor/golang.org/x/tools/internal/pkgbits/doc.go b/vendor/golang.org/x/tools/internal/pkgbits/doc.go deleted file mode 100644 index c8a2796b5e4..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package pkgbits implements low-level coding abstractions for -// Unified IR's export data format. -// -// At a low-level, a package is a collection of bitstream elements. -// Each element has a "kind" and a dense, non-negative index. -// Elements can be randomly accessed given their kind and index. -// -// Individual elements are sequences of variable-length values (e.g., -// integers, booleans, strings, go/constant values, cross-references -// to other elements). Package pkgbits provides APIs for encoding and -// decoding these low-level values, but the details of mapping -// higher-level Go constructs into elements is left to higher-level -// abstractions. -// -// Elements may cross-reference each other with "relocations." For -// example, an element representing a pointer type has a relocation -// referring to the element type. -// -// Go constructs may be composed as a constellation of multiple -// elements. For example, a declared function may have one element to -// describe the object (e.g., its name, type, position), and a -// separate element to describe its function body. This allows readers -// some flexibility in efficiently seeking or re-reading data (e.g., -// inlining requires re-reading the function body for each inlined -// call, without needing to re-read the object-level details). -// -// This is a copy of internal/pkgbits in the Go implementation. -package pkgbits diff --git a/vendor/golang.org/x/tools/internal/pkgbits/encoder.go b/vendor/golang.org/x/tools/internal/pkgbits/encoder.go deleted file mode 100644 index c17a12399d0..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/encoder.go +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "bytes" - "crypto/md5" - "encoding/binary" - "go/constant" - "io" - "math/big" - "runtime" - "strings" -) - -// A PkgEncoder provides methods for encoding a package's Unified IR -// export data. -type PkgEncoder struct { - // version of the bitstream. - version Version - - // elems holds the bitstream for previously encoded elements. - elems [numRelocs][]string - - // stringsIdx maps previously encoded strings to their index within - // the RelocString section, to allow deduplication. That is, - // elems[RelocString][stringsIdx[s]] == s (if present). - stringsIdx map[string]Index - - // syncFrames is the number of frames to write at each sync - // marker. A negative value means sync markers are omitted. - syncFrames int -} - -// SyncMarkers reports whether pw uses sync markers. -func (pw *PkgEncoder) SyncMarkers() bool { return pw.syncFrames >= 0 } - -// NewPkgEncoder returns an initialized PkgEncoder. -// -// syncFrames is the number of caller frames that should be serialized -// at Sync points. Serializing additional frames results in larger -// export data files, but can help diagnosing desync errors in -// higher-level Unified IR reader/writer code. If syncFrames is -// negative, then sync markers are omitted entirely. -func NewPkgEncoder(version Version, syncFrames int) PkgEncoder { - return PkgEncoder{ - version: version, - stringsIdx: make(map[string]Index), - syncFrames: syncFrames, - } -} - -// DumpTo writes the package's encoded data to out0 and returns the -// package fingerprint. -func (pw *PkgEncoder) DumpTo(out0 io.Writer) (fingerprint [8]byte) { - h := md5.New() - out := io.MultiWriter(out0, h) - - writeUint32 := func(x uint32) { - assert(binary.Write(out, binary.LittleEndian, x) == nil) - } - - writeUint32(uint32(pw.version)) - - if pw.version.Has(Flags) { - var flags uint32 - if pw.SyncMarkers() { - flags |= flagSyncMarkers - } - writeUint32(flags) - } - - // Write elemEndsEnds. - var sum uint32 - for _, elems := range &pw.elems { - sum += uint32(len(elems)) - writeUint32(sum) - } - - // Write elemEnds. - sum = 0 - for _, elems := range &pw.elems { - for _, elem := range elems { - sum += uint32(len(elem)) - writeUint32(sum) - } - } - - // Write elemData. - for _, elems := range &pw.elems { - for _, elem := range elems { - _, err := io.WriteString(out, elem) - assert(err == nil) - } - } - - // Write fingerprint. - copy(fingerprint[:], h.Sum(nil)) - _, err := out0.Write(fingerprint[:]) - assert(err == nil) - - return -} - -// StringIdx adds a string value to the strings section, if not -// already present, and returns its index. -func (pw *PkgEncoder) StringIdx(s string) Index { - if idx, ok := pw.stringsIdx[s]; ok { - assert(pw.elems[RelocString][idx] == s) - return idx - } - - idx := Index(len(pw.elems[RelocString])) - pw.elems[RelocString] = append(pw.elems[RelocString], s) - pw.stringsIdx[s] = idx - return idx -} - -// NewEncoder returns an Encoder for a new element within the given -// section, and encodes the given SyncMarker as the start of the -// element bitstream. -func (pw *PkgEncoder) NewEncoder(k RelocKind, marker SyncMarker) Encoder { - e := pw.NewEncoderRaw(k) - e.Sync(marker) - return e -} - -// NewEncoderRaw returns an Encoder for a new element within the given -// section. -// -// Most callers should use NewEncoder instead. -func (pw *PkgEncoder) NewEncoderRaw(k RelocKind) Encoder { - idx := Index(len(pw.elems[k])) - pw.elems[k] = append(pw.elems[k], "") // placeholder - - return Encoder{ - p: pw, - k: k, - Idx: idx, - } -} - -// An Encoder provides methods for encoding an individual element's -// bitstream data. -type Encoder struct { - p *PkgEncoder - - Relocs []RelocEnt - RelocMap map[RelocEnt]uint32 - Data bytes.Buffer // accumulated element bitstream data - - encodingRelocHeader bool - - k RelocKind - Idx Index // index within relocation section -} - -// Flush finalizes the element's bitstream and returns its Index. -func (w *Encoder) Flush() Index { - var sb strings.Builder - - // Backup the data so we write the relocations at the front. - var tmp bytes.Buffer - io.Copy(&tmp, &w.Data) - - // TODO(mdempsky): Consider writing these out separately so they're - // easier to strip, along with function bodies, so that we can prune - // down to just the data that's relevant to go/types. - if w.encodingRelocHeader { - panic("encodingRelocHeader already true; recursive flush?") - } - w.encodingRelocHeader = true - w.Sync(SyncRelocs) - w.Len(len(w.Relocs)) - for _, rEnt := range w.Relocs { - w.Sync(SyncReloc) - w.Len(int(rEnt.Kind)) - w.Len(int(rEnt.Idx)) - } - - io.Copy(&sb, &w.Data) - io.Copy(&sb, &tmp) - w.p.elems[w.k][w.Idx] = sb.String() - - return w.Idx -} - -func (w *Encoder) checkErr(err error) { - if err != nil { - panicf("unexpected encoding error: %v", err) - } -} - -func (w *Encoder) rawUvarint(x uint64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutUvarint(buf[:], x) - _, err := w.Data.Write(buf[:n]) - w.checkErr(err) -} - -func (w *Encoder) rawVarint(x int64) { - // Zig-zag encode. - ux := uint64(x) << 1 - if x < 0 { - ux = ^ux - } - - w.rawUvarint(ux) -} - -func (w *Encoder) rawReloc(r RelocKind, idx Index) int { - e := RelocEnt{r, idx} - if w.RelocMap != nil { - if i, ok := w.RelocMap[e]; ok { - return int(i) - } - } else { - w.RelocMap = make(map[RelocEnt]uint32) - } - - i := len(w.Relocs) - w.RelocMap[e] = uint32(i) - w.Relocs = append(w.Relocs, e) - return i -} - -func (w *Encoder) Sync(m SyncMarker) { - if !w.p.SyncMarkers() { - return - } - - // Writing out stack frame string references requires working - // relocations, but writing out the relocations themselves involves - // sync markers. To prevent infinite recursion, we simply trim the - // stack frame for sync markers within the relocation header. - var frames []string - if !w.encodingRelocHeader && w.p.syncFrames > 0 { - pcs := make([]uintptr, w.p.syncFrames) - n := runtime.Callers(2, pcs) - frames = fmtFrames(pcs[:n]...) - } - - // TODO(mdempsky): Save space by writing out stack frames as a - // linked list so we can share common stack frames. - w.rawUvarint(uint64(m)) - w.rawUvarint(uint64(len(frames))) - for _, frame := range frames { - w.rawUvarint(uint64(w.rawReloc(RelocString, w.p.StringIdx(frame)))) - } -} - -// Bool encodes and writes a bool value into the element bitstream, -// and then returns the bool value. -// -// For simple, 2-alternative encodings, the idiomatic way to call Bool -// is something like: -// -// if w.Bool(x != 0) { -// // alternative #1 -// } else { -// // alternative #2 -// } -// -// For multi-alternative encodings, use Code instead. -func (w *Encoder) Bool(b bool) bool { - w.Sync(SyncBool) - var x byte - if b { - x = 1 - } - err := w.Data.WriteByte(x) - w.checkErr(err) - return b -} - -// Int64 encodes and writes an int64 value into the element bitstream. -func (w *Encoder) Int64(x int64) { - w.Sync(SyncInt64) - w.rawVarint(x) -} - -// Uint64 encodes and writes a uint64 value into the element bitstream. -func (w *Encoder) Uint64(x uint64) { - w.Sync(SyncUint64) - w.rawUvarint(x) -} - -// Len encodes and writes a non-negative int value into the element bitstream. -func (w *Encoder) Len(x int) { assert(x >= 0); w.Uint64(uint64(x)) } - -// Int encodes and writes an int value into the element bitstream. -func (w *Encoder) Int(x int) { w.Int64(int64(x)) } - -// Uint encodes and writes a uint value into the element bitstream. -func (w *Encoder) Uint(x uint) { w.Uint64(uint64(x)) } - -// Reloc encodes and writes a relocation for the given (section, -// index) pair into the element bitstream. -// -// Note: Only the index is formally written into the element -// bitstream, so bitstream decoders must know from context which -// section an encoded relocation refers to. -func (w *Encoder) Reloc(r RelocKind, idx Index) { - w.Sync(SyncUseReloc) - w.Len(w.rawReloc(r, idx)) -} - -// Code encodes and writes a Code value into the element bitstream. -func (w *Encoder) Code(c Code) { - w.Sync(c.Marker()) - w.Len(c.Value()) -} - -// String encodes and writes a string value into the element -// bitstream. -// -// Internally, strings are deduplicated by adding them to the strings -// section (if not already present), and then writing a relocation -// into the element bitstream. -func (w *Encoder) String(s string) { - w.StringRef(w.p.StringIdx(s)) -} - -// StringRef writes a reference to the given index, which must be a -// previously encoded string value. -func (w *Encoder) StringRef(idx Index) { - w.Sync(SyncString) - w.Reloc(RelocString, idx) -} - -// Strings encodes and writes a variable-length slice of strings into -// the element bitstream. -func (w *Encoder) Strings(ss []string) { - w.Len(len(ss)) - for _, s := range ss { - w.String(s) - } -} - -// Value encodes and writes a constant.Value into the element -// bitstream. -func (w *Encoder) Value(val constant.Value) { - w.Sync(SyncValue) - if w.Bool(val.Kind() == constant.Complex) { - w.scalar(constant.Real(val)) - w.scalar(constant.Imag(val)) - } else { - w.scalar(val) - } -} - -func (w *Encoder) scalar(val constant.Value) { - switch v := constant.Val(val).(type) { - default: - panicf("unhandled %v (%v)", val, val.Kind()) - case bool: - w.Code(ValBool) - w.Bool(v) - case string: - w.Code(ValString) - w.String(v) - case int64: - w.Code(ValInt64) - w.Int64(v) - case *big.Int: - w.Code(ValBigInt) - w.bigInt(v) - case *big.Rat: - w.Code(ValBigRat) - w.bigInt(v.Num()) - w.bigInt(v.Denom()) - case *big.Float: - w.Code(ValBigFloat) - w.bigFloat(v) - } -} - -func (w *Encoder) bigInt(v *big.Int) { - b := v.Bytes() - w.String(string(b)) // TODO: More efficient encoding. - w.Bool(v.Sign() < 0) -} - -func (w *Encoder) bigFloat(v *big.Float) { - b := v.Append(nil, 'p', -1) - w.String(string(b)) // TODO: More efficient encoding. -} - -// Version reports the version of the bitstream. -func (w *Encoder) Version() Version { return w.p.version } diff --git a/vendor/golang.org/x/tools/internal/pkgbits/flags.go b/vendor/golang.org/x/tools/internal/pkgbits/flags.go deleted file mode 100644 index 654222745fa..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/flags.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -const ( - flagSyncMarkers = 1 << iota // file format contains sync markers -) diff --git a/vendor/golang.org/x/tools/internal/pkgbits/reloc.go b/vendor/golang.org/x/tools/internal/pkgbits/reloc.go deleted file mode 100644 index fcdfb97ca99..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/reloc.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -// A RelocKind indicates a particular section within a unified IR export. -type RelocKind int32 - -// An Index represents a bitstream element index within a particular -// section. -type Index int32 - -// A relocEnt (relocation entry) is an entry in an element's local -// reference table. -// -// TODO(mdempsky): Rename this too. -type RelocEnt struct { - Kind RelocKind - Idx Index -} - -// Reserved indices within the meta relocation section. -const ( - PublicRootIdx Index = 0 - PrivateRootIdx Index = 1 -) - -const ( - RelocString RelocKind = iota - RelocMeta - RelocPosBase - RelocPkg - RelocName - RelocType - RelocObj - RelocObjExt - RelocObjDict - RelocBody - - numRelocs = iota -) diff --git a/vendor/golang.org/x/tools/internal/pkgbits/support.go b/vendor/golang.org/x/tools/internal/pkgbits/support.go deleted file mode 100644 index 50534a29553..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/support.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import "fmt" - -func assert(b bool) { - if !b { - panic("assertion failed") - } -} - -func panicf(format string, args ...any) { - panic(fmt.Errorf(format, args...)) -} diff --git a/vendor/golang.org/x/tools/internal/pkgbits/sync.go b/vendor/golang.org/x/tools/internal/pkgbits/sync.go deleted file mode 100644 index 1520b73afb9..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/sync.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "fmt" - "runtime" - "strings" -) - -// fmtFrames formats a backtrace for reporting reader/writer desyncs. -func fmtFrames(pcs ...uintptr) []string { - res := make([]string, 0, len(pcs)) - walkFrames(pcs, func(file string, line int, name string, offset uintptr) { - // Trim package from function name. It's just redundant noise. - name = strings.TrimPrefix(name, "cmd/compile/internal/noder.") - - res = append(res, fmt.Sprintf("%s:%v: %s +0x%v", file, line, name, offset)) - }) - return res -} - -type frameVisitor func(file string, line int, name string, offset uintptr) - -// walkFrames calls visit for each call frame represented by pcs. -// -// pcs should be a slice of PCs, as returned by runtime.Callers. -func walkFrames(pcs []uintptr, visit frameVisitor) { - if len(pcs) == 0 { - return - } - - frames := runtime.CallersFrames(pcs) - for { - frame, more := frames.Next() - visit(frame.File, frame.Line, frame.Function, frame.PC-frame.Entry) - if !more { - return - } - } -} - -// SyncMarker is an enum type that represents markers that may be -// written to export data to ensure the reader and writer stay -// synchronized. -type SyncMarker int - -//go:generate stringer -type=SyncMarker -trimprefix=Sync - -const ( - _ SyncMarker = iota - - // Public markers (known to go/types importers). - - // Low-level coding markers. - SyncEOF - SyncBool - SyncInt64 - SyncUint64 - SyncString - SyncValue - SyncVal - SyncRelocs - SyncReloc - SyncUseReloc - - // Higher-level object and type markers. - SyncPublic - SyncPos - SyncPosBase - SyncObject - SyncObject1 - SyncPkg - SyncPkgDef - SyncMethod - SyncType - SyncTypeIdx - SyncTypeParamNames - SyncSignature - SyncParams - SyncParam - SyncCodeObj - SyncSym - SyncLocalIdent - SyncSelector - - // Private markers (only known to cmd/compile). - SyncPrivate - - SyncFuncExt - SyncVarExt - SyncTypeExt - SyncPragma - - SyncExprList - SyncExprs - SyncExpr - SyncExprType - SyncAssign - SyncOp - SyncFuncLit - SyncCompLit - - SyncDecl - SyncFuncBody - SyncOpenScope - SyncCloseScope - SyncCloseAnotherScope - SyncDeclNames - SyncDeclName - - SyncStmts - SyncBlockStmt - SyncIfStmt - SyncForStmt - SyncSwitchStmt - SyncRangeStmt - SyncCaseClause - SyncCommClause - SyncSelectStmt - SyncDecls - SyncLabeledStmt - SyncUseObjLocal - SyncAddLocal - SyncLinkname - SyncStmt1 - SyncStmtsEnd - SyncLabel - SyncOptLabel - - SyncMultiExpr - SyncRType - SyncConvRTTI -) diff --git a/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go b/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go deleted file mode 100644 index 582ad56d3e0..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by "stringer -type=SyncMarker -trimprefix=Sync"; DO NOT EDIT. - -package pkgbits - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[SyncEOF-1] - _ = x[SyncBool-2] - _ = x[SyncInt64-3] - _ = x[SyncUint64-4] - _ = x[SyncString-5] - _ = x[SyncValue-6] - _ = x[SyncVal-7] - _ = x[SyncRelocs-8] - _ = x[SyncReloc-9] - _ = x[SyncUseReloc-10] - _ = x[SyncPublic-11] - _ = x[SyncPos-12] - _ = x[SyncPosBase-13] - _ = x[SyncObject-14] - _ = x[SyncObject1-15] - _ = x[SyncPkg-16] - _ = x[SyncPkgDef-17] - _ = x[SyncMethod-18] - _ = x[SyncType-19] - _ = x[SyncTypeIdx-20] - _ = x[SyncTypeParamNames-21] - _ = x[SyncSignature-22] - _ = x[SyncParams-23] - _ = x[SyncParam-24] - _ = x[SyncCodeObj-25] - _ = x[SyncSym-26] - _ = x[SyncLocalIdent-27] - _ = x[SyncSelector-28] - _ = x[SyncPrivate-29] - _ = x[SyncFuncExt-30] - _ = x[SyncVarExt-31] - _ = x[SyncTypeExt-32] - _ = x[SyncPragma-33] - _ = x[SyncExprList-34] - _ = x[SyncExprs-35] - _ = x[SyncExpr-36] - _ = x[SyncExprType-37] - _ = x[SyncAssign-38] - _ = x[SyncOp-39] - _ = x[SyncFuncLit-40] - _ = x[SyncCompLit-41] - _ = x[SyncDecl-42] - _ = x[SyncFuncBody-43] - _ = x[SyncOpenScope-44] - _ = x[SyncCloseScope-45] - _ = x[SyncCloseAnotherScope-46] - _ = x[SyncDeclNames-47] - _ = x[SyncDeclName-48] - _ = x[SyncStmts-49] - _ = x[SyncBlockStmt-50] - _ = x[SyncIfStmt-51] - _ = x[SyncForStmt-52] - _ = x[SyncSwitchStmt-53] - _ = x[SyncRangeStmt-54] - _ = x[SyncCaseClause-55] - _ = x[SyncCommClause-56] - _ = x[SyncSelectStmt-57] - _ = x[SyncDecls-58] - _ = x[SyncLabeledStmt-59] - _ = x[SyncUseObjLocal-60] - _ = x[SyncAddLocal-61] - _ = x[SyncLinkname-62] - _ = x[SyncStmt1-63] - _ = x[SyncStmtsEnd-64] - _ = x[SyncLabel-65] - _ = x[SyncOptLabel-66] - _ = x[SyncMultiExpr-67] - _ = x[SyncRType-68] - _ = x[SyncConvRTTI-69] -} - -const _SyncMarker_name = "EOFBoolInt64Uint64StringValueValRelocsRelocUseRelocPublicPosPosBaseObjectObject1PkgPkgDefMethodTypeTypeIdxTypeParamNamesSignatureParamsParamCodeObjSymLocalIdentSelectorPrivateFuncExtVarExtTypeExtPragmaExprListExprsExprExprTypeAssignOpFuncLitCompLitDeclFuncBodyOpenScopeCloseScopeCloseAnotherScopeDeclNamesDeclNameStmtsBlockStmtIfStmtForStmtSwitchStmtRangeStmtCaseClauseCommClauseSelectStmtDeclsLabeledStmtUseObjLocalAddLocalLinknameStmt1StmtsEndLabelOptLabelMultiExprRTypeConvRTTI" - -var _SyncMarker_index = [...]uint16{0, 3, 7, 12, 18, 24, 29, 32, 38, 43, 51, 57, 60, 67, 73, 80, 83, 89, 95, 99, 106, 120, 129, 135, 140, 147, 150, 160, 168, 175, 182, 188, 195, 201, 209, 214, 218, 226, 232, 234, 241, 248, 252, 260, 269, 279, 296, 305, 313, 318, 327, 333, 340, 350, 359, 369, 379, 389, 394, 405, 416, 424, 432, 437, 445, 450, 458, 467, 472, 480} - -func (i SyncMarker) String() string { - i -= 1 - if i < 0 || i >= SyncMarker(len(_SyncMarker_index)-1) { - return "SyncMarker(" + strconv.FormatInt(int64(i+1), 10) + ")" - } - return _SyncMarker_name[_SyncMarker_index[i]:_SyncMarker_index[i+1]] -} diff --git a/vendor/golang.org/x/tools/internal/pkgbits/version.go b/vendor/golang.org/x/tools/internal/pkgbits/version.go deleted file mode 100644 index 0db96527480..00000000000 --- a/vendor/golang.org/x/tools/internal/pkgbits/version.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -// Version indicates a version of a unified IR bitstream. -// Each Version indicates the addition, removal, or change of -// new data in the bitstream. -// -// These are serialized to disk and the interpretation remains fixed. -type Version uint32 - -const ( - // V0: initial prototype. - // - // All data that is not assigned a Field is in version V0 - // and has not been deprecated. - V0 Version = iota - - // V1: adds the Flags uint32 word - V1 - - // V2: removes unused legacy fields and supports type parameters for aliases. - // - remove the legacy "has init" bool from the public root - // - remove obj's "derived func instance" bool - // - add a TypeParamNames field to ObjAlias - // - remove derived info "needed" bool - V2 - - // V3: introduces a more compact format for composite literal element lists - // - negative lengths indicate that (some) elements may have keys - // - positive lengths indicate that no element has a key - // - a negative struct field index indicates an embedded field - V3 - - // V4: encodes generic methods as standalone function objects - V4 - - numVersions = iota -) - -// Field denotes a unit of data in the serialized unified IR bitstream. -// It is conceptually a like field in a structure. -// -// We only really need Fields when the data may or may not be present -// in a stream based on the Version of the bitstream. -// -// Unlike much of pkgbits, Fields are not serialized and -// can change values as needed. -type Field int - -const ( - // Flags in a uint32 in the header of a bitstream - // that is used to indicate whether optional features are enabled. - Flags Field = iota - - // Deprecated: HasInit was a bool indicating whether a package - // has any init functions. - HasInit - - // Deprecated: DerivedFuncInstance was a bool indicating - // whether an object was a function instance. - DerivedFuncInstance - - // ObjAlias has a list of TypeParamNames. - AliasTypeParamNames - - // Deprecated: DerivedInfoNeeded was a bool indicating - // whether a type was a derived type. - DerivedInfoNeeded - - // Composite literals use a more compact format for element lists. - CompactCompLiterals - - // Generic methods may appear as standalone function objects. - GenericMethods - - numFields = iota -) - -// introduced is the version a field was added. -var introduced = [numFields]Version{ - Flags: V1, - AliasTypeParamNames: V2, - CompactCompLiterals: V3, - GenericMethods: V4, -} - -// removed is the version a field was removed in or 0 for fields -// that have not yet been deprecated. -// (So removed[f]-1 is the last version it is included in.) -var removed = [numFields]Version{ - HasInit: V2, - DerivedFuncInstance: V2, - DerivedInfoNeeded: V2, -} - -// Has reports whether field f is present in a bitstream at version v. -func (v Version) Has(f Field) bool { - return introduced[f] <= v && (v < removed[f] || removed[f] == V0) -} diff --git a/vendor/golang.org/x/tools/internal/stdlib/deps.go b/vendor/golang.org/x/tools/internal/stdlib/deps.go deleted file mode 100644 index b049e5f9775..00000000000 --- a/vendor/golang.org/x/tools/internal/stdlib/deps.go +++ /dev/null @@ -1,550 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by generate.go. DO NOT EDIT. - -package stdlib - -type pkginfo struct { - name string - deps string // list of indices of dependencies, as varint-encoded deltas -} - -var deps = [...]pkginfo{ - {"archive/tar", "\x03|\x03F>\x01\n\x01&\x01\x01\x02\x05\b\x02\x01\x02\x02\r"}, - {"archive/zip", "\x02\x04k\x0e\x03\x12\x022>\x01-\x05\x01\x0f\x03\x02\x0f\x04"}, - {"bufio", "\x03|\x87\x01F\x15"}, - {"bytes", "\x7f*]\x03\fJ\x02\x02"}, - {"cmp", ""}, - {"compress/bzip2", "\x02\x02\x82\x02C"}, - {"compress/flate", "\x02}\x03\x84\x01\f\x034\x02\x03"}, - {"compress/gzip", "\x02\x04k\x0e\x03\x14pW"}, - {"compress/lzw", "\x02}\x03\x84\x01"}, - {"compress/zlib", "\x02\x04k\x0e\x03\x12\x01q"}, - {"container/heap", "\xca\x02"}, - {"container/list", ""}, - {"container/ring", ""}, - {"context", "\x7f]r\x01\x0e"}, - {"crypto", "\x94\x01rE"}, - {"crypto/aes", "\x10\v\v\xa5\x02"}, - {"crypto/cipher", "\x03#\x01\x01 \x13$+\\"}, - {"crypto/des", "\x10\x18 7+\xa1\x01\x03"}, - {"crypto/dsa", "H\x034\x87\x01\r"}, - {"crypto/ecdh", "\x03\v\r\x12\x04\x17\x03\x10$\x87\x01"}, - {"crypto/ecdsa", "\x0e\x05\x03\x05\x01\x12\b\v\x06\x01\x03\x0f\x01$\x87\x01\r\x05O\x01"}, - {"crypto/ed25519", "\x0e!\x12\a\x03\t\a$I>E"}, - {"crypto/elliptic", "6I\x87\x01\r;"}, - {"crypto/fips140", "%\x05\x9e\x01\x9b\x01"}, - {"crypto/hkdf", "2\x15\x017\x15"}, - {"crypto/hmac", "\x1b\x18\x14\x01\x139"}, - {"crypto/hpke", "\x03\v\x02\x03\x04\x01\x0e\x01\x05\x1f\x06\a\x01\x01%\x03\x12\x16\x9f\x01\x1d"}, - {"crypto/internal/boring", "\x0e\x02\x0ev"}, - {"crypto/internal/boring/bbig", "\x1b\xf8\x01P"}, - {"crypto/internal/boring/bcache", "\xcf\x02\x14"}, - {"crypto/internal/boring/sig", ""}, - {"crypto/internal/constanttime", ""}, - {"crypto/internal/cryptotest", "\x03\r\v\n%\x11\x1a\r\x12\x12!\x04\x06\n\x19\x01\x11\x11\x1d\x01\a\x03\x02\b\x02\x01\x05\f"}, - {"crypto/internal/cryptotest/wycheproof", "\x0e\x12T\x01\f\x01r@\x05\x03\x15\x10"}, - {"crypto/internal/cryptotest/x509limbo", "u\n\x03\xba\x01\x03\x1e"}, - {"crypto/internal/entropy", "M"}, - {"crypto/internal/entropy/v1.0.0", "F9\x96\x01:\x14"}, - {"crypto/internal/fips140", "E:\xc2\x01\v\x17"}, - {"crypto/internal/fips140/aes", "\x03\"\x03\x02\x14\x05\x01\x01\x055\x96\x016"}, - {"crypto/internal/fips140/aes/gcm", "%\x01\x02\x02\x02\x12\x05\x01\x065\x93\x01"}, - {"crypto/internal/fips140/alias", "\xe3\x02"}, - {"crypto/internal/fips140/bigmod", "*\x19\x01\x065\x96\x01"}, - {"crypto/internal/fips140/check", "%\x0e\a\t\x02\xc1\x01]"}, - {"crypto/internal/fips140/check/checktest", "*\x97\x02\""}, - {"crypto/internal/fips140/drbg", "\x03!\x01\x01\x04\x14\x05\n2\x87\x01\x0f9\x01"}, - {"crypto/internal/fips140/ecdh", "\x03\"\x05\x02\n\r<\x87\x01\x0f9"}, - {"crypto/internal/fips140/ecdsa", "\x03\"\x04\x01\x02\a\x03\x06C\x15r\x0f9"}, - {"crypto/internal/fips140/ed25519", "\x03\"\x05\x02\x04\fC\xcc\x01\x03"}, - {"crypto/internal/fips140/edwards25519", "\x1f\v\a\x12<\x96\x019"}, - {"crypto/internal/fips140/edwards25519/field", "*\x14\x05<\x96\x01"}, - {"crypto/internal/fips140/hkdf", "\x03\"\x05\t\aE\x15"}, - {"crypto/internal/fips140/hmac", "\x03\"\x15\x01\x01C\x15"}, - {"crypto/internal/fips140/mldsa", "\x03\x1c\x06\x05\x02\x0e\x01\x03\x05<\x96\x019"}, - {"crypto/internal/fips140/mlkem", "\x03\"\x05\x02\x0f\x03\x05<\xcf\x01"}, - {"crypto/internal/fips140/nistec", "\x1f\v\r\f<\x96\x01,\r\x15"}, - {"crypto/internal/fips140/nistec/fiat", "*\x14A\x96\x01"}, - {"crypto/internal/fips140/pbkdf2", "\x03\"\x05\t\aE\x15"}, - {"crypto/internal/fips140/rsa", "\x03\x1c\x06\x04\x01\x02\x0e\x01\x01\x02A\x15rH"}, - {"crypto/internal/fips140/sha256", "\x03\"\x1e\x01\x065\x15\x81\x01"}, - {"crypto/internal/fips140/sha3", "\x03\"\x19\x05\x01;\x96\x01N"}, - {"crypto/internal/fips140/sha512", "\x03\"\x1e\x01\x065\x15\x81\x01"}, - {"crypto/internal/fips140/ssh", "*j"}, - {"crypto/internal/fips140/subtle", "\x1f\t\x1b\xd2\x01"}, - {"crypto/internal/fips140/tls12", "\x03\"\x05\t\a\x02C\x15"}, - {"crypto/internal/fips140/tls13", "\x03\"\x05\b\b\t<\x15"}, - {"crypto/internal/fips140cache", "\xc1\x02\r."}, - {"crypto/internal/fips140deps", ""}, - {"crypto/internal/fips140deps/byteorder", "\xaa\x01"}, - {"crypto/internal/fips140deps/cpu", "\xbf\x01\b"}, - {"crypto/internal/fips140deps/godebug", "\xc8\x01"}, - {"crypto/internal/fips140deps/time", "\xe3\x02"}, - {"crypto/internal/fips140hash", ";\x1e;\xcf\x01"}, - {"crypto/internal/fips140only", "\x17\x15\x0e\x01\x01Xr"}, - {"crypto/internal/fips140test", ""}, - {"crypto/internal/impl", "\xcc\x02"}, - {"crypto/internal/rand", "\x1b\x11 |>]"}, - {"crypto/internal/randutil", "\x86\x02\x12"}, - {"crypto/internal/sysrand", "\x7fr!\"\r\r\x01\x01\r\x06"}, - {"crypto/internal/sysrand/internal/seccomp", "\x7f"}, - {"crypto/md5", "\x0e:7\x15\x16k"}, - {"crypto/mldsa", "\x0e&K\x87\x01"}, - {"crypto/mlkem", "\x0e'"}, - {"crypto/mlkem/mlkemtest", "5\x13\t."}, - {"crypto/pbkdf2", "8\x0f\x017\x15"}, - {"crypto/rand", "\x1b\x11\x1c\x034\x87\x01\rP"}, - {"crypto/rc4", "( 7\xcc\x01"}, - {"crypto/rsa", "\x0e\r\x01\r\x10\x0e\x01\x03\t\a$\x03\x124>\f\x01"}, - {"crypto/sha1", "\x0e\r-\x025\x15\x16\x15V"}, - {"crypto/sha256", "\x0e\r\x1fZ"}, - {"crypto/sha3", "\x0e-Y\xcf\x01"}, - {"crypto/sha512", "\x0e\r!X"}, - {"crypto/subtle", "\x1f\x1f\xa9\x01|"}, - {"crypto/tls", "\x03\b\x02\x01\x01\x01\x01\x02\x01\x01\x01\x01\x01\x01\x01\x01\v\x01\x18\x01\x0f\x01\x01\x03\x01\x01\x01\x01\x02\x01\x02\x01\x1f\x02\x03\x12\x16\x15\t>\x16\x18\r\b\x01\x01\x01\x02\x01\x0e\x06\x03\x01\x15"}, - {"crypto/tls/internal/fips140tls", "\x17\xb8\x02"}, - {"crypto/x509", "\x03\v\x01\x01\x01\x01\x01\x01\x01\x01\x018\x01\x06\x01\x01\x02\x05\x0f\x06\t\x02\x03F\x03;\x01\x02\b\x01\x01\x02\a\x12\x05\x01\x06\a\b\x02\x01\x02\x0f\x02\x01\x01\x02\x04\x01"}, - {"crypto/x509/pkix", "n\x06\x0e\x91\x019\x11"}, - {"database/sql", "\x03\nT\x01\x1d\x03\x84\x01\v\a$\x05\b\x02\x03\x01\x0e\x02\x02\x02\x01"}, - {"database/sql/driver", "\rU\x1d\x03\xba\x01\x0f\x12\a"}, - {"database/sql/internal", ""}, - {"debug/buildinfo", "\x03b\x02\x01\x01\b\x0e\x03h\x1a\x02\x01-\x0f "}, - {"debug/dwarf", "\x03n\x0e\x03\x84\x013\x11\x01\x01"}, - {"debug/elf", "\x03\x06[\r\x0e\x03h\x1b\x01\f\"\x17\x01\x17"}, - {"debug/gosym", "\x03n\x11#\xa5\x01\x01\x01\x02"}, - {"debug/macho", "\x03\x06[\r\x11h\x1c.\x17\x01"}, - {"debug/pe", "\x03\x06[\r\x0e\x03h\x1c.\x17\x01\x17"}, - {"debug/plan9obj", "q\x0e\x03h\x1c."}, - {"embed", "\x7f*D\x19\x01V"}, - {"embed/internal/embedtest", ""}, - {"encoding", ""}, - {"encoding/ascii85", "\x86\x02E"}, - {"encoding/asn1", "\x03|\x03h(\x01)\r\x02\x01\x11\x03\x01"}, - {"encoding/base32", "\x86\x02C\x02"}, - {"encoding/base64", "\xaa\x01\\C\x02"}, - {"encoding/binary", "\x7f\x87\x01\f*\r\x05"}, - {"encoding/csv", "\x02\x01|\x03\x84\x01F\x13\x02"}, - {"encoding/gob", "\x02j\x05\x0e\x03h\x1c\v\x01\x03\x1f\b\x12\x01\x10\x02"}, - {"encoding/hex", "\x7f\x03\x84\x01C\x03"}, - {"encoding/json", "\x03\x01h\n\x01\x01\x02\x01\x01\x03\x03\x84\x016\x0f\x01"}, - {"encoding/json/internal", "\x7f"}, - {"encoding/json/internal/jsonflags", "v"}, - {"encoding/json/internal/jsonopts", "v\x01"}, - {"encoding/json/internal/jsontest", "\x03g\x15\x03\x83\x01\x01\x012\b\b\x03\x02\x0f"}, - {"encoding/json/internal/jsonwire", "\x04s\b\x87\x01\f7\x02\x01\x13\x01\x01"}, - {"encoding/json/jsontext", "\x03s\x01\x01\x02\x05\x87\x01\x03\t\x034\x02\x01\x02\x13"}, - {"encoding/json/v2", "\x03\x01h\x03\x01\x01\x03\x02\x01\x01\x02\x01\x04\x03\x84\x01\f\x03'\r\x02\x01\x02\x0f\x02\x02"}, - {"encoding/pem", "\x03m\x0f\x87\x01C\x03"}, - {"encoding/xml", "\x02\x01i\x13\x03\x84\x016\x05\n\x01\x02\x11\x02"}, - {"errors", "\xdc\x01\x87\x01"}, - {"expvar", "uSB\b\v\x17\r\b\x02\x03\x01\x12"}, - {"flag", "l\x13\x03\x84\x01.\b\x05\b\x02\x01\x11"}, - {"fmt", "\x7fE)\x19\f\"\b\r\x02\x03\x13"}, - {"go/ast", "\x03\x01~\x0e\x01u\x03+\b\r\x02\x01\x13\x02"}, - {"go/build", "\x02\x01|\x03\x01\x02\x02\a\x02\x01\x17 \x04\x02\t\x1c\x13\x01-\x01\x04\x01\a\b\x02\x01\x13\x02\x02"}, - {"go/build/constraint", "\x7f\xcc\x01\x01\x13\x02"}, - {"go/constant", "\x82\x01\x0f\x81\x01\x01\x026\x01\x02\x13"}, - {"go/doc", "\x04~\x01\x05\t>73\x10\x02\x01\x13\x02"}, - {"go/doc/comment", "\x03\x7f\xc7\x01\x01\x01\x01\x13\x02"}, - {"go/format", "\x03\x7f\x01\v\x01\x02uF"}, - {"go/importer", "\x84\x01\a\x01\x01\x04\x01t;"}, - {"go/internal/gccgoimporter", "\x02\x01b\x1a\x03\x04\v\x01r\x02.\x01\x05\x11\x01\r\b"}, - {"go/internal/gcimporter", "\x02\x80\x01\x0f\x010\x140.\x15\x03\x02"}, - {"go/internal/srcimporter", "\x82\x01\x01\x01\n\x03\x01t.\x01\x05\x12\x02\x15"}, - {"go/parser", "\x03|\x03\x01\x02\v\x01u\x01-\x06\x12"}, - {"go/printer", "\x82\x01\x01\x02\x03\tu\f\"\x15\x02\x01\x02\f\x05\x02"}, - {"go/scanner", "\x03\x7f\x0fu4\x10\x01\x14\x02"}, - {"go/token", "\x04~\x87\x01@\x02\x03\x01\x10\x02"}, - {"go/types", "\x03\x01\x06u\x03\x01\x03\b\x03\x02\x0654\x04\x03\t\"\x06\a\b\x01\x01\x01\x02\x01\x10\x02\x02"}, - {"go/version", "\xcd\x01\x7f"}, - {"hash", "\x86\x02"}, - {"hash/adler32", "\x7f\x15\x16"}, - {"hash/crc32", "\x7f\x15\x16\x15\x8f\x01\x01\x14"}, - {"hash/crc64", "\x7f\x15\x16\xa4\x01"}, - {"hash/fnv", "\x7f\x15\x16k"}, - {"hash/maphash", "\x94\x01\x11>\x80\x01"}, - {"html", "\xcc\x02\x02\x13"}, - {"html/template", "\x03r\r\x18.>\x01\n#\x05\x01\x02\x03\n\x02\x01\x02\r\x01\x03\x02"}, - {"image", "\x02}\x1ei\x0f6\x03\x01"}, - {"image/color", ""}, - {"image/color/palette", "\x9d\x01"}, - {"image/draw", "\x9c\x01\x01\x04"}, - {"image/gif", "\x02\x01\x05w\x03\x1a\x01\x01\x01\v\\\x0f"}, - {"image/internal/imageutil", "\x9c\x01"}, - {"image/jpeg", "\x02}\x1d\x01\x04e"}, - {"image/png", "\x02\ah\x11\x12\x02\x06\x01iE"}, - {"index/suffixarray", "\x03n\x0e\x87\x01\f-\n\x01"}, - {"internal/abi", "\xc7\x01\x9c\x01"}, - {"internal/asan", "\xe3\x02"}, - {"internal/bisect", "\xc1\x02\r\x01"}, - {"internal/buildcfg", "\x82\x01Hj\x06\x02\x05\n\x01"}, - {"internal/bytealg", "\xbf\x01\xa4\x01"}, - {"internal/byteorder", ""}, - {"internal/cfg", ""}, - {"internal/cgrouptest", "\x82\x01\\V\x06\x0f\x02\x01\x04\x01"}, - {"internal/chacha8rand", "\xaa\x01\x15\b\x9c\x01"}, - {"internal/copyright", ""}, - {"internal/coverage", ""}, - {"internal/coverage/calloc", ""}, - {"internal/coverage/cfile", "u\r\x16\x17\x01\x02\x01\x01\x01\x01\x01\x01\x01$\x02'.\x06\a\n\x01\x03\x0e\x06"}, - {"internal/coverage/cformat", "\x04~-\x04S\v8\x01\x02\x0e"}, - {"internal/coverage/cmerge", "\x82\x01-c"}, - {"internal/coverage/decodecounter", "q\x11-\v\x02J.\x17\x18"}, - {"internal/coverage/decodemeta", "\x02o\x11\x16\x17\v\x02J."}, - {"internal/coverage/encodecounter", "\x02o\x11-\f\x01\x02H\v#\x15"}, - {"internal/coverage/encodemeta", "\x02\x01n\x11\x12\x04\x17\r\x02H./"}, - {"internal/coverage/pods", "\x04~-\x85\x01\x06\x05\n\x02\x01"}, - {"internal/coverage/rtcov", "\xe3\x02"}, - {"internal/coverage/slicereader", "q\x11\x84\x01]"}, - {"internal/coverage/slicewriter", "\x82\x01\x84\x01"}, - {"internal/coverage/stringtab", "\x82\x018\x04H"}, - {"internal/coverage/test", ""}, - {"internal/coverage/uleb128", ""}, - {"internal/cpu", "\xe3\x02"}, - {"internal/dag", "\x04~\xc7\x01\x03"}, - {"internal/diff", "\x03\x7f\xc8\x01\x02"}, - {"internal/exportdata", "\x02\x01|\x03\x02f\x1c.\x01\x05\x11\x01\x02"}, - {"internal/filepathlite", "\x7f*D\x1aB"}, - {"internal/fmtsort", "\x04\xb8\x02\r"}, - {"internal/fuzz", "\x03\nK\x19\x04\n\x03\x01\v\x037>\f\x03\x1f\x01\x05\x02\x05\n\x01\x02\x01\x01\r\x04\x02"}, - {"internal/gate", "\r"}, - {"internal/goarch", ""}, - {"internal/godebug", "\xa7\x01\"\x85\x01\x01\x14"}, - {"internal/godebugs", ""}, - {"internal/goexperiment", ""}, - {"internal/goos", ""}, - {"internal/goroot", "\xb4\x02\x01\x05\x12\x02"}, - {"internal/gover", "\x04"}, - {"internal/goversion", ""}, - {"internal/lazyregexp", "\xb4\x02\v\r\x02"}, - {"internal/lazytemplate", "\x86\x02.\x18\x02\r"}, - {"internal/msan", "\xe3\x02"}, - {"internal/nettest", "\x03\nrG@\f\n\x12\x06\x15\x05\x0f"}, - {"internal/nettrace", ""}, - {"internal/obscuretestdata", "p\x96\x01."}, - {"internal/oserror", "\x7f"}, - {"internal/pkgbits", "\x03U\x19\x0e\x03\x04\vu\r!\r\n\x01"}, - {"internal/platform", ""}, - {"internal/poll", "\x7fm\x05\x15;\r\x01\x01\r\x06"}, - {"internal/profile", "\x03\x04x\x03\x84\x019\n\x01\x01\x01\x11"}, - {"internal/profilerecord", ""}, - {"internal/race", "\xa5\x01\xbe\x01"}, - {"internal/reflectlite", "\xa5\x01\"<>\""}, - {"internal/runtime/atomic", "\xc7\x01\x9c\x01"}, - {"internal/runtime/cgroup", "\xa9\x01?\x04w"}, - {"internal/runtime/exithook", "\xdd\x01\x86\x01"}, - {"internal/runtime/gc", "\xc7\x01"}, - {"internal/runtime/gc/internal/gen", "\ng\x11\x17m\x04\v\x1f\b\x10\x02"}, - {"internal/runtime/gc/scan", "\xbf\x01\b\x19\a|"}, - {"internal/runtime/maps", "\xa5\x01\x01\x04\x15\b\x03\a\n\t\x03.N"}, - {"internal/runtime/math", "\xc7\x01"}, - {"internal/runtime/pprof/label", ""}, - {"internal/runtime/startlinetest", ""}, - {"internal/runtime/sys", "\xc7\x01\x04"}, - {"internal/runtime/syscall/linux", "\xc7\x01\x9c\x01"}, - {"internal/runtime/wasitest", ""}, - {"internal/saferio", "\x86\x02]"}, - {"internal/singleflight", "\xce\x02"}, - {"internal/strconv", "\x95\x02N"}, - {"internal/stringslite", "\xa9\x01\xba\x01"}, - {"internal/sync", "\xa5\x01\"\x14t\x14"}, - {"internal/synctest", "\xa5\x01\xbe\x01"}, - {"internal/syscall/execenv", "\xd0\x02"}, - {"internal/syscall/unix", "\xec\x01U\x0e\x01\x13"}, - {"internal/sysinfo", "\x02\x01\xbc\x01G.\x18\x02"}, - {"internal/syslist", ""}, - {"internal/testenv", "\x03\nr\x02\x01)\x1c\x100-\x01\x05\a\n\x01\x02\x02\x01\f"}, - {"internal/testhash", "\x03\x91\x01r\x11:\f"}, - {"internal/testlog", "\xce\x02\x01\x14"}, - {"internal/testpty", "\x7f\x03\xb2\x01"}, - {"internal/trace", "\x02\x01\x01\x06g\x0e\x03x\x03\x03\x06\x03\t-\n\x01\x01\x01\x11\x06"}, - {"internal/trace/internal/testgen", "\x03n\x11v\x03\x02\x03\x013\v\r\x11"}, - {"internal/trace/internal/tracev1", "\x03\x01m\x0e\x03~\x06\f7\x01"}, - {"internal/trace/raw", "\x02o\x11{\x03\x06E\x01\x13"}, - {"internal/trace/testtrace", "\x02\x01|\x03r\x04\x03\x05\x01\x05.\v\x02\b\x02\x01\x05"}, - {"internal/trace/tracev2", ""}, - {"internal/trace/traceviewer", "\x02h\v\r\x19>\x1f\a\a\x04\b\v\x17\x01\x05\a\n\x01\x02\x0f"}, - {"internal/trace/traceviewer/format", ""}, - {"internal/trace/version", "\x82\x01{\t"}, - {"internal/txtar", "\x03\x7f\xb2\x01\x18"}, - {"internal/types/errors", "\xcb\x02"}, - {"internal/unsafeheader", "\xe3\x02"}, - {"internal/xcoff", "d\r\x0e\x03h\x1c.\x17\x01"}, - {"internal/zstd", "q\x0e\x03\x84\x01\x0f"}, - {"io", "\x7f\xcf\x01"}, - {"io/fs", "\x7f*,13\x10\x14\x04"}, - {"io/ioutil", "\x86\x02\x01-\x15\x03"}, - {"iter", "\xdb\x01f\""}, - {"log", "\x82\x01\x84\x01\x05)\r\r\x01\x0e"}, - {"log/internal", ""}, - {"log/slog", "\x03\n_\t\n\x03H<\x04\x01\x02\x02\x03*\x05\b\x02\x01\x02\x01\x0e\x02\x02\x02"}, - {"log/slog/internal", ""}, - {"log/slog/internal/benchmarks", "\rr\x03\x84\x01\x06\x03<\x12"}, - {"log/slog/internal/buffer", "\xce\x02"}, - {"log/syslog", "\x7f\x03\x88\x01\x12\x18\x18\x02\x0f"}, - {"maps", "\x89\x02Z"}, - {"math", "\xbf\x01VN"}, - {"math/big", "\x03|\x03(\x15G\f\x03\x022\x02\x01\x02\x15"}, - {"math/big/internal/asmgen", "\x03\x01~\x93\x014\x03"}, - {"math/bits", "\xe3\x02"}, - {"math/cmplx", "\x92\x02\x03"}, - {"math/rand", "\xc8\x01J<\x01\x14"}, - {"math/rand/v2", "\x7f+\x03e\x03N"}, - {"mime", "\x02\x01m\x0f\x03\x84\x01\v#\x15\x03\x02\x11\x02"}, - {"mime/multipart", "\x02\x01Q+\x03F>\v\x01\a\x02\x17\x02\x06\x0f\x02\x01\x17"}, - {"mime/quotedprintable", "\x02\x01\x7f\x84\x01"}, - {"net", "\x04\tr*\x1f\v\x05\x13\x01\x01\x04\x15\x01'\x06\r\b\x05\x01\x01\r\x06\t"}, - {"net/http", "\x02\x01\x03\x01\x04\x02O\x14\x0f\x03F>\x01\x03\a\x01\x06\x01\x01\x02\x06\x02\x01\x01\f\x01\x01\x05\x01\x02\x05\b\x01\x01\x01\x02\x01\x0e\x02\x02\x02\n\x01\x03"}, - {"net/http/cgi", "\x02Z#\x03\x84\x01\x04\a\v\x01\x15\x01\x01\x01\x04\x01\x05\x02\b\x02\x01\x11\x10"}, - {"net/http/cookiejar", "\x04{\x03\x9a\x01\x01\b\t\x05\x16\x03\x02\x0f\x04"}, - {"net/http/fcgi", "\x02\x01\nd\x0e\x03\x84\x01\x16\x01\x01\x16\x18\x02\x0f"}, - {"net/http/httptest", "\x02\x01\nO\x02#\x01P4\x04\x12\x01\f\t\x02\r\n\x01\x02\x03\f\x06\n"}, - {"net/http/httptrace", "\rOwI\x16+"}, - {"net/http/httputil", "\x02\x01\nr\x03F>\x04\x0f\x03\x01\x05\x02\x01\r\x01\x19\x02\x0f\x10"}, - {"net/http/internal", "\x02\x01n\x0e\x03\x84\x01"}, - {"net/http/internal/ascii", "\xcc\x02\x13"}, - {"net/http/internal/http2", "\x02\x01\x03\x01\x06G\b\x15\x0e\x03\x84\x01\x01\x03\b\x03\x02\x03\x02\x06\x02\x03\x01\n\x01\x01\b\x05\b\x02\x01\x02\x01\x0e\x10\x02\x02"}, - {"net/http/internal/httpcommon", "\rr\x03\xa0\x01\x10\x01\x17\x01\x01\x02\x1f\x02"}, - {"net/http/internal/httpsfv", "\xc9\x02\x02\x01\x11\x04"}, - {"net/http/internal/testcert", "\xcc\x02"}, - {"net/http/pprof", "\x02\x01\nu\x18.\x11-\x04\x13\x16\x01\r\x04\x03\x01\x02\x01\x11"}, - {"net/internal/cgotest", ""}, - {"net/internal/socktest", "\x82\x01\xcc\x01\x02"}, - {"net/mail", "\x02}\x03\x84\x01\x04\x0f\x03\x16\x1a\x02\x0f\x04"}, - {"net/netip", "\x04{*\x01h\x036\x17"}, - {"net/rpc", "\x02q\f\x03\x0f\nk\x04\x12\x01\x1f\r\x03\x02"}, - {"net/rpc/jsonrpc", "u\n\x03\x84\x01\x16\x13\x1f"}, - {"net/smtp", "\x196\r\x14\x0f\x03\x84\x01\x16\x16\x1a"}, - {"net/textproto", "\x02\x01|\x03\x84\x01\f\n/\x01\x02\x15"}, - {"net/url", "\x7f\x03Ff\v\x10\x02\x01\x17"}, - {"os", "\x7f*\x01\x19\x04\x11\x14\x01\x03\x01\x05\x10\x01:\b\x05\x01\x01\r\x06"}, - {"os/exec", "\x03\nrI(\x01\x15\x01-\x06\a\n\x01\x03\x01\r"}, - {"os/exec/internal/fdtest", "\xd0\x02"}, - {"os/signal", "\r\xa7\x02\x15\x05\x02"}, - {"os/user", "\x02\x01|\x03\x84\x01.\r\n\x01\x02"}, - {"path", "\x7f*\xb8\x01"}, - {"path/filepath", "\x7f*\x1aD-\r\b\x03\x04\x11"}, - {"plugin", "\x7f"}, - {"reflect", "\x7f&\x04\x1e\x03\x11\b\x04\x05\x17\x06\t/\n\x03\x11\x02\x02"}, - {"reflect/internal/example1", ""}, - {"reflect/internal/example2", ""}, - {"regexp", "\x03\x83\x02\x037\t\x02\x01\x02\x11\x02"}, - {"regexp/syntax", "\xc9\x02\x01\x01\x01\x02\x11\x02"}, - {"runtime", "\xa5\x01\x04\x01\x03\f\x06\b\x02\x01\x01\x0f\x03\x01\x01\x01\x02\x01\x01\x01\x02\x01\x04\x01\x10\x18N"}, - {"runtime/coverage", "\xb1\x01U"}, - {"runtime/debug", "\x82\x01V\\\r\b\x02\x01\x11\x06"}, - {"runtime/metrics", "\xc9\x01I/\""}, - {"runtime/pprof", "\x02\x01\x01\x03\x06d\x0e\x03#5\v!\f\"\r\b\x01\x01\x01\x02\x02\n\x03\x06"}, - {"runtime/race", "\xc7\x02"}, - {"runtime/race/internal/amd64v1", ""}, - {"runtime/trace", "\rr\x03{\t;\b\x05\x01\x0e\x06"}, - {"slices", "\x04\x85\x02\fN"}, - {"sort", "\xdc\x0194"}, - {"strconv", "\x7f*C\x01t"}, - {"strings", "\x7f&\x04D\x19\x03\f9\x11\x02\x02"}, - {"structs", ""}, - {"sync", "\xdb\x01\x02\x11\x01R\x0e\x14"}, - {"sync/atomic", "\xe3\x02"}, - {"syscall", "\x7f'\x03\x01\x1d\n\x04\x06\r\x04U\b\x05\x01\x14"}, - {"testing", "\x03\nr\x02\x01Y\x17\x14\f\x05\x1d\x06\x02\x05\x02\x05\x01\x02\x01\x02\x01\x0e\x02\x04"}, - {"testing/cryptotest", "TV\\\x126\x03\x12"}, - {"testing/fstest", "\x7f\x03\x84\x01\x01\n(\x10\x03\t\b"}, - {"testing/internal/testdeps", "\x02\v\xb8\x011\x10.\x03\x05\x03\x06\a\x02\x0f"}, - {"testing/iotest", "\x03|\x03\x84\x01\x04"}, - {"testing/quick", "\x81\x01\x01\x90\x01\x05%\x10\x11"}, - {"testing/slogtest", "\rr\x03\x8a\x010\x05\x10\f"}, - {"testing/synctest", "\xef\x01b\f\x06"}, - {"text/scanner", "\x03\x7f\x84\x01.+\x02"}, - {"text/tabwriter", "\x82\x01\x84\x01["}, - {"text/template", "\x7f\x03BB\x01\n\"\x01\x05\x01\x02\x05\v\x02\x0e\x03\x02"}, - {"text/template/parse", "\x03\x7f\xbf\x01\n\x01\x13\x02"}, - {"time", "\x7f*D(,\r\x02\x13"}, - {"time/tzdata", "\x7f\xd1\x01\x13"}, - {"unicode", ""}, - {"unicode/utf16", ""}, - {"unicode/utf8", ""}, - {"unique", "\xa5\x01\"&\x01S\r\x01\x14\x19"}, - {"unsafe", ""}, - {"uuid", "\x03\x01P\x1d\x03\v\xcf\x01\x0f"}, - {"vendor/golang.org/x/crypto/chacha20", "\x10a\x0e\x96\x01,)"}, - {"vendor/golang.org/x/crypto/chacha20poly1305", "\x10\aZ\x0e\xe6\x01\x05\x01\f"}, - {"vendor/golang.org/x/crypto/cryptobyte", "n\x11\x03\x91\x01)!\v"}, - {"vendor/golang.org/x/crypto/cryptobyte/asn1", ""}, - {"vendor/golang.org/x/crypto/hkdf", "\x18\x01f\x15r"}, - {"vendor/golang.org/x/crypto/internal/alias", "\xe3\x02"}, - {"vendor/golang.org/x/crypto/internal/poly1305", "[\x16\xa4\x01"}, - {"vendor/golang.org/x/net/dns/dnsmessage", "\x7f\xca\x01"}, - {"vendor/golang.org/x/net/http/httpguts", "\x9c\x02\x16\x1a\x15\x10"}, - {"vendor/golang.org/x/net/http/httpproxy", "\x7f\x03\x9a\x01\x12\x05\x01\x18\x15\x10"}, - {"vendor/golang.org/x/net/http2/hpack", "\x03|\x03\x84\x01H"}, - {"vendor/golang.org/x/net/http3", "\x9d\x02@\x06\x0f\x04"}, - {"vendor/golang.org/x/net/idna", "\x82\x01\x90\x01:\x13\x02\x17\x02\x01"}, - {"vendor/golang.org/x/net/internal/http3", "\rO#\x03\x84\x01\v\x04\a\x01\x05\x10\x01\x16\x02\x01\x02\x0f\x10\x02\x04\x03"}, - {"vendor/golang.org/x/net/internal/httpcommon", "\rr\x03\xa0\x01\x10\x01\x17\x01\x01\x02\x1f\x02"}, - {"vendor/golang.org/x/net/internal/quic/quicwire", "q"}, - {"vendor/golang.org/x/net/nettest", "\x03n\x0e\x03\x84\x01\x11\x05\x18\x01\f\n\x01\x02\x02\x01\f"}, - {"vendor/golang.org/x/net/quic", "\x03\n\x01\x01\x01\t;\x04\x04\x15\x03\v\x03\x12r\x06\x06\x06\x04\x12\x06\x15\x02\x01\x02\x01\x01\r\x06\x02\x01\x01\x02\v"}, - {"vendor/golang.org/x/sys/cpu", "\xb4\x02\r\n\x01\x17"}, - {"vendor/golang.org/x/text/secure/bidirule", "\x7f\xe2\x01\x18\x01"}, - {"vendor/golang.org/x/text/transform", "\x03|\x87\x01["}, - {"vendor/golang.org/x/text/unicode/bidi", "\x03\bw\x88\x01@\x17"}, - {"vendor/golang.org/x/text/unicode/norm", "q\x11\x84\x01H\x13\x18"}, - {"weak", "\xa5\x01\x9c\x01\""}, -} - -// bootstrap is the list of bootstrap packages extracted from cmd/dist. -var bootstrap = map[string]bool{ - "cmp": true, - "cmd/asm": true, - "cmd/asm/internal/arch": true, - "cmd/asm/internal/asm": true, - "cmd/asm/internal/flags": true, - "cmd/asm/internal/lex": true, - "cmd/cgo": true, - "cmd/compile": true, - "cmd/compile/internal/abi": true, - "cmd/compile/internal/abt": true, - "cmd/compile/internal/amd64": true, - "cmd/compile/internal/arm": true, - "cmd/compile/internal/arm64": true, - "cmd/compile/internal/base": true, - "cmd/compile/internal/bitvec": true, - "cmd/compile/internal/bloop": true, - "cmd/compile/internal/compare": true, - "cmd/compile/internal/coverage": true, - "cmd/compile/internal/deadlocals": true, - "cmd/compile/internal/devirtualize": true, - "cmd/compile/internal/dwarfgen": true, - "cmd/compile/internal/escape": true, - "cmd/compile/internal/gc": true, - "cmd/compile/internal/importer": true, - "cmd/compile/internal/inline": true, - "cmd/compile/internal/inline/inlheur": true, - "cmd/compile/internal/inline/interleaved": true, - "cmd/compile/internal/ir": true, - "cmd/compile/internal/liveness": true, - "cmd/compile/internal/logopt": true, - "cmd/compile/internal/loong64": true, - "cmd/compile/internal/loopvar": true, - "cmd/compile/internal/midway": true, - "cmd/compile/internal/mips": true, - "cmd/compile/internal/mips64": true, - "cmd/compile/internal/noder": true, - "cmd/compile/internal/objw": true, - "cmd/compile/internal/pgoir": true, - "cmd/compile/internal/pkginit": true, - "cmd/compile/internal/ppc64": true, - "cmd/compile/internal/rangefunc": true, - "cmd/compile/internal/reflectdata": true, - "cmd/compile/internal/riscv64": true, - "cmd/compile/internal/rttype": true, - "cmd/compile/internal/s390x": true, - "cmd/compile/internal/slice": true, - "cmd/compile/internal/ssa": true, - "cmd/compile/internal/ssagen": true, - "cmd/compile/internal/staticdata": true, - "cmd/compile/internal/staticinit": true, - "cmd/compile/internal/syntax": true, - "cmd/compile/internal/test": true, - "cmd/compile/internal/typebits": true, - "cmd/compile/internal/typecheck": true, - "cmd/compile/internal/types": true, - "cmd/compile/internal/types2": true, - "cmd/compile/internal/walk": true, - "cmd/compile/internal/wasm": true, - "cmd/compile/internal/x86": true, - "cmd/internal/archive": true, - "cmd/internal/bio": true, - "cmd/internal/codesign": true, - "cmd/internal/dwarf": true, - "cmd/internal/edit": true, - "cmd/internal/gcprog": true, - "cmd/internal/goobj": true, - "cmd/internal/hash": true, - "cmd/internal/macho": true, - "cmd/internal/obj": true, - "cmd/internal/obj/arm": true, - "cmd/internal/obj/arm64": true, - "cmd/internal/obj/loong64": true, - "cmd/internal/obj/mips": true, - "cmd/internal/obj/ppc64": true, - "cmd/internal/obj/riscv": true, - "cmd/internal/obj/s390x": true, - "cmd/internal/obj/wasm": true, - "cmd/internal/obj/x86": true, - "cmd/internal/objabi": true, - "cmd/internal/par": true, - "cmd/internal/pgo": true, - "cmd/internal/pkgpath": true, - "cmd/internal/quoted": true, - "cmd/internal/src": true, - "cmd/internal/sys": true, - "cmd/internal/telemetry": true, - "cmd/internal/telemetry/counter": true, - "cmd/link": true, - "cmd/link/internal/amd64": true, - "cmd/link/internal/arm": true, - "cmd/link/internal/arm64": true, - "cmd/link/internal/benchmark": true, - "cmd/link/internal/dwtest": true, - "cmd/link/internal/ld": true, - "cmd/link/internal/loadelf": true, - "cmd/link/internal/loader": true, - "cmd/link/internal/loadmacho": true, - "cmd/link/internal/loadpe": true, - "cmd/link/internal/loadxcoff": true, - "cmd/link/internal/loong64": true, - "cmd/link/internal/mips": true, - "cmd/link/internal/mips64": true, - "cmd/link/internal/ppc64": true, - "cmd/link/internal/riscv64": true, - "cmd/link/internal/s390x": true, - "cmd/link/internal/sym": true, - "cmd/link/internal/wasm": true, - "cmd/link/internal/x86": true, - "compress/flate": true, - "compress/zlib": true, - "container/heap": true, - "debug/dwarf": true, - "debug/elf": true, - "debug/macho": true, - "debug/pe": true, - "go/build/constraint": true, - "go/constant": true, - "go/version": true, - "internal/abi": true, - "internal/coverage": true, - "cmd/internal/cov/covcmd": true, - "internal/bisect": true, - "internal/buildcfg": true, - "internal/exportdata": true, - "internal/goarch": true, - "internal/godebugs": true, - "internal/goexperiment": true, - "internal/goroot": true, - "internal/gover": true, - "internal/goversion": true, - "internal/lazyregexp": true, - "internal/pkgbits": true, - "internal/platform": true, - "internal/profile": true, - "internal/race": true, - "internal/runtime/gc": true, - "internal/saferio": true, - "internal/strconv": true, - "internal/syscall/unix": true, - "internal/types/errors": true, - "internal/unsafeheader": true, - "internal/xcoff": true, - "internal/zstd": true, - "math/bits": true, - "sort": true, -} - -// BootstrapVersion is the minor version of Go used during toolchain -// bootstrapping. Packages for which [IsBootstrapPackage] must not use -// features of Go newer than this version. -const BootstrapVersion = Version(24) // go1.24.6 diff --git a/vendor/golang.org/x/tools/internal/stdlib/import.go b/vendor/golang.org/x/tools/internal/stdlib/import.go deleted file mode 100644 index 8ecc672b8b5..00000000000 --- a/vendor/golang.org/x/tools/internal/stdlib/import.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package stdlib - -// This file provides the API for the import graph of the standard library. -// -// Be aware that the compiler-generated code for every package -// implicitly depends on package "runtime" and a handful of others -// (see runtimePkgs in GOROOT/src/cmd/internal/objabi/pkgspecial.go). - -import ( - "encoding/binary" - "iter" - "slices" - "strings" -) - -// Imports returns the sequence of packages directly imported by the -// named standard packages, in name order. -// The imports of an unknown package are the empty set. -// -// The graph is built into the application and may differ from the -// graph in the Go source tree being analyzed by the application. -func Imports(pkgs ...string) iter.Seq[string] { - return func(yield func(string) bool) { - for _, pkg := range pkgs { - if i, ok := find(pkg); ok { - var depIndex uint64 - for data := []byte(deps[i].deps); len(data) > 0; { - delta, n := binary.Uvarint(data) - depIndex += delta - if !yield(deps[depIndex].name) { - return - } - data = data[n:] - } - } - } - } -} - -// Dependencies returns the set of all dependencies of the named -// standard packages, including the initial package, -// in a deterministic topological order. -// The dependencies of an unknown package are the empty set. -// -// The graph is built into the application and may differ from the -// graph in the Go source tree being analyzed by the application. -func Dependencies(pkgs ...string) iter.Seq[string] { - return func(yield func(string) bool) { - for _, pkg := range pkgs { - if i, ok := find(pkg); ok { - var seen [1 + len(deps)/8]byte // bit set of seen packages - var visit func(i int) bool - visit = func(i int) bool { - bit := byte(1) << (i % 8) - if seen[i/8]&bit == 0 { - seen[i/8] |= bit - var depIndex uint64 - for data := []byte(deps[i].deps); len(data) > 0; { - delta, n := binary.Uvarint(data) - depIndex += delta - if !visit(int(depIndex)) { - return false - } - data = data[n:] - } - if !yield(deps[i].name) { - return false - } - } - return true - } - if !visit(i) { - return - } - } - } - } -} - -// find returns the index of pkg in the deps table. -func find(pkg string) (int, bool) { - return slices.BinarySearchFunc(deps[:], pkg, func(p pkginfo, n string) int { - return strings.Compare(p.name, n) - }) -} - -// IsBootstrapPackage reports whether pkg is one of the low-level -// packages in the Go distribution that must compile with the older -// language version specified by [BootstrapVersion] during toolchain -// bootstrapping; see golang.org/s/go15bootstrap. -func IsBootstrapPackage(pkg string) bool { - return bootstrap[pkg] -} diff --git a/vendor/golang.org/x/tools/internal/stdlib/manifest.go b/vendor/golang.org/x/tools/internal/stdlib/manifest.go deleted file mode 100644 index e11abf04553..00000000000 --- a/vendor/golang.org/x/tools/internal/stdlib/manifest.go +++ /dev/null @@ -1,18615 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by generate.go. DO NOT EDIT. - -package stdlib - -var PackageSymbols = map[string][]Symbol{ - "archive/tar": { - {"(*Header).FileInfo", Method, 1, ""}, - {"(*Reader).Next", Method, 0, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Writer).AddFS", Method, 22, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(*Writer).WriteHeader", Method, 0, ""}, - {"(FileInfoNames).Gname", Method, 23, ""}, - {"(FileInfoNames).IsDir", Method, 23, ""}, - {"(FileInfoNames).ModTime", Method, 23, ""}, - {"(FileInfoNames).Mode", Method, 23, ""}, - {"(FileInfoNames).Name", Method, 23, ""}, - {"(FileInfoNames).Size", Method, 23, ""}, - {"(FileInfoNames).Sys", Method, 23, ""}, - {"(FileInfoNames).Uname", Method, 23, ""}, - {"(Format).String", Method, 10, ""}, - {"ErrFieldTooLong", Var, 0, ""}, - {"ErrHeader", Var, 0, ""}, - {"ErrInsecurePath", Var, 20, ""}, - {"ErrWriteAfterClose", Var, 0, ""}, - {"ErrWriteTooLong", Var, 0, ""}, - {"FileInfoHeader", Func, 1, "func(fi fs.FileInfo, link string) (*Header, error)"}, - {"FileInfoNames", Type, 23, ""}, - {"Format", Type, 10, ""}, - {"FormatGNU", Const, 10, ""}, - {"FormatPAX", Const, 10, ""}, - {"FormatUSTAR", Const, 10, ""}, - {"FormatUnknown", Const, 10, ""}, - {"Header", Type, 0, ""}, - {"Header.AccessTime", Field, 0, ""}, - {"Header.ChangeTime", Field, 0, ""}, - {"Header.Devmajor", Field, 0, ""}, - {"Header.Devminor", Field, 0, ""}, - {"Header.Format", Field, 10, ""}, - {"Header.Gid", Field, 0, ""}, - {"Header.Gname", Field, 0, ""}, - {"Header.Linkname", Field, 0, ""}, - {"Header.ModTime", Field, 0, ""}, - {"Header.Mode", Field, 0, ""}, - {"Header.Name", Field, 0, ""}, - {"Header.PAXRecords", Field, 10, ""}, - {"Header.Size", Field, 0, ""}, - {"Header.Typeflag", Field, 0, ""}, - {"Header.Uid", Field, 0, ""}, - {"Header.Uname", Field, 0, ""}, - {"Header.Xattrs", Field, 3, ""}, - {"NewReader", Func, 0, "func(r io.Reader) *Reader"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"Reader", Type, 0, ""}, - {"TypeBlock", Const, 0, ""}, - {"TypeChar", Const, 0, ""}, - {"TypeCont", Const, 0, ""}, - {"TypeDir", Const, 0, ""}, - {"TypeFifo", Const, 0, ""}, - {"TypeGNULongLink", Const, 1, ""}, - {"TypeGNULongName", Const, 1, ""}, - {"TypeGNUSparse", Const, 3, ""}, - {"TypeLink", Const, 0, ""}, - {"TypeReg", Const, 0, ""}, - {"TypeRegA", Const, 0, ""}, - {"TypeSymlink", Const, 0, ""}, - {"TypeXGlobalHeader", Const, 0, ""}, - {"TypeXHeader", Const, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "archive/zip": { - {"(*File).DataOffset", Method, 2, ""}, - {"(*File).FileInfo", Method, 0, ""}, - {"(*File).ModTime", Method, 0, ""}, - {"(*File).Mode", Method, 0, ""}, - {"(*File).Open", Method, 0, ""}, - {"(*File).OpenRaw", Method, 17, ""}, - {"(*File).SetModTime", Method, 0, ""}, - {"(*File).SetMode", Method, 0, ""}, - {"(*FileHeader).FileInfo", Method, 0, ""}, - {"(*FileHeader).ModTime", Method, 0, ""}, - {"(*FileHeader).Mode", Method, 0, ""}, - {"(*FileHeader).SetModTime", Method, 0, ""}, - {"(*FileHeader).SetMode", Method, 0, ""}, - {"(*ReadCloser).Close", Method, 0, ""}, - {"(*ReadCloser).Open", Method, 16, ""}, - {"(*ReadCloser).RegisterDecompressor", Method, 6, ""}, - {"(*Reader).Open", Method, 16, ""}, - {"(*Reader).RegisterDecompressor", Method, 6, ""}, - {"(*Writer).AddFS", Method, 22, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Copy", Method, 17, ""}, - {"(*Writer).Create", Method, 0, ""}, - {"(*Writer).CreateHeader", Method, 0, ""}, - {"(*Writer).CreateRaw", Method, 17, ""}, - {"(*Writer).Flush", Method, 4, ""}, - {"(*Writer).RegisterCompressor", Method, 6, ""}, - {"(*Writer).SetComment", Method, 10, ""}, - {"(*Writer).SetOffset", Method, 5, ""}, - {"Compressor", Type, 2, ""}, - {"Decompressor", Type, 2, ""}, - {"Deflate", Const, 0, ""}, - {"ErrAlgorithm", Var, 0, ""}, - {"ErrChecksum", Var, 0, ""}, - {"ErrFormat", Var, 0, ""}, - {"ErrInsecurePath", Var, 20, ""}, - {"File", Type, 0, ""}, - {"File.FileHeader", Field, 0, ""}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.CRC32", Field, 0, ""}, - {"FileHeader.Comment", Field, 0, ""}, - {"FileHeader.CompressedSize", Field, 0, ""}, - {"FileHeader.CompressedSize64", Field, 1, ""}, - {"FileHeader.CreatorVersion", Field, 0, ""}, - {"FileHeader.ExternalAttrs", Field, 0, ""}, - {"FileHeader.Extra", Field, 0, ""}, - {"FileHeader.Flags", Field, 0, ""}, - {"FileHeader.Method", Field, 0, ""}, - {"FileHeader.Modified", Field, 10, ""}, - {"FileHeader.ModifiedDate", Field, 0, ""}, - {"FileHeader.ModifiedTime", Field, 0, ""}, - {"FileHeader.Name", Field, 0, ""}, - {"FileHeader.NonUTF8", Field, 10, ""}, - {"FileHeader.ReaderVersion", Field, 0, ""}, - {"FileHeader.UncompressedSize", Field, 0, ""}, - {"FileHeader.UncompressedSize64", Field, 1, ""}, - {"FileInfoHeader", Func, 0, "func(fi fs.FileInfo) (*FileHeader, error)"}, - {"NewReader", Func, 0, "func(r io.ReaderAt, size int64) (*Reader, error)"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"OpenReader", Func, 0, "func(name string) (*ReadCloser, error)"}, - {"ReadCloser", Type, 0, ""}, - {"ReadCloser.Reader", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"Reader.Comment", Field, 0, ""}, - {"Reader.File", Field, 0, ""}, - {"RegisterCompressor", Func, 2, "func(method uint16, comp Compressor)"}, - {"RegisterDecompressor", Func, 2, "func(method uint16, dcomp Decompressor)"}, - {"Store", Const, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "bufio": { - {"(*Reader).Buffered", Method, 0, ""}, - {"(*Reader).Discard", Method, 5, ""}, - {"(*Reader).Peek", Method, 0, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).ReadByte", Method, 0, ""}, - {"(*Reader).ReadBytes", Method, 0, ""}, - {"(*Reader).ReadLine", Method, 0, ""}, - {"(*Reader).ReadRune", Method, 0, ""}, - {"(*Reader).ReadSlice", Method, 0, ""}, - {"(*Reader).ReadString", Method, 0, ""}, - {"(*Reader).Reset", Method, 2, ""}, - {"(*Reader).Size", Method, 10, ""}, - {"(*Reader).UnreadByte", Method, 0, ""}, - {"(*Reader).UnreadRune", Method, 0, ""}, - {"(*Reader).WriteTo", Method, 1, ""}, - {"(*Scanner).Buffer", Method, 6, ""}, - {"(*Scanner).Bytes", Method, 1, ""}, - {"(*Scanner).Err", Method, 1, ""}, - {"(*Scanner).Scan", Method, 1, ""}, - {"(*Scanner).Split", Method, 1, ""}, - {"(*Scanner).Text", Method, 1, ""}, - {"(*Writer).Available", Method, 0, ""}, - {"(*Writer).AvailableBuffer", Method, 18, ""}, - {"(*Writer).Buffered", Method, 0, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).ReadFrom", Method, 1, ""}, - {"(*Writer).Reset", Method, 2, ""}, - {"(*Writer).Size", Method, 10, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(*Writer).WriteByte", Method, 0, ""}, - {"(*Writer).WriteRune", Method, 0, ""}, - {"(*Writer).WriteString", Method, 0, ""}, - {"(ReadWriter).Available", Method, 0, ""}, - {"(ReadWriter).AvailableBuffer", Method, 18, ""}, - {"(ReadWriter).Discard", Method, 5, ""}, - {"(ReadWriter).Flush", Method, 0, ""}, - {"(ReadWriter).Peek", Method, 0, ""}, - {"(ReadWriter).Read", Method, 0, ""}, - {"(ReadWriter).ReadByte", Method, 0, ""}, - {"(ReadWriter).ReadBytes", Method, 0, ""}, - {"(ReadWriter).ReadFrom", Method, 1, ""}, - {"(ReadWriter).ReadLine", Method, 0, ""}, - {"(ReadWriter).ReadRune", Method, 0, ""}, - {"(ReadWriter).ReadSlice", Method, 0, ""}, - {"(ReadWriter).ReadString", Method, 0, ""}, - {"(ReadWriter).UnreadByte", Method, 0, ""}, - {"(ReadWriter).UnreadRune", Method, 0, ""}, - {"(ReadWriter).Write", Method, 0, ""}, - {"(ReadWriter).WriteByte", Method, 0, ""}, - {"(ReadWriter).WriteRune", Method, 0, ""}, - {"(ReadWriter).WriteString", Method, 0, ""}, - {"(ReadWriter).WriteTo", Method, 1, ""}, - {"ErrAdvanceTooFar", Var, 1, ""}, - {"ErrBadReadCount", Var, 15, ""}, - {"ErrBufferFull", Var, 0, ""}, - {"ErrFinalToken", Var, 6, ""}, - {"ErrInvalidUnreadByte", Var, 0, ""}, - {"ErrInvalidUnreadRune", Var, 0, ""}, - {"ErrNegativeAdvance", Var, 1, ""}, - {"ErrNegativeCount", Var, 0, ""}, - {"ErrTooLong", Var, 1, ""}, - {"MaxScanTokenSize", Const, 1, ""}, - {"NewReadWriter", Func, 0, "func(r *Reader, w *Writer) *ReadWriter"}, - {"NewReader", Func, 0, "func(rd io.Reader) *Reader"}, - {"NewReaderSize", Func, 0, "func(rd io.Reader, size int) *Reader"}, - {"NewScanner", Func, 1, "func(r io.Reader) *Scanner"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"NewWriterSize", Func, 0, "func(w io.Writer, size int) *Writer"}, - {"ReadWriter", Type, 0, ""}, - {"ReadWriter.Reader", Field, 0, ""}, - {"ReadWriter.Writer", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"ScanBytes", Func, 1, "func(data []byte, atEOF bool) (advance int, token []byte, err error)"}, - {"ScanLines", Func, 1, "func(data []byte, atEOF bool) (advance int, token []byte, err error)"}, - {"ScanRunes", Func, 1, "func(data []byte, atEOF bool) (advance int, token []byte, err error)"}, - {"ScanWords", Func, 1, "func(data []byte, atEOF bool) (advance int, token []byte, err error)"}, - {"Scanner", Type, 1, ""}, - {"SplitFunc", Type, 1, ""}, - {"Writer", Type, 0, ""}, - }, - "bytes": { - {"(*Buffer).Available", Method, 21, ""}, - {"(*Buffer).AvailableBuffer", Method, 21, ""}, - {"(*Buffer).Bytes", Method, 0, ""}, - {"(*Buffer).Cap", Method, 5, ""}, - {"(*Buffer).Grow", Method, 1, ""}, - {"(*Buffer).Len", Method, 0, ""}, - {"(*Buffer).Next", Method, 0, ""}, - {"(*Buffer).Peek", Method, 26, ""}, - {"(*Buffer).Read", Method, 0, ""}, - {"(*Buffer).ReadByte", Method, 0, ""}, - {"(*Buffer).ReadBytes", Method, 0, ""}, - {"(*Buffer).ReadFrom", Method, 0, ""}, - {"(*Buffer).ReadRune", Method, 0, ""}, - {"(*Buffer).ReadString", Method, 0, ""}, - {"(*Buffer).Reset", Method, 0, ""}, - {"(*Buffer).String", Method, 0, ""}, - {"(*Buffer).Truncate", Method, 0, ""}, - {"(*Buffer).UnreadByte", Method, 0, ""}, - {"(*Buffer).UnreadRune", Method, 0, ""}, - {"(*Buffer).Write", Method, 0, ""}, - {"(*Buffer).WriteByte", Method, 0, ""}, - {"(*Buffer).WriteRune", Method, 0, ""}, - {"(*Buffer).WriteString", Method, 0, ""}, - {"(*Buffer).WriteTo", Method, 0, ""}, - {"(*Reader).Len", Method, 0, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).ReadAt", Method, 0, ""}, - {"(*Reader).ReadByte", Method, 0, ""}, - {"(*Reader).ReadRune", Method, 0, ""}, - {"(*Reader).Reset", Method, 7, ""}, - {"(*Reader).Seek", Method, 0, ""}, - {"(*Reader).Size", Method, 5, ""}, - {"(*Reader).UnreadByte", Method, 0, ""}, - {"(*Reader).UnreadRune", Method, 0, ""}, - {"(*Reader).WriteTo", Method, 1, ""}, - {"Buffer", Type, 0, ""}, - {"Clone", Func, 20, "func(b []byte) []byte"}, - {"Compare", Func, 0, "func(a []byte, b []byte) int"}, - {"Contains", Func, 0, "func(b []byte, subslice []byte) bool"}, - {"ContainsAny", Func, 7, "func(b []byte, chars string) bool"}, - {"ContainsFunc", Func, 21, "func(b []byte, f func(rune) bool) bool"}, - {"ContainsRune", Func, 7, "func(b []byte, r rune) bool"}, - {"Count", Func, 0, "func(s []byte, sep []byte) int"}, - {"Cut", Func, 18, "func(s []byte, sep []byte) (before []byte, after []byte, found bool)"}, - {"CutLast", Func, 27, "func(s []byte, sep []byte) (before []byte, after []byte, found bool)"}, - {"CutPrefix", Func, 20, "func(s []byte, prefix []byte) (after []byte, found bool)"}, - {"CutSuffix", Func, 20, "func(s []byte, suffix []byte) (before []byte, found bool)"}, - {"Equal", Func, 0, "func(a []byte, b []byte) bool"}, - {"EqualFold", Func, 0, "func(s []byte, t []byte) bool"}, - {"ErrTooLarge", Var, 0, ""}, - {"Fields", Func, 0, "func(s []byte) [][]byte"}, - {"FieldsFunc", Func, 0, "func(s []byte, f func(rune) bool) [][]byte"}, - {"FieldsFuncSeq", Func, 24, "func(s []byte, f func(rune) bool) iter.Seq[[]byte]"}, - {"FieldsSeq", Func, 24, "func(s []byte) iter.Seq[[]byte]"}, - {"HasPrefix", Func, 0, "func(s []byte, prefix []byte) bool"}, - {"HasSuffix", Func, 0, "func(s []byte, suffix []byte) bool"}, - {"Index", Func, 0, "func(s []byte, sep []byte) int"}, - {"IndexAny", Func, 0, "func(s []byte, chars string) int"}, - {"IndexByte", Func, 0, "func(b []byte, c byte) int"}, - {"IndexFunc", Func, 0, "func(s []byte, f func(r rune) bool) int"}, - {"IndexRune", Func, 0, "func(s []byte, r rune) int"}, - {"Join", Func, 0, "func(s [][]byte, sep []byte) []byte"}, - {"LastIndex", Func, 0, "func(s []byte, sep []byte) int"}, - {"LastIndexAny", Func, 0, "func(s []byte, chars string) int"}, - {"LastIndexByte", Func, 5, "func(s []byte, c byte) int"}, - {"LastIndexFunc", Func, 0, "func(s []byte, f func(r rune) bool) int"}, - {"Lines", Func, 24, "func(s []byte) iter.Seq[[]byte]"}, - {"Map", Func, 0, "func(mapping func(r rune) rune, s []byte) []byte"}, - {"MinRead", Const, 0, ""}, - {"NewBuffer", Func, 0, "func(buf []byte) *Buffer"}, - {"NewBufferString", Func, 0, "func(s string) *Buffer"}, - {"NewReader", Func, 0, "func(b []byte) *Reader"}, - {"Reader", Type, 0, ""}, - {"Repeat", Func, 0, "func(b []byte, count int) []byte"}, - {"Replace", Func, 0, "func(s []byte, old []byte, new []byte, n int) []byte"}, - {"ReplaceAll", Func, 12, "func(s []byte, old []byte, new []byte) []byte"}, - {"Runes", Func, 0, "func(s []byte) []rune"}, - {"Split", Func, 0, "func(s []byte, sep []byte) [][]byte"}, - {"SplitAfter", Func, 0, "func(s []byte, sep []byte) [][]byte"}, - {"SplitAfterN", Func, 0, "func(s []byte, sep []byte, n int) [][]byte"}, - {"SplitAfterSeq", Func, 24, "func(s []byte, sep []byte) iter.Seq[[]byte]"}, - {"SplitN", Func, 0, "func(s []byte, sep []byte, n int) [][]byte"}, - {"SplitSeq", Func, 24, "func(s []byte, sep []byte) iter.Seq[[]byte]"}, - {"Title", Func, 0, "func(s []byte) []byte"}, - {"ToLower", Func, 0, "func(s []byte) []byte"}, - {"ToLowerSpecial", Func, 0, "func(c unicode.SpecialCase, s []byte) []byte"}, - {"ToTitle", Func, 0, "func(s []byte) []byte"}, - {"ToTitleSpecial", Func, 0, "func(c unicode.SpecialCase, s []byte) []byte"}, - {"ToUpper", Func, 0, "func(s []byte) []byte"}, - {"ToUpperSpecial", Func, 0, "func(c unicode.SpecialCase, s []byte) []byte"}, - {"ToValidUTF8", Func, 13, "func(s []byte, replacement []byte) []byte"}, - {"Trim", Func, 0, "func(s []byte, cutset string) []byte"}, - {"TrimFunc", Func, 0, "func(s []byte, f func(r rune) bool) []byte"}, - {"TrimLeft", Func, 0, "func(s []byte, cutset string) []byte"}, - {"TrimLeftFunc", Func, 0, "func(s []byte, f func(r rune) bool) []byte"}, - {"TrimPrefix", Func, 1, "func(s []byte, prefix []byte) []byte"}, - {"TrimRight", Func, 0, "func(s []byte, cutset string) []byte"}, - {"TrimRightFunc", Func, 0, "func(s []byte, f func(r rune) bool) []byte"}, - {"TrimSpace", Func, 0, "func(s []byte) []byte"}, - {"TrimSuffix", Func, 1, "func(s []byte, suffix []byte) []byte"}, - }, - "cmp": { - {"Compare", Func, 21, "func[T Ordered](x T, y T) int"}, - {"Less", Func, 21, "func[T Ordered](x T, y T) bool"}, - {"Or", Func, 22, "func[T comparable](vals ...T) T"}, - {"Ordered", Type, 21, ""}, - }, - "compress/bzip2": { - {"(StructuralError).Error", Method, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"StructuralError", Type, 0, ""}, - }, - "compress/flate": { - {"(*ReadError).Error", Method, 0, ""}, - {"(*WriteError).Error", Method, 0, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Reset", Method, 2, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(CorruptInputError).Error", Method, 0, ""}, - {"(InternalError).Error", Method, 0, ""}, - {"(Reader).Read", Method, 0, ""}, - {"(Reader).ReadByte", Method, 0, ""}, - {"(Resetter).Reset", Method, 4, ""}, - {"BestCompression", Const, 0, ""}, - {"BestSpeed", Const, 0, ""}, - {"CorruptInputError", Type, 0, ""}, - {"DefaultCompression", Const, 0, ""}, - {"HuffmanOnly", Const, 7, ""}, - {"InternalError", Type, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader) io.ReadCloser"}, - {"NewReaderDict", Func, 0, "func(r io.Reader, dict []byte) io.ReadCloser"}, - {"NewWriter", Func, 0, "func(w io.Writer, level int) (*Writer, error)"}, - {"NewWriterDict", Func, 0, "func(w io.Writer, level int, dict []byte) (*Writer, error)"}, - {"NoCompression", Const, 0, ""}, - {"ReadError", Type, 0, ""}, - {"ReadError.Err", Field, 0, ""}, - {"ReadError.Offset", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"Resetter", Type, 4, ""}, - {"WriteError", Type, 0, ""}, - {"WriteError.Err", Field, 0, ""}, - {"WriteError.Offset", Field, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "compress/gzip": { - {"(*Reader).Close", Method, 0, ""}, - {"(*Reader).Multistream", Method, 4, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).Reset", Method, 3, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Flush", Method, 1, ""}, - {"(*Writer).Reset", Method, 2, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"BestCompression", Const, 0, ""}, - {"BestSpeed", Const, 0, ""}, - {"DefaultCompression", Const, 0, ""}, - {"ErrChecksum", Var, 0, ""}, - {"ErrHeader", Var, 0, ""}, - {"Header", Type, 0, ""}, - {"Header.Comment", Field, 0, ""}, - {"Header.Extra", Field, 0, ""}, - {"Header.ModTime", Field, 0, ""}, - {"Header.Name", Field, 0, ""}, - {"Header.OS", Field, 0, ""}, - {"HuffmanOnly", Const, 8, ""}, - {"NewReader", Func, 0, "func(r io.Reader) (*Reader, error)"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"NewWriterLevel", Func, 0, "func(w io.Writer, level int) (*Writer, error)"}, - {"NoCompression", Const, 0, ""}, - {"Reader", Type, 0, ""}, - {"Reader.Header", Field, 0, ""}, - {"Writer", Type, 0, ""}, - {"Writer.Header", Field, 0, ""}, - }, - "compress/lzw": { - {"(*Reader).Close", Method, 17, ""}, - {"(*Reader).Read", Method, 17, ""}, - {"(*Reader).Reset", Method, 17, ""}, - {"(*Writer).Close", Method, 17, ""}, - {"(*Writer).Reset", Method, 17, ""}, - {"(*Writer).Write", Method, 17, ""}, - {"LSB", Const, 0, ""}, - {"MSB", Const, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader, order Order, litWidth int) io.ReadCloser"}, - {"NewWriter", Func, 0, "func(w io.Writer, order Order, litWidth int) io.WriteCloser"}, - {"Order", Type, 0, ""}, - {"Reader", Type, 17, ""}, - {"Writer", Type, 17, ""}, - }, - "compress/zlib": { - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Reset", Method, 2, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(Resetter).Reset", Method, 4, ""}, - {"BestCompression", Const, 0, ""}, - {"BestSpeed", Const, 0, ""}, - {"DefaultCompression", Const, 0, ""}, - {"ErrChecksum", Var, 0, ""}, - {"ErrDictionary", Var, 0, ""}, - {"ErrHeader", Var, 0, ""}, - {"HuffmanOnly", Const, 8, ""}, - {"NewReader", Func, 0, "func(r io.Reader) (io.ReadCloser, error)"}, - {"NewReaderDict", Func, 0, "func(r io.Reader, dict []byte) (io.ReadCloser, error)"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"NewWriterLevel", Func, 0, "func(w io.Writer, level int) (*Writer, error)"}, - {"NewWriterLevelDict", Func, 0, "func(w io.Writer, level int, dict []byte) (*Writer, error)"}, - {"NoCompression", Const, 0, ""}, - {"Resetter", Type, 4, ""}, - {"Writer", Type, 0, ""}, - }, - "container/heap": { - {"(Interface).Len", Method, 0, ""}, - {"(Interface).Less", Method, 0, ""}, - {"(Interface).Pop", Method, 0, ""}, - {"(Interface).Push", Method, 0, ""}, - {"(Interface).Swap", Method, 0, ""}, - {"Fix", Func, 2, "func(h Interface, i int)"}, - {"Init", Func, 0, "func(h Interface)"}, - {"Interface", Type, 0, ""}, - {"Pop", Func, 0, "func(h Interface) any"}, - {"Push", Func, 0, "func(h Interface, x any)"}, - {"Remove", Func, 0, "func(h Interface, i int) any"}, - }, - "container/list": { - {"(*Element).Next", Method, 0, ""}, - {"(*Element).Prev", Method, 0, ""}, - {"(*List).Back", Method, 0, ""}, - {"(*List).Front", Method, 0, ""}, - {"(*List).Init", Method, 0, ""}, - {"(*List).InsertAfter", Method, 0, ""}, - {"(*List).InsertBefore", Method, 0, ""}, - {"(*List).Len", Method, 0, ""}, - {"(*List).MoveAfter", Method, 2, ""}, - {"(*List).MoveBefore", Method, 2, ""}, - {"(*List).MoveToBack", Method, 0, ""}, - {"(*List).MoveToFront", Method, 0, ""}, - {"(*List).PushBack", Method, 0, ""}, - {"(*List).PushBackList", Method, 0, ""}, - {"(*List).PushFront", Method, 0, ""}, - {"(*List).PushFrontList", Method, 0, ""}, - {"(*List).Remove", Method, 0, ""}, - {"Element", Type, 0, ""}, - {"Element.Value", Field, 0, ""}, - {"List", Type, 0, ""}, - {"New", Func, 0, "func() *List"}, - }, - "container/ring": { - {"(*Ring).Do", Method, 0, ""}, - {"(*Ring).Len", Method, 0, ""}, - {"(*Ring).Link", Method, 0, ""}, - {"(*Ring).Move", Method, 0, ""}, - {"(*Ring).Next", Method, 0, ""}, - {"(*Ring).Prev", Method, 0, ""}, - {"(*Ring).Unlink", Method, 0, ""}, - {"New", Func, 0, "func(n int) *Ring"}, - {"Ring", Type, 0, ""}, - {"Ring.Value", Field, 0, ""}, - }, - "context": { - {"(Context).Deadline", Method, 7, ""}, - {"(Context).Done", Method, 7, ""}, - {"(Context).Err", Method, 7, ""}, - {"(Context).Value", Method, 7, ""}, - {"AfterFunc", Func, 21, "func(ctx Context, f func()) (stop func() bool)"}, - {"Background", Func, 7, "func() Context"}, - {"CancelCauseFunc", Type, 20, ""}, - {"CancelFunc", Type, 7, ""}, - {"Canceled", Var, 7, ""}, - {"Cause", Func, 20, "func(c Context) error"}, - {"Context", Type, 7, ""}, - {"DeadlineExceeded", Var, 7, ""}, - {"TODO", Func, 7, "func() Context"}, - {"WithCancel", Func, 7, "func(parent Context) (ctx Context, cancel CancelFunc)"}, - {"WithCancelCause", Func, 20, "func(parent Context) (ctx Context, cancel CancelCauseFunc)"}, - {"WithDeadline", Func, 7, "func(parent Context, d time.Time) (Context, CancelFunc)"}, - {"WithDeadlineCause", Func, 21, "func(parent Context, d time.Time, cause error) (Context, CancelFunc)"}, - {"WithTimeout", Func, 7, "func(parent Context, timeout time.Duration) (Context, CancelFunc)"}, - {"WithTimeoutCause", Func, 21, "func(parent Context, timeout time.Duration, cause error) (Context, CancelFunc)"}, - {"WithValue", Func, 7, "func(parent Context, key any, val any) Context"}, - {"WithoutCancel", Func, 21, "func(parent Context) Context"}, - }, - "crypto": { - {"(Decapsulator).Decapsulate", Method, 26, ""}, - {"(Decapsulator).Encapsulator", Method, 26, ""}, - {"(Decrypter).Decrypt", Method, 5, ""}, - {"(Decrypter).Public", Method, 5, ""}, - {"(Encapsulator).Bytes", Method, 26, ""}, - {"(Encapsulator).Encapsulate", Method, 26, ""}, - {"(Hash).Available", Method, 0, ""}, - {"(Hash).HashFunc", Method, 4, ""}, - {"(Hash).New", Method, 0, ""}, - {"(Hash).Size", Method, 0, ""}, - {"(Hash).String", Method, 15, ""}, - {"(MessageSigner).Public", Method, 25, ""}, - {"(MessageSigner).Sign", Method, 25, ""}, - {"(MessageSigner).SignMessage", Method, 25, ""}, - {"(Signer).Public", Method, 4, ""}, - {"(Signer).Sign", Method, 4, ""}, - {"(SignerOpts).HashFunc", Method, 4, ""}, - {"BLAKE2b_256", Const, 9, ""}, - {"BLAKE2b_384", Const, 9, ""}, - {"BLAKE2b_512", Const, 9, ""}, - {"BLAKE2s_256", Const, 9, ""}, - {"Decapsulator", Type, 26, ""}, - {"Decrypter", Type, 5, ""}, - {"DecrypterOpts", Type, 5, ""}, - {"Encapsulator", Type, 26, ""}, - {"Hash", Type, 0, ""}, - {"MD4", Const, 0, ""}, - {"MD5", Const, 0, ""}, - {"MD5SHA1", Const, 0, ""}, - {"MLDSAMu", Const, 27, ""}, - {"MessageSigner", Type, 25, ""}, - {"PrivateKey", Type, 0, ""}, - {"PublicKey", Type, 2, ""}, - {"RIPEMD160", Const, 0, ""}, - {"RegisterHash", Func, 0, "func(h Hash, f func() hash.Hash)"}, - {"SHA1", Const, 0, ""}, - {"SHA224", Const, 0, ""}, - {"SHA256", Const, 0, ""}, - {"SHA384", Const, 0, ""}, - {"SHA3_224", Const, 4, ""}, - {"SHA3_256", Const, 4, ""}, - {"SHA3_384", Const, 4, ""}, - {"SHA3_512", Const, 4, ""}, - {"SHA512", Const, 0, ""}, - {"SHA512_224", Const, 5, ""}, - {"SHA512_256", Const, 5, ""}, - {"SignMessage", Func, 25, "func(signer Signer, rand io.Reader, msg []byte, opts SignerOpts) (signature []byte, err error)"}, - {"Signer", Type, 4, ""}, - {"SignerOpts", Type, 4, ""}, - }, - "crypto/aes": { - {"(KeySizeError).Error", Method, 0, ""}, - {"BlockSize", Const, 0, ""}, - {"KeySizeError", Type, 0, ""}, - {"NewCipher", Func, 0, "func(key []byte) (cipher.Block, error)"}, - }, - "crypto/cipher": { - {"(AEAD).NonceSize", Method, 2, ""}, - {"(AEAD).Open", Method, 2, ""}, - {"(AEAD).Overhead", Method, 2, ""}, - {"(AEAD).Seal", Method, 2, ""}, - {"(Block).BlockSize", Method, 0, ""}, - {"(Block).Decrypt", Method, 0, ""}, - {"(Block).Encrypt", Method, 0, ""}, - {"(BlockMode).BlockSize", Method, 0, ""}, - {"(BlockMode).CryptBlocks", Method, 0, ""}, - {"(Stream).XORKeyStream", Method, 0, ""}, - {"(StreamReader).Read", Method, 0, ""}, - {"(StreamWriter).Close", Method, 0, ""}, - {"(StreamWriter).Write", Method, 0, ""}, - {"AEAD", Type, 2, ""}, - {"Block", Type, 0, ""}, - {"BlockMode", Type, 0, ""}, - {"NewCBCDecrypter", Func, 0, "func(b Block, iv []byte) BlockMode"}, - {"NewCBCEncrypter", Func, 0, "func(b Block, iv []byte) BlockMode"}, - {"NewCFBDecrypter", Func, 0, "func(block Block, iv []byte) Stream"}, - {"NewCFBEncrypter", Func, 0, "func(block Block, iv []byte) Stream"}, - {"NewCTR", Func, 0, "func(block Block, iv []byte) Stream"}, - {"NewGCM", Func, 2, "func(cipher Block) (AEAD, error)"}, - {"NewGCMWithNonceSize", Func, 5, "func(cipher Block, size int) (AEAD, error)"}, - {"NewGCMWithRandomNonce", Func, 24, "func(cipher Block) (AEAD, error)"}, - {"NewGCMWithTagSize", Func, 11, "func(cipher Block, tagSize int) (AEAD, error)"}, - {"NewOFB", Func, 0, "func(b Block, iv []byte) Stream"}, - {"Stream", Type, 0, ""}, - {"StreamReader", Type, 0, ""}, - {"StreamReader.R", Field, 0, ""}, - {"StreamReader.S", Field, 0, ""}, - {"StreamWriter", Type, 0, ""}, - {"StreamWriter.Err", Field, 0, ""}, - {"StreamWriter.S", Field, 0, ""}, - {"StreamWriter.W", Field, 0, ""}, - }, - "crypto/des": { - {"(KeySizeError).Error", Method, 0, ""}, - {"BlockSize", Const, 0, ""}, - {"KeySizeError", Type, 0, ""}, - {"NewCipher", Func, 0, "func(key []byte) (cipher.Block, error)"}, - {"NewTripleDESCipher", Func, 0, "func(key []byte) (cipher.Block, error)"}, - }, - "crypto/dsa": { - {"ErrInvalidPublicKey", Var, 0, ""}, - {"GenerateKey", Func, 0, "func(priv *PrivateKey, rand io.Reader) error"}, - {"GenerateParameters", Func, 0, "func(params *Parameters, rand io.Reader, sizes ParameterSizes) error"}, - {"L1024N160", Const, 0, ""}, - {"L2048N224", Const, 0, ""}, - {"L2048N256", Const, 0, ""}, - {"L3072N256", Const, 0, ""}, - {"ParameterSizes", Type, 0, ""}, - {"Parameters", Type, 0, ""}, - {"Parameters.G", Field, 0, ""}, - {"Parameters.P", Field, 0, ""}, - {"Parameters.Q", Field, 0, ""}, - {"PrivateKey", Type, 0, ""}, - {"PrivateKey.PublicKey", Field, 0, ""}, - {"PrivateKey.X", Field, 0, ""}, - {"PublicKey", Type, 0, ""}, - {"PublicKey.Parameters", Field, 0, ""}, - {"PublicKey.Y", Field, 0, ""}, - {"Sign", Func, 0, "func(random io.Reader, priv *PrivateKey, hash []byte) (r *big.Int, s *big.Int, err error)"}, - {"Verify", Func, 0, "func(pub *PublicKey, hash []byte, r *big.Int, s *big.Int) bool"}, - }, - "crypto/ecdh": { - {"(*PrivateKey).Bytes", Method, 20, ""}, - {"(*PrivateKey).Curve", Method, 20, ""}, - {"(*PrivateKey).ECDH", Method, 20, ""}, - {"(*PrivateKey).Equal", Method, 20, ""}, - {"(*PrivateKey).Public", Method, 20, ""}, - {"(*PrivateKey).PublicKey", Method, 20, ""}, - {"(*PublicKey).Bytes", Method, 20, ""}, - {"(*PublicKey).Curve", Method, 20, ""}, - {"(*PublicKey).Equal", Method, 20, ""}, - {"(Curve).GenerateKey", Method, 20, ""}, - {"(Curve).NewPrivateKey", Method, 20, ""}, - {"(Curve).NewPublicKey", Method, 20, ""}, - {"(KeyExchanger).Curve", Method, 26, ""}, - {"(KeyExchanger).ECDH", Method, 26, ""}, - {"(KeyExchanger).PublicKey", Method, 26, ""}, - {"KeyExchanger", Type, 26, ""}, - {"P256", Func, 20, "func() Curve"}, - {"P384", Func, 20, "func() Curve"}, - {"P521", Func, 20, "func() Curve"}, - {"PrivateKey", Type, 20, ""}, - {"PublicKey", Type, 20, ""}, - {"X25519", Func, 20, "func() Curve"}, - }, - "crypto/ecdsa": { - {"(*PrivateKey).Bytes", Method, 25, ""}, - {"(*PrivateKey).ECDH", Method, 20, ""}, - {"(*PrivateKey).Equal", Method, 15, ""}, - {"(*PrivateKey).Public", Method, 4, ""}, - {"(*PrivateKey).Sign", Method, 4, ""}, - {"(*PublicKey).Bytes", Method, 25, ""}, - {"(*PublicKey).ECDH", Method, 20, ""}, - {"(*PublicKey).Equal", Method, 15, ""}, - {"(PrivateKey).Add", Method, 0, ""}, - {"(PrivateKey).Double", Method, 0, ""}, - {"(PrivateKey).IsOnCurve", Method, 0, ""}, - {"(PrivateKey).Params", Method, 0, ""}, - {"(PrivateKey).ScalarBaseMult", Method, 0, ""}, - {"(PrivateKey).ScalarMult", Method, 0, ""}, - {"(PublicKey).Add", Method, 0, ""}, - {"(PublicKey).Double", Method, 0, ""}, - {"(PublicKey).IsOnCurve", Method, 0, ""}, - {"(PublicKey).Params", Method, 0, ""}, - {"(PublicKey).ScalarBaseMult", Method, 0, ""}, - {"(PublicKey).ScalarMult", Method, 0, ""}, - {"GenerateKey", Func, 0, "func(c elliptic.Curve, r io.Reader) (*PrivateKey, error)"}, - {"ParseRawPrivateKey", Func, 25, "func(curve elliptic.Curve, data []byte) (*PrivateKey, error)"}, - {"ParseUncompressedPublicKey", Func, 25, "func(curve elliptic.Curve, data []byte) (*PublicKey, error)"}, - {"PrivateKey", Type, 0, ""}, - {"PrivateKey.D", Field, 0, ""}, - {"PrivateKey.PublicKey", Field, 0, ""}, - {"PublicKey", Type, 0, ""}, - {"PublicKey.Curve", Field, 0, ""}, - {"PublicKey.X", Field, 0, ""}, - {"PublicKey.Y", Field, 0, ""}, - {"Sign", Func, 0, "func(rand io.Reader, priv *PrivateKey, hash []byte) (r *big.Int, s *big.Int, err error)"}, - {"SignASN1", Func, 15, "func(r io.Reader, priv *PrivateKey, hash []byte) ([]byte, error)"}, - {"Verify", Func, 0, "func(pub *PublicKey, hash []byte, r *big.Int, s *big.Int) bool"}, - {"VerifyASN1", Func, 15, "func(pub *PublicKey, hash []byte, sig []byte) bool"}, - }, - "crypto/ed25519": { - {"(*Options).HashFunc", Method, 20, ""}, - {"(PrivateKey).Equal", Method, 15, ""}, - {"(PrivateKey).Public", Method, 13, ""}, - {"(PrivateKey).Seed", Method, 13, ""}, - {"(PrivateKey).Sign", Method, 13, ""}, - {"(PublicKey).Equal", Method, 15, ""}, - {"GenerateKey", Func, 13, "func(random io.Reader) (PublicKey, PrivateKey, error)"}, - {"NewKeyFromSeed", Func, 13, "func(seed []byte) PrivateKey"}, - {"Options", Type, 20, ""}, - {"Options.Context", Field, 20, ""}, - {"Options.Hash", Field, 20, ""}, - {"PrivateKey", Type, 13, ""}, - {"PrivateKeySize", Const, 13, ""}, - {"PublicKey", Type, 13, ""}, - {"PublicKeySize", Const, 13, ""}, - {"SeedSize", Const, 13, ""}, - {"Sign", Func, 13, "func(privateKey PrivateKey, message []byte) []byte"}, - {"SignatureSize", Const, 13, ""}, - {"Verify", Func, 13, "func(publicKey PublicKey, message []byte, sig []byte) bool"}, - {"VerifyWithOptions", Func, 20, "func(publicKey PublicKey, message []byte, sig []byte, opts *Options) error"}, - }, - "crypto/elliptic": { - {"(*CurveParams).Add", Method, 0, ""}, - {"(*CurveParams).Double", Method, 0, ""}, - {"(*CurveParams).IsOnCurve", Method, 0, ""}, - {"(*CurveParams).Params", Method, 0, ""}, - {"(*CurveParams).ScalarBaseMult", Method, 0, ""}, - {"(*CurveParams).ScalarMult", Method, 0, ""}, - {"(Curve).Add", Method, 0, ""}, - {"(Curve).Double", Method, 0, ""}, - {"(Curve).IsOnCurve", Method, 0, ""}, - {"(Curve).Params", Method, 0, ""}, - {"(Curve).ScalarBaseMult", Method, 0, ""}, - {"(Curve).ScalarMult", Method, 0, ""}, - {"Curve", Type, 0, ""}, - {"CurveParams", Type, 0, ""}, - {"CurveParams.B", Field, 0, ""}, - {"CurveParams.BitSize", Field, 0, ""}, - {"CurveParams.Gx", Field, 0, ""}, - {"CurveParams.Gy", Field, 0, ""}, - {"CurveParams.N", Field, 0, ""}, - {"CurveParams.Name", Field, 5, ""}, - {"CurveParams.P", Field, 0, ""}, - {"GenerateKey", Func, 0, "func(curve Curve, rand io.Reader) (priv []byte, x *big.Int, y *big.Int, err error)"}, - {"Marshal", Func, 0, "func(curve Curve, x *big.Int, y *big.Int) []byte"}, - {"MarshalCompressed", Func, 15, "func(curve Curve, x *big.Int, y *big.Int) []byte"}, - {"P224", Func, 0, "func() Curve"}, - {"P256", Func, 0, "func() Curve"}, - {"P384", Func, 0, "func() Curve"}, - {"P521", Func, 0, "func() Curve"}, - {"Unmarshal", Func, 0, "func(curve Curve, data []byte) (x *big.Int, y *big.Int)"}, - {"UnmarshalCompressed", Func, 15, "func(curve Curve, data []byte) (x *big.Int, y *big.Int)"}, - }, - "crypto/fips140": { - {"Enabled", Func, 24, "func() bool"}, - {"Enforced", Func, 26, "func() bool"}, - {"Version", Func, 26, "func() string"}, - {"WithoutEnforcement", Func, 26, "func(f func())"}, - }, - "crypto/hkdf": { - {"Expand", Func, 24, "func[H hash.Hash](h func() H, pseudorandomKey []byte, info string, keyLength int) ([]byte, error)"}, - {"Extract", Func, 24, "func[H hash.Hash](h func() H, secret []byte, salt []byte) ([]byte, error)"}, - {"Key", Func, 24, "func[Hash hash.Hash](h func() Hash, secret []byte, salt []byte, info string, keyLength int) ([]byte, error)"}, - }, - "crypto/hmac": { - {"Equal", Func, 1, "func(mac1 []byte, mac2 []byte) bool"}, - {"New", Func, 0, "func(h func() hash.Hash, key []byte) hash.Hash"}, - }, - "crypto/hpke": { - {"(*Recipient).Export", Method, 26, ""}, - {"(*Recipient).Open", Method, 26, ""}, - {"(*Sender).Export", Method, 26, ""}, - {"(*Sender).Seal", Method, 26, ""}, - {"(AEAD).ID", Method, 26, ""}, - {"(KDF).ID", Method, 26, ""}, - {"(KEM).DeriveKeyPair", Method, 26, ""}, - {"(KEM).GenerateKey", Method, 26, ""}, - {"(KEM).ID", Method, 26, ""}, - {"(KEM).NewPrivateKey", Method, 26, ""}, - {"(KEM).NewPublicKey", Method, 26, ""}, - {"(PrivateKey).Bytes", Method, 26, ""}, - {"(PrivateKey).KEM", Method, 26, ""}, - {"(PrivateKey).PublicKey", Method, 26, ""}, - {"(PublicKey).Bytes", Method, 26, ""}, - {"(PublicKey).KEM", Method, 26, ""}, - {"AES128GCM", Func, 26, "func() AEAD"}, - {"AES256GCM", Func, 26, "func() AEAD"}, - {"ChaCha20Poly1305", Func, 26, "func() AEAD"}, - {"DHKEM", Func, 26, "func(curve ecdh.Curve) KEM"}, - {"ExportOnly", Func, 26, "func() AEAD"}, - {"HKDFSHA256", Func, 26, "func() KDF"}, - {"HKDFSHA384", Func, 26, "func() KDF"}, - {"HKDFSHA512", Func, 26, "func() KDF"}, - {"MLKEM1024", Func, 26, "func() KEM"}, - {"MLKEM1024P384", Func, 26, "func() KEM"}, - {"MLKEM768", Func, 26, "func() KEM"}, - {"MLKEM768P256", Func, 26, "func() KEM"}, - {"MLKEM768X25519", Func, 26, "func() KEM"}, - {"NewAEAD", Func, 26, "func(id uint16) (AEAD, error)"}, - {"NewDHKEMPrivateKey", Func, 26, "func(priv ecdh.KeyExchanger) (PrivateKey, error)"}, - {"NewDHKEMPublicKey", Func, 26, "func(pub *ecdh.PublicKey) (PublicKey, error)"}, - {"NewHybridPrivateKey", Func, 26, "func(pq crypto.Decapsulator, t ecdh.KeyExchanger) (PrivateKey, error)"}, - {"NewHybridPublicKey", Func, 26, "func(pq crypto.Encapsulator, t *ecdh.PublicKey) (PublicKey, error)"}, - {"NewKDF", Func, 26, "func(id uint16) (KDF, error)"}, - {"NewKEM", Func, 26, "func(id uint16) (KEM, error)"}, - {"NewMLKEMPrivateKey", Func, 26, "func(priv crypto.Decapsulator) (PrivateKey, error)"}, - {"NewMLKEMPublicKey", Func, 26, "func(pub crypto.Encapsulator) (PublicKey, error)"}, - {"NewRecipient", Func, 26, "func(enc []byte, k PrivateKey, kdf KDF, aead AEAD, info []byte) (*Recipient, error)"}, - {"NewSender", Func, 26, "func(pk PublicKey, kdf KDF, aead AEAD, info []byte) (enc []byte, s *Sender, err error)"}, - {"Open", Func, 26, "func(k PrivateKey, kdf KDF, aead AEAD, info []byte, ciphertext []byte) ([]byte, error)"}, - {"Recipient", Type, 26, ""}, - {"SHAKE128", Func, 26, "func() KDF"}, - {"SHAKE256", Func, 26, "func() KDF"}, - {"Seal", Func, 26, "func(pk PublicKey, kdf KDF, aead AEAD, info []byte, plaintext []byte) ([]byte, error)"}, - {"Sender", Type, 26, ""}, - }, - "crypto/md5": { - {"BlockSize", Const, 0, ""}, - {"New", Func, 0, "func() hash.Hash"}, - {"Size", Const, 0, ""}, - {"Sum", Func, 2, "func(data []byte) [16]byte"}, - }, - "crypto/mldsa": { - {"(*Options).HashFunc", Method, 27, ""}, - {"(*PrivateKey).Bytes", Method, 27, ""}, - {"(*PrivateKey).Equal", Method, 27, ""}, - {"(*PrivateKey).Public", Method, 27, ""}, - {"(*PrivateKey).PublicKey", Method, 27, ""}, - {"(*PrivateKey).Sign", Method, 27, ""}, - {"(*PrivateKey).SignDeterministic", Method, 27, ""}, - {"(*PublicKey).Bytes", Method, 27, ""}, - {"(*PublicKey).Equal", Method, 27, ""}, - {"(*PublicKey).Parameters", Method, 27, ""}, - {"(Parameters).PublicKeySize", Method, 27, ""}, - {"(Parameters).SignatureSize", Method, 27, ""}, - {"(Parameters).String", Method, 27, ""}, - {"GenerateKey", Func, 27, "func(params Parameters) (*PrivateKey, error)"}, - {"MLDSA44", Func, 27, "func() Parameters"}, - {"MLDSA44PublicKeySize", Const, 27, ""}, - {"MLDSA44SignatureSize", Const, 27, ""}, - {"MLDSA65", Func, 27, "func() Parameters"}, - {"MLDSA65PublicKeySize", Const, 27, ""}, - {"MLDSA65SignatureSize", Const, 27, ""}, - {"MLDSA87", Func, 27, "func() Parameters"}, - {"MLDSA87PublicKeySize", Const, 27, ""}, - {"MLDSA87SignatureSize", Const, 27, ""}, - {"NewPrivateKey", Func, 27, "func(params Parameters, seed []byte) (*PrivateKey, error)"}, - {"NewPublicKey", Func, 27, "func(params Parameters, encoding []byte) (*PublicKey, error)"}, - {"Options", Type, 27, ""}, - {"Options.Context", Field, 27, ""}, - {"Parameters", Type, 27, ""}, - {"PrivateKey", Type, 27, ""}, - {"PrivateKeySize", Const, 27, ""}, - {"PublicKey", Type, 27, ""}, - {"Verify", Func, 27, "func(pk *PublicKey, message []byte, signature []byte, opts *Options) error"}, - }, - "crypto/mlkem": { - {"(*DecapsulationKey1024).Bytes", Method, 24, ""}, - {"(*DecapsulationKey1024).Decapsulate", Method, 24, ""}, - {"(*DecapsulationKey1024).EncapsulationKey", Method, 24, ""}, - {"(*DecapsulationKey1024).Encapsulator", Method, 26, ""}, - {"(*DecapsulationKey768).Bytes", Method, 24, ""}, - {"(*DecapsulationKey768).Decapsulate", Method, 24, ""}, - {"(*DecapsulationKey768).EncapsulationKey", Method, 24, ""}, - {"(*DecapsulationKey768).Encapsulator", Method, 26, ""}, - {"(*EncapsulationKey1024).Bytes", Method, 24, ""}, - {"(*EncapsulationKey1024).Encapsulate", Method, 24, ""}, - {"(*EncapsulationKey768).Bytes", Method, 24, ""}, - {"(*EncapsulationKey768).Encapsulate", Method, 24, ""}, - {"CiphertextSize1024", Const, 24, ""}, - {"CiphertextSize768", Const, 24, ""}, - {"DecapsulationKey1024", Type, 24, ""}, - {"DecapsulationKey768", Type, 24, ""}, - {"EncapsulationKey1024", Type, 24, ""}, - {"EncapsulationKey768", Type, 24, ""}, - {"EncapsulationKeySize1024", Const, 24, ""}, - {"EncapsulationKeySize768", Const, 24, ""}, - {"GenerateKey1024", Func, 24, "func() (*DecapsulationKey1024, error)"}, - {"GenerateKey768", Func, 24, "func() (*DecapsulationKey768, error)"}, - {"NewDecapsulationKey1024", Func, 24, "func(seed []byte) (*DecapsulationKey1024, error)"}, - {"NewDecapsulationKey768", Func, 24, "func(seed []byte) (*DecapsulationKey768, error)"}, - {"NewEncapsulationKey1024", Func, 24, "func(encapsulationKey []byte) (*EncapsulationKey1024, error)"}, - {"NewEncapsulationKey768", Func, 24, "func(encapsulationKey []byte) (*EncapsulationKey768, error)"}, - {"SeedSize", Const, 24, ""}, - {"SharedKeySize", Const, 24, ""}, - }, - "crypto/mlkem/mlkemtest": { - {"Encapsulate1024", Func, 26, "func(ek *mlkem.EncapsulationKey1024, random []byte) (sharedKey []byte, ciphertext []byte, err error)"}, - {"Encapsulate768", Func, 26, "func(ek *mlkem.EncapsulationKey768, random []byte) (sharedKey []byte, ciphertext []byte, err error)"}, - }, - "crypto/pbkdf2": { - {"Key", Func, 24, "func[Hash hash.Hash](h func() Hash, password string, salt []byte, iter int, keyLength int) ([]byte, error)"}, - }, - "crypto/rand": { - {"Int", Func, 0, "func(rand io.Reader, max *big.Int) (n *big.Int, err error)"}, - {"Prime", Func, 0, "func(r io.Reader, bits int) (*big.Int, error)"}, - {"Read", Func, 0, "func(b []byte) (n int, err error)"}, - {"Reader", Var, 0, ""}, - {"Text", Func, 24, "func() string"}, - }, - "crypto/rc4": { - {"(*Cipher).Reset", Method, 0, ""}, - {"(*Cipher).XORKeyStream", Method, 0, ""}, - {"(KeySizeError).Error", Method, 0, ""}, - {"Cipher", Type, 0, ""}, - {"KeySizeError", Type, 0, ""}, - {"NewCipher", Func, 0, "func(key []byte) (*Cipher, error)"}, - }, - "crypto/rsa": { - {"(*PSSOptions).HashFunc", Method, 4, ""}, - {"(*PrivateKey).Decrypt", Method, 5, ""}, - {"(*PrivateKey).Equal", Method, 15, ""}, - {"(*PrivateKey).Precompute", Method, 0, ""}, - {"(*PrivateKey).Public", Method, 4, ""}, - {"(*PrivateKey).Sign", Method, 4, ""}, - {"(*PrivateKey).Size", Method, 11, ""}, - {"(*PrivateKey).Validate", Method, 0, ""}, - {"(*PublicKey).Equal", Method, 15, ""}, - {"(*PublicKey).Size", Method, 11, ""}, - {"CRTValue", Type, 0, ""}, - {"CRTValue.Coeff", Field, 0, ""}, - {"CRTValue.Exp", Field, 0, ""}, - {"CRTValue.R", Field, 0, ""}, - {"DecryptOAEP", Func, 0, "func(hash hash.Hash, random io.Reader, priv *PrivateKey, ciphertext []byte, label []byte) ([]byte, error)"}, - {"DecryptPKCS1v15", Func, 0, "func(random io.Reader, priv *PrivateKey, ciphertext []byte) ([]byte, error)"}, - {"DecryptPKCS1v15SessionKey", Func, 0, "func(random io.Reader, priv *PrivateKey, ciphertext []byte, key []byte) error"}, - {"EncryptOAEP", Func, 0, "func(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) ([]byte, error)"}, - {"EncryptOAEPWithOptions", Func, 26, "func(random io.Reader, pub *PublicKey, msg []byte, opts *OAEPOptions) ([]byte, error)"}, - {"EncryptPKCS1v15", Func, 0, "func(random io.Reader, pub *PublicKey, msg []byte) ([]byte, error)"}, - {"ErrDecryption", Var, 0, ""}, - {"ErrMessageTooLong", Var, 0, ""}, - {"ErrVerification", Var, 0, ""}, - {"GenerateKey", Func, 0, "func(random io.Reader, bits int) (*PrivateKey, error)"}, - {"GenerateMultiPrimeKey", Func, 0, "func(random io.Reader, nprimes int, bits int) (*PrivateKey, error)"}, - {"OAEPOptions", Type, 5, ""}, - {"OAEPOptions.Hash", Field, 5, ""}, - {"OAEPOptions.Label", Field, 5, ""}, - {"OAEPOptions.MGFHash", Field, 20, ""}, - {"PKCS1v15DecryptOptions", Type, 5, ""}, - {"PKCS1v15DecryptOptions.SessionKeyLen", Field, 5, ""}, - {"PSSOptions", Type, 2, ""}, - {"PSSOptions.Hash", Field, 4, ""}, - {"PSSOptions.SaltLength", Field, 2, ""}, - {"PSSSaltLengthAuto", Const, 2, ""}, - {"PSSSaltLengthEqualsHash", Const, 2, ""}, - {"PrecomputedValues", Type, 0, ""}, - {"PrecomputedValues.CRTValues", Field, 0, ""}, - {"PrecomputedValues.Dp", Field, 0, ""}, - {"PrecomputedValues.Dq", Field, 0, ""}, - {"PrecomputedValues.Qinv", Field, 0, ""}, - {"PrivateKey", Type, 0, ""}, - {"PrivateKey.D", Field, 0, ""}, - {"PrivateKey.Precomputed", Field, 0, ""}, - {"PrivateKey.Primes", Field, 0, ""}, - {"PrivateKey.PublicKey", Field, 0, ""}, - {"PublicKey", Type, 0, ""}, - {"PublicKey.E", Field, 0, ""}, - {"PublicKey.N", Field, 0, ""}, - {"SignPKCS1v15", Func, 0, "func(random io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte) ([]byte, error)"}, - {"SignPSS", Func, 2, "func(random io.Reader, priv *PrivateKey, hash crypto.Hash, digest []byte, opts *PSSOptions) ([]byte, error)"}, - {"VerifyPKCS1v15", Func, 0, "func(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte) error"}, - {"VerifyPSS", Func, 2, "func(pub *PublicKey, hash crypto.Hash, digest []byte, sig []byte, opts *PSSOptions) error"}, - }, - "crypto/sha1": { - {"BlockSize", Const, 0, ""}, - {"New", Func, 0, "func() hash.Hash"}, - {"Size", Const, 0, ""}, - {"Sum", Func, 2, "func(data []byte) [20]byte"}, - }, - "crypto/sha256": { - {"BlockSize", Const, 0, ""}, - {"New", Func, 0, "func() hash.Hash"}, - {"New224", Func, 0, "func() hash.Hash"}, - {"Size", Const, 0, ""}, - {"Size224", Const, 0, ""}, - {"Sum224", Func, 2, "func(data []byte) [28]byte"}, - {"Sum256", Func, 2, "func(data []byte) [32]byte"}, - }, - "crypto/sha3": { - {"(*SHA3).AppendBinary", Method, 24, ""}, - {"(*SHA3).BlockSize", Method, 24, ""}, - {"(*SHA3).Clone", Method, 25, ""}, - {"(*SHA3).MarshalBinary", Method, 24, ""}, - {"(*SHA3).Reset", Method, 24, ""}, - {"(*SHA3).Size", Method, 24, ""}, - {"(*SHA3).Sum", Method, 24, ""}, - {"(*SHA3).UnmarshalBinary", Method, 24, ""}, - {"(*SHA3).Write", Method, 24, ""}, - {"(*SHAKE).AppendBinary", Method, 24, ""}, - {"(*SHAKE).BlockSize", Method, 24, ""}, - {"(*SHAKE).MarshalBinary", Method, 24, ""}, - {"(*SHAKE).Read", Method, 24, ""}, - {"(*SHAKE).Reset", Method, 24, ""}, - {"(*SHAKE).UnmarshalBinary", Method, 24, ""}, - {"(*SHAKE).Write", Method, 24, ""}, - {"New224", Func, 24, "func() *SHA3"}, - {"New256", Func, 24, "func() *SHA3"}, - {"New384", Func, 24, "func() *SHA3"}, - {"New512", Func, 24, "func() *SHA3"}, - {"NewCSHAKE128", Func, 24, "func(N []byte, S []byte) *SHAKE"}, - {"NewCSHAKE256", Func, 24, "func(N []byte, S []byte) *SHAKE"}, - {"NewSHAKE128", Func, 24, "func() *SHAKE"}, - {"NewSHAKE256", Func, 24, "func() *SHAKE"}, - {"SHA3", Type, 24, ""}, - {"SHAKE", Type, 24, ""}, - {"Sum224", Func, 24, "func(data []byte) [28]byte"}, - {"Sum256", Func, 24, "func(data []byte) [32]byte"}, - {"Sum384", Func, 24, "func(data []byte) [48]byte"}, - {"Sum512", Func, 24, "func(data []byte) [64]byte"}, - {"SumSHAKE128", Func, 24, "func(data []byte, length int) []byte"}, - {"SumSHAKE256", Func, 24, "func(data []byte, length int) []byte"}, - }, - "crypto/sha512": { - {"BlockSize", Const, 0, ""}, - {"New", Func, 0, "func() hash.Hash"}, - {"New384", Func, 0, "func() hash.Hash"}, - {"New512_224", Func, 5, "func() hash.Hash"}, - {"New512_256", Func, 5, "func() hash.Hash"}, - {"Size", Const, 0, ""}, - {"Size224", Const, 5, ""}, - {"Size256", Const, 5, ""}, - {"Size384", Const, 0, ""}, - {"Sum384", Func, 2, "func(data []byte) [48]byte"}, - {"Sum512", Func, 2, "func(data []byte) [64]byte"}, - {"Sum512_224", Func, 5, "func(data []byte) [28]byte"}, - {"Sum512_256", Func, 5, "func(data []byte) [32]byte"}, - }, - "crypto/subtle": { - {"ConstantTimeByteEq", Func, 0, "func(x uint8, y uint8) int"}, - {"ConstantTimeCompare", Func, 0, "func(x []byte, y []byte) int"}, - {"ConstantTimeCopy", Func, 0, "func(v int, x []byte, y []byte)"}, - {"ConstantTimeEq", Func, 0, "func(x int32, y int32) int"}, - {"ConstantTimeLessOrEq", Func, 2, "func(x int, y int) int"}, - {"ConstantTimeSelect", Func, 0, "func(v int, x int, y int) int"}, - {"WithDataIndependentTiming", Func, 24, "func(f func())"}, - {"XORBytes", Func, 20, "func(dst []byte, x []byte, y []byte) int"}, - }, - "crypto/tls": { - {"(*CertificateRequestInfo).Context", Method, 17, ""}, - {"(*CertificateRequestInfo).SupportsCertificate", Method, 14, ""}, - {"(*CertificateVerificationError).Error", Method, 20, ""}, - {"(*CertificateVerificationError).Unwrap", Method, 20, ""}, - {"(*ClientHelloInfo).Context", Method, 17, ""}, - {"(*ClientHelloInfo).SupportsCertificate", Method, 14, ""}, - {"(*ClientSessionState).ResumptionState", Method, 21, ""}, - {"(*Config).BuildNameToCertificate", Method, 0, ""}, - {"(*Config).Clone", Method, 8, ""}, - {"(*Config).DecryptTicket", Method, 21, ""}, - {"(*Config).EncryptTicket", Method, 21, ""}, - {"(*Config).SetSessionTicketKeys", Method, 5, ""}, - {"(*Conn).Close", Method, 0, ""}, - {"(*Conn).CloseWrite", Method, 8, ""}, - {"(*Conn).ConnectionState", Method, 0, ""}, - {"(*Conn).Handshake", Method, 0, ""}, - {"(*Conn).HandshakeContext", Method, 17, ""}, - {"(*Conn).LocalAddr", Method, 0, ""}, - {"(*Conn).NetConn", Method, 18, ""}, - {"(*Conn).OCSPResponse", Method, 0, ""}, - {"(*Conn).Read", Method, 0, ""}, - {"(*Conn).RemoteAddr", Method, 0, ""}, - {"(*Conn).SetDeadline", Method, 0, ""}, - {"(*Conn).SetReadDeadline", Method, 0, ""}, - {"(*Conn).SetWriteDeadline", Method, 0, ""}, - {"(*Conn).VerifyHostname", Method, 0, ""}, - {"(*Conn).Write", Method, 0, ""}, - {"(*ConnectionState).ExportKeyingMaterial", Method, 11, ""}, - {"(*Dialer).Dial", Method, 15, ""}, - {"(*Dialer).DialContext", Method, 15, ""}, - {"(*ECHRejectionError).Error", Method, 23, ""}, - {"(*QUICConn).Close", Method, 21, ""}, - {"(*QUICConn).ConnectionState", Method, 21, ""}, - {"(*QUICConn).HandleData", Method, 21, ""}, - {"(*QUICConn).NextEvent", Method, 21, ""}, - {"(*QUICConn).SendSessionTicket", Method, 21, ""}, - {"(*QUICConn).SetTransportParameters", Method, 21, ""}, - {"(*QUICConn).Start", Method, 21, ""}, - {"(*QUICConn).StoreSession", Method, 23, ""}, - {"(*SessionState).Bytes", Method, 21, ""}, - {"(AlertError).Error", Method, 21, ""}, - {"(ClientAuthType).String", Method, 15, ""}, - {"(ClientSessionCache).Get", Method, 3, ""}, - {"(ClientSessionCache).Put", Method, 3, ""}, - {"(CurveID).String", Method, 15, ""}, - {"(QUICEncryptionLevel).String", Method, 21, ""}, - {"(RecordHeaderError).Error", Method, 6, ""}, - {"(SignatureScheme).String", Method, 15, ""}, - {"AlertError", Type, 21, ""}, - {"Certificate", Type, 0, ""}, - {"Certificate.Certificate", Field, 0, ""}, - {"Certificate.Leaf", Field, 0, ""}, - {"Certificate.OCSPStaple", Field, 0, ""}, - {"Certificate.PrivateKey", Field, 0, ""}, - {"Certificate.SignedCertificateTimestamps", Field, 5, ""}, - {"Certificate.SupportedSignatureAlgorithms", Field, 14, ""}, - {"CertificateRequestInfo", Type, 8, ""}, - {"CertificateRequestInfo.AcceptableCAs", Field, 8, ""}, - {"CertificateRequestInfo.SignatureSchemes", Field, 8, ""}, - {"CertificateRequestInfo.Version", Field, 14, ""}, - {"CertificateVerificationError", Type, 20, ""}, - {"CertificateVerificationError.Err", Field, 20, ""}, - {"CertificateVerificationError.UnverifiedCertificates", Field, 20, ""}, - {"CipherSuite", Type, 14, ""}, - {"CipherSuite.ID", Field, 14, ""}, - {"CipherSuite.Insecure", Field, 14, ""}, - {"CipherSuite.Name", Field, 14, ""}, - {"CipherSuite.SupportedVersions", Field, 14, ""}, - {"CipherSuiteName", Func, 14, "func(id uint16) string"}, - {"CipherSuites", Func, 14, "func() []*CipherSuite"}, - {"Client", Func, 0, "func(conn net.Conn, config *Config) *Conn"}, - {"ClientAuthType", Type, 0, ""}, - {"ClientHelloInfo", Type, 4, ""}, - {"ClientHelloInfo.CipherSuites", Field, 4, ""}, - {"ClientHelloInfo.Conn", Field, 8, ""}, - {"ClientHelloInfo.Extensions", Field, 24, ""}, - {"ClientHelloInfo.HelloRetryRequest", Field, 26, ""}, - {"ClientHelloInfo.ServerName", Field, 4, ""}, - {"ClientHelloInfo.SignatureSchemes", Field, 8, ""}, - {"ClientHelloInfo.SupportedCurves", Field, 4, ""}, - {"ClientHelloInfo.SupportedPoints", Field, 4, ""}, - {"ClientHelloInfo.SupportedProtos", Field, 8, ""}, - {"ClientHelloInfo.SupportedVersions", Field, 8, ""}, - {"ClientSessionCache", Type, 3, ""}, - {"ClientSessionState", Type, 3, ""}, - {"Config", Type, 0, ""}, - {"Config.Certificates", Field, 0, ""}, - {"Config.CipherSuites", Field, 0, ""}, - {"Config.ClientAuth", Field, 0, ""}, - {"Config.ClientCAs", Field, 0, ""}, - {"Config.ClientSessionCache", Field, 3, ""}, - {"Config.CurvePreferences", Field, 3, ""}, - {"Config.DynamicRecordSizingDisabled", Field, 7, ""}, - {"Config.EncryptedClientHelloConfigList", Field, 23, ""}, - {"Config.EncryptedClientHelloKeys", Field, 24, ""}, - {"Config.EncryptedClientHelloRejectionVerify", Field, 23, ""}, - {"Config.GetCertificate", Field, 4, ""}, - {"Config.GetClientCertificate", Field, 8, ""}, - {"Config.GetConfigForClient", Field, 8, ""}, - {"Config.GetEncryptedClientHelloKeys", Field, 25, ""}, - {"Config.InsecureSkipVerify", Field, 0, ""}, - {"Config.KeyLogWriter", Field, 8, ""}, - {"Config.MaxVersion", Field, 2, ""}, - {"Config.MinVersion", Field, 2, ""}, - {"Config.NameToCertificate", Field, 0, ""}, - {"Config.NextProtos", Field, 0, ""}, - {"Config.PreferServerCipherSuites", Field, 1, ""}, - {"Config.Rand", Field, 0, ""}, - {"Config.Renegotiation", Field, 7, ""}, - {"Config.RootCAs", Field, 0, ""}, - {"Config.ServerName", Field, 0, ""}, - {"Config.SessionTicketKey", Field, 1, ""}, - {"Config.SessionTicketsDisabled", Field, 1, ""}, - {"Config.Time", Field, 0, ""}, - {"Config.UnwrapSession", Field, 21, ""}, - {"Config.VerifyConnection", Field, 15, ""}, - {"Config.VerifyPeerCertificate", Field, 8, ""}, - {"Config.WrapSession", Field, 21, ""}, - {"Conn", Type, 0, ""}, - {"ConnectionState", Type, 0, ""}, - {"ConnectionState.CipherSuite", Field, 0, ""}, - {"ConnectionState.CurveID", Field, 25, ""}, - {"ConnectionState.DidResume", Field, 1, ""}, - {"ConnectionState.ECHAccepted", Field, 23, ""}, - {"ConnectionState.HandshakeComplete", Field, 0, ""}, - {"ConnectionState.HelloRetryRequest", Field, 26, ""}, - {"ConnectionState.LocalCertificate", Field, 27, ""}, - {"ConnectionState.NegotiatedProtocol", Field, 0, ""}, - {"ConnectionState.NegotiatedProtocolIsMutual", Field, 0, ""}, - {"ConnectionState.OCSPResponse", Field, 5, ""}, - {"ConnectionState.PeerCertificates", Field, 0, ""}, - {"ConnectionState.ServerName", Field, 0, ""}, - {"ConnectionState.SignedCertificateTimestamps", Field, 5, ""}, - {"ConnectionState.TLSUnique", Field, 4, ""}, - {"ConnectionState.VerifiedChains", Field, 0, ""}, - {"ConnectionState.Version", Field, 3, ""}, - {"CurveID", Type, 3, ""}, - {"CurveP256", Const, 3, ""}, - {"CurveP384", Const, 3, ""}, - {"CurveP521", Const, 3, ""}, - {"Dial", Func, 0, "func(network string, addr string, config *Config) (*Conn, error)"}, - {"DialWithDialer", Func, 3, "func(dialer *net.Dialer, network string, addr string, config *Config) (*Conn, error)"}, - {"Dialer", Type, 15, ""}, - {"Dialer.Config", Field, 15, ""}, - {"Dialer.NetDialer", Field, 15, ""}, - {"ECDSAWithP256AndSHA256", Const, 8, ""}, - {"ECDSAWithP384AndSHA384", Const, 8, ""}, - {"ECDSAWithP521AndSHA512", Const, 8, ""}, - {"ECDSAWithSHA1", Const, 10, ""}, - {"ECHRejectionError", Type, 23, ""}, - {"ECHRejectionError.RetryConfigList", Field, 23, ""}, - {"Ed25519", Const, 13, ""}, - {"EncryptedClientHelloKey", Type, 24, ""}, - {"EncryptedClientHelloKey.Config", Field, 24, ""}, - {"EncryptedClientHelloKey.PrivateKey", Field, 24, ""}, - {"EncryptedClientHelloKey.SendAsRetry", Field, 24, ""}, - {"InsecureCipherSuites", Func, 14, "func() []*CipherSuite"}, - {"Listen", Func, 0, "func(network string, laddr string, config *Config) (net.Listener, error)"}, - {"LoadX509KeyPair", Func, 0, "func(certFile string, keyFile string) (Certificate, error)"}, - {"MLDSA44", Const, 27, ""}, - {"MLDSA65", Const, 27, ""}, - {"MLDSA87", Const, 27, ""}, - {"MLKEM1024", Const, 27, ""}, - {"NewLRUClientSessionCache", Func, 3, "func(capacity int) ClientSessionCache"}, - {"NewListener", Func, 0, "func(inner net.Listener, config *Config) net.Listener"}, - {"NewResumptionState", Func, 21, "func(ticket []byte, state *SessionState) (*ClientSessionState, error)"}, - {"NoClientCert", Const, 0, ""}, - {"PKCS1WithSHA1", Const, 8, ""}, - {"PKCS1WithSHA256", Const, 8, ""}, - {"PKCS1WithSHA384", Const, 8, ""}, - {"PKCS1WithSHA512", Const, 8, ""}, - {"PSSWithSHA256", Const, 8, ""}, - {"PSSWithSHA384", Const, 8, ""}, - {"PSSWithSHA512", Const, 8, ""}, - {"ParseSessionState", Func, 21, "func(data []byte) (*SessionState, error)"}, - {"QUICClient", Func, 21, "func(config *QUICConfig) *QUICConn"}, - {"QUICConfig", Type, 21, ""}, - {"QUICConfig.ClientHelloInfoConn", Field, 27, ""}, - {"QUICConfig.EnableSessionEvents", Field, 23, ""}, - {"QUICConfig.TLSConfig", Field, 21, ""}, - {"QUICConn", Type, 21, ""}, - {"QUICEncryptionLevel", Type, 21, ""}, - {"QUICEncryptionLevelApplication", Const, 21, ""}, - {"QUICEncryptionLevelEarly", Const, 21, ""}, - {"QUICEncryptionLevelHandshake", Const, 21, ""}, - {"QUICEncryptionLevelInitial", Const, 21, ""}, - {"QUICErrorEvent", Const, 26, ""}, - {"QUICEvent", Type, 21, ""}, - {"QUICEvent.Data", Field, 21, ""}, - {"QUICEvent.Err", Field, 26, ""}, - {"QUICEvent.Kind", Field, 21, ""}, - {"QUICEvent.Level", Field, 21, ""}, - {"QUICEvent.SessionState", Field, 23, ""}, - {"QUICEvent.Suite", Field, 21, ""}, - {"QUICEventKind", Type, 21, ""}, - {"QUICHandshakeDone", Const, 21, ""}, - {"QUICNoEvent", Const, 21, ""}, - {"QUICRejectedEarlyData", Const, 21, ""}, - {"QUICResumeSession", Const, 23, ""}, - {"QUICServer", Func, 21, "func(config *QUICConfig) *QUICConn"}, - {"QUICSessionTicketOptions", Type, 21, ""}, - {"QUICSessionTicketOptions.EarlyData", Field, 21, ""}, - {"QUICSessionTicketOptions.Extra", Field, 23, ""}, - {"QUICSetReadSecret", Const, 21, ""}, - {"QUICSetWriteSecret", Const, 21, ""}, - {"QUICStoreSession", Const, 23, ""}, - {"QUICTransportParameters", Const, 21, ""}, - {"QUICTransportParametersRequired", Const, 21, ""}, - {"QUICWriteData", Const, 21, ""}, - {"RecordHeaderError", Type, 6, ""}, - {"RecordHeaderError.Conn", Field, 12, ""}, - {"RecordHeaderError.Msg", Field, 6, ""}, - {"RecordHeaderError.RecordHeader", Field, 6, ""}, - {"RenegotiateFreelyAsClient", Const, 7, ""}, - {"RenegotiateNever", Const, 7, ""}, - {"RenegotiateOnceAsClient", Const, 7, ""}, - {"RenegotiationSupport", Type, 7, ""}, - {"RequestClientCert", Const, 0, ""}, - {"RequireAndVerifyClientCert", Const, 0, ""}, - {"RequireAnyClientCert", Const, 0, ""}, - {"SecP256r1MLKEM768", Const, 26, ""}, - {"SecP384r1MLKEM1024", Const, 26, ""}, - {"Server", Func, 0, "func(conn net.Conn, config *Config) *Conn"}, - {"SessionState", Type, 21, ""}, - {"SessionState.EarlyData", Field, 21, ""}, - {"SessionState.Extra", Field, 21, ""}, - {"SignatureScheme", Type, 8, ""}, - {"TLS_AES_128_GCM_SHA256", Const, 12, ""}, - {"TLS_AES_256_GCM_SHA384", Const, 12, ""}, - {"TLS_CHACHA20_POLY1305_SHA256", Const, 12, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", Const, 2, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", Const, 8, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", Const, 2, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", Const, 2, ""}, - {"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", Const, 5, ""}, - {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", Const, 8, ""}, - {"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", Const, 14, ""}, - {"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", Const, 2, ""}, - {"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", Const, 0, ""}, - {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", Const, 0, ""}, - {"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", Const, 8, ""}, - {"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", Const, 2, ""}, - {"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", Const, 1, ""}, - {"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", Const, 5, ""}, - {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", Const, 8, ""}, - {"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", Const, 14, ""}, - {"TLS_ECDHE_RSA_WITH_RC4_128_SHA", Const, 0, ""}, - {"TLS_FALLBACK_SCSV", Const, 4, ""}, - {"TLS_RSA_WITH_3DES_EDE_CBC_SHA", Const, 0, ""}, - {"TLS_RSA_WITH_AES_128_CBC_SHA", Const, 0, ""}, - {"TLS_RSA_WITH_AES_128_CBC_SHA256", Const, 8, ""}, - {"TLS_RSA_WITH_AES_128_GCM_SHA256", Const, 6, ""}, - {"TLS_RSA_WITH_AES_256_CBC_SHA", Const, 1, ""}, - {"TLS_RSA_WITH_AES_256_GCM_SHA384", Const, 6, ""}, - {"TLS_RSA_WITH_RC4_128_SHA", Const, 0, ""}, - {"VerifyClientCertIfGiven", Const, 0, ""}, - {"VersionName", Func, 21, "func(version uint16) string"}, - {"VersionSSL30", Const, 2, ""}, - {"VersionTLS10", Const, 2, ""}, - {"VersionTLS11", Const, 2, ""}, - {"VersionTLS12", Const, 2, ""}, - {"VersionTLS13", Const, 12, ""}, - {"X25519", Const, 8, ""}, - {"X25519MLKEM768", Const, 24, ""}, - {"X509KeyPair", Func, 0, "func(certPEMBlock []byte, keyPEMBlock []byte) (Certificate, error)"}, - }, - "crypto/x509": { - {"(*CertPool).AddCert", Method, 0, ""}, - {"(*CertPool).AddCertWithConstraint", Method, 22, ""}, - {"(*CertPool).AppendCertsFromPEM", Method, 0, ""}, - {"(*CertPool).Clone", Method, 19, ""}, - {"(*CertPool).Equal", Method, 19, ""}, - {"(*CertPool).Subjects", Method, 0, ""}, - {"(*Certificate).CheckCRLSignature", Method, 0, ""}, - {"(*Certificate).CheckSignature", Method, 0, ""}, - {"(*Certificate).CheckSignatureFrom", Method, 0, ""}, - {"(*Certificate).CreateCRL", Method, 0, ""}, - {"(*Certificate).Equal", Method, 0, ""}, - {"(*Certificate).Verify", Method, 0, ""}, - {"(*Certificate).VerifyHostname", Method, 0, ""}, - {"(*CertificateRequest).CheckSignature", Method, 5, ""}, - {"(*OID).UnmarshalBinary", Method, 23, ""}, - {"(*OID).UnmarshalText", Method, 23, ""}, - {"(*RevocationList).CheckSignatureFrom", Method, 19, ""}, - {"(CertificateInvalidError).Error", Method, 0, ""}, - {"(ConstraintViolationError).Error", Method, 0, ""}, - {"(ExtKeyUsage).OID", Method, 26, ""}, - {"(ExtKeyUsage).String", Method, 26, ""}, - {"(HostnameError).Error", Method, 0, ""}, - {"(InsecureAlgorithmError).Error", Method, 6, ""}, - {"(KeyUsage).String", Method, 26, ""}, - {"(OID).AppendBinary", Method, 24, ""}, - {"(OID).AppendText", Method, 24, ""}, - {"(OID).Equal", Method, 22, ""}, - {"(OID).EqualASN1OID", Method, 22, ""}, - {"(OID).MarshalBinary", Method, 23, ""}, - {"(OID).MarshalText", Method, 23, ""}, - {"(OID).String", Method, 22, ""}, - {"(PublicKeyAlgorithm).String", Method, 10, ""}, - {"(SignatureAlgorithm).String", Method, 6, ""}, - {"(SystemRootsError).Error", Method, 1, ""}, - {"(SystemRootsError).Unwrap", Method, 16, ""}, - {"(UnhandledCriticalExtension).Error", Method, 0, ""}, - {"(UnknownAuthorityError).Error", Method, 0, ""}, - {"CANotAuthorizedForExtKeyUsage", Const, 10, ""}, - {"CANotAuthorizedForThisName", Const, 0, ""}, - {"CertPool", Type, 0, ""}, - {"Certificate", Type, 0, ""}, - {"Certificate.AuthorityKeyId", Field, 0, ""}, - {"Certificate.BasicConstraintsValid", Field, 0, ""}, - {"Certificate.CRLDistributionPoints", Field, 2, ""}, - {"Certificate.DNSNames", Field, 0, ""}, - {"Certificate.EmailAddresses", Field, 0, ""}, - {"Certificate.ExcludedDNSDomains", Field, 9, ""}, - {"Certificate.ExcludedEmailAddresses", Field, 10, ""}, - {"Certificate.ExcludedIPRanges", Field, 10, ""}, - {"Certificate.ExcludedURIDomains", Field, 10, ""}, - {"Certificate.ExtKeyUsage", Field, 0, ""}, - {"Certificate.Extensions", Field, 2, ""}, - {"Certificate.ExtraExtensions", Field, 2, ""}, - {"Certificate.IPAddresses", Field, 1, ""}, - {"Certificate.InhibitAnyPolicy", Field, 24, ""}, - {"Certificate.InhibitAnyPolicyZero", Field, 24, ""}, - {"Certificate.InhibitPolicyMapping", Field, 24, ""}, - {"Certificate.InhibitPolicyMappingZero", Field, 24, ""}, - {"Certificate.IsCA", Field, 0, ""}, - {"Certificate.Issuer", Field, 0, ""}, - {"Certificate.IssuingCertificateURL", Field, 2, ""}, - {"Certificate.KeyUsage", Field, 0, ""}, - {"Certificate.MaxPathLen", Field, 0, ""}, - {"Certificate.MaxPathLenZero", Field, 4, ""}, - {"Certificate.NotAfter", Field, 0, ""}, - {"Certificate.NotBefore", Field, 0, ""}, - {"Certificate.OCSPServer", Field, 2, ""}, - {"Certificate.PermittedDNSDomains", Field, 0, ""}, - {"Certificate.PermittedDNSDomainsCritical", Field, 0, ""}, - {"Certificate.PermittedEmailAddresses", Field, 10, ""}, - {"Certificate.PermittedIPRanges", Field, 10, ""}, - {"Certificate.PermittedURIDomains", Field, 10, ""}, - {"Certificate.Policies", Field, 22, ""}, - {"Certificate.PolicyIdentifiers", Field, 0, ""}, - {"Certificate.PolicyMappings", Field, 24, ""}, - {"Certificate.PublicKey", Field, 0, ""}, - {"Certificate.PublicKeyAlgorithm", Field, 0, ""}, - {"Certificate.Raw", Field, 0, ""}, - {"Certificate.RawIssuer", Field, 0, ""}, - {"Certificate.RawSignatureAlgorithm", Field, 27, ""}, - {"Certificate.RawSubject", Field, 0, ""}, - {"Certificate.RawSubjectPublicKeyInfo", Field, 0, ""}, - {"Certificate.RawTBSCertificate", Field, 0, ""}, - {"Certificate.RequireExplicitPolicy", Field, 24, ""}, - {"Certificate.RequireExplicitPolicyZero", Field, 24, ""}, - {"Certificate.SerialNumber", Field, 0, ""}, - {"Certificate.Signature", Field, 0, ""}, - {"Certificate.SignatureAlgorithm", Field, 0, ""}, - {"Certificate.Subject", Field, 0, ""}, - {"Certificate.SubjectKeyId", Field, 0, ""}, - {"Certificate.URIs", Field, 10, ""}, - {"Certificate.UnhandledCriticalExtensions", Field, 5, ""}, - {"Certificate.UnknownExtKeyUsage", Field, 0, ""}, - {"Certificate.Version", Field, 0, ""}, - {"CertificateInvalidError", Type, 0, ""}, - {"CertificateInvalidError.Cert", Field, 0, ""}, - {"CertificateInvalidError.Detail", Field, 10, ""}, - {"CertificateInvalidError.Reason", Field, 0, ""}, - {"CertificateRequest", Type, 3, ""}, - {"CertificateRequest.Attributes", Field, 3, ""}, - {"CertificateRequest.DNSNames", Field, 3, ""}, - {"CertificateRequest.EmailAddresses", Field, 3, ""}, - {"CertificateRequest.Extensions", Field, 3, ""}, - {"CertificateRequest.ExtraExtensions", Field, 3, ""}, - {"CertificateRequest.IPAddresses", Field, 3, ""}, - {"CertificateRequest.PublicKey", Field, 3, ""}, - {"CertificateRequest.PublicKeyAlgorithm", Field, 3, ""}, - {"CertificateRequest.Raw", Field, 3, ""}, - {"CertificateRequest.RawSignatureAlgorithm", Field, 27, ""}, - {"CertificateRequest.RawSubject", Field, 3, ""}, - {"CertificateRequest.RawSubjectPublicKeyInfo", Field, 3, ""}, - {"CertificateRequest.RawTBSCertificateRequest", Field, 3, ""}, - {"CertificateRequest.Signature", Field, 3, ""}, - {"CertificateRequest.SignatureAlgorithm", Field, 3, ""}, - {"CertificateRequest.Subject", Field, 3, ""}, - {"CertificateRequest.URIs", Field, 10, ""}, - {"CertificateRequest.Version", Field, 3, ""}, - {"ConstraintViolationError", Type, 0, ""}, - {"CreateCertificate", Func, 0, "func(rand io.Reader, template *Certificate, parent *Certificate, pub any, priv any) ([]byte, error)"}, - {"CreateCertificateRequest", Func, 3, "func(rand io.Reader, template *CertificateRequest, priv any) (csr []byte, err error)"}, - {"CreateRevocationList", Func, 15, "func(rand io.Reader, template *RevocationList, issuer *Certificate, priv crypto.Signer) ([]byte, error)"}, - {"DSA", Const, 0, ""}, - {"DSAWithSHA1", Const, 0, ""}, - {"DSAWithSHA256", Const, 0, ""}, - {"DecryptPEMBlock", Func, 1, "func(b *pem.Block, password []byte) ([]byte, error)"}, - {"ECDSA", Const, 1, ""}, - {"ECDSAWithSHA1", Const, 1, ""}, - {"ECDSAWithSHA256", Const, 1, ""}, - {"ECDSAWithSHA384", Const, 1, ""}, - {"ECDSAWithSHA512", Const, 1, ""}, - {"Ed25519", Const, 13, ""}, - {"EncryptPEMBlock", Func, 1, "func(rand io.Reader, blockType string, data []byte, password []byte, alg PEMCipher) (*pem.Block, error)"}, - {"ErrUnsupportedAlgorithm", Var, 0, ""}, - {"Expired", Const, 0, ""}, - {"ExtKeyUsage", Type, 0, ""}, - {"ExtKeyUsageAny", Const, 0, ""}, - {"ExtKeyUsageClientAuth", Const, 0, ""}, - {"ExtKeyUsageCodeSigning", Const, 0, ""}, - {"ExtKeyUsageEmailProtection", Const, 0, ""}, - {"ExtKeyUsageIPSECEndSystem", Const, 1, ""}, - {"ExtKeyUsageIPSECTunnel", Const, 1, ""}, - {"ExtKeyUsageIPSECUser", Const, 1, ""}, - {"ExtKeyUsageMicrosoftCommercialCodeSigning", Const, 10, ""}, - {"ExtKeyUsageMicrosoftKernelCodeSigning", Const, 10, ""}, - {"ExtKeyUsageMicrosoftServerGatedCrypto", Const, 1, ""}, - {"ExtKeyUsageNetscapeServerGatedCrypto", Const, 1, ""}, - {"ExtKeyUsageOCSPSigning", Const, 0, ""}, - {"ExtKeyUsageServerAuth", Const, 0, ""}, - {"ExtKeyUsageTimeStamping", Const, 0, ""}, - {"HostnameError", Type, 0, ""}, - {"HostnameError.Certificate", Field, 0, ""}, - {"HostnameError.Host", Field, 0, ""}, - {"IncompatibleUsage", Const, 1, ""}, - {"IncorrectPasswordError", Var, 1, ""}, - {"InsecureAlgorithmError", Type, 6, ""}, - {"InvalidReason", Type, 0, ""}, - {"IsEncryptedPEMBlock", Func, 1, "func(b *pem.Block) bool"}, - {"KeyUsage", Type, 0, ""}, - {"KeyUsageCRLSign", Const, 0, ""}, - {"KeyUsageCertSign", Const, 0, ""}, - {"KeyUsageContentCommitment", Const, 0, ""}, - {"KeyUsageDataEncipherment", Const, 0, ""}, - {"KeyUsageDecipherOnly", Const, 0, ""}, - {"KeyUsageDigitalSignature", Const, 0, ""}, - {"KeyUsageEncipherOnly", Const, 0, ""}, - {"KeyUsageKeyAgreement", Const, 0, ""}, - {"KeyUsageKeyEncipherment", Const, 0, ""}, - {"MD2WithRSA", Const, 0, ""}, - {"MD5WithRSA", Const, 0, ""}, - {"MLDSA", Const, 27, ""}, - {"MLDSA44", Const, 27, ""}, - {"MLDSA65", Const, 27, ""}, - {"MLDSA87", Const, 27, ""}, - {"MarshalECPrivateKey", Func, 2, "func(key *ecdsa.PrivateKey) ([]byte, error)"}, - {"MarshalPKCS1PrivateKey", Func, 0, "func(key *rsa.PrivateKey) []byte"}, - {"MarshalPKCS1PublicKey", Func, 10, "func(key *rsa.PublicKey) []byte"}, - {"MarshalPKCS8PrivateKey", Func, 10, "func(key any) ([]byte, error)"}, - {"MarshalPKIXPublicKey", Func, 0, "func(pub any) ([]byte, error)"}, - {"NameConstraintsWithoutSANs", Const, 10, ""}, - {"NameMismatch", Const, 8, ""}, - {"NewCertPool", Func, 0, "func() *CertPool"}, - {"NoValidChains", Const, 24, ""}, - {"NotAuthorizedToSign", Const, 0, ""}, - {"OID", Type, 22, ""}, - {"OIDFromASN1OID", Func, 26, "func(asn1OID asn1.ObjectIdentifier) (OID, error)"}, - {"OIDFromInts", Func, 22, "func(oid []uint64) (OID, error)"}, - {"PEMCipher", Type, 1, ""}, - {"PEMCipher3DES", Const, 1, ""}, - {"PEMCipherAES128", Const, 1, ""}, - {"PEMCipherAES192", Const, 1, ""}, - {"PEMCipherAES256", Const, 1, ""}, - {"PEMCipherDES", Const, 1, ""}, - {"ParseCRL", Func, 0, "func(crlBytes []byte) (*pkix.CertificateList, error)"}, - {"ParseCertificate", Func, 0, "func(der []byte) (*Certificate, error)"}, - {"ParseCertificateRequest", Func, 3, "func(asn1Data []byte) (*CertificateRequest, error)"}, - {"ParseCertificates", Func, 0, "func(der []byte) ([]*Certificate, error)"}, - {"ParseDERCRL", Func, 0, "func(derBytes []byte) (*pkix.CertificateList, error)"}, - {"ParseECPrivateKey", Func, 1, "func(der []byte) (*ecdsa.PrivateKey, error)"}, - {"ParseOID", Func, 23, "func(oid string) (OID, error)"}, - {"ParsePKCS1PrivateKey", Func, 0, "func(der []byte) (*rsa.PrivateKey, error)"}, - {"ParsePKCS1PublicKey", Func, 10, "func(der []byte) (*rsa.PublicKey, error)"}, - {"ParsePKCS8PrivateKey", Func, 0, "func(der []byte) (key any, err error)"}, - {"ParsePKIXPublicKey", Func, 0, "func(derBytes []byte) (pub any, err error)"}, - {"ParseRevocationList", Func, 19, "func(der []byte) (*RevocationList, error)"}, - {"PolicyMapping", Type, 24, ""}, - {"PolicyMapping.IssuerDomainPolicy", Field, 24, ""}, - {"PolicyMapping.SubjectDomainPolicy", Field, 24, ""}, - {"PublicKeyAlgorithm", Type, 0, ""}, - {"PureEd25519", Const, 13, ""}, - {"RSA", Const, 0, ""}, - {"RevocationList", Type, 15, ""}, - {"RevocationList.AuthorityKeyId", Field, 19, ""}, - {"RevocationList.Extensions", Field, 19, ""}, - {"RevocationList.ExtraExtensions", Field, 15, ""}, - {"RevocationList.Issuer", Field, 19, ""}, - {"RevocationList.NextUpdate", Field, 15, ""}, - {"RevocationList.Number", Field, 15, ""}, - {"RevocationList.Raw", Field, 19, ""}, - {"RevocationList.RawIssuer", Field, 19, ""}, - {"RevocationList.RawSignatureAlgorithm", Field, 27, ""}, - {"RevocationList.RawTBSRevocationList", Field, 19, ""}, - {"RevocationList.RevokedCertificateEntries", Field, 21, ""}, - {"RevocationList.RevokedCertificates", Field, 15, ""}, - {"RevocationList.Signature", Field, 19, ""}, - {"RevocationList.SignatureAlgorithm", Field, 15, ""}, - {"RevocationList.ThisUpdate", Field, 15, ""}, - {"RevocationListEntry", Type, 21, ""}, - {"RevocationListEntry.Extensions", Field, 21, ""}, - {"RevocationListEntry.ExtraExtensions", Field, 21, ""}, - {"RevocationListEntry.Raw", Field, 21, ""}, - {"RevocationListEntry.ReasonCode", Field, 21, ""}, - {"RevocationListEntry.RevocationTime", Field, 21, ""}, - {"RevocationListEntry.SerialNumber", Field, 21, ""}, - {"SHA1WithRSA", Const, 0, ""}, - {"SHA256WithRSA", Const, 0, ""}, - {"SHA256WithRSAPSS", Const, 8, ""}, - {"SHA384WithRSA", Const, 0, ""}, - {"SHA384WithRSAPSS", Const, 8, ""}, - {"SHA512WithRSA", Const, 0, ""}, - {"SHA512WithRSAPSS", Const, 8, ""}, - {"SetFallbackRoots", Func, 20, "func(roots *CertPool)"}, - {"SignatureAlgorithm", Type, 0, ""}, - {"SystemCertPool", Func, 7, "func() (*CertPool, error)"}, - {"SystemRootsError", Type, 1, ""}, - {"SystemRootsError.Err", Field, 7, ""}, - {"TooManyConstraints", Const, 10, ""}, - {"TooManyIntermediates", Const, 0, ""}, - {"UnconstrainedName", Const, 10, ""}, - {"UnhandledCriticalExtension", Type, 0, ""}, - {"UnknownAuthorityError", Type, 0, ""}, - {"UnknownAuthorityError.Cert", Field, 8, ""}, - {"UnknownPublicKeyAlgorithm", Const, 0, ""}, - {"UnknownSignatureAlgorithm", Const, 0, ""}, - {"VerifyOptions", Type, 0, ""}, - {"VerifyOptions.CertificatePolicies", Field, 24, ""}, - {"VerifyOptions.CurrentTime", Field, 0, ""}, - {"VerifyOptions.DNSName", Field, 0, ""}, - {"VerifyOptions.Intermediates", Field, 0, ""}, - {"VerifyOptions.KeyUsages", Field, 1, ""}, - {"VerifyOptions.MaxConstraintComparisions", Field, 10, ""}, - {"VerifyOptions.Roots", Field, 0, ""}, - }, - "crypto/x509/pkix": { - {"(*CertificateList).HasExpired", Method, 0, ""}, - {"(*Name).FillFromRDNSequence", Method, 0, ""}, - {"(Name).String", Method, 10, ""}, - {"(Name).ToRDNSequence", Method, 0, ""}, - {"(RDNSequence).String", Method, 10, ""}, - {"AlgorithmIdentifier", Type, 0, ""}, - {"AlgorithmIdentifier.Algorithm", Field, 0, ""}, - {"AlgorithmIdentifier.Parameters", Field, 0, ""}, - {"AttributeTypeAndValue", Type, 0, ""}, - {"AttributeTypeAndValue.Type", Field, 0, ""}, - {"AttributeTypeAndValue.Value", Field, 0, ""}, - {"AttributeTypeAndValueSET", Type, 3, ""}, - {"AttributeTypeAndValueSET.Type", Field, 3, ""}, - {"AttributeTypeAndValueSET.Value", Field, 3, ""}, - {"CertificateList", Type, 0, ""}, - {"CertificateList.SignatureAlgorithm", Field, 0, ""}, - {"CertificateList.SignatureValue", Field, 0, ""}, - {"CertificateList.TBSCertList", Field, 0, ""}, - {"Extension", Type, 0, ""}, - {"Extension.Critical", Field, 0, ""}, - {"Extension.Id", Field, 0, ""}, - {"Extension.Value", Field, 0, ""}, - {"Name", Type, 0, ""}, - {"Name.CommonName", Field, 0, ""}, - {"Name.Country", Field, 0, ""}, - {"Name.ExtraNames", Field, 5, ""}, - {"Name.Locality", Field, 0, ""}, - {"Name.Names", Field, 0, ""}, - {"Name.Organization", Field, 0, ""}, - {"Name.OrganizationalUnit", Field, 0, ""}, - {"Name.PostalCode", Field, 0, ""}, - {"Name.Province", Field, 0, ""}, - {"Name.SerialNumber", Field, 0, ""}, - {"Name.StreetAddress", Field, 0, ""}, - {"RDNSequence", Type, 0, ""}, - {"RelativeDistinguishedNameSET", Type, 0, ""}, - {"RevokedCertificate", Type, 0, ""}, - {"RevokedCertificate.Extensions", Field, 0, ""}, - {"RevokedCertificate.RevocationTime", Field, 0, ""}, - {"RevokedCertificate.SerialNumber", Field, 0, ""}, - {"TBSCertificateList", Type, 0, ""}, - {"TBSCertificateList.Extensions", Field, 0, ""}, - {"TBSCertificateList.Issuer", Field, 0, ""}, - {"TBSCertificateList.NextUpdate", Field, 0, ""}, - {"TBSCertificateList.Raw", Field, 0, ""}, - {"TBSCertificateList.RevokedCertificates", Field, 0, ""}, - {"TBSCertificateList.Signature", Field, 0, ""}, - {"TBSCertificateList.ThisUpdate", Field, 0, ""}, - {"TBSCertificateList.Version", Field, 0, ""}, - }, - "database/sql": { - {"(*ColumnType).DatabaseTypeName", Method, 8, ""}, - {"(*ColumnType).DecimalSize", Method, 8, ""}, - {"(*ColumnType).Length", Method, 8, ""}, - {"(*ColumnType).Name", Method, 8, ""}, - {"(*ColumnType).Nullable", Method, 8, ""}, - {"(*ColumnType).ScanType", Method, 8, ""}, - {"(*Conn).BeginTx", Method, 9, ""}, - {"(*Conn).Close", Method, 9, ""}, - {"(*Conn).ExecContext", Method, 9, ""}, - {"(*Conn).PingContext", Method, 9, ""}, - {"(*Conn).PrepareContext", Method, 9, ""}, - {"(*Conn).QueryContext", Method, 9, ""}, - {"(*Conn).QueryRowContext", Method, 9, ""}, - {"(*Conn).Raw", Method, 13, ""}, - {"(*DB).Begin", Method, 0, ""}, - {"(*DB).BeginTx", Method, 8, ""}, - {"(*DB).Close", Method, 0, ""}, - {"(*DB).Conn", Method, 9, ""}, - {"(*DB).Driver", Method, 0, ""}, - {"(*DB).Exec", Method, 0, ""}, - {"(*DB).ExecContext", Method, 8, ""}, - {"(*DB).Ping", Method, 1, ""}, - {"(*DB).PingContext", Method, 8, ""}, - {"(*DB).Prepare", Method, 0, ""}, - {"(*DB).PrepareContext", Method, 8, ""}, - {"(*DB).Query", Method, 0, ""}, - {"(*DB).QueryContext", Method, 8, ""}, - {"(*DB).QueryRow", Method, 0, ""}, - {"(*DB).QueryRowContext", Method, 8, ""}, - {"(*DB).SetConnMaxIdleTime", Method, 15, ""}, - {"(*DB).SetConnMaxLifetime", Method, 6, ""}, - {"(*DB).SetMaxIdleConns", Method, 1, ""}, - {"(*DB).SetMaxOpenConns", Method, 2, ""}, - {"(*DB).Stats", Method, 5, ""}, - {"(*Null).Scan", Method, 22, ""}, - {"(*NullBool).Scan", Method, 0, ""}, - {"(*NullByte).Scan", Method, 17, ""}, - {"(*NullFloat64).Scan", Method, 0, ""}, - {"(*NullInt16).Scan", Method, 17, ""}, - {"(*NullInt32).Scan", Method, 13, ""}, - {"(*NullInt64).Scan", Method, 0, ""}, - {"(*NullString).Scan", Method, 0, ""}, - {"(*NullTime).Scan", Method, 13, ""}, - {"(*Row).Err", Method, 15, ""}, - {"(*Row).Scan", Method, 0, ""}, - {"(*Rows).Close", Method, 0, ""}, - {"(*Rows).ColumnTypes", Method, 8, ""}, - {"(*Rows).Columns", Method, 0, ""}, - {"(*Rows).Err", Method, 0, ""}, - {"(*Rows).Next", Method, 0, ""}, - {"(*Rows).NextResultSet", Method, 8, ""}, - {"(*Rows).Scan", Method, 0, ""}, - {"(*Stmt).Close", Method, 0, ""}, - {"(*Stmt).Exec", Method, 0, ""}, - {"(*Stmt).ExecContext", Method, 8, ""}, - {"(*Stmt).Query", Method, 0, ""}, - {"(*Stmt).QueryContext", Method, 8, ""}, - {"(*Stmt).QueryRow", Method, 0, ""}, - {"(*Stmt).QueryRowContext", Method, 8, ""}, - {"(*Tx).Commit", Method, 0, ""}, - {"(*Tx).Exec", Method, 0, ""}, - {"(*Tx).ExecContext", Method, 8, ""}, - {"(*Tx).Prepare", Method, 0, ""}, - {"(*Tx).PrepareContext", Method, 8, ""}, - {"(*Tx).Query", Method, 0, ""}, - {"(*Tx).QueryContext", Method, 8, ""}, - {"(*Tx).QueryRow", Method, 0, ""}, - {"(*Tx).QueryRowContext", Method, 8, ""}, - {"(*Tx).Rollback", Method, 0, ""}, - {"(*Tx).Stmt", Method, 0, ""}, - {"(*Tx).StmtContext", Method, 8, ""}, - {"(IsolationLevel).String", Method, 11, ""}, - {"(Null).Value", Method, 22, ""}, - {"(NullBool).Value", Method, 0, ""}, - {"(NullByte).Value", Method, 17, ""}, - {"(NullFloat64).Value", Method, 0, ""}, - {"(NullInt16).Value", Method, 17, ""}, - {"(NullInt32).Value", Method, 13, ""}, - {"(NullInt64).Value", Method, 0, ""}, - {"(NullString).Value", Method, 0, ""}, - {"(NullTime).Value", Method, 13, ""}, - {"(Result).LastInsertId", Method, 0, ""}, - {"(Result).RowsAffected", Method, 0, ""}, - {"(Scanner).Scan", Method, 0, ""}, - {"ColumnType", Type, 8, ""}, - {"Conn", Type, 9, ""}, - {"ConvertAssign", Func, 27, "func(scanCtx driver.ScanContext, dest any, src driver.Value) error"}, - {"DB", Type, 0, ""}, - {"DBStats", Type, 5, ""}, - {"DBStats.Idle", Field, 11, ""}, - {"DBStats.InUse", Field, 11, ""}, - {"DBStats.MaxIdleClosed", Field, 11, ""}, - {"DBStats.MaxIdleTimeClosed", Field, 15, ""}, - {"DBStats.MaxLifetimeClosed", Field, 11, ""}, - {"DBStats.MaxOpenConnections", Field, 11, ""}, - {"DBStats.OpenConnections", Field, 5, ""}, - {"DBStats.WaitCount", Field, 11, ""}, - {"DBStats.WaitDuration", Field, 11, ""}, - {"Drivers", Func, 4, "func() []string"}, - {"ErrConnDone", Var, 9, ""}, - {"ErrNoRows", Var, 0, ""}, - {"ErrTxDone", Var, 0, ""}, - {"IsolationLevel", Type, 8, ""}, - {"LevelDefault", Const, 8, ""}, - {"LevelLinearizable", Const, 8, ""}, - {"LevelReadCommitted", Const, 8, ""}, - {"LevelReadUncommitted", Const, 8, ""}, - {"LevelRepeatableRead", Const, 8, ""}, - {"LevelSerializable", Const, 8, ""}, - {"LevelSnapshot", Const, 8, ""}, - {"LevelWriteCommitted", Const, 8, ""}, - {"Named", Func, 8, "func(name string, value any) NamedArg"}, - {"NamedArg", Type, 8, ""}, - {"NamedArg.Name", Field, 8, ""}, - {"NamedArg.Value", Field, 8, ""}, - {"Null", Type, 22, ""}, - {"NullBool", Type, 0, ""}, - {"NullBool.Bool", Field, 0, ""}, - {"NullBool.Valid", Field, 0, ""}, - {"NullByte", Type, 17, ""}, - {"NullByte.Byte", Field, 17, ""}, - {"NullByte.Valid", Field, 17, ""}, - {"NullFloat64", Type, 0, ""}, - {"NullFloat64.Float64", Field, 0, ""}, - {"NullFloat64.Valid", Field, 0, ""}, - {"NullInt16", Type, 17, ""}, - {"NullInt16.Int16", Field, 17, ""}, - {"NullInt16.Valid", Field, 17, ""}, - {"NullInt32", Type, 13, ""}, - {"NullInt32.Int32", Field, 13, ""}, - {"NullInt32.Valid", Field, 13, ""}, - {"NullInt64", Type, 0, ""}, - {"NullInt64.Int64", Field, 0, ""}, - {"NullInt64.Valid", Field, 0, ""}, - {"NullString", Type, 0, ""}, - {"NullString.String", Field, 0, ""}, - {"NullString.Valid", Field, 0, ""}, - {"NullTime", Type, 13, ""}, - {"NullTime.Time", Field, 13, ""}, - {"NullTime.Valid", Field, 13, ""}, - {"Open", Func, 0, "func(driverName string, dataSourceName string) (*DB, error)"}, - {"OpenDB", Func, 10, "func(c driver.Connector) *DB"}, - {"Out", Type, 9, ""}, - {"Out.Dest", Field, 9, ""}, - {"Out.In", Field, 9, ""}, - {"RawBytes", Type, 0, ""}, - {"Register", Func, 0, "func(name string, driver driver.Driver)"}, - {"Result", Type, 0, ""}, - {"Row", Type, 0, ""}, - {"Rows", Type, 0, ""}, - {"Scanner", Type, 0, ""}, - {"Stmt", Type, 0, ""}, - {"Tx", Type, 0, ""}, - {"TxOptions", Type, 8, ""}, - {"TxOptions.Isolation", Field, 8, ""}, - {"TxOptions.ReadOnly", Field, 8, ""}, - }, - "database/sql/driver": { - {"(ColumnConverter).ColumnConverter", Method, 0, ""}, - {"(Conn).Begin", Method, 0, ""}, - {"(Conn).Close", Method, 0, ""}, - {"(Conn).Prepare", Method, 0, ""}, - {"(ConnBeginTx).BeginTx", Method, 8, ""}, - {"(ConnPrepareContext).PrepareContext", Method, 8, ""}, - {"(Connector).Connect", Method, 10, ""}, - {"(Connector).Driver", Method, 10, ""}, - {"(Driver).Open", Method, 0, ""}, - {"(DriverContext).OpenConnector", Method, 10, ""}, - {"(Execer).Exec", Method, 0, ""}, - {"(ExecerContext).ExecContext", Method, 8, ""}, - {"(NamedValueChecker).CheckNamedValue", Method, 9, ""}, - {"(NotNull).ConvertValue", Method, 0, ""}, - {"(Null).ConvertValue", Method, 0, ""}, - {"(Pinger).Ping", Method, 8, ""}, - {"(Queryer).Query", Method, 1, ""}, - {"(QueryerContext).QueryContext", Method, 8, ""}, - {"(Result).LastInsertId", Method, 0, ""}, - {"(Result).RowsAffected", Method, 0, ""}, - {"(Rows).Close", Method, 0, ""}, - {"(Rows).Columns", Method, 0, ""}, - {"(Rows).Next", Method, 0, ""}, - {"(RowsAffected).LastInsertId", Method, 0, ""}, - {"(RowsAffected).RowsAffected", Method, 0, ""}, - {"(RowsColumnScanner).Close", Method, 27, ""}, - {"(RowsColumnScanner).Columns", Method, 27, ""}, - {"(RowsColumnScanner).Next", Method, 27, ""}, - {"(RowsColumnScanner).NextRow", Method, 27, ""}, - {"(RowsColumnScanner).ScanColumn", Method, 27, ""}, - {"(RowsColumnTypeDatabaseTypeName).Close", Method, 8, ""}, - {"(RowsColumnTypeDatabaseTypeName).ColumnTypeDatabaseTypeName", Method, 8, ""}, - {"(RowsColumnTypeDatabaseTypeName).Columns", Method, 8, ""}, - {"(RowsColumnTypeDatabaseTypeName).Next", Method, 8, ""}, - {"(RowsColumnTypeLength).Close", Method, 8, ""}, - {"(RowsColumnTypeLength).ColumnTypeLength", Method, 8, ""}, - {"(RowsColumnTypeLength).Columns", Method, 8, ""}, - {"(RowsColumnTypeLength).Next", Method, 8, ""}, - {"(RowsColumnTypeNullable).Close", Method, 8, ""}, - {"(RowsColumnTypeNullable).ColumnTypeNullable", Method, 8, ""}, - {"(RowsColumnTypeNullable).Columns", Method, 8, ""}, - {"(RowsColumnTypeNullable).Next", Method, 8, ""}, - {"(RowsColumnTypePrecisionScale).Close", Method, 8, ""}, - {"(RowsColumnTypePrecisionScale).ColumnTypePrecisionScale", Method, 8, ""}, - {"(RowsColumnTypePrecisionScale).Columns", Method, 8, ""}, - {"(RowsColumnTypePrecisionScale).Next", Method, 8, ""}, - {"(RowsColumnTypeScanType).Close", Method, 8, ""}, - {"(RowsColumnTypeScanType).ColumnTypeScanType", Method, 8, ""}, - {"(RowsColumnTypeScanType).Columns", Method, 8, ""}, - {"(RowsColumnTypeScanType).Next", Method, 8, ""}, - {"(RowsNextResultSet).Close", Method, 8, ""}, - {"(RowsNextResultSet).Columns", Method, 8, ""}, - {"(RowsNextResultSet).HasNextResultSet", Method, 8, ""}, - {"(RowsNextResultSet).Next", Method, 8, ""}, - {"(RowsNextResultSet).NextResultSet", Method, 8, ""}, - {"(SessionResetter).ResetSession", Method, 10, ""}, - {"(Stmt).Close", Method, 0, ""}, - {"(Stmt).Exec", Method, 0, ""}, - {"(Stmt).NumInput", Method, 0, ""}, - {"(Stmt).Query", Method, 0, ""}, - {"(StmtExecContext).ExecContext", Method, 8, ""}, - {"(StmtQueryContext).QueryContext", Method, 8, ""}, - {"(Tx).Commit", Method, 0, ""}, - {"(Tx).Rollback", Method, 0, ""}, - {"(Validator).IsValid", Method, 15, ""}, - {"(ValueConverter).ConvertValue", Method, 0, ""}, - {"(Valuer).Value", Method, 0, ""}, - {"Bool", Var, 0, ""}, - {"ColumnConverter", Type, 0, ""}, - {"Conn", Type, 0, ""}, - {"ConnBeginTx", Type, 8, ""}, - {"ConnPrepareContext", Type, 8, ""}, - {"Connector", Type, 10, ""}, - {"DefaultParameterConverter", Var, 0, ""}, - {"Driver", Type, 0, ""}, - {"DriverContext", Type, 10, ""}, - {"ErrBadConn", Var, 0, ""}, - {"ErrRemoveArgument", Var, 9, ""}, - {"ErrSkip", Var, 0, ""}, - {"Execer", Type, 0, ""}, - {"ExecerContext", Type, 8, ""}, - {"Int32", Var, 0, ""}, - {"IsScanValue", Func, 0, "func(v any) bool"}, - {"IsValue", Func, 0, "func(v any) bool"}, - {"IsolationLevel", Type, 8, ""}, - {"NamedValue", Type, 8, ""}, - {"NamedValue.Name", Field, 8, ""}, - {"NamedValue.Ordinal", Field, 8, ""}, - {"NamedValue.Value", Field, 8, ""}, - {"NamedValueChecker", Type, 9, ""}, - {"NotNull", Type, 0, ""}, - {"NotNull.Converter", Field, 0, ""}, - {"Null", Type, 0, ""}, - {"Null.Converter", Field, 0, ""}, - {"Pinger", Type, 8, ""}, - {"Queryer", Type, 1, ""}, - {"QueryerContext", Type, 8, ""}, - {"Result", Type, 0, ""}, - {"ResultNoRows", Var, 0, ""}, - {"Rows", Type, 0, ""}, - {"RowsAffected", Type, 0, ""}, - {"RowsColumnScanner", Type, 27, ""}, - {"RowsColumnTypeDatabaseTypeName", Type, 8, ""}, - {"RowsColumnTypeLength", Type, 8, ""}, - {"RowsColumnTypeNullable", Type, 8, ""}, - {"RowsColumnTypePrecisionScale", Type, 8, ""}, - {"RowsColumnTypeScanType", Type, 8, ""}, - {"RowsNextResultSet", Type, 8, ""}, - {"ScanContext", Type, 27, ""}, - {"SessionResetter", Type, 10, ""}, - {"Stmt", Type, 0, ""}, - {"StmtExecContext", Type, 8, ""}, - {"StmtQueryContext", Type, 8, ""}, - {"String", Var, 0, ""}, - {"Tx", Type, 0, ""}, - {"TxOptions", Type, 8, ""}, - {"TxOptions.Isolation", Field, 8, ""}, - {"TxOptions.ReadOnly", Field, 8, ""}, - {"Validator", Type, 15, ""}, - {"Value", Type, 0, ""}, - {"ValueConverter", Type, 0, ""}, - {"Valuer", Type, 0, ""}, - }, - "debug/buildinfo": { - {"BuildInfo", Type, 18, ""}, - {"Read", Func, 18, "func(r io.ReaderAt) (*BuildInfo, error)"}, - {"ReadFile", Func, 18, "func(name string) (info *BuildInfo, err error)"}, - }, - "debug/dwarf": { - {"(*AddrType).Basic", Method, 0, ""}, - {"(*AddrType).Common", Method, 0, ""}, - {"(*AddrType).Size", Method, 0, ""}, - {"(*AddrType).String", Method, 0, ""}, - {"(*ArrayType).Common", Method, 0, ""}, - {"(*ArrayType).Size", Method, 0, ""}, - {"(*ArrayType).String", Method, 0, ""}, - {"(*BasicType).Basic", Method, 0, ""}, - {"(*BasicType).Common", Method, 0, ""}, - {"(*BasicType).Size", Method, 0, ""}, - {"(*BasicType).String", Method, 0, ""}, - {"(*BoolType).Basic", Method, 0, ""}, - {"(*BoolType).Common", Method, 0, ""}, - {"(*BoolType).Size", Method, 0, ""}, - {"(*BoolType).String", Method, 0, ""}, - {"(*CharType).Basic", Method, 0, ""}, - {"(*CharType).Common", Method, 0, ""}, - {"(*CharType).Size", Method, 0, ""}, - {"(*CharType).String", Method, 0, ""}, - {"(*CommonType).Common", Method, 0, ""}, - {"(*CommonType).Size", Method, 0, ""}, - {"(*ComplexType).Basic", Method, 0, ""}, - {"(*ComplexType).Common", Method, 0, ""}, - {"(*ComplexType).Size", Method, 0, ""}, - {"(*ComplexType).String", Method, 0, ""}, - {"(*Data).AddSection", Method, 14, ""}, - {"(*Data).AddTypes", Method, 3, ""}, - {"(*Data).LineReader", Method, 5, ""}, - {"(*Data).Ranges", Method, 7, ""}, - {"(*Data).Reader", Method, 0, ""}, - {"(*Data).Type", Method, 0, ""}, - {"(*DotDotDotType).Common", Method, 0, ""}, - {"(*DotDotDotType).Size", Method, 0, ""}, - {"(*DotDotDotType).String", Method, 0, ""}, - {"(*Entry).AttrField", Method, 5, ""}, - {"(*Entry).Val", Method, 0, ""}, - {"(*EnumType).Common", Method, 0, ""}, - {"(*EnumType).Size", Method, 0, ""}, - {"(*EnumType).String", Method, 0, ""}, - {"(*FloatType).Basic", Method, 0, ""}, - {"(*FloatType).Common", Method, 0, ""}, - {"(*FloatType).Size", Method, 0, ""}, - {"(*FloatType).String", Method, 0, ""}, - {"(*FuncType).Common", Method, 0, ""}, - {"(*FuncType).Size", Method, 0, ""}, - {"(*FuncType).String", Method, 0, ""}, - {"(*IntType).Basic", Method, 0, ""}, - {"(*IntType).Common", Method, 0, ""}, - {"(*IntType).Size", Method, 0, ""}, - {"(*IntType).String", Method, 0, ""}, - {"(*LineReader).Files", Method, 14, ""}, - {"(*LineReader).Next", Method, 5, ""}, - {"(*LineReader).Reset", Method, 5, ""}, - {"(*LineReader).Seek", Method, 5, ""}, - {"(*LineReader).SeekPC", Method, 5, ""}, - {"(*LineReader).Tell", Method, 5, ""}, - {"(*PtrType).Common", Method, 0, ""}, - {"(*PtrType).Size", Method, 0, ""}, - {"(*PtrType).String", Method, 0, ""}, - {"(*QualType).Common", Method, 0, ""}, - {"(*QualType).Size", Method, 0, ""}, - {"(*QualType).String", Method, 0, ""}, - {"(*Reader).AddressSize", Method, 5, ""}, - {"(*Reader).ByteOrder", Method, 14, ""}, - {"(*Reader).Next", Method, 0, ""}, - {"(*Reader).Seek", Method, 0, ""}, - {"(*Reader).SeekPC", Method, 7, ""}, - {"(*Reader).SkipChildren", Method, 0, ""}, - {"(*StructType).Common", Method, 0, ""}, - {"(*StructType).Defn", Method, 0, ""}, - {"(*StructType).Size", Method, 0, ""}, - {"(*StructType).String", Method, 0, ""}, - {"(*TypedefType).Common", Method, 0, ""}, - {"(*TypedefType).Size", Method, 0, ""}, - {"(*TypedefType).String", Method, 0, ""}, - {"(*UcharType).Basic", Method, 0, ""}, - {"(*UcharType).Common", Method, 0, ""}, - {"(*UcharType).Size", Method, 0, ""}, - {"(*UcharType).String", Method, 0, ""}, - {"(*UintType).Basic", Method, 0, ""}, - {"(*UintType).Common", Method, 0, ""}, - {"(*UintType).Size", Method, 0, ""}, - {"(*UintType).String", Method, 0, ""}, - {"(*UnspecifiedType).Basic", Method, 4, ""}, - {"(*UnspecifiedType).Common", Method, 4, ""}, - {"(*UnspecifiedType).Size", Method, 4, ""}, - {"(*UnspecifiedType).String", Method, 4, ""}, - {"(*UnsupportedType).Common", Method, 13, ""}, - {"(*UnsupportedType).Size", Method, 13, ""}, - {"(*UnsupportedType).String", Method, 13, ""}, - {"(*VoidType).Common", Method, 0, ""}, - {"(*VoidType).Size", Method, 0, ""}, - {"(*VoidType).String", Method, 0, ""}, - {"(Attr).GoString", Method, 0, ""}, - {"(Attr).String", Method, 0, ""}, - {"(Class).GoString", Method, 5, ""}, - {"(Class).String", Method, 5, ""}, - {"(DecodeError).Error", Method, 0, ""}, - {"(Tag).GoString", Method, 0, ""}, - {"(Tag).String", Method, 0, ""}, - {"(Type).Common", Method, 0, ""}, - {"(Type).Size", Method, 0, ""}, - {"(Type).String", Method, 0, ""}, - {"AddrType", Type, 0, ""}, - {"AddrType.BasicType", Field, 0, ""}, - {"ArrayType", Type, 0, ""}, - {"ArrayType.CommonType", Field, 0, ""}, - {"ArrayType.Count", Field, 0, ""}, - {"ArrayType.StrideBitSize", Field, 0, ""}, - {"ArrayType.Type", Field, 0, ""}, - {"Attr", Type, 0, ""}, - {"AttrAbstractOrigin", Const, 0, ""}, - {"AttrAccessibility", Const, 0, ""}, - {"AttrAddrBase", Const, 14, ""}, - {"AttrAddrClass", Const, 0, ""}, - {"AttrAlignment", Const, 14, ""}, - {"AttrAllocated", Const, 0, ""}, - {"AttrArtificial", Const, 0, ""}, - {"AttrAssociated", Const, 0, ""}, - {"AttrBaseTypes", Const, 0, ""}, - {"AttrBinaryScale", Const, 14, ""}, - {"AttrBitOffset", Const, 0, ""}, - {"AttrBitSize", Const, 0, ""}, - {"AttrByteSize", Const, 0, ""}, - {"AttrCallAllCalls", Const, 14, ""}, - {"AttrCallAllSourceCalls", Const, 14, ""}, - {"AttrCallAllTailCalls", Const, 14, ""}, - {"AttrCallColumn", Const, 0, ""}, - {"AttrCallDataLocation", Const, 14, ""}, - {"AttrCallDataValue", Const, 14, ""}, - {"AttrCallFile", Const, 0, ""}, - {"AttrCallLine", Const, 0, ""}, - {"AttrCallOrigin", Const, 14, ""}, - {"AttrCallPC", Const, 14, ""}, - {"AttrCallParameter", Const, 14, ""}, - {"AttrCallReturnPC", Const, 14, ""}, - {"AttrCallTailCall", Const, 14, ""}, - {"AttrCallTarget", Const, 14, ""}, - {"AttrCallTargetClobbered", Const, 14, ""}, - {"AttrCallValue", Const, 14, ""}, - {"AttrCalling", Const, 0, ""}, - {"AttrCommonRef", Const, 0, ""}, - {"AttrCompDir", Const, 0, ""}, - {"AttrConstExpr", Const, 14, ""}, - {"AttrConstValue", Const, 0, ""}, - {"AttrContainingType", Const, 0, ""}, - {"AttrCount", Const, 0, ""}, - {"AttrDataBitOffset", Const, 14, ""}, - {"AttrDataLocation", Const, 0, ""}, - {"AttrDataMemberLoc", Const, 0, ""}, - {"AttrDecimalScale", Const, 14, ""}, - {"AttrDecimalSign", Const, 14, ""}, - {"AttrDeclColumn", Const, 0, ""}, - {"AttrDeclFile", Const, 0, ""}, - {"AttrDeclLine", Const, 0, ""}, - {"AttrDeclaration", Const, 0, ""}, - {"AttrDefaultValue", Const, 0, ""}, - {"AttrDefaulted", Const, 14, ""}, - {"AttrDeleted", Const, 14, ""}, - {"AttrDescription", Const, 0, ""}, - {"AttrDigitCount", Const, 14, ""}, - {"AttrDiscr", Const, 0, ""}, - {"AttrDiscrList", Const, 0, ""}, - {"AttrDiscrValue", Const, 0, ""}, - {"AttrDwoName", Const, 14, ""}, - {"AttrElemental", Const, 14, ""}, - {"AttrEncoding", Const, 0, ""}, - {"AttrEndianity", Const, 14, ""}, - {"AttrEntrypc", Const, 0, ""}, - {"AttrEnumClass", Const, 14, ""}, - {"AttrExplicit", Const, 14, ""}, - {"AttrExportSymbols", Const, 14, ""}, - {"AttrExtension", Const, 0, ""}, - {"AttrExternal", Const, 0, ""}, - {"AttrFrameBase", Const, 0, ""}, - {"AttrFriend", Const, 0, ""}, - {"AttrHighpc", Const, 0, ""}, - {"AttrIdentifierCase", Const, 0, ""}, - {"AttrImport", Const, 0, ""}, - {"AttrInline", Const, 0, ""}, - {"AttrIsOptional", Const, 0, ""}, - {"AttrLanguage", Const, 0, ""}, - {"AttrLinkageName", Const, 14, ""}, - {"AttrLocation", Const, 0, ""}, - {"AttrLoclistsBase", Const, 14, ""}, - {"AttrLowerBound", Const, 0, ""}, - {"AttrLowpc", Const, 0, ""}, - {"AttrMacroInfo", Const, 0, ""}, - {"AttrMacros", Const, 14, ""}, - {"AttrMainSubprogram", Const, 14, ""}, - {"AttrMutable", Const, 14, ""}, - {"AttrName", Const, 0, ""}, - {"AttrNamelistItem", Const, 0, ""}, - {"AttrNoreturn", Const, 14, ""}, - {"AttrObjectPointer", Const, 14, ""}, - {"AttrOrdering", Const, 0, ""}, - {"AttrPictureString", Const, 14, ""}, - {"AttrPriority", Const, 0, ""}, - {"AttrProducer", Const, 0, ""}, - {"AttrPrototyped", Const, 0, ""}, - {"AttrPure", Const, 14, ""}, - {"AttrRanges", Const, 0, ""}, - {"AttrRank", Const, 14, ""}, - {"AttrRecursive", Const, 14, ""}, - {"AttrReference", Const, 14, ""}, - {"AttrReturnAddr", Const, 0, ""}, - {"AttrRnglistsBase", Const, 14, ""}, - {"AttrRvalueReference", Const, 14, ""}, - {"AttrSegment", Const, 0, ""}, - {"AttrSibling", Const, 0, ""}, - {"AttrSignature", Const, 14, ""}, - {"AttrSmall", Const, 14, ""}, - {"AttrSpecification", Const, 0, ""}, - {"AttrStartScope", Const, 0, ""}, - {"AttrStaticLink", Const, 0, ""}, - {"AttrStmtList", Const, 0, ""}, - {"AttrStrOffsetsBase", Const, 14, ""}, - {"AttrStride", Const, 0, ""}, - {"AttrStrideSize", Const, 0, ""}, - {"AttrStringLength", Const, 0, ""}, - {"AttrStringLengthBitSize", Const, 14, ""}, - {"AttrStringLengthByteSize", Const, 14, ""}, - {"AttrThreadsScaled", Const, 14, ""}, - {"AttrTrampoline", Const, 0, ""}, - {"AttrType", Const, 0, ""}, - {"AttrUpperBound", Const, 0, ""}, - {"AttrUseLocation", Const, 0, ""}, - {"AttrUseUTF8", Const, 0, ""}, - {"AttrVarParam", Const, 0, ""}, - {"AttrVirtuality", Const, 0, ""}, - {"AttrVisibility", Const, 0, ""}, - {"AttrVtableElemLoc", Const, 0, ""}, - {"BasicType", Type, 0, ""}, - {"BasicType.BitOffset", Field, 0, ""}, - {"BasicType.BitSize", Field, 0, ""}, - {"BasicType.CommonType", Field, 0, ""}, - {"BasicType.DataBitOffset", Field, 18, ""}, - {"BoolType", Type, 0, ""}, - {"BoolType.BasicType", Field, 0, ""}, - {"CharType", Type, 0, ""}, - {"CharType.BasicType", Field, 0, ""}, - {"Class", Type, 5, ""}, - {"ClassAddrPtr", Const, 14, ""}, - {"ClassAddress", Const, 5, ""}, - {"ClassBlock", Const, 5, ""}, - {"ClassConstant", Const, 5, ""}, - {"ClassExprLoc", Const, 5, ""}, - {"ClassFlag", Const, 5, ""}, - {"ClassLinePtr", Const, 5, ""}, - {"ClassLocList", Const, 14, ""}, - {"ClassLocListPtr", Const, 5, ""}, - {"ClassMacPtr", Const, 5, ""}, - {"ClassRangeListPtr", Const, 5, ""}, - {"ClassReference", Const, 5, ""}, - {"ClassReferenceAlt", Const, 5, ""}, - {"ClassReferenceSig", Const, 5, ""}, - {"ClassRngList", Const, 14, ""}, - {"ClassRngListsPtr", Const, 14, ""}, - {"ClassStrOffsetsPtr", Const, 14, ""}, - {"ClassString", Const, 5, ""}, - {"ClassStringAlt", Const, 5, ""}, - {"ClassUnknown", Const, 6, ""}, - {"CommonType", Type, 0, ""}, - {"CommonType.ByteSize", Field, 0, ""}, - {"CommonType.Name", Field, 0, ""}, - {"ComplexType", Type, 0, ""}, - {"ComplexType.BasicType", Field, 0, ""}, - {"Data", Type, 0, ""}, - {"DecodeError", Type, 0, ""}, - {"DecodeError.Err", Field, 0, ""}, - {"DecodeError.Name", Field, 0, ""}, - {"DecodeError.Offset", Field, 0, ""}, - {"DotDotDotType", Type, 0, ""}, - {"DotDotDotType.CommonType", Field, 0, ""}, - {"Entry", Type, 0, ""}, - {"Entry.Children", Field, 0, ""}, - {"Entry.Field", Field, 0, ""}, - {"Entry.Offset", Field, 0, ""}, - {"Entry.Tag", Field, 0, ""}, - {"EnumType", Type, 0, ""}, - {"EnumType.CommonType", Field, 0, ""}, - {"EnumType.EnumName", Field, 0, ""}, - {"EnumType.Val", Field, 0, ""}, - {"EnumValue", Type, 0, ""}, - {"EnumValue.Name", Field, 0, ""}, - {"EnumValue.Val", Field, 0, ""}, - {"ErrUnknownPC", Var, 5, ""}, - {"Field", Type, 0, ""}, - {"Field.Attr", Field, 0, ""}, - {"Field.Class", Field, 5, ""}, - {"Field.Val", Field, 0, ""}, - {"FloatType", Type, 0, ""}, - {"FloatType.BasicType", Field, 0, ""}, - {"FuncType", Type, 0, ""}, - {"FuncType.CommonType", Field, 0, ""}, - {"FuncType.ParamType", Field, 0, ""}, - {"FuncType.ReturnType", Field, 0, ""}, - {"IntType", Type, 0, ""}, - {"IntType.BasicType", Field, 0, ""}, - {"LineEntry", Type, 5, ""}, - {"LineEntry.Address", Field, 5, ""}, - {"LineEntry.BasicBlock", Field, 5, ""}, - {"LineEntry.Column", Field, 5, ""}, - {"LineEntry.Discriminator", Field, 5, ""}, - {"LineEntry.EndSequence", Field, 5, ""}, - {"LineEntry.EpilogueBegin", Field, 5, ""}, - {"LineEntry.File", Field, 5, ""}, - {"LineEntry.ISA", Field, 5, ""}, - {"LineEntry.IsStmt", Field, 5, ""}, - {"LineEntry.Line", Field, 5, ""}, - {"LineEntry.OpIndex", Field, 5, ""}, - {"LineEntry.PrologueEnd", Field, 5, ""}, - {"LineFile", Type, 5, ""}, - {"LineFile.Length", Field, 5, ""}, - {"LineFile.Mtime", Field, 5, ""}, - {"LineFile.Name", Field, 5, ""}, - {"LineReader", Type, 5, ""}, - {"LineReaderPos", Type, 5, ""}, - {"New", Func, 0, "func(abbrev []byte, aranges []byte, frame []byte, info []byte, line []byte, pubnames []byte, ranges []byte, str []byte) (*Data, error)"}, - {"Offset", Type, 0, ""}, - {"PtrType", Type, 0, ""}, - {"PtrType.CommonType", Field, 0, ""}, - {"PtrType.Type", Field, 0, ""}, - {"QualType", Type, 0, ""}, - {"QualType.CommonType", Field, 0, ""}, - {"QualType.Qual", Field, 0, ""}, - {"QualType.Type", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"StructField", Type, 0, ""}, - {"StructField.BitOffset", Field, 0, ""}, - {"StructField.BitSize", Field, 0, ""}, - {"StructField.ByteOffset", Field, 0, ""}, - {"StructField.ByteSize", Field, 0, ""}, - {"StructField.DataBitOffset", Field, 18, ""}, - {"StructField.Name", Field, 0, ""}, - {"StructField.Type", Field, 0, ""}, - {"StructType", Type, 0, ""}, - {"StructType.CommonType", Field, 0, ""}, - {"StructType.Field", Field, 0, ""}, - {"StructType.Incomplete", Field, 0, ""}, - {"StructType.Kind", Field, 0, ""}, - {"StructType.StructName", Field, 0, ""}, - {"Tag", Type, 0, ""}, - {"TagAccessDeclaration", Const, 0, ""}, - {"TagArrayType", Const, 0, ""}, - {"TagAtomicType", Const, 14, ""}, - {"TagBaseType", Const, 0, ""}, - {"TagCallSite", Const, 14, ""}, - {"TagCallSiteParameter", Const, 14, ""}, - {"TagCatchDwarfBlock", Const, 0, ""}, - {"TagClassType", Const, 0, ""}, - {"TagCoarrayType", Const, 14, ""}, - {"TagCommonDwarfBlock", Const, 0, ""}, - {"TagCommonInclusion", Const, 0, ""}, - {"TagCompileUnit", Const, 0, ""}, - {"TagCondition", Const, 3, ""}, - {"TagConstType", Const, 0, ""}, - {"TagConstant", Const, 0, ""}, - {"TagDwarfProcedure", Const, 0, ""}, - {"TagDynamicType", Const, 14, ""}, - {"TagEntryPoint", Const, 0, ""}, - {"TagEnumerationType", Const, 0, ""}, - {"TagEnumerator", Const, 0, ""}, - {"TagFileType", Const, 0, ""}, - {"TagFormalParameter", Const, 0, ""}, - {"TagFriend", Const, 0, ""}, - {"TagGenericSubrange", Const, 14, ""}, - {"TagImmutableType", Const, 14, ""}, - {"TagImportedDeclaration", Const, 0, ""}, - {"TagImportedModule", Const, 0, ""}, - {"TagImportedUnit", Const, 0, ""}, - {"TagInheritance", Const, 0, ""}, - {"TagInlinedSubroutine", Const, 0, ""}, - {"TagInterfaceType", Const, 0, ""}, - {"TagLabel", Const, 0, ""}, - {"TagLexDwarfBlock", Const, 0, ""}, - {"TagMember", Const, 0, ""}, - {"TagModule", Const, 0, ""}, - {"TagMutableType", Const, 0, ""}, - {"TagNamelist", Const, 0, ""}, - {"TagNamelistItem", Const, 0, ""}, - {"TagNamespace", Const, 0, ""}, - {"TagPackedType", Const, 0, ""}, - {"TagPartialUnit", Const, 0, ""}, - {"TagPointerType", Const, 0, ""}, - {"TagPtrToMemberType", Const, 0, ""}, - {"TagReferenceType", Const, 0, ""}, - {"TagRestrictType", Const, 0, ""}, - {"TagRvalueReferenceType", Const, 3, ""}, - {"TagSetType", Const, 0, ""}, - {"TagSharedType", Const, 3, ""}, - {"TagSkeletonUnit", Const, 14, ""}, - {"TagStringType", Const, 0, ""}, - {"TagStructType", Const, 0, ""}, - {"TagSubprogram", Const, 0, ""}, - {"TagSubrangeType", Const, 0, ""}, - {"TagSubroutineType", Const, 0, ""}, - {"TagTemplateAlias", Const, 3, ""}, - {"TagTemplateTypeParameter", Const, 0, ""}, - {"TagTemplateValueParameter", Const, 0, ""}, - {"TagThrownType", Const, 0, ""}, - {"TagTryDwarfBlock", Const, 0, ""}, - {"TagTypeUnit", Const, 3, ""}, - {"TagTypedef", Const, 0, ""}, - {"TagUnionType", Const, 0, ""}, - {"TagUnspecifiedParameters", Const, 0, ""}, - {"TagUnspecifiedType", Const, 0, ""}, - {"TagVariable", Const, 0, ""}, - {"TagVariant", Const, 0, ""}, - {"TagVariantPart", Const, 0, ""}, - {"TagVolatileType", Const, 0, ""}, - {"TagWithStmt", Const, 0, ""}, - {"Type", Type, 0, ""}, - {"TypedefType", Type, 0, ""}, - {"TypedefType.CommonType", Field, 0, ""}, - {"TypedefType.Type", Field, 0, ""}, - {"UcharType", Type, 0, ""}, - {"UcharType.BasicType", Field, 0, ""}, - {"UintType", Type, 0, ""}, - {"UintType.BasicType", Field, 0, ""}, - {"UnspecifiedType", Type, 4, ""}, - {"UnspecifiedType.BasicType", Field, 4, ""}, - {"UnsupportedType", Type, 13, ""}, - {"UnsupportedType.CommonType", Field, 13, ""}, - {"UnsupportedType.Tag", Field, 13, ""}, - {"VoidType", Type, 0, ""}, - {"VoidType.CommonType", Field, 0, ""}, - }, - "debug/elf": { - {"(*File).Close", Method, 0, ""}, - {"(*File).DWARF", Method, 0, ""}, - {"(*File).DynString", Method, 1, ""}, - {"(*File).DynValue", Method, 21, ""}, - {"(*File).DynamicSymbols", Method, 4, ""}, - {"(*File).DynamicVersionNeeds", Method, 24, ""}, - {"(*File).DynamicVersions", Method, 24, ""}, - {"(*File).ImportedLibraries", Method, 0, ""}, - {"(*File).ImportedSymbols", Method, 0, ""}, - {"(*File).Section", Method, 0, ""}, - {"(*File).SectionByType", Method, 0, ""}, - {"(*File).Symbols", Method, 0, ""}, - {"(*FormatError).Error", Method, 0, ""}, - {"(*Prog).Open", Method, 0, ""}, - {"(*Section).Data", Method, 0, ""}, - {"(*Section).Open", Method, 0, ""}, - {"(Class).GoString", Method, 0, ""}, - {"(Class).String", Method, 0, ""}, - {"(CompressionType).GoString", Method, 6, ""}, - {"(CompressionType).String", Method, 6, ""}, - {"(Data).GoString", Method, 0, ""}, - {"(Data).String", Method, 0, ""}, - {"(DynFlag).GoString", Method, 0, ""}, - {"(DynFlag).String", Method, 0, ""}, - {"(DynFlag1).GoString", Method, 21, ""}, - {"(DynFlag1).String", Method, 21, ""}, - {"(DynTag).GoString", Method, 0, ""}, - {"(DynTag).String", Method, 0, ""}, - {"(Machine).GoString", Method, 0, ""}, - {"(Machine).String", Method, 0, ""}, - {"(NType).GoString", Method, 0, ""}, - {"(NType).String", Method, 0, ""}, - {"(OSABI).GoString", Method, 0, ""}, - {"(OSABI).String", Method, 0, ""}, - {"(Prog).ReadAt", Method, 0, ""}, - {"(ProgFlag).GoString", Method, 0, ""}, - {"(ProgFlag).String", Method, 0, ""}, - {"(ProgType).GoString", Method, 0, ""}, - {"(ProgType).String", Method, 0, ""}, - {"(R_386).GoString", Method, 0, ""}, - {"(R_386).String", Method, 0, ""}, - {"(R_390).GoString", Method, 7, ""}, - {"(R_390).String", Method, 7, ""}, - {"(R_AARCH64).GoString", Method, 4, ""}, - {"(R_AARCH64).String", Method, 4, ""}, - {"(R_ALPHA).GoString", Method, 0, ""}, - {"(R_ALPHA).String", Method, 0, ""}, - {"(R_ARM).GoString", Method, 0, ""}, - {"(R_ARM).String", Method, 0, ""}, - {"(R_LARCH).GoString", Method, 19, ""}, - {"(R_LARCH).String", Method, 19, ""}, - {"(R_MIPS).GoString", Method, 6, ""}, - {"(R_MIPS).String", Method, 6, ""}, - {"(R_PPC).GoString", Method, 0, ""}, - {"(R_PPC).String", Method, 0, ""}, - {"(R_PPC64).GoString", Method, 5, ""}, - {"(R_PPC64).String", Method, 5, ""}, - {"(R_RISCV).GoString", Method, 11, ""}, - {"(R_RISCV).String", Method, 11, ""}, - {"(R_SPARC).GoString", Method, 0, ""}, - {"(R_SPARC).String", Method, 0, ""}, - {"(R_X86_64).GoString", Method, 0, ""}, - {"(R_X86_64).String", Method, 0, ""}, - {"(Section).ReadAt", Method, 0, ""}, - {"(SectionFlag).GoString", Method, 0, ""}, - {"(SectionFlag).String", Method, 0, ""}, - {"(SectionIndex).GoString", Method, 0, ""}, - {"(SectionIndex).String", Method, 0, ""}, - {"(SectionType).GoString", Method, 0, ""}, - {"(SectionType).String", Method, 0, ""}, - {"(SymBind).GoString", Method, 0, ""}, - {"(SymBind).String", Method, 0, ""}, - {"(SymType).GoString", Method, 0, ""}, - {"(SymType).String", Method, 0, ""}, - {"(SymVis).GoString", Method, 0, ""}, - {"(SymVis).String", Method, 0, ""}, - {"(Type).GoString", Method, 0, ""}, - {"(Type).String", Method, 0, ""}, - {"(Version).GoString", Method, 0, ""}, - {"(Version).String", Method, 0, ""}, - {"(VersionIndex).Index", Method, 24, ""}, - {"(VersionIndex).IsHidden", Method, 24, ""}, - {"ARM_MAGIC_TRAMP_NUMBER", Const, 0, ""}, - {"COMPRESS_HIOS", Const, 6, ""}, - {"COMPRESS_HIPROC", Const, 6, ""}, - {"COMPRESS_LOOS", Const, 6, ""}, - {"COMPRESS_LOPROC", Const, 6, ""}, - {"COMPRESS_ZLIB", Const, 6, ""}, - {"COMPRESS_ZSTD", Const, 21, ""}, - {"Chdr32", Type, 6, ""}, - {"Chdr32.Addralign", Field, 6, ""}, - {"Chdr32.Size", Field, 6, ""}, - {"Chdr32.Type", Field, 6, ""}, - {"Chdr64", Type, 6, ""}, - {"Chdr64.Addralign", Field, 6, ""}, - {"Chdr64.Size", Field, 6, ""}, - {"Chdr64.Type", Field, 6, ""}, - {"Class", Type, 0, ""}, - {"CompressionType", Type, 6, ""}, - {"DF_1_CONFALT", Const, 21, ""}, - {"DF_1_DIRECT", Const, 21, ""}, - {"DF_1_DISPRELDNE", Const, 21, ""}, - {"DF_1_DISPRELPND", Const, 21, ""}, - {"DF_1_EDITED", Const, 21, ""}, - {"DF_1_ENDFILTEE", Const, 21, ""}, - {"DF_1_GLOBAL", Const, 21, ""}, - {"DF_1_GLOBAUDIT", Const, 21, ""}, - {"DF_1_GROUP", Const, 21, ""}, - {"DF_1_IGNMULDEF", Const, 21, ""}, - {"DF_1_INITFIRST", Const, 21, ""}, - {"DF_1_INTERPOSE", Const, 21, ""}, - {"DF_1_KMOD", Const, 21, ""}, - {"DF_1_LOADFLTR", Const, 21, ""}, - {"DF_1_NOCOMMON", Const, 21, ""}, - {"DF_1_NODEFLIB", Const, 21, ""}, - {"DF_1_NODELETE", Const, 21, ""}, - {"DF_1_NODIRECT", Const, 21, ""}, - {"DF_1_NODUMP", Const, 21, ""}, - {"DF_1_NOHDR", Const, 21, ""}, - {"DF_1_NOKSYMS", Const, 21, ""}, - {"DF_1_NOOPEN", Const, 21, ""}, - {"DF_1_NORELOC", Const, 21, ""}, - {"DF_1_NOW", Const, 21, ""}, - {"DF_1_ORIGIN", Const, 21, ""}, - {"DF_1_PIE", Const, 21, ""}, - {"DF_1_SINGLETON", Const, 21, ""}, - {"DF_1_STUB", Const, 21, ""}, - {"DF_1_SYMINTPOSE", Const, 21, ""}, - {"DF_1_TRANS", Const, 21, ""}, - {"DF_1_WEAKFILTER", Const, 21, ""}, - {"DF_BIND_NOW", Const, 0, ""}, - {"DF_ORIGIN", Const, 0, ""}, - {"DF_STATIC_TLS", Const, 0, ""}, - {"DF_SYMBOLIC", Const, 0, ""}, - {"DF_TEXTREL", Const, 0, ""}, - {"DT_ADDRRNGHI", Const, 16, ""}, - {"DT_ADDRRNGLO", Const, 16, ""}, - {"DT_AUDIT", Const, 16, ""}, - {"DT_AUXILIARY", Const, 16, ""}, - {"DT_BIND_NOW", Const, 0, ""}, - {"DT_CHECKSUM", Const, 16, ""}, - {"DT_CONFIG", Const, 16, ""}, - {"DT_DEBUG", Const, 0, ""}, - {"DT_DEPAUDIT", Const, 16, ""}, - {"DT_ENCODING", Const, 0, ""}, - {"DT_FEATURE", Const, 16, ""}, - {"DT_FILTER", Const, 16, ""}, - {"DT_FINI", Const, 0, ""}, - {"DT_FINI_ARRAY", Const, 0, ""}, - {"DT_FINI_ARRAYSZ", Const, 0, ""}, - {"DT_FLAGS", Const, 0, ""}, - {"DT_FLAGS_1", Const, 16, ""}, - {"DT_GNU_CONFLICT", Const, 16, ""}, - {"DT_GNU_CONFLICTSZ", Const, 16, ""}, - {"DT_GNU_HASH", Const, 16, ""}, - {"DT_GNU_LIBLIST", Const, 16, ""}, - {"DT_GNU_LIBLISTSZ", Const, 16, ""}, - {"DT_GNU_PRELINKED", Const, 16, ""}, - {"DT_HASH", Const, 0, ""}, - {"DT_HIOS", Const, 0, ""}, - {"DT_HIPROC", Const, 0, ""}, - {"DT_INIT", Const, 0, ""}, - {"DT_INIT_ARRAY", Const, 0, ""}, - {"DT_INIT_ARRAYSZ", Const, 0, ""}, - {"DT_JMPREL", Const, 0, ""}, - {"DT_LOOS", Const, 0, ""}, - {"DT_LOPROC", Const, 0, ""}, - {"DT_MIPS_AUX_DYNAMIC", Const, 16, ""}, - {"DT_MIPS_BASE_ADDRESS", Const, 16, ""}, - {"DT_MIPS_COMPACT_SIZE", Const, 16, ""}, - {"DT_MIPS_CONFLICT", Const, 16, ""}, - {"DT_MIPS_CONFLICTNO", Const, 16, ""}, - {"DT_MIPS_CXX_FLAGS", Const, 16, ""}, - {"DT_MIPS_DELTA_CLASS", Const, 16, ""}, - {"DT_MIPS_DELTA_CLASSSYM", Const, 16, ""}, - {"DT_MIPS_DELTA_CLASSSYM_NO", Const, 16, ""}, - {"DT_MIPS_DELTA_CLASS_NO", Const, 16, ""}, - {"DT_MIPS_DELTA_INSTANCE", Const, 16, ""}, - {"DT_MIPS_DELTA_INSTANCE_NO", Const, 16, ""}, - {"DT_MIPS_DELTA_RELOC", Const, 16, ""}, - {"DT_MIPS_DELTA_RELOC_NO", Const, 16, ""}, - {"DT_MIPS_DELTA_SYM", Const, 16, ""}, - {"DT_MIPS_DELTA_SYM_NO", Const, 16, ""}, - {"DT_MIPS_DYNSTR_ALIGN", Const, 16, ""}, - {"DT_MIPS_FLAGS", Const, 16, ""}, - {"DT_MIPS_GOTSYM", Const, 16, ""}, - {"DT_MIPS_GP_VALUE", Const, 16, ""}, - {"DT_MIPS_HIDDEN_GOTIDX", Const, 16, ""}, - {"DT_MIPS_HIPAGENO", Const, 16, ""}, - {"DT_MIPS_ICHECKSUM", Const, 16, ""}, - {"DT_MIPS_INTERFACE", Const, 16, ""}, - {"DT_MIPS_INTERFACE_SIZE", Const, 16, ""}, - {"DT_MIPS_IVERSION", Const, 16, ""}, - {"DT_MIPS_LIBLIST", Const, 16, ""}, - {"DT_MIPS_LIBLISTNO", Const, 16, ""}, - {"DT_MIPS_LOCALPAGE_GOTIDX", Const, 16, ""}, - {"DT_MIPS_LOCAL_GOTIDX", Const, 16, ""}, - {"DT_MIPS_LOCAL_GOTNO", Const, 16, ""}, - {"DT_MIPS_MSYM", Const, 16, ""}, - {"DT_MIPS_OPTIONS", Const, 16, ""}, - {"DT_MIPS_PERF_SUFFIX", Const, 16, ""}, - {"DT_MIPS_PIXIE_INIT", Const, 16, ""}, - {"DT_MIPS_PLTGOT", Const, 16, ""}, - {"DT_MIPS_PROTECTED_GOTIDX", Const, 16, ""}, - {"DT_MIPS_RLD_MAP", Const, 16, ""}, - {"DT_MIPS_RLD_MAP_REL", Const, 16, ""}, - {"DT_MIPS_RLD_TEXT_RESOLVE_ADDR", Const, 16, ""}, - {"DT_MIPS_RLD_VERSION", Const, 16, ""}, - {"DT_MIPS_RWPLT", Const, 16, ""}, - {"DT_MIPS_SYMBOL_LIB", Const, 16, ""}, - {"DT_MIPS_SYMTABNO", Const, 16, ""}, - {"DT_MIPS_TIME_STAMP", Const, 16, ""}, - {"DT_MIPS_UNREFEXTNO", Const, 16, ""}, - {"DT_MOVEENT", Const, 16, ""}, - {"DT_MOVESZ", Const, 16, ""}, - {"DT_MOVETAB", Const, 16, ""}, - {"DT_NEEDED", Const, 0, ""}, - {"DT_NULL", Const, 0, ""}, - {"DT_PLTGOT", Const, 0, ""}, - {"DT_PLTPAD", Const, 16, ""}, - {"DT_PLTPADSZ", Const, 16, ""}, - {"DT_PLTREL", Const, 0, ""}, - {"DT_PLTRELSZ", Const, 0, ""}, - {"DT_POSFLAG_1", Const, 16, ""}, - {"DT_PPC64_GLINK", Const, 16, ""}, - {"DT_PPC64_OPD", Const, 16, ""}, - {"DT_PPC64_OPDSZ", Const, 16, ""}, - {"DT_PPC64_OPT", Const, 16, ""}, - {"DT_PPC_GOT", Const, 16, ""}, - {"DT_PPC_OPT", Const, 16, ""}, - {"DT_PREINIT_ARRAY", Const, 0, ""}, - {"DT_PREINIT_ARRAYSZ", Const, 0, ""}, - {"DT_REL", Const, 0, ""}, - {"DT_RELA", Const, 0, ""}, - {"DT_RELACOUNT", Const, 16, ""}, - {"DT_RELAENT", Const, 0, ""}, - {"DT_RELASZ", Const, 0, ""}, - {"DT_RELCOUNT", Const, 16, ""}, - {"DT_RELENT", Const, 0, ""}, - {"DT_RELSZ", Const, 0, ""}, - {"DT_RPATH", Const, 0, ""}, - {"DT_RUNPATH", Const, 0, ""}, - {"DT_SONAME", Const, 0, ""}, - {"DT_SPARC_REGISTER", Const, 16, ""}, - {"DT_STRSZ", Const, 0, ""}, - {"DT_STRTAB", Const, 0, ""}, - {"DT_SYMBOLIC", Const, 0, ""}, - {"DT_SYMENT", Const, 0, ""}, - {"DT_SYMINENT", Const, 16, ""}, - {"DT_SYMINFO", Const, 16, ""}, - {"DT_SYMINSZ", Const, 16, ""}, - {"DT_SYMTAB", Const, 0, ""}, - {"DT_SYMTAB_SHNDX", Const, 16, ""}, - {"DT_TEXTREL", Const, 0, ""}, - {"DT_TLSDESC_GOT", Const, 16, ""}, - {"DT_TLSDESC_PLT", Const, 16, ""}, - {"DT_USED", Const, 16, ""}, - {"DT_VALRNGHI", Const, 16, ""}, - {"DT_VALRNGLO", Const, 16, ""}, - {"DT_VERDEF", Const, 16, ""}, - {"DT_VERDEFNUM", Const, 16, ""}, - {"DT_VERNEED", Const, 0, ""}, - {"DT_VERNEEDNUM", Const, 0, ""}, - {"DT_VERSYM", Const, 0, ""}, - {"Data", Type, 0, ""}, - {"Dyn32", Type, 0, ""}, - {"Dyn32.Tag", Field, 0, ""}, - {"Dyn32.Val", Field, 0, ""}, - {"Dyn64", Type, 0, ""}, - {"Dyn64.Tag", Field, 0, ""}, - {"Dyn64.Val", Field, 0, ""}, - {"DynFlag", Type, 0, ""}, - {"DynFlag1", Type, 21, ""}, - {"DynTag", Type, 0, ""}, - {"DynamicVersion", Type, 24, ""}, - {"DynamicVersion.Deps", Field, 24, ""}, - {"DynamicVersion.Flags", Field, 24, ""}, - {"DynamicVersion.Index", Field, 24, ""}, - {"DynamicVersion.Name", Field, 24, ""}, - {"DynamicVersionDep", Type, 24, ""}, - {"DynamicVersionDep.Dep", Field, 24, ""}, - {"DynamicVersionDep.Flags", Field, 24, ""}, - {"DynamicVersionDep.Index", Field, 24, ""}, - {"DynamicVersionFlag", Type, 24, ""}, - {"DynamicVersionNeed", Type, 24, ""}, - {"DynamicVersionNeed.Name", Field, 24, ""}, - {"DynamicVersionNeed.Needs", Field, 24, ""}, - {"EI_ABIVERSION", Const, 0, ""}, - {"EI_CLASS", Const, 0, ""}, - {"EI_DATA", Const, 0, ""}, - {"EI_NIDENT", Const, 0, ""}, - {"EI_OSABI", Const, 0, ""}, - {"EI_PAD", Const, 0, ""}, - {"EI_VERSION", Const, 0, ""}, - {"ELFCLASS32", Const, 0, ""}, - {"ELFCLASS64", Const, 0, ""}, - {"ELFCLASSNONE", Const, 0, ""}, - {"ELFDATA2LSB", Const, 0, ""}, - {"ELFDATA2MSB", Const, 0, ""}, - {"ELFDATANONE", Const, 0, ""}, - {"ELFMAG", Const, 0, ""}, - {"ELFOSABI_86OPEN", Const, 0, ""}, - {"ELFOSABI_AIX", Const, 0, ""}, - {"ELFOSABI_ARM", Const, 0, ""}, - {"ELFOSABI_AROS", Const, 11, ""}, - {"ELFOSABI_CLOUDABI", Const, 11, ""}, - {"ELFOSABI_FENIXOS", Const, 11, ""}, - {"ELFOSABI_FREEBSD", Const, 0, ""}, - {"ELFOSABI_HPUX", Const, 0, ""}, - {"ELFOSABI_HURD", Const, 0, ""}, - {"ELFOSABI_IRIX", Const, 0, ""}, - {"ELFOSABI_LINUX", Const, 0, ""}, - {"ELFOSABI_MODESTO", Const, 0, ""}, - {"ELFOSABI_NETBSD", Const, 0, ""}, - {"ELFOSABI_NONE", Const, 0, ""}, - {"ELFOSABI_NSK", Const, 0, ""}, - {"ELFOSABI_OPENBSD", Const, 0, ""}, - {"ELFOSABI_OPENVMS", Const, 0, ""}, - {"ELFOSABI_SOLARIS", Const, 0, ""}, - {"ELFOSABI_STANDALONE", Const, 0, ""}, - {"ELFOSABI_TRU64", Const, 0, ""}, - {"EM_386", Const, 0, ""}, - {"EM_486", Const, 0, ""}, - {"EM_56800EX", Const, 11, ""}, - {"EM_68HC05", Const, 11, ""}, - {"EM_68HC08", Const, 11, ""}, - {"EM_68HC11", Const, 11, ""}, - {"EM_68HC12", Const, 0, ""}, - {"EM_68HC16", Const, 11, ""}, - {"EM_68K", Const, 0, ""}, - {"EM_78KOR", Const, 11, ""}, - {"EM_8051", Const, 11, ""}, - {"EM_860", Const, 0, ""}, - {"EM_88K", Const, 0, ""}, - {"EM_960", Const, 0, ""}, - {"EM_AARCH64", Const, 4, ""}, - {"EM_ALPHA", Const, 0, ""}, - {"EM_ALPHA_STD", Const, 0, ""}, - {"EM_ALTERA_NIOS2", Const, 11, ""}, - {"EM_AMDGPU", Const, 11, ""}, - {"EM_ARC", Const, 0, ""}, - {"EM_ARCA", Const, 11, ""}, - {"EM_ARC_COMPACT", Const, 11, ""}, - {"EM_ARC_COMPACT2", Const, 11, ""}, - {"EM_ARM", Const, 0, ""}, - {"EM_AVR", Const, 11, ""}, - {"EM_AVR32", Const, 11, ""}, - {"EM_BA1", Const, 11, ""}, - {"EM_BA2", Const, 11, ""}, - {"EM_BLACKFIN", Const, 11, ""}, - {"EM_BPF", Const, 11, ""}, - {"EM_C166", Const, 11, ""}, - {"EM_CDP", Const, 11, ""}, - {"EM_CE", Const, 11, ""}, - {"EM_CLOUDSHIELD", Const, 11, ""}, - {"EM_COGE", Const, 11, ""}, - {"EM_COLDFIRE", Const, 0, ""}, - {"EM_COOL", Const, 11, ""}, - {"EM_COREA_1ST", Const, 11, ""}, - {"EM_COREA_2ND", Const, 11, ""}, - {"EM_CR", Const, 11, ""}, - {"EM_CR16", Const, 11, ""}, - {"EM_CRAYNV2", Const, 11, ""}, - {"EM_CRIS", Const, 11, ""}, - {"EM_CRX", Const, 11, ""}, - {"EM_CSR_KALIMBA", Const, 11, ""}, - {"EM_CUDA", Const, 11, ""}, - {"EM_CYPRESS_M8C", Const, 11, ""}, - {"EM_D10V", Const, 11, ""}, - {"EM_D30V", Const, 11, ""}, - {"EM_DSP24", Const, 11, ""}, - {"EM_DSPIC30F", Const, 11, ""}, - {"EM_DXP", Const, 11, ""}, - {"EM_ECOG1", Const, 11, ""}, - {"EM_ECOG16", Const, 11, ""}, - {"EM_ECOG1X", Const, 11, ""}, - {"EM_ECOG2", Const, 11, ""}, - {"EM_ETPU", Const, 11, ""}, - {"EM_EXCESS", Const, 11, ""}, - {"EM_F2MC16", Const, 11, ""}, - {"EM_FIREPATH", Const, 11, ""}, - {"EM_FR20", Const, 0, ""}, - {"EM_FR30", Const, 11, ""}, - {"EM_FT32", Const, 11, ""}, - {"EM_FX66", Const, 11, ""}, - {"EM_H8S", Const, 0, ""}, - {"EM_H8_300", Const, 0, ""}, - {"EM_H8_300H", Const, 0, ""}, - {"EM_H8_500", Const, 0, ""}, - {"EM_HUANY", Const, 11, ""}, - {"EM_IA_64", Const, 0, ""}, - {"EM_INTEL205", Const, 11, ""}, - {"EM_INTEL206", Const, 11, ""}, - {"EM_INTEL207", Const, 11, ""}, - {"EM_INTEL208", Const, 11, ""}, - {"EM_INTEL209", Const, 11, ""}, - {"EM_IP2K", Const, 11, ""}, - {"EM_JAVELIN", Const, 11, ""}, - {"EM_K10M", Const, 11, ""}, - {"EM_KM32", Const, 11, ""}, - {"EM_KMX16", Const, 11, ""}, - {"EM_KMX32", Const, 11, ""}, - {"EM_KMX8", Const, 11, ""}, - {"EM_KVARC", Const, 11, ""}, - {"EM_L10M", Const, 11, ""}, - {"EM_LANAI", Const, 11, ""}, - {"EM_LATTICEMICO32", Const, 11, ""}, - {"EM_LOONGARCH", Const, 19, ""}, - {"EM_M16C", Const, 11, ""}, - {"EM_M32", Const, 0, ""}, - {"EM_M32C", Const, 11, ""}, - {"EM_M32R", Const, 11, ""}, - {"EM_MANIK", Const, 11, ""}, - {"EM_MAX", Const, 11, ""}, - {"EM_MAXQ30", Const, 11, ""}, - {"EM_MCHP_PIC", Const, 11, ""}, - {"EM_MCST_ELBRUS", Const, 11, ""}, - {"EM_ME16", Const, 0, ""}, - {"EM_METAG", Const, 11, ""}, - {"EM_MICROBLAZE", Const, 11, ""}, - {"EM_MIPS", Const, 0, ""}, - {"EM_MIPS_RS3_LE", Const, 0, ""}, - {"EM_MIPS_RS4_BE", Const, 0, ""}, - {"EM_MIPS_X", Const, 0, ""}, - {"EM_MMA", Const, 0, ""}, - {"EM_MMDSP_PLUS", Const, 11, ""}, - {"EM_MMIX", Const, 11, ""}, - {"EM_MN10200", Const, 11, ""}, - {"EM_MN10300", Const, 11, ""}, - {"EM_MOXIE", Const, 11, ""}, - {"EM_MSP430", Const, 11, ""}, - {"EM_NCPU", Const, 0, ""}, - {"EM_NDR1", Const, 0, ""}, - {"EM_NDS32", Const, 11, ""}, - {"EM_NONE", Const, 0, ""}, - {"EM_NORC", Const, 11, ""}, - {"EM_NS32K", Const, 11, ""}, - {"EM_OPEN8", Const, 11, ""}, - {"EM_OPENRISC", Const, 11, ""}, - {"EM_PARISC", Const, 0, ""}, - {"EM_PCP", Const, 0, ""}, - {"EM_PDP10", Const, 11, ""}, - {"EM_PDP11", Const, 11, ""}, - {"EM_PDSP", Const, 11, ""}, - {"EM_PJ", Const, 11, ""}, - {"EM_PPC", Const, 0, ""}, - {"EM_PPC64", Const, 0, ""}, - {"EM_PRISM", Const, 11, ""}, - {"EM_QDSP6", Const, 11, ""}, - {"EM_R32C", Const, 11, ""}, - {"EM_RCE", Const, 0, ""}, - {"EM_RH32", Const, 0, ""}, - {"EM_RISCV", Const, 11, ""}, - {"EM_RL78", Const, 11, ""}, - {"EM_RS08", Const, 11, ""}, - {"EM_RX", Const, 11, ""}, - {"EM_S370", Const, 0, ""}, - {"EM_S390", Const, 0, ""}, - {"EM_SCORE7", Const, 11, ""}, - {"EM_SEP", Const, 11, ""}, - {"EM_SE_C17", Const, 11, ""}, - {"EM_SE_C33", Const, 11, ""}, - {"EM_SH", Const, 0, ""}, - {"EM_SHARC", Const, 11, ""}, - {"EM_SLE9X", Const, 11, ""}, - {"EM_SNP1K", Const, 11, ""}, - {"EM_SPARC", Const, 0, ""}, - {"EM_SPARC32PLUS", Const, 0, ""}, - {"EM_SPARCV9", Const, 0, ""}, - {"EM_ST100", Const, 0, ""}, - {"EM_ST19", Const, 11, ""}, - {"EM_ST200", Const, 11, ""}, - {"EM_ST7", Const, 11, ""}, - {"EM_ST9PLUS", Const, 11, ""}, - {"EM_STARCORE", Const, 0, ""}, - {"EM_STM8", Const, 11, ""}, - {"EM_STXP7X", Const, 11, ""}, - {"EM_SVX", Const, 11, ""}, - {"EM_TILE64", Const, 11, ""}, - {"EM_TILEGX", Const, 11, ""}, - {"EM_TILEPRO", Const, 11, ""}, - {"EM_TINYJ", Const, 0, ""}, - {"EM_TI_ARP32", Const, 11, ""}, - {"EM_TI_C2000", Const, 11, ""}, - {"EM_TI_C5500", Const, 11, ""}, - {"EM_TI_C6000", Const, 11, ""}, - {"EM_TI_PRU", Const, 11, ""}, - {"EM_TMM_GPP", Const, 11, ""}, - {"EM_TPC", Const, 11, ""}, - {"EM_TRICORE", Const, 0, ""}, - {"EM_TRIMEDIA", Const, 11, ""}, - {"EM_TSK3000", Const, 11, ""}, - {"EM_UNICORE", Const, 11, ""}, - {"EM_V800", Const, 0, ""}, - {"EM_V850", Const, 11, ""}, - {"EM_VAX", Const, 11, ""}, - {"EM_VIDEOCORE", Const, 11, ""}, - {"EM_VIDEOCORE3", Const, 11, ""}, - {"EM_VIDEOCORE5", Const, 11, ""}, - {"EM_VISIUM", Const, 11, ""}, - {"EM_VPP500", Const, 0, ""}, - {"EM_X86_64", Const, 0, ""}, - {"EM_XCORE", Const, 11, ""}, - {"EM_XGATE", Const, 11, ""}, - {"EM_XIMO16", Const, 11, ""}, - {"EM_XTENSA", Const, 11, ""}, - {"EM_Z80", Const, 11, ""}, - {"EM_ZSP", Const, 11, ""}, - {"ET_CORE", Const, 0, ""}, - {"ET_DYN", Const, 0, ""}, - {"ET_EXEC", Const, 0, ""}, - {"ET_HIOS", Const, 0, ""}, - {"ET_HIPROC", Const, 0, ""}, - {"ET_LOOS", Const, 0, ""}, - {"ET_LOPROC", Const, 0, ""}, - {"ET_NONE", Const, 0, ""}, - {"ET_REL", Const, 0, ""}, - {"EV_CURRENT", Const, 0, ""}, - {"EV_NONE", Const, 0, ""}, - {"ErrNoSymbols", Var, 4, ""}, - {"File", Type, 0, ""}, - {"File.FileHeader", Field, 0, ""}, - {"File.Progs", Field, 0, ""}, - {"File.Sections", Field, 0, ""}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.ABIVersion", Field, 0, ""}, - {"FileHeader.ByteOrder", Field, 0, ""}, - {"FileHeader.Class", Field, 0, ""}, - {"FileHeader.Data", Field, 0, ""}, - {"FileHeader.Entry", Field, 1, ""}, - {"FileHeader.Machine", Field, 0, ""}, - {"FileHeader.OSABI", Field, 0, ""}, - {"FileHeader.Type", Field, 0, ""}, - {"FileHeader.Version", Field, 0, ""}, - {"FormatError", Type, 0, ""}, - {"Header32", Type, 0, ""}, - {"Header32.Ehsize", Field, 0, ""}, - {"Header32.Entry", Field, 0, ""}, - {"Header32.Flags", Field, 0, ""}, - {"Header32.Ident", Field, 0, ""}, - {"Header32.Machine", Field, 0, ""}, - {"Header32.Phentsize", Field, 0, ""}, - {"Header32.Phnum", Field, 0, ""}, - {"Header32.Phoff", Field, 0, ""}, - {"Header32.Shentsize", Field, 0, ""}, - {"Header32.Shnum", Field, 0, ""}, - {"Header32.Shoff", Field, 0, ""}, - {"Header32.Shstrndx", Field, 0, ""}, - {"Header32.Type", Field, 0, ""}, - {"Header32.Version", Field, 0, ""}, - {"Header64", Type, 0, ""}, - {"Header64.Ehsize", Field, 0, ""}, - {"Header64.Entry", Field, 0, ""}, - {"Header64.Flags", Field, 0, ""}, - {"Header64.Ident", Field, 0, ""}, - {"Header64.Machine", Field, 0, ""}, - {"Header64.Phentsize", Field, 0, ""}, - {"Header64.Phnum", Field, 0, ""}, - {"Header64.Phoff", Field, 0, ""}, - {"Header64.Shentsize", Field, 0, ""}, - {"Header64.Shnum", Field, 0, ""}, - {"Header64.Shoff", Field, 0, ""}, - {"Header64.Shstrndx", Field, 0, ""}, - {"Header64.Type", Field, 0, ""}, - {"Header64.Version", Field, 0, ""}, - {"ImportedSymbol", Type, 0, ""}, - {"ImportedSymbol.Library", Field, 0, ""}, - {"ImportedSymbol.Name", Field, 0, ""}, - {"ImportedSymbol.Version", Field, 0, ""}, - {"Machine", Type, 0, ""}, - {"NT_FPREGSET", Const, 0, ""}, - {"NT_PRPSINFO", Const, 0, ""}, - {"NT_PRSTATUS", Const, 0, ""}, - {"NType", Type, 0, ""}, - {"NewFile", Func, 0, "func(r io.ReaderAt) (*File, error)"}, - {"OSABI", Type, 0, ""}, - {"Open", Func, 0, "func(name string) (*File, error)"}, - {"PF_MASKOS", Const, 0, ""}, - {"PF_MASKPROC", Const, 0, ""}, - {"PF_R", Const, 0, ""}, - {"PF_W", Const, 0, ""}, - {"PF_X", Const, 0, ""}, - {"PT_AARCH64_ARCHEXT", Const, 16, ""}, - {"PT_AARCH64_UNWIND", Const, 16, ""}, - {"PT_ARM_ARCHEXT", Const, 16, ""}, - {"PT_ARM_EXIDX", Const, 16, ""}, - {"PT_DYNAMIC", Const, 0, ""}, - {"PT_GNU_EH_FRAME", Const, 16, ""}, - {"PT_GNU_MBIND_HI", Const, 16, ""}, - {"PT_GNU_MBIND_LO", Const, 16, ""}, - {"PT_GNU_PROPERTY", Const, 16, ""}, - {"PT_GNU_RELRO", Const, 16, ""}, - {"PT_GNU_STACK", Const, 16, ""}, - {"PT_HIOS", Const, 0, ""}, - {"PT_HIPROC", Const, 0, ""}, - {"PT_INTERP", Const, 0, ""}, - {"PT_LOAD", Const, 0, ""}, - {"PT_LOOS", Const, 0, ""}, - {"PT_LOPROC", Const, 0, ""}, - {"PT_MIPS_ABIFLAGS", Const, 16, ""}, - {"PT_MIPS_OPTIONS", Const, 16, ""}, - {"PT_MIPS_REGINFO", Const, 16, ""}, - {"PT_MIPS_RTPROC", Const, 16, ""}, - {"PT_NOTE", Const, 0, ""}, - {"PT_NULL", Const, 0, ""}, - {"PT_OPENBSD_BOOTDATA", Const, 16, ""}, - {"PT_OPENBSD_NOBTCFI", Const, 23, ""}, - {"PT_OPENBSD_RANDOMIZE", Const, 16, ""}, - {"PT_OPENBSD_WXNEEDED", Const, 16, ""}, - {"PT_PAX_FLAGS", Const, 16, ""}, - {"PT_PHDR", Const, 0, ""}, - {"PT_RISCV_ATTRIBUTES", Const, 25, ""}, - {"PT_S390_PGSTE", Const, 16, ""}, - {"PT_SHLIB", Const, 0, ""}, - {"PT_SUNWSTACK", Const, 16, ""}, - {"PT_SUNW_EH_FRAME", Const, 16, ""}, - {"PT_TLS", Const, 0, ""}, - {"Prog", Type, 0, ""}, - {"Prog.ProgHeader", Field, 0, ""}, - {"Prog.ReaderAt", Field, 0, ""}, - {"Prog32", Type, 0, ""}, - {"Prog32.Align", Field, 0, ""}, - {"Prog32.Filesz", Field, 0, ""}, - {"Prog32.Flags", Field, 0, ""}, - {"Prog32.Memsz", Field, 0, ""}, - {"Prog32.Off", Field, 0, ""}, - {"Prog32.Paddr", Field, 0, ""}, - {"Prog32.Type", Field, 0, ""}, - {"Prog32.Vaddr", Field, 0, ""}, - {"Prog64", Type, 0, ""}, - {"Prog64.Align", Field, 0, ""}, - {"Prog64.Filesz", Field, 0, ""}, - {"Prog64.Flags", Field, 0, ""}, - {"Prog64.Memsz", Field, 0, ""}, - {"Prog64.Off", Field, 0, ""}, - {"Prog64.Paddr", Field, 0, ""}, - {"Prog64.Type", Field, 0, ""}, - {"Prog64.Vaddr", Field, 0, ""}, - {"ProgFlag", Type, 0, ""}, - {"ProgHeader", Type, 0, ""}, - {"ProgHeader.Align", Field, 0, ""}, - {"ProgHeader.Filesz", Field, 0, ""}, - {"ProgHeader.Flags", Field, 0, ""}, - {"ProgHeader.Memsz", Field, 0, ""}, - {"ProgHeader.Off", Field, 0, ""}, - {"ProgHeader.Paddr", Field, 0, ""}, - {"ProgHeader.Type", Field, 0, ""}, - {"ProgHeader.Vaddr", Field, 0, ""}, - {"ProgType", Type, 0, ""}, - {"R_386", Type, 0, ""}, - {"R_386_16", Const, 10, ""}, - {"R_386_32", Const, 0, ""}, - {"R_386_32PLT", Const, 10, ""}, - {"R_386_8", Const, 10, ""}, - {"R_386_COPY", Const, 0, ""}, - {"R_386_GLOB_DAT", Const, 0, ""}, - {"R_386_GOT32", Const, 0, ""}, - {"R_386_GOT32X", Const, 10, ""}, - {"R_386_GOTOFF", Const, 0, ""}, - {"R_386_GOTPC", Const, 0, ""}, - {"R_386_IRELATIVE", Const, 10, ""}, - {"R_386_JMP_SLOT", Const, 0, ""}, - {"R_386_NONE", Const, 0, ""}, - {"R_386_PC16", Const, 10, ""}, - {"R_386_PC32", Const, 0, ""}, - {"R_386_PC8", Const, 10, ""}, - {"R_386_PLT32", Const, 0, ""}, - {"R_386_RELATIVE", Const, 0, ""}, - {"R_386_SIZE32", Const, 10, ""}, - {"R_386_TLS_DESC", Const, 10, ""}, - {"R_386_TLS_DESC_CALL", Const, 10, ""}, - {"R_386_TLS_DTPMOD32", Const, 0, ""}, - {"R_386_TLS_DTPOFF32", Const, 0, ""}, - {"R_386_TLS_GD", Const, 0, ""}, - {"R_386_TLS_GD_32", Const, 0, ""}, - {"R_386_TLS_GD_CALL", Const, 0, ""}, - {"R_386_TLS_GD_POP", Const, 0, ""}, - {"R_386_TLS_GD_PUSH", Const, 0, ""}, - {"R_386_TLS_GOTDESC", Const, 10, ""}, - {"R_386_TLS_GOTIE", Const, 0, ""}, - {"R_386_TLS_IE", Const, 0, ""}, - {"R_386_TLS_IE_32", Const, 0, ""}, - {"R_386_TLS_LDM", Const, 0, ""}, - {"R_386_TLS_LDM_32", Const, 0, ""}, - {"R_386_TLS_LDM_CALL", Const, 0, ""}, - {"R_386_TLS_LDM_POP", Const, 0, ""}, - {"R_386_TLS_LDM_PUSH", Const, 0, ""}, - {"R_386_TLS_LDO_32", Const, 0, ""}, - {"R_386_TLS_LE", Const, 0, ""}, - {"R_386_TLS_LE_32", Const, 0, ""}, - {"R_386_TLS_TPOFF", Const, 0, ""}, - {"R_386_TLS_TPOFF32", Const, 0, ""}, - {"R_390", Type, 7, ""}, - {"R_390_12", Const, 7, ""}, - {"R_390_16", Const, 7, ""}, - {"R_390_20", Const, 7, ""}, - {"R_390_32", Const, 7, ""}, - {"R_390_64", Const, 7, ""}, - {"R_390_8", Const, 7, ""}, - {"R_390_COPY", Const, 7, ""}, - {"R_390_GLOB_DAT", Const, 7, ""}, - {"R_390_GOT12", Const, 7, ""}, - {"R_390_GOT16", Const, 7, ""}, - {"R_390_GOT20", Const, 7, ""}, - {"R_390_GOT32", Const, 7, ""}, - {"R_390_GOT64", Const, 7, ""}, - {"R_390_GOTENT", Const, 7, ""}, - {"R_390_GOTOFF", Const, 7, ""}, - {"R_390_GOTOFF16", Const, 7, ""}, - {"R_390_GOTOFF64", Const, 7, ""}, - {"R_390_GOTPC", Const, 7, ""}, - {"R_390_GOTPCDBL", Const, 7, ""}, - {"R_390_GOTPLT12", Const, 7, ""}, - {"R_390_GOTPLT16", Const, 7, ""}, - {"R_390_GOTPLT20", Const, 7, ""}, - {"R_390_GOTPLT32", Const, 7, ""}, - {"R_390_GOTPLT64", Const, 7, ""}, - {"R_390_GOTPLTENT", Const, 7, ""}, - {"R_390_GOTPLTOFF16", Const, 7, ""}, - {"R_390_GOTPLTOFF32", Const, 7, ""}, - {"R_390_GOTPLTOFF64", Const, 7, ""}, - {"R_390_JMP_SLOT", Const, 7, ""}, - {"R_390_NONE", Const, 7, ""}, - {"R_390_PC16", Const, 7, ""}, - {"R_390_PC16DBL", Const, 7, ""}, - {"R_390_PC32", Const, 7, ""}, - {"R_390_PC32DBL", Const, 7, ""}, - {"R_390_PC64", Const, 7, ""}, - {"R_390_PLT16DBL", Const, 7, ""}, - {"R_390_PLT32", Const, 7, ""}, - {"R_390_PLT32DBL", Const, 7, ""}, - {"R_390_PLT64", Const, 7, ""}, - {"R_390_RELATIVE", Const, 7, ""}, - {"R_390_TLS_DTPMOD", Const, 7, ""}, - {"R_390_TLS_DTPOFF", Const, 7, ""}, - {"R_390_TLS_GD32", Const, 7, ""}, - {"R_390_TLS_GD64", Const, 7, ""}, - {"R_390_TLS_GDCALL", Const, 7, ""}, - {"R_390_TLS_GOTIE12", Const, 7, ""}, - {"R_390_TLS_GOTIE20", Const, 7, ""}, - {"R_390_TLS_GOTIE32", Const, 7, ""}, - {"R_390_TLS_GOTIE64", Const, 7, ""}, - {"R_390_TLS_IE32", Const, 7, ""}, - {"R_390_TLS_IE64", Const, 7, ""}, - {"R_390_TLS_IEENT", Const, 7, ""}, - {"R_390_TLS_LDCALL", Const, 7, ""}, - {"R_390_TLS_LDM32", Const, 7, ""}, - {"R_390_TLS_LDM64", Const, 7, ""}, - {"R_390_TLS_LDO32", Const, 7, ""}, - {"R_390_TLS_LDO64", Const, 7, ""}, - {"R_390_TLS_LE32", Const, 7, ""}, - {"R_390_TLS_LE64", Const, 7, ""}, - {"R_390_TLS_LOAD", Const, 7, ""}, - {"R_390_TLS_TPOFF", Const, 7, ""}, - {"R_AARCH64", Type, 4, ""}, - {"R_AARCH64_ABS16", Const, 4, ""}, - {"R_AARCH64_ABS32", Const, 4, ""}, - {"R_AARCH64_ABS64", Const, 4, ""}, - {"R_AARCH64_ADD_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_ADR_GOT_PAGE", Const, 4, ""}, - {"R_AARCH64_ADR_PREL_LO21", Const, 4, ""}, - {"R_AARCH64_ADR_PREL_PG_HI21", Const, 4, ""}, - {"R_AARCH64_ADR_PREL_PG_HI21_NC", Const, 4, ""}, - {"R_AARCH64_CALL26", Const, 4, ""}, - {"R_AARCH64_CONDBR19", Const, 4, ""}, - {"R_AARCH64_COPY", Const, 4, ""}, - {"R_AARCH64_GLOB_DAT", Const, 4, ""}, - {"R_AARCH64_GOT_LD_PREL19", Const, 4, ""}, - {"R_AARCH64_IRELATIVE", Const, 4, ""}, - {"R_AARCH64_JUMP26", Const, 4, ""}, - {"R_AARCH64_JUMP_SLOT", Const, 4, ""}, - {"R_AARCH64_LD64_GOTOFF_LO15", Const, 10, ""}, - {"R_AARCH64_LD64_GOTPAGE_LO15", Const, 10, ""}, - {"R_AARCH64_LD64_GOT_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST128_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST16_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST32_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST64_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LDST8_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_LD_PREL_LO19", Const, 4, ""}, - {"R_AARCH64_MOVW_SABS_G0", Const, 4, ""}, - {"R_AARCH64_MOVW_SABS_G1", Const, 4, ""}, - {"R_AARCH64_MOVW_SABS_G2", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G0", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G0_NC", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G1", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G1_NC", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G2", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G2_NC", Const, 4, ""}, - {"R_AARCH64_MOVW_UABS_G3", Const, 4, ""}, - {"R_AARCH64_NONE", Const, 4, ""}, - {"R_AARCH64_NULL", Const, 4, ""}, - {"R_AARCH64_P32_ABS16", Const, 4, ""}, - {"R_AARCH64_P32_ABS32", Const, 4, ""}, - {"R_AARCH64_P32_ADD_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_ADR_GOT_PAGE", Const, 4, ""}, - {"R_AARCH64_P32_ADR_PREL_LO21", Const, 4, ""}, - {"R_AARCH64_P32_ADR_PREL_PG_HI21", Const, 4, ""}, - {"R_AARCH64_P32_CALL26", Const, 4, ""}, - {"R_AARCH64_P32_CONDBR19", Const, 4, ""}, - {"R_AARCH64_P32_COPY", Const, 4, ""}, - {"R_AARCH64_P32_GLOB_DAT", Const, 4, ""}, - {"R_AARCH64_P32_GOT_LD_PREL19", Const, 4, ""}, - {"R_AARCH64_P32_IRELATIVE", Const, 4, ""}, - {"R_AARCH64_P32_JUMP26", Const, 4, ""}, - {"R_AARCH64_P32_JUMP_SLOT", Const, 4, ""}, - {"R_AARCH64_P32_LD32_GOT_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST128_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST16_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST32_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST64_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LDST8_ABS_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_LD_PREL_LO19", Const, 4, ""}, - {"R_AARCH64_P32_MOVW_SABS_G0", Const, 4, ""}, - {"R_AARCH64_P32_MOVW_UABS_G0", Const, 4, ""}, - {"R_AARCH64_P32_MOVW_UABS_G0_NC", Const, 4, ""}, - {"R_AARCH64_P32_MOVW_UABS_G1", Const, 4, ""}, - {"R_AARCH64_P32_PREL16", Const, 4, ""}, - {"R_AARCH64_P32_PREL32", Const, 4, ""}, - {"R_AARCH64_P32_RELATIVE", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_ADD_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_ADR_PAGE21", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_ADR_PREL21", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_CALL", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_LD32_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSDESC_LD_PREL19", Const, 4, ""}, - {"R_AARCH64_P32_TLSGD_ADD_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSGD_ADR_PAGE21", Const, 4, ""}, - {"R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", Const, 4, ""}, - {"R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", Const, 4, ""}, - {"R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", Const, 4, ""}, - {"R_AARCH64_P32_TLS_DTPMOD", Const, 4, ""}, - {"R_AARCH64_P32_TLS_DTPREL", Const, 4, ""}, - {"R_AARCH64_P32_TLS_TPREL", Const, 4, ""}, - {"R_AARCH64_P32_TSTBR14", Const, 4, ""}, - {"R_AARCH64_PREL16", Const, 4, ""}, - {"R_AARCH64_PREL32", Const, 4, ""}, - {"R_AARCH64_PREL64", Const, 4, ""}, - {"R_AARCH64_RELATIVE", Const, 4, ""}, - {"R_AARCH64_TLSDESC", Const, 4, ""}, - {"R_AARCH64_TLSDESC_ADD", Const, 4, ""}, - {"R_AARCH64_TLSDESC_ADD_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSDESC_ADR_PAGE21", Const, 4, ""}, - {"R_AARCH64_TLSDESC_ADR_PREL21", Const, 4, ""}, - {"R_AARCH64_TLSDESC_CALL", Const, 4, ""}, - {"R_AARCH64_TLSDESC_LD64_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSDESC_LDR", Const, 4, ""}, - {"R_AARCH64_TLSDESC_LD_PREL19", Const, 4, ""}, - {"R_AARCH64_TLSDESC_OFF_G0_NC", Const, 4, ""}, - {"R_AARCH64_TLSDESC_OFF_G1", Const, 4, ""}, - {"R_AARCH64_TLSGD_ADD_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSGD_ADR_PAGE21", Const, 4, ""}, - {"R_AARCH64_TLSGD_ADR_PREL21", Const, 10, ""}, - {"R_AARCH64_TLSGD_MOVW_G0_NC", Const, 10, ""}, - {"R_AARCH64_TLSGD_MOVW_G1", Const, 10, ""}, - {"R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", Const, 4, ""}, - {"R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", Const, 4, ""}, - {"R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", Const, 4, ""}, - {"R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", Const, 4, ""}, - {"R_AARCH64_TLSLD_ADR_PAGE21", Const, 10, ""}, - {"R_AARCH64_TLSLD_ADR_PREL21", Const, 10, ""}, - {"R_AARCH64_TLSLD_LDST128_DTPREL_LO12", Const, 10, ""}, - {"R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", Const, 10, ""}, - {"R_AARCH64_TLSLE_ADD_TPREL_HI12", Const, 4, ""}, - {"R_AARCH64_TLSLE_ADD_TPREL_LO12", Const, 4, ""}, - {"R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", Const, 4, ""}, - {"R_AARCH64_TLSLE_LDST128_TPREL_LO12", Const, 10, ""}, - {"R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", Const, 10, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G0", Const, 4, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", Const, 4, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G1", Const, 4, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", Const, 4, ""}, - {"R_AARCH64_TLSLE_MOVW_TPREL_G2", Const, 4, ""}, - {"R_AARCH64_TLS_DTPMOD64", Const, 4, ""}, - {"R_AARCH64_TLS_DTPREL64", Const, 4, ""}, - {"R_AARCH64_TLS_TPREL64", Const, 4, ""}, - {"R_AARCH64_TSTBR14", Const, 4, ""}, - {"R_ALPHA", Type, 0, ""}, - {"R_ALPHA_BRADDR", Const, 0, ""}, - {"R_ALPHA_COPY", Const, 0, ""}, - {"R_ALPHA_GLOB_DAT", Const, 0, ""}, - {"R_ALPHA_GPDISP", Const, 0, ""}, - {"R_ALPHA_GPREL32", Const, 0, ""}, - {"R_ALPHA_GPRELHIGH", Const, 0, ""}, - {"R_ALPHA_GPRELLOW", Const, 0, ""}, - {"R_ALPHA_GPVALUE", Const, 0, ""}, - {"R_ALPHA_HINT", Const, 0, ""}, - {"R_ALPHA_IMMED_BR_HI32", Const, 0, ""}, - {"R_ALPHA_IMMED_GP_16", Const, 0, ""}, - {"R_ALPHA_IMMED_GP_HI32", Const, 0, ""}, - {"R_ALPHA_IMMED_LO32", Const, 0, ""}, - {"R_ALPHA_IMMED_SCN_HI32", Const, 0, ""}, - {"R_ALPHA_JMP_SLOT", Const, 0, ""}, - {"R_ALPHA_LITERAL", Const, 0, ""}, - {"R_ALPHA_LITUSE", Const, 0, ""}, - {"R_ALPHA_NONE", Const, 0, ""}, - {"R_ALPHA_OP_PRSHIFT", Const, 0, ""}, - {"R_ALPHA_OP_PSUB", Const, 0, ""}, - {"R_ALPHA_OP_PUSH", Const, 0, ""}, - {"R_ALPHA_OP_STORE", Const, 0, ""}, - {"R_ALPHA_REFLONG", Const, 0, ""}, - {"R_ALPHA_REFQUAD", Const, 0, ""}, - {"R_ALPHA_RELATIVE", Const, 0, ""}, - {"R_ALPHA_SREL16", Const, 0, ""}, - {"R_ALPHA_SREL32", Const, 0, ""}, - {"R_ALPHA_SREL64", Const, 0, ""}, - {"R_ARM", Type, 0, ""}, - {"R_ARM_ABS12", Const, 0, ""}, - {"R_ARM_ABS16", Const, 0, ""}, - {"R_ARM_ABS32", Const, 0, ""}, - {"R_ARM_ABS32_NOI", Const, 10, ""}, - {"R_ARM_ABS8", Const, 0, ""}, - {"R_ARM_ALU_PCREL_15_8", Const, 10, ""}, - {"R_ARM_ALU_PCREL_23_15", Const, 10, ""}, - {"R_ARM_ALU_PCREL_7_0", Const, 10, ""}, - {"R_ARM_ALU_PC_G0", Const, 10, ""}, - {"R_ARM_ALU_PC_G0_NC", Const, 10, ""}, - {"R_ARM_ALU_PC_G1", Const, 10, ""}, - {"R_ARM_ALU_PC_G1_NC", Const, 10, ""}, - {"R_ARM_ALU_PC_G2", Const, 10, ""}, - {"R_ARM_ALU_SBREL_19_12_NC", Const, 10, ""}, - {"R_ARM_ALU_SBREL_27_20_CK", Const, 10, ""}, - {"R_ARM_ALU_SB_G0", Const, 10, ""}, - {"R_ARM_ALU_SB_G0_NC", Const, 10, ""}, - {"R_ARM_ALU_SB_G1", Const, 10, ""}, - {"R_ARM_ALU_SB_G1_NC", Const, 10, ""}, - {"R_ARM_ALU_SB_G2", Const, 10, ""}, - {"R_ARM_AMP_VCALL9", Const, 0, ""}, - {"R_ARM_BASE_ABS", Const, 10, ""}, - {"R_ARM_CALL", Const, 10, ""}, - {"R_ARM_COPY", Const, 0, ""}, - {"R_ARM_GLOB_DAT", Const, 0, ""}, - {"R_ARM_GNU_VTENTRY", Const, 0, ""}, - {"R_ARM_GNU_VTINHERIT", Const, 0, ""}, - {"R_ARM_GOT32", Const, 0, ""}, - {"R_ARM_GOTOFF", Const, 0, ""}, - {"R_ARM_GOTOFF12", Const, 10, ""}, - {"R_ARM_GOTPC", Const, 0, ""}, - {"R_ARM_GOTRELAX", Const, 10, ""}, - {"R_ARM_GOT_ABS", Const, 10, ""}, - {"R_ARM_GOT_BREL12", Const, 10, ""}, - {"R_ARM_GOT_PREL", Const, 10, ""}, - {"R_ARM_IRELATIVE", Const, 10, ""}, - {"R_ARM_JUMP24", Const, 10, ""}, - {"R_ARM_JUMP_SLOT", Const, 0, ""}, - {"R_ARM_LDC_PC_G0", Const, 10, ""}, - {"R_ARM_LDC_PC_G1", Const, 10, ""}, - {"R_ARM_LDC_PC_G2", Const, 10, ""}, - {"R_ARM_LDC_SB_G0", Const, 10, ""}, - {"R_ARM_LDC_SB_G1", Const, 10, ""}, - {"R_ARM_LDC_SB_G2", Const, 10, ""}, - {"R_ARM_LDRS_PC_G0", Const, 10, ""}, - {"R_ARM_LDRS_PC_G1", Const, 10, ""}, - {"R_ARM_LDRS_PC_G2", Const, 10, ""}, - {"R_ARM_LDRS_SB_G0", Const, 10, ""}, - {"R_ARM_LDRS_SB_G1", Const, 10, ""}, - {"R_ARM_LDRS_SB_G2", Const, 10, ""}, - {"R_ARM_LDR_PC_G1", Const, 10, ""}, - {"R_ARM_LDR_PC_G2", Const, 10, ""}, - {"R_ARM_LDR_SBREL_11_10_NC", Const, 10, ""}, - {"R_ARM_LDR_SB_G0", Const, 10, ""}, - {"R_ARM_LDR_SB_G1", Const, 10, ""}, - {"R_ARM_LDR_SB_G2", Const, 10, ""}, - {"R_ARM_ME_TOO", Const, 10, ""}, - {"R_ARM_MOVT_ABS", Const, 10, ""}, - {"R_ARM_MOVT_BREL", Const, 10, ""}, - {"R_ARM_MOVT_PREL", Const, 10, ""}, - {"R_ARM_MOVW_ABS_NC", Const, 10, ""}, - {"R_ARM_MOVW_BREL", Const, 10, ""}, - {"R_ARM_MOVW_BREL_NC", Const, 10, ""}, - {"R_ARM_MOVW_PREL_NC", Const, 10, ""}, - {"R_ARM_NONE", Const, 0, ""}, - {"R_ARM_PC13", Const, 0, ""}, - {"R_ARM_PC24", Const, 0, ""}, - {"R_ARM_PLT32", Const, 0, ""}, - {"R_ARM_PLT32_ABS", Const, 10, ""}, - {"R_ARM_PREL31", Const, 10, ""}, - {"R_ARM_PRIVATE_0", Const, 10, ""}, - {"R_ARM_PRIVATE_1", Const, 10, ""}, - {"R_ARM_PRIVATE_10", Const, 10, ""}, - {"R_ARM_PRIVATE_11", Const, 10, ""}, - {"R_ARM_PRIVATE_12", Const, 10, ""}, - {"R_ARM_PRIVATE_13", Const, 10, ""}, - {"R_ARM_PRIVATE_14", Const, 10, ""}, - {"R_ARM_PRIVATE_15", Const, 10, ""}, - {"R_ARM_PRIVATE_2", Const, 10, ""}, - {"R_ARM_PRIVATE_3", Const, 10, ""}, - {"R_ARM_PRIVATE_4", Const, 10, ""}, - {"R_ARM_PRIVATE_5", Const, 10, ""}, - {"R_ARM_PRIVATE_6", Const, 10, ""}, - {"R_ARM_PRIVATE_7", Const, 10, ""}, - {"R_ARM_PRIVATE_8", Const, 10, ""}, - {"R_ARM_PRIVATE_9", Const, 10, ""}, - {"R_ARM_RABS32", Const, 0, ""}, - {"R_ARM_RBASE", Const, 0, ""}, - {"R_ARM_REL32", Const, 0, ""}, - {"R_ARM_REL32_NOI", Const, 10, ""}, - {"R_ARM_RELATIVE", Const, 0, ""}, - {"R_ARM_RPC24", Const, 0, ""}, - {"R_ARM_RREL32", Const, 0, ""}, - {"R_ARM_RSBREL32", Const, 0, ""}, - {"R_ARM_RXPC25", Const, 10, ""}, - {"R_ARM_SBREL31", Const, 10, ""}, - {"R_ARM_SBREL32", Const, 0, ""}, - {"R_ARM_SWI24", Const, 0, ""}, - {"R_ARM_TARGET1", Const, 10, ""}, - {"R_ARM_TARGET2", Const, 10, ""}, - {"R_ARM_THM_ABS5", Const, 0, ""}, - {"R_ARM_THM_ALU_ABS_G0_NC", Const, 10, ""}, - {"R_ARM_THM_ALU_ABS_G1_NC", Const, 10, ""}, - {"R_ARM_THM_ALU_ABS_G2_NC", Const, 10, ""}, - {"R_ARM_THM_ALU_ABS_G3", Const, 10, ""}, - {"R_ARM_THM_ALU_PREL_11_0", Const, 10, ""}, - {"R_ARM_THM_GOT_BREL12", Const, 10, ""}, - {"R_ARM_THM_JUMP11", Const, 10, ""}, - {"R_ARM_THM_JUMP19", Const, 10, ""}, - {"R_ARM_THM_JUMP24", Const, 10, ""}, - {"R_ARM_THM_JUMP6", Const, 10, ""}, - {"R_ARM_THM_JUMP8", Const, 10, ""}, - {"R_ARM_THM_MOVT_ABS", Const, 10, ""}, - {"R_ARM_THM_MOVT_BREL", Const, 10, ""}, - {"R_ARM_THM_MOVT_PREL", Const, 10, ""}, - {"R_ARM_THM_MOVW_ABS_NC", Const, 10, ""}, - {"R_ARM_THM_MOVW_BREL", Const, 10, ""}, - {"R_ARM_THM_MOVW_BREL_NC", Const, 10, ""}, - {"R_ARM_THM_MOVW_PREL_NC", Const, 10, ""}, - {"R_ARM_THM_PC12", Const, 10, ""}, - {"R_ARM_THM_PC22", Const, 0, ""}, - {"R_ARM_THM_PC8", Const, 0, ""}, - {"R_ARM_THM_RPC22", Const, 0, ""}, - {"R_ARM_THM_SWI8", Const, 0, ""}, - {"R_ARM_THM_TLS_CALL", Const, 10, ""}, - {"R_ARM_THM_TLS_DESCSEQ16", Const, 10, ""}, - {"R_ARM_THM_TLS_DESCSEQ32", Const, 10, ""}, - {"R_ARM_THM_XPC22", Const, 0, ""}, - {"R_ARM_TLS_CALL", Const, 10, ""}, - {"R_ARM_TLS_DESCSEQ", Const, 10, ""}, - {"R_ARM_TLS_DTPMOD32", Const, 10, ""}, - {"R_ARM_TLS_DTPOFF32", Const, 10, ""}, - {"R_ARM_TLS_GD32", Const, 10, ""}, - {"R_ARM_TLS_GOTDESC", Const, 10, ""}, - {"R_ARM_TLS_IE12GP", Const, 10, ""}, - {"R_ARM_TLS_IE32", Const, 10, ""}, - {"R_ARM_TLS_LDM32", Const, 10, ""}, - {"R_ARM_TLS_LDO12", Const, 10, ""}, - {"R_ARM_TLS_LDO32", Const, 10, ""}, - {"R_ARM_TLS_LE12", Const, 10, ""}, - {"R_ARM_TLS_LE32", Const, 10, ""}, - {"R_ARM_TLS_TPOFF32", Const, 10, ""}, - {"R_ARM_V4BX", Const, 10, ""}, - {"R_ARM_XPC25", Const, 0, ""}, - {"R_INFO", Func, 0, "func(sym uint32, typ uint32) uint64"}, - {"R_INFO32", Func, 0, "func(sym uint32, typ uint32) uint32"}, - {"R_LARCH", Type, 19, ""}, - {"R_LARCH_32", Const, 19, ""}, - {"R_LARCH_32_PCREL", Const, 20, ""}, - {"R_LARCH_64", Const, 19, ""}, - {"R_LARCH_64_PCREL", Const, 22, ""}, - {"R_LARCH_ABS64_HI12", Const, 20, ""}, - {"R_LARCH_ABS64_LO20", Const, 20, ""}, - {"R_LARCH_ABS_HI20", Const, 20, ""}, - {"R_LARCH_ABS_LO12", Const, 20, ""}, - {"R_LARCH_ADD16", Const, 19, ""}, - {"R_LARCH_ADD24", Const, 19, ""}, - {"R_LARCH_ADD32", Const, 19, ""}, - {"R_LARCH_ADD6", Const, 22, ""}, - {"R_LARCH_ADD64", Const, 19, ""}, - {"R_LARCH_ADD8", Const, 19, ""}, - {"R_LARCH_ADD_ULEB128", Const, 22, ""}, - {"R_LARCH_ALIGN", Const, 22, ""}, - {"R_LARCH_B16", Const, 20, ""}, - {"R_LARCH_B21", Const, 20, ""}, - {"R_LARCH_B26", Const, 20, ""}, - {"R_LARCH_CALL36", Const, 26, ""}, - {"R_LARCH_CFA", Const, 22, ""}, - {"R_LARCH_COPY", Const, 19, ""}, - {"R_LARCH_DELETE", Const, 22, ""}, - {"R_LARCH_GNU_VTENTRY", Const, 20, ""}, - {"R_LARCH_GNU_VTINHERIT", Const, 20, ""}, - {"R_LARCH_GOT64_HI12", Const, 20, ""}, - {"R_LARCH_GOT64_LO20", Const, 20, ""}, - {"R_LARCH_GOT64_PC_HI12", Const, 20, ""}, - {"R_LARCH_GOT64_PC_LO20", Const, 20, ""}, - {"R_LARCH_GOT_HI20", Const, 20, ""}, - {"R_LARCH_GOT_LO12", Const, 20, ""}, - {"R_LARCH_GOT_PC_HI20", Const, 20, ""}, - {"R_LARCH_GOT_PC_LO12", Const, 20, ""}, - {"R_LARCH_IRELATIVE", Const, 19, ""}, - {"R_LARCH_JUMP_SLOT", Const, 19, ""}, - {"R_LARCH_MARK_LA", Const, 19, ""}, - {"R_LARCH_MARK_PCREL", Const, 19, ""}, - {"R_LARCH_NONE", Const, 19, ""}, - {"R_LARCH_PCALA64_HI12", Const, 20, ""}, - {"R_LARCH_PCALA64_LO20", Const, 20, ""}, - {"R_LARCH_PCALA_HI20", Const, 20, ""}, - {"R_LARCH_PCALA_LO12", Const, 20, ""}, - {"R_LARCH_PCREL20_S2", Const, 22, ""}, - {"R_LARCH_RELATIVE", Const, 19, ""}, - {"R_LARCH_RELAX", Const, 20, ""}, - {"R_LARCH_SOP_ADD", Const, 19, ""}, - {"R_LARCH_SOP_AND", Const, 19, ""}, - {"R_LARCH_SOP_ASSERT", Const, 19, ""}, - {"R_LARCH_SOP_IF_ELSE", Const, 19, ""}, - {"R_LARCH_SOP_NOT", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_0_10_10_16_S2", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_0_5_10_16_S2", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_10_12", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_10_16", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_10_16_S2", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_10_5", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_S_5_20", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_U", Const, 19, ""}, - {"R_LARCH_SOP_POP_32_U_10_12", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_ABSOLUTE", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_DUP", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_GPREL", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_PCREL", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_PLT_PCREL", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_TLS_GD", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_TLS_GOT", Const, 19, ""}, - {"R_LARCH_SOP_PUSH_TLS_TPREL", Const, 19, ""}, - {"R_LARCH_SOP_SL", Const, 19, ""}, - {"R_LARCH_SOP_SR", Const, 19, ""}, - {"R_LARCH_SOP_SUB", Const, 19, ""}, - {"R_LARCH_SUB16", Const, 19, ""}, - {"R_LARCH_SUB24", Const, 19, ""}, - {"R_LARCH_SUB32", Const, 19, ""}, - {"R_LARCH_SUB6", Const, 22, ""}, - {"R_LARCH_SUB64", Const, 19, ""}, - {"R_LARCH_SUB8", Const, 19, ""}, - {"R_LARCH_SUB_ULEB128", Const, 22, ""}, - {"R_LARCH_TLS_DESC32", Const, 26, ""}, - {"R_LARCH_TLS_DESC64", Const, 26, ""}, - {"R_LARCH_TLS_DESC64_HI12", Const, 26, ""}, - {"R_LARCH_TLS_DESC64_LO20", Const, 26, ""}, - {"R_LARCH_TLS_DESC64_PC_HI12", Const, 26, ""}, - {"R_LARCH_TLS_DESC64_PC_LO20", Const, 26, ""}, - {"R_LARCH_TLS_DESC_CALL", Const, 26, ""}, - {"R_LARCH_TLS_DESC_HI20", Const, 26, ""}, - {"R_LARCH_TLS_DESC_LD", Const, 26, ""}, - {"R_LARCH_TLS_DESC_LO12", Const, 26, ""}, - {"R_LARCH_TLS_DESC_PCREL20_S2", Const, 26, ""}, - {"R_LARCH_TLS_DESC_PC_HI20", Const, 26, ""}, - {"R_LARCH_TLS_DESC_PC_LO12", Const, 26, ""}, - {"R_LARCH_TLS_DTPMOD32", Const, 19, ""}, - {"R_LARCH_TLS_DTPMOD64", Const, 19, ""}, - {"R_LARCH_TLS_DTPREL32", Const, 19, ""}, - {"R_LARCH_TLS_DTPREL64", Const, 19, ""}, - {"R_LARCH_TLS_GD_HI20", Const, 20, ""}, - {"R_LARCH_TLS_GD_PCREL20_S2", Const, 26, ""}, - {"R_LARCH_TLS_GD_PC_HI20", Const, 20, ""}, - {"R_LARCH_TLS_IE64_HI12", Const, 20, ""}, - {"R_LARCH_TLS_IE64_LO20", Const, 20, ""}, - {"R_LARCH_TLS_IE64_PC_HI12", Const, 20, ""}, - {"R_LARCH_TLS_IE64_PC_LO20", Const, 20, ""}, - {"R_LARCH_TLS_IE_HI20", Const, 20, ""}, - {"R_LARCH_TLS_IE_LO12", Const, 20, ""}, - {"R_LARCH_TLS_IE_PC_HI20", Const, 20, ""}, - {"R_LARCH_TLS_IE_PC_LO12", Const, 20, ""}, - {"R_LARCH_TLS_LD_HI20", Const, 20, ""}, - {"R_LARCH_TLS_LD_PCREL20_S2", Const, 26, ""}, - {"R_LARCH_TLS_LD_PC_HI20", Const, 20, ""}, - {"R_LARCH_TLS_LE64_HI12", Const, 20, ""}, - {"R_LARCH_TLS_LE64_LO20", Const, 20, ""}, - {"R_LARCH_TLS_LE_ADD_R", Const, 26, ""}, - {"R_LARCH_TLS_LE_HI20", Const, 20, ""}, - {"R_LARCH_TLS_LE_HI20_R", Const, 26, ""}, - {"R_LARCH_TLS_LE_LO12", Const, 20, ""}, - {"R_LARCH_TLS_LE_LO12_R", Const, 26, ""}, - {"R_LARCH_TLS_TPREL32", Const, 19, ""}, - {"R_LARCH_TLS_TPREL64", Const, 19, ""}, - {"R_MIPS", Type, 6, ""}, - {"R_MIPS_16", Const, 6, ""}, - {"R_MIPS_26", Const, 6, ""}, - {"R_MIPS_32", Const, 6, ""}, - {"R_MIPS_64", Const, 6, ""}, - {"R_MIPS_ADD_IMMEDIATE", Const, 6, ""}, - {"R_MIPS_CALL16", Const, 6, ""}, - {"R_MIPS_CALL_HI16", Const, 6, ""}, - {"R_MIPS_CALL_LO16", Const, 6, ""}, - {"R_MIPS_DELETE", Const, 6, ""}, - {"R_MIPS_GOT16", Const, 6, ""}, - {"R_MIPS_GOT_DISP", Const, 6, ""}, - {"R_MIPS_GOT_HI16", Const, 6, ""}, - {"R_MIPS_GOT_LO16", Const, 6, ""}, - {"R_MIPS_GOT_OFST", Const, 6, ""}, - {"R_MIPS_GOT_PAGE", Const, 6, ""}, - {"R_MIPS_GPREL16", Const, 6, ""}, - {"R_MIPS_GPREL32", Const, 6, ""}, - {"R_MIPS_HI16", Const, 6, ""}, - {"R_MIPS_HIGHER", Const, 6, ""}, - {"R_MIPS_HIGHEST", Const, 6, ""}, - {"R_MIPS_INSERT_A", Const, 6, ""}, - {"R_MIPS_INSERT_B", Const, 6, ""}, - {"R_MIPS_JALR", Const, 6, ""}, - {"R_MIPS_LITERAL", Const, 6, ""}, - {"R_MIPS_LO16", Const, 6, ""}, - {"R_MIPS_NONE", Const, 6, ""}, - {"R_MIPS_PC16", Const, 6, ""}, - {"R_MIPS_PC32", Const, 22, ""}, - {"R_MIPS_PJUMP", Const, 6, ""}, - {"R_MIPS_REL16", Const, 6, ""}, - {"R_MIPS_REL32", Const, 6, ""}, - {"R_MIPS_RELGOT", Const, 6, ""}, - {"R_MIPS_SCN_DISP", Const, 6, ""}, - {"R_MIPS_SHIFT5", Const, 6, ""}, - {"R_MIPS_SHIFT6", Const, 6, ""}, - {"R_MIPS_SUB", Const, 6, ""}, - {"R_MIPS_TLS_DTPMOD32", Const, 6, ""}, - {"R_MIPS_TLS_DTPMOD64", Const, 6, ""}, - {"R_MIPS_TLS_DTPREL32", Const, 6, ""}, - {"R_MIPS_TLS_DTPREL64", Const, 6, ""}, - {"R_MIPS_TLS_DTPREL_HI16", Const, 6, ""}, - {"R_MIPS_TLS_DTPREL_LO16", Const, 6, ""}, - {"R_MIPS_TLS_GD", Const, 6, ""}, - {"R_MIPS_TLS_GOTTPREL", Const, 6, ""}, - {"R_MIPS_TLS_LDM", Const, 6, ""}, - {"R_MIPS_TLS_TPREL32", Const, 6, ""}, - {"R_MIPS_TLS_TPREL64", Const, 6, ""}, - {"R_MIPS_TLS_TPREL_HI16", Const, 6, ""}, - {"R_MIPS_TLS_TPREL_LO16", Const, 6, ""}, - {"R_PPC", Type, 0, ""}, - {"R_PPC64", Type, 5, ""}, - {"R_PPC64_ADDR14", Const, 5, ""}, - {"R_PPC64_ADDR14_BRNTAKEN", Const, 5, ""}, - {"R_PPC64_ADDR14_BRTAKEN", Const, 5, ""}, - {"R_PPC64_ADDR16", Const, 5, ""}, - {"R_PPC64_ADDR16_DS", Const, 5, ""}, - {"R_PPC64_ADDR16_HA", Const, 5, ""}, - {"R_PPC64_ADDR16_HI", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGH", Const, 10, ""}, - {"R_PPC64_ADDR16_HIGHA", Const, 10, ""}, - {"R_PPC64_ADDR16_HIGHER", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGHER34", Const, 20, ""}, - {"R_PPC64_ADDR16_HIGHERA", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGHERA34", Const, 20, ""}, - {"R_PPC64_ADDR16_HIGHEST", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGHEST34", Const, 20, ""}, - {"R_PPC64_ADDR16_HIGHESTA", Const, 5, ""}, - {"R_PPC64_ADDR16_HIGHESTA34", Const, 20, ""}, - {"R_PPC64_ADDR16_LO", Const, 5, ""}, - {"R_PPC64_ADDR16_LO_DS", Const, 5, ""}, - {"R_PPC64_ADDR24", Const, 5, ""}, - {"R_PPC64_ADDR32", Const, 5, ""}, - {"R_PPC64_ADDR64", Const, 5, ""}, - {"R_PPC64_ADDR64_LOCAL", Const, 10, ""}, - {"R_PPC64_COPY", Const, 20, ""}, - {"R_PPC64_D28", Const, 20, ""}, - {"R_PPC64_D34", Const, 20, ""}, - {"R_PPC64_D34_HA30", Const, 20, ""}, - {"R_PPC64_D34_HI30", Const, 20, ""}, - {"R_PPC64_D34_LO", Const, 20, ""}, - {"R_PPC64_DTPMOD64", Const, 5, ""}, - {"R_PPC64_DTPREL16", Const, 5, ""}, - {"R_PPC64_DTPREL16_DS", Const, 5, ""}, - {"R_PPC64_DTPREL16_HA", Const, 5, ""}, - {"R_PPC64_DTPREL16_HI", Const, 5, ""}, - {"R_PPC64_DTPREL16_HIGH", Const, 10, ""}, - {"R_PPC64_DTPREL16_HIGHA", Const, 10, ""}, - {"R_PPC64_DTPREL16_HIGHER", Const, 5, ""}, - {"R_PPC64_DTPREL16_HIGHERA", Const, 5, ""}, - {"R_PPC64_DTPREL16_HIGHEST", Const, 5, ""}, - {"R_PPC64_DTPREL16_HIGHESTA", Const, 5, ""}, - {"R_PPC64_DTPREL16_LO", Const, 5, ""}, - {"R_PPC64_DTPREL16_LO_DS", Const, 5, ""}, - {"R_PPC64_DTPREL34", Const, 20, ""}, - {"R_PPC64_DTPREL64", Const, 5, ""}, - {"R_PPC64_ENTRY", Const, 10, ""}, - {"R_PPC64_GLOB_DAT", Const, 20, ""}, - {"R_PPC64_GNU_VTENTRY", Const, 20, ""}, - {"R_PPC64_GNU_VTINHERIT", Const, 20, ""}, - {"R_PPC64_GOT16", Const, 5, ""}, - {"R_PPC64_GOT16_DS", Const, 5, ""}, - {"R_PPC64_GOT16_HA", Const, 5, ""}, - {"R_PPC64_GOT16_HI", Const, 5, ""}, - {"R_PPC64_GOT16_LO", Const, 5, ""}, - {"R_PPC64_GOT16_LO_DS", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL16_DS", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL16_HA", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL16_HI", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL16_LO_DS", Const, 5, ""}, - {"R_PPC64_GOT_DTPREL_PCREL34", Const, 20, ""}, - {"R_PPC64_GOT_PCREL34", Const, 20, ""}, - {"R_PPC64_GOT_TLSGD16", Const, 5, ""}, - {"R_PPC64_GOT_TLSGD16_HA", Const, 5, ""}, - {"R_PPC64_GOT_TLSGD16_HI", Const, 5, ""}, - {"R_PPC64_GOT_TLSGD16_LO", Const, 5, ""}, - {"R_PPC64_GOT_TLSGD_PCREL34", Const, 20, ""}, - {"R_PPC64_GOT_TLSLD16", Const, 5, ""}, - {"R_PPC64_GOT_TLSLD16_HA", Const, 5, ""}, - {"R_PPC64_GOT_TLSLD16_HI", Const, 5, ""}, - {"R_PPC64_GOT_TLSLD16_LO", Const, 5, ""}, - {"R_PPC64_GOT_TLSLD_PCREL34", Const, 20, ""}, - {"R_PPC64_GOT_TPREL16_DS", Const, 5, ""}, - {"R_PPC64_GOT_TPREL16_HA", Const, 5, ""}, - {"R_PPC64_GOT_TPREL16_HI", Const, 5, ""}, - {"R_PPC64_GOT_TPREL16_LO_DS", Const, 5, ""}, - {"R_PPC64_GOT_TPREL_PCREL34", Const, 20, ""}, - {"R_PPC64_IRELATIVE", Const, 10, ""}, - {"R_PPC64_JMP_IREL", Const, 10, ""}, - {"R_PPC64_JMP_SLOT", Const, 5, ""}, - {"R_PPC64_NONE", Const, 5, ""}, - {"R_PPC64_PCREL28", Const, 20, ""}, - {"R_PPC64_PCREL34", Const, 20, ""}, - {"R_PPC64_PCREL_OPT", Const, 20, ""}, - {"R_PPC64_PLT16_HA", Const, 20, ""}, - {"R_PPC64_PLT16_HI", Const, 20, ""}, - {"R_PPC64_PLT16_LO", Const, 20, ""}, - {"R_PPC64_PLT16_LO_DS", Const, 10, ""}, - {"R_PPC64_PLT32", Const, 20, ""}, - {"R_PPC64_PLT64", Const, 20, ""}, - {"R_PPC64_PLTCALL", Const, 20, ""}, - {"R_PPC64_PLTCALL_NOTOC", Const, 20, ""}, - {"R_PPC64_PLTGOT16", Const, 10, ""}, - {"R_PPC64_PLTGOT16_DS", Const, 10, ""}, - {"R_PPC64_PLTGOT16_HA", Const, 10, ""}, - {"R_PPC64_PLTGOT16_HI", Const, 10, ""}, - {"R_PPC64_PLTGOT16_LO", Const, 10, ""}, - {"R_PPC64_PLTGOT_LO_DS", Const, 10, ""}, - {"R_PPC64_PLTREL32", Const, 20, ""}, - {"R_PPC64_PLTREL64", Const, 20, ""}, - {"R_PPC64_PLTSEQ", Const, 20, ""}, - {"R_PPC64_PLTSEQ_NOTOC", Const, 20, ""}, - {"R_PPC64_PLT_PCREL34", Const, 20, ""}, - {"R_PPC64_PLT_PCREL34_NOTOC", Const, 20, ""}, - {"R_PPC64_REL14", Const, 5, ""}, - {"R_PPC64_REL14_BRNTAKEN", Const, 5, ""}, - {"R_PPC64_REL14_BRTAKEN", Const, 5, ""}, - {"R_PPC64_REL16", Const, 5, ""}, - {"R_PPC64_REL16DX_HA", Const, 10, ""}, - {"R_PPC64_REL16_HA", Const, 5, ""}, - {"R_PPC64_REL16_HI", Const, 5, ""}, - {"R_PPC64_REL16_HIGH", Const, 20, ""}, - {"R_PPC64_REL16_HIGHA", Const, 20, ""}, - {"R_PPC64_REL16_HIGHER", Const, 20, ""}, - {"R_PPC64_REL16_HIGHER34", Const, 20, ""}, - {"R_PPC64_REL16_HIGHERA", Const, 20, ""}, - {"R_PPC64_REL16_HIGHERA34", Const, 20, ""}, - {"R_PPC64_REL16_HIGHEST", Const, 20, ""}, - {"R_PPC64_REL16_HIGHEST34", Const, 20, ""}, - {"R_PPC64_REL16_HIGHESTA", Const, 20, ""}, - {"R_PPC64_REL16_HIGHESTA34", Const, 20, ""}, - {"R_PPC64_REL16_LO", Const, 5, ""}, - {"R_PPC64_REL24", Const, 5, ""}, - {"R_PPC64_REL24_NOTOC", Const, 10, ""}, - {"R_PPC64_REL24_P9NOTOC", Const, 21, ""}, - {"R_PPC64_REL30", Const, 20, ""}, - {"R_PPC64_REL32", Const, 5, ""}, - {"R_PPC64_REL64", Const, 5, ""}, - {"R_PPC64_RELATIVE", Const, 18, ""}, - {"R_PPC64_SECTOFF", Const, 20, ""}, - {"R_PPC64_SECTOFF_DS", Const, 10, ""}, - {"R_PPC64_SECTOFF_HA", Const, 20, ""}, - {"R_PPC64_SECTOFF_HI", Const, 20, ""}, - {"R_PPC64_SECTOFF_LO", Const, 20, ""}, - {"R_PPC64_SECTOFF_LO_DS", Const, 10, ""}, - {"R_PPC64_TLS", Const, 5, ""}, - {"R_PPC64_TLSGD", Const, 5, ""}, - {"R_PPC64_TLSLD", Const, 5, ""}, - {"R_PPC64_TOC", Const, 5, ""}, - {"R_PPC64_TOC16", Const, 5, ""}, - {"R_PPC64_TOC16_DS", Const, 5, ""}, - {"R_PPC64_TOC16_HA", Const, 5, ""}, - {"R_PPC64_TOC16_HI", Const, 5, ""}, - {"R_PPC64_TOC16_LO", Const, 5, ""}, - {"R_PPC64_TOC16_LO_DS", Const, 5, ""}, - {"R_PPC64_TOCSAVE", Const, 10, ""}, - {"R_PPC64_TPREL16", Const, 5, ""}, - {"R_PPC64_TPREL16_DS", Const, 5, ""}, - {"R_PPC64_TPREL16_HA", Const, 5, ""}, - {"R_PPC64_TPREL16_HI", Const, 5, ""}, - {"R_PPC64_TPREL16_HIGH", Const, 10, ""}, - {"R_PPC64_TPREL16_HIGHA", Const, 10, ""}, - {"R_PPC64_TPREL16_HIGHER", Const, 5, ""}, - {"R_PPC64_TPREL16_HIGHERA", Const, 5, ""}, - {"R_PPC64_TPREL16_HIGHEST", Const, 5, ""}, - {"R_PPC64_TPREL16_HIGHESTA", Const, 5, ""}, - {"R_PPC64_TPREL16_LO", Const, 5, ""}, - {"R_PPC64_TPREL16_LO_DS", Const, 5, ""}, - {"R_PPC64_TPREL34", Const, 20, ""}, - {"R_PPC64_TPREL64", Const, 5, ""}, - {"R_PPC64_UADDR16", Const, 20, ""}, - {"R_PPC64_UADDR32", Const, 20, ""}, - {"R_PPC64_UADDR64", Const, 20, ""}, - {"R_PPC_ADDR14", Const, 0, ""}, - {"R_PPC_ADDR14_BRNTAKEN", Const, 0, ""}, - {"R_PPC_ADDR14_BRTAKEN", Const, 0, ""}, - {"R_PPC_ADDR16", Const, 0, ""}, - {"R_PPC_ADDR16_HA", Const, 0, ""}, - {"R_PPC_ADDR16_HI", Const, 0, ""}, - {"R_PPC_ADDR16_LO", Const, 0, ""}, - {"R_PPC_ADDR24", Const, 0, ""}, - {"R_PPC_ADDR32", Const, 0, ""}, - {"R_PPC_COPY", Const, 0, ""}, - {"R_PPC_DTPMOD32", Const, 0, ""}, - {"R_PPC_DTPREL16", Const, 0, ""}, - {"R_PPC_DTPREL16_HA", Const, 0, ""}, - {"R_PPC_DTPREL16_HI", Const, 0, ""}, - {"R_PPC_DTPREL16_LO", Const, 0, ""}, - {"R_PPC_DTPREL32", Const, 0, ""}, - {"R_PPC_EMB_BIT_FLD", Const, 0, ""}, - {"R_PPC_EMB_MRKREF", Const, 0, ""}, - {"R_PPC_EMB_NADDR16", Const, 0, ""}, - {"R_PPC_EMB_NADDR16_HA", Const, 0, ""}, - {"R_PPC_EMB_NADDR16_HI", Const, 0, ""}, - {"R_PPC_EMB_NADDR16_LO", Const, 0, ""}, - {"R_PPC_EMB_NADDR32", Const, 0, ""}, - {"R_PPC_EMB_RELSDA", Const, 0, ""}, - {"R_PPC_EMB_RELSEC16", Const, 0, ""}, - {"R_PPC_EMB_RELST_HA", Const, 0, ""}, - {"R_PPC_EMB_RELST_HI", Const, 0, ""}, - {"R_PPC_EMB_RELST_LO", Const, 0, ""}, - {"R_PPC_EMB_SDA21", Const, 0, ""}, - {"R_PPC_EMB_SDA2I16", Const, 0, ""}, - {"R_PPC_EMB_SDA2REL", Const, 0, ""}, - {"R_PPC_EMB_SDAI16", Const, 0, ""}, - {"R_PPC_GLOB_DAT", Const, 0, ""}, - {"R_PPC_GOT16", Const, 0, ""}, - {"R_PPC_GOT16_HA", Const, 0, ""}, - {"R_PPC_GOT16_HI", Const, 0, ""}, - {"R_PPC_GOT16_LO", Const, 0, ""}, - {"R_PPC_GOT_TLSGD16", Const, 0, ""}, - {"R_PPC_GOT_TLSGD16_HA", Const, 0, ""}, - {"R_PPC_GOT_TLSGD16_HI", Const, 0, ""}, - {"R_PPC_GOT_TLSGD16_LO", Const, 0, ""}, - {"R_PPC_GOT_TLSLD16", Const, 0, ""}, - {"R_PPC_GOT_TLSLD16_HA", Const, 0, ""}, - {"R_PPC_GOT_TLSLD16_HI", Const, 0, ""}, - {"R_PPC_GOT_TLSLD16_LO", Const, 0, ""}, - {"R_PPC_GOT_TPREL16", Const, 0, ""}, - {"R_PPC_GOT_TPREL16_HA", Const, 0, ""}, - {"R_PPC_GOT_TPREL16_HI", Const, 0, ""}, - {"R_PPC_GOT_TPREL16_LO", Const, 0, ""}, - {"R_PPC_JMP_SLOT", Const, 0, ""}, - {"R_PPC_LOCAL24PC", Const, 0, ""}, - {"R_PPC_NONE", Const, 0, ""}, - {"R_PPC_PLT16_HA", Const, 0, ""}, - {"R_PPC_PLT16_HI", Const, 0, ""}, - {"R_PPC_PLT16_LO", Const, 0, ""}, - {"R_PPC_PLT32", Const, 0, ""}, - {"R_PPC_PLTREL24", Const, 0, ""}, - {"R_PPC_PLTREL32", Const, 0, ""}, - {"R_PPC_REL14", Const, 0, ""}, - {"R_PPC_REL14_BRNTAKEN", Const, 0, ""}, - {"R_PPC_REL14_BRTAKEN", Const, 0, ""}, - {"R_PPC_REL24", Const, 0, ""}, - {"R_PPC_REL32", Const, 0, ""}, - {"R_PPC_RELATIVE", Const, 0, ""}, - {"R_PPC_SDAREL16", Const, 0, ""}, - {"R_PPC_SECTOFF", Const, 0, ""}, - {"R_PPC_SECTOFF_HA", Const, 0, ""}, - {"R_PPC_SECTOFF_HI", Const, 0, ""}, - {"R_PPC_SECTOFF_LO", Const, 0, ""}, - {"R_PPC_TLS", Const, 0, ""}, - {"R_PPC_TPREL16", Const, 0, ""}, - {"R_PPC_TPREL16_HA", Const, 0, ""}, - {"R_PPC_TPREL16_HI", Const, 0, ""}, - {"R_PPC_TPREL16_LO", Const, 0, ""}, - {"R_PPC_TPREL32", Const, 0, ""}, - {"R_PPC_UADDR16", Const, 0, ""}, - {"R_PPC_UADDR32", Const, 0, ""}, - {"R_RISCV", Type, 11, ""}, - {"R_RISCV_32", Const, 11, ""}, - {"R_RISCV_32_PCREL", Const, 12, ""}, - {"R_RISCV_64", Const, 11, ""}, - {"R_RISCV_ADD16", Const, 11, ""}, - {"R_RISCV_ADD32", Const, 11, ""}, - {"R_RISCV_ADD64", Const, 11, ""}, - {"R_RISCV_ADD8", Const, 11, ""}, - {"R_RISCV_ALIGN", Const, 11, ""}, - {"R_RISCV_BRANCH", Const, 11, ""}, - {"R_RISCV_CALL", Const, 11, ""}, - {"R_RISCV_CALL_PLT", Const, 11, ""}, - {"R_RISCV_COPY", Const, 11, ""}, - {"R_RISCV_GNU_VTENTRY", Const, 11, ""}, - {"R_RISCV_GNU_VTINHERIT", Const, 11, ""}, - {"R_RISCV_GOT_HI20", Const, 11, ""}, - {"R_RISCV_GPREL_I", Const, 11, ""}, - {"R_RISCV_GPREL_S", Const, 11, ""}, - {"R_RISCV_HI20", Const, 11, ""}, - {"R_RISCV_JAL", Const, 11, ""}, - {"R_RISCV_JUMP_SLOT", Const, 11, ""}, - {"R_RISCV_LO12_I", Const, 11, ""}, - {"R_RISCV_LO12_S", Const, 11, ""}, - {"R_RISCV_NONE", Const, 11, ""}, - {"R_RISCV_PCREL_HI20", Const, 11, ""}, - {"R_RISCV_PCREL_LO12_I", Const, 11, ""}, - {"R_RISCV_PCREL_LO12_S", Const, 11, ""}, - {"R_RISCV_RELATIVE", Const, 11, ""}, - {"R_RISCV_RELAX", Const, 11, ""}, - {"R_RISCV_RVC_BRANCH", Const, 11, ""}, - {"R_RISCV_RVC_JUMP", Const, 11, ""}, - {"R_RISCV_RVC_LUI", Const, 11, ""}, - {"R_RISCV_SET16", Const, 11, ""}, - {"R_RISCV_SET32", Const, 11, ""}, - {"R_RISCV_SET6", Const, 11, ""}, - {"R_RISCV_SET8", Const, 11, ""}, - {"R_RISCV_SUB16", Const, 11, ""}, - {"R_RISCV_SUB32", Const, 11, ""}, - {"R_RISCV_SUB6", Const, 11, ""}, - {"R_RISCV_SUB64", Const, 11, ""}, - {"R_RISCV_SUB8", Const, 11, ""}, - {"R_RISCV_TLS_DTPMOD32", Const, 11, ""}, - {"R_RISCV_TLS_DTPMOD64", Const, 11, ""}, - {"R_RISCV_TLS_DTPREL32", Const, 11, ""}, - {"R_RISCV_TLS_DTPREL64", Const, 11, ""}, - {"R_RISCV_TLS_GD_HI20", Const, 11, ""}, - {"R_RISCV_TLS_GOT_HI20", Const, 11, ""}, - {"R_RISCV_TLS_TPREL32", Const, 11, ""}, - {"R_RISCV_TLS_TPREL64", Const, 11, ""}, - {"R_RISCV_TPREL_ADD", Const, 11, ""}, - {"R_RISCV_TPREL_HI20", Const, 11, ""}, - {"R_RISCV_TPREL_I", Const, 11, ""}, - {"R_RISCV_TPREL_LO12_I", Const, 11, ""}, - {"R_RISCV_TPREL_LO12_S", Const, 11, ""}, - {"R_RISCV_TPREL_S", Const, 11, ""}, - {"R_SPARC", Type, 0, ""}, - {"R_SPARC_10", Const, 0, ""}, - {"R_SPARC_11", Const, 0, ""}, - {"R_SPARC_13", Const, 0, ""}, - {"R_SPARC_16", Const, 0, ""}, - {"R_SPARC_22", Const, 0, ""}, - {"R_SPARC_32", Const, 0, ""}, - {"R_SPARC_5", Const, 0, ""}, - {"R_SPARC_6", Const, 0, ""}, - {"R_SPARC_64", Const, 0, ""}, - {"R_SPARC_7", Const, 0, ""}, - {"R_SPARC_8", Const, 0, ""}, - {"R_SPARC_COPY", Const, 0, ""}, - {"R_SPARC_DISP16", Const, 0, ""}, - {"R_SPARC_DISP32", Const, 0, ""}, - {"R_SPARC_DISP64", Const, 0, ""}, - {"R_SPARC_DISP8", Const, 0, ""}, - {"R_SPARC_GLOB_DAT", Const, 0, ""}, - {"R_SPARC_GLOB_JMP", Const, 0, ""}, - {"R_SPARC_GOT10", Const, 0, ""}, - {"R_SPARC_GOT13", Const, 0, ""}, - {"R_SPARC_GOT22", Const, 0, ""}, - {"R_SPARC_H44", Const, 0, ""}, - {"R_SPARC_HH22", Const, 0, ""}, - {"R_SPARC_HI22", Const, 0, ""}, - {"R_SPARC_HIPLT22", Const, 0, ""}, - {"R_SPARC_HIX22", Const, 0, ""}, - {"R_SPARC_HM10", Const, 0, ""}, - {"R_SPARC_JMP_SLOT", Const, 0, ""}, - {"R_SPARC_L44", Const, 0, ""}, - {"R_SPARC_LM22", Const, 0, ""}, - {"R_SPARC_LO10", Const, 0, ""}, - {"R_SPARC_LOPLT10", Const, 0, ""}, - {"R_SPARC_LOX10", Const, 0, ""}, - {"R_SPARC_M44", Const, 0, ""}, - {"R_SPARC_NONE", Const, 0, ""}, - {"R_SPARC_OLO10", Const, 0, ""}, - {"R_SPARC_PC10", Const, 0, ""}, - {"R_SPARC_PC22", Const, 0, ""}, - {"R_SPARC_PCPLT10", Const, 0, ""}, - {"R_SPARC_PCPLT22", Const, 0, ""}, - {"R_SPARC_PCPLT32", Const, 0, ""}, - {"R_SPARC_PC_HH22", Const, 0, ""}, - {"R_SPARC_PC_HM10", Const, 0, ""}, - {"R_SPARC_PC_LM22", Const, 0, ""}, - {"R_SPARC_PLT32", Const, 0, ""}, - {"R_SPARC_PLT64", Const, 0, ""}, - {"R_SPARC_REGISTER", Const, 0, ""}, - {"R_SPARC_RELATIVE", Const, 0, ""}, - {"R_SPARC_UA16", Const, 0, ""}, - {"R_SPARC_UA32", Const, 0, ""}, - {"R_SPARC_UA64", Const, 0, ""}, - {"R_SPARC_WDISP16", Const, 0, ""}, - {"R_SPARC_WDISP19", Const, 0, ""}, - {"R_SPARC_WDISP22", Const, 0, ""}, - {"R_SPARC_WDISP30", Const, 0, ""}, - {"R_SPARC_WPLT30", Const, 0, ""}, - {"R_SYM32", Func, 0, "func(info uint32) uint32"}, - {"R_SYM64", Func, 0, "func(info uint64) uint32"}, - {"R_TYPE32", Func, 0, "func(info uint32) uint32"}, - {"R_TYPE64", Func, 0, "func(info uint64) uint32"}, - {"R_X86_64", Type, 0, ""}, - {"R_X86_64_16", Const, 0, ""}, - {"R_X86_64_32", Const, 0, ""}, - {"R_X86_64_32S", Const, 0, ""}, - {"R_X86_64_64", Const, 0, ""}, - {"R_X86_64_8", Const, 0, ""}, - {"R_X86_64_COPY", Const, 0, ""}, - {"R_X86_64_DTPMOD64", Const, 0, ""}, - {"R_X86_64_DTPOFF32", Const, 0, ""}, - {"R_X86_64_DTPOFF64", Const, 0, ""}, - {"R_X86_64_GLOB_DAT", Const, 0, ""}, - {"R_X86_64_GOT32", Const, 0, ""}, - {"R_X86_64_GOT64", Const, 10, ""}, - {"R_X86_64_GOTOFF64", Const, 10, ""}, - {"R_X86_64_GOTPC32", Const, 10, ""}, - {"R_X86_64_GOTPC32_TLSDESC", Const, 10, ""}, - {"R_X86_64_GOTPC64", Const, 10, ""}, - {"R_X86_64_GOTPCREL", Const, 0, ""}, - {"R_X86_64_GOTPCREL64", Const, 10, ""}, - {"R_X86_64_GOTPCRELX", Const, 10, ""}, - {"R_X86_64_GOTPLT64", Const, 10, ""}, - {"R_X86_64_GOTTPOFF", Const, 0, ""}, - {"R_X86_64_IRELATIVE", Const, 10, ""}, - {"R_X86_64_JMP_SLOT", Const, 0, ""}, - {"R_X86_64_NONE", Const, 0, ""}, - {"R_X86_64_PC16", Const, 0, ""}, - {"R_X86_64_PC32", Const, 0, ""}, - {"R_X86_64_PC32_BND", Const, 10, ""}, - {"R_X86_64_PC64", Const, 10, ""}, - {"R_X86_64_PC8", Const, 0, ""}, - {"R_X86_64_PLT32", Const, 0, ""}, - {"R_X86_64_PLT32_BND", Const, 10, ""}, - {"R_X86_64_PLTOFF64", Const, 10, ""}, - {"R_X86_64_RELATIVE", Const, 0, ""}, - {"R_X86_64_RELATIVE64", Const, 10, ""}, - {"R_X86_64_REX_GOTPCRELX", Const, 10, ""}, - {"R_X86_64_SIZE32", Const, 10, ""}, - {"R_X86_64_SIZE64", Const, 10, ""}, - {"R_X86_64_TLSDESC", Const, 10, ""}, - {"R_X86_64_TLSDESC_CALL", Const, 10, ""}, - {"R_X86_64_TLSGD", Const, 0, ""}, - {"R_X86_64_TLSLD", Const, 0, ""}, - {"R_X86_64_TPOFF32", Const, 0, ""}, - {"R_X86_64_TPOFF64", Const, 0, ""}, - {"Rel32", Type, 0, ""}, - {"Rel32.Info", Field, 0, ""}, - {"Rel32.Off", Field, 0, ""}, - {"Rel64", Type, 0, ""}, - {"Rel64.Info", Field, 0, ""}, - {"Rel64.Off", Field, 0, ""}, - {"Rela32", Type, 0, ""}, - {"Rela32.Addend", Field, 0, ""}, - {"Rela32.Info", Field, 0, ""}, - {"Rela32.Off", Field, 0, ""}, - {"Rela64", Type, 0, ""}, - {"Rela64.Addend", Field, 0, ""}, - {"Rela64.Info", Field, 0, ""}, - {"Rela64.Off", Field, 0, ""}, - {"SHF_ALLOC", Const, 0, ""}, - {"SHF_COMPRESSED", Const, 6, ""}, - {"SHF_EXECINSTR", Const, 0, ""}, - {"SHF_GROUP", Const, 0, ""}, - {"SHF_INFO_LINK", Const, 0, ""}, - {"SHF_LINK_ORDER", Const, 0, ""}, - {"SHF_MASKOS", Const, 0, ""}, - {"SHF_MASKPROC", Const, 0, ""}, - {"SHF_MERGE", Const, 0, ""}, - {"SHF_OS_NONCONFORMING", Const, 0, ""}, - {"SHF_STRINGS", Const, 0, ""}, - {"SHF_TLS", Const, 0, ""}, - {"SHF_WRITE", Const, 0, ""}, - {"SHN_ABS", Const, 0, ""}, - {"SHN_COMMON", Const, 0, ""}, - {"SHN_HIOS", Const, 0, ""}, - {"SHN_HIPROC", Const, 0, ""}, - {"SHN_HIRESERVE", Const, 0, ""}, - {"SHN_LOOS", Const, 0, ""}, - {"SHN_LOPROC", Const, 0, ""}, - {"SHN_LORESERVE", Const, 0, ""}, - {"SHN_UNDEF", Const, 0, ""}, - {"SHN_XINDEX", Const, 0, ""}, - {"SHT_DYNAMIC", Const, 0, ""}, - {"SHT_DYNSYM", Const, 0, ""}, - {"SHT_FINI_ARRAY", Const, 0, ""}, - {"SHT_GNU_ATTRIBUTES", Const, 0, ""}, - {"SHT_GNU_HASH", Const, 0, ""}, - {"SHT_GNU_LIBLIST", Const, 0, ""}, - {"SHT_GNU_VERDEF", Const, 0, ""}, - {"SHT_GNU_VERNEED", Const, 0, ""}, - {"SHT_GNU_VERSYM", Const, 0, ""}, - {"SHT_GROUP", Const, 0, ""}, - {"SHT_HASH", Const, 0, ""}, - {"SHT_HIOS", Const, 0, ""}, - {"SHT_HIPROC", Const, 0, ""}, - {"SHT_HIUSER", Const, 0, ""}, - {"SHT_INIT_ARRAY", Const, 0, ""}, - {"SHT_LOOS", Const, 0, ""}, - {"SHT_LOPROC", Const, 0, ""}, - {"SHT_LOUSER", Const, 0, ""}, - {"SHT_MIPS_ABIFLAGS", Const, 17, ""}, - {"SHT_NOBITS", Const, 0, ""}, - {"SHT_NOTE", Const, 0, ""}, - {"SHT_NULL", Const, 0, ""}, - {"SHT_PREINIT_ARRAY", Const, 0, ""}, - {"SHT_PROGBITS", Const, 0, ""}, - {"SHT_REL", Const, 0, ""}, - {"SHT_RELA", Const, 0, ""}, - {"SHT_RISCV_ATTRIBUTES", Const, 25, ""}, - {"SHT_SHLIB", Const, 0, ""}, - {"SHT_STRTAB", Const, 0, ""}, - {"SHT_SYMTAB", Const, 0, ""}, - {"SHT_SYMTAB_SHNDX", Const, 0, ""}, - {"STB_GLOBAL", Const, 0, ""}, - {"STB_HIOS", Const, 0, ""}, - {"STB_HIPROC", Const, 0, ""}, - {"STB_LOCAL", Const, 0, ""}, - {"STB_LOOS", Const, 0, ""}, - {"STB_LOPROC", Const, 0, ""}, - {"STB_WEAK", Const, 0, ""}, - {"STT_COMMON", Const, 0, ""}, - {"STT_FILE", Const, 0, ""}, - {"STT_FUNC", Const, 0, ""}, - {"STT_GNU_IFUNC", Const, 23, ""}, - {"STT_HIOS", Const, 0, ""}, - {"STT_HIPROC", Const, 0, ""}, - {"STT_LOOS", Const, 0, ""}, - {"STT_LOPROC", Const, 0, ""}, - {"STT_NOTYPE", Const, 0, ""}, - {"STT_OBJECT", Const, 0, ""}, - {"STT_RELC", Const, 23, ""}, - {"STT_SECTION", Const, 0, ""}, - {"STT_SRELC", Const, 23, ""}, - {"STT_TLS", Const, 0, ""}, - {"STV_DEFAULT", Const, 0, ""}, - {"STV_HIDDEN", Const, 0, ""}, - {"STV_INTERNAL", Const, 0, ""}, - {"STV_PROTECTED", Const, 0, ""}, - {"ST_BIND", Func, 0, "func(info uint8) SymBind"}, - {"ST_INFO", Func, 0, "func(bind SymBind, typ SymType) uint8"}, - {"ST_TYPE", Func, 0, "func(info uint8) SymType"}, - {"ST_VISIBILITY", Func, 0, "func(other uint8) SymVis"}, - {"Section", Type, 0, ""}, - {"Section.ReaderAt", Field, 0, ""}, - {"Section.SectionHeader", Field, 0, ""}, - {"Section32", Type, 0, ""}, - {"Section32.Addr", Field, 0, ""}, - {"Section32.Addralign", Field, 0, ""}, - {"Section32.Entsize", Field, 0, ""}, - {"Section32.Flags", Field, 0, ""}, - {"Section32.Info", Field, 0, ""}, - {"Section32.Link", Field, 0, ""}, - {"Section32.Name", Field, 0, ""}, - {"Section32.Off", Field, 0, ""}, - {"Section32.Size", Field, 0, ""}, - {"Section32.Type", Field, 0, ""}, - {"Section64", Type, 0, ""}, - {"Section64.Addr", Field, 0, ""}, - {"Section64.Addralign", Field, 0, ""}, - {"Section64.Entsize", Field, 0, ""}, - {"Section64.Flags", Field, 0, ""}, - {"Section64.Info", Field, 0, ""}, - {"Section64.Link", Field, 0, ""}, - {"Section64.Name", Field, 0, ""}, - {"Section64.Off", Field, 0, ""}, - {"Section64.Size", Field, 0, ""}, - {"Section64.Type", Field, 0, ""}, - {"SectionFlag", Type, 0, ""}, - {"SectionHeader", Type, 0, ""}, - {"SectionHeader.Addr", Field, 0, ""}, - {"SectionHeader.Addralign", Field, 0, ""}, - {"SectionHeader.Entsize", Field, 0, ""}, - {"SectionHeader.FileSize", Field, 6, ""}, - {"SectionHeader.Flags", Field, 0, ""}, - {"SectionHeader.Info", Field, 0, ""}, - {"SectionHeader.Link", Field, 0, ""}, - {"SectionHeader.Name", Field, 0, ""}, - {"SectionHeader.Offset", Field, 0, ""}, - {"SectionHeader.Size", Field, 0, ""}, - {"SectionHeader.Type", Field, 0, ""}, - {"SectionIndex", Type, 0, ""}, - {"SectionType", Type, 0, ""}, - {"Sym32", Type, 0, ""}, - {"Sym32.Info", Field, 0, ""}, - {"Sym32.Name", Field, 0, ""}, - {"Sym32.Other", Field, 0, ""}, - {"Sym32.Shndx", Field, 0, ""}, - {"Sym32.Size", Field, 0, ""}, - {"Sym32.Value", Field, 0, ""}, - {"Sym32Size", Const, 0, ""}, - {"Sym64", Type, 0, ""}, - {"Sym64.Info", Field, 0, ""}, - {"Sym64.Name", Field, 0, ""}, - {"Sym64.Other", Field, 0, ""}, - {"Sym64.Shndx", Field, 0, ""}, - {"Sym64.Size", Field, 0, ""}, - {"Sym64.Value", Field, 0, ""}, - {"Sym64Size", Const, 0, ""}, - {"SymBind", Type, 0, ""}, - {"SymType", Type, 0, ""}, - {"SymVis", Type, 0, ""}, - {"Symbol", Type, 0, ""}, - {"Symbol.HasVersion", Field, 24, ""}, - {"Symbol.Info", Field, 0, ""}, - {"Symbol.Library", Field, 13, ""}, - {"Symbol.Name", Field, 0, ""}, - {"Symbol.Other", Field, 0, ""}, - {"Symbol.Section", Field, 0, ""}, - {"Symbol.Size", Field, 0, ""}, - {"Symbol.Value", Field, 0, ""}, - {"Symbol.Version", Field, 13, ""}, - {"Symbol.VersionIndex", Field, 24, ""}, - {"Type", Type, 0, ""}, - {"VER_FLG_BASE", Const, 24, ""}, - {"VER_FLG_INFO", Const, 24, ""}, - {"VER_FLG_WEAK", Const, 24, ""}, - {"Version", Type, 0, ""}, - {"VersionIndex", Type, 24, ""}, - }, - "debug/gosym": { - {"(*DecodingError).Error", Method, 0, ""}, - {"(*LineTable).LineToPC", Method, 0, ""}, - {"(*LineTable).PCToLine", Method, 0, ""}, - {"(*Sym).BaseName", Method, 0, ""}, - {"(*Sym).PackageName", Method, 0, ""}, - {"(*Sym).ReceiverName", Method, 0, ""}, - {"(*Sym).Static", Method, 0, ""}, - {"(*Table).LineToPC", Method, 0, ""}, - {"(*Table).LookupFunc", Method, 0, ""}, - {"(*Table).LookupSym", Method, 0, ""}, - {"(*Table).PCToFunc", Method, 0, ""}, - {"(*Table).PCToLine", Method, 0, ""}, - {"(*Table).SymByAddr", Method, 0, ""}, - {"(*UnknownLineError).Error", Method, 0, ""}, - {"(Func).BaseName", Method, 0, ""}, - {"(Func).PackageName", Method, 0, ""}, - {"(Func).ReceiverName", Method, 0, ""}, - {"(Func).Static", Method, 0, ""}, - {"(UnknownFileError).Error", Method, 0, ""}, - {"DecodingError", Type, 0, ""}, - {"Func", Type, 0, ""}, - {"Func.End", Field, 0, ""}, - {"Func.Entry", Field, 0, ""}, - {"Func.FrameSize", Field, 0, ""}, - {"Func.LineTable", Field, 0, ""}, - {"Func.Locals", Field, 0, ""}, - {"Func.Obj", Field, 0, ""}, - {"Func.Params", Field, 0, ""}, - {"Func.Sym", Field, 0, ""}, - {"LineTable", Type, 0, ""}, - {"LineTable.Data", Field, 0, ""}, - {"LineTable.Line", Field, 0, ""}, - {"LineTable.PC", Field, 0, ""}, - {"NewLineTable", Func, 0, "func(data []byte, text uint64) *LineTable"}, - {"NewTable", Func, 0, "func(symtab []byte, pcln *LineTable) (*Table, error)"}, - {"Obj", Type, 0, ""}, - {"Obj.Funcs", Field, 0, ""}, - {"Obj.Paths", Field, 0, ""}, - {"Sym", Type, 0, ""}, - {"Sym.Func", Field, 0, ""}, - {"Sym.GoType", Field, 0, ""}, - {"Sym.Name", Field, 0, ""}, - {"Sym.Type", Field, 0, ""}, - {"Sym.Value", Field, 0, ""}, - {"Table", Type, 0, ""}, - {"Table.Files", Field, 0, ""}, - {"Table.Funcs", Field, 0, ""}, - {"Table.Objs", Field, 0, ""}, - {"Table.Syms", Field, 0, ""}, - {"UnknownFileError", Type, 0, ""}, - {"UnknownLineError", Type, 0, ""}, - {"UnknownLineError.File", Field, 0, ""}, - {"UnknownLineError.Line", Field, 0, ""}, - }, - "debug/macho": { - {"(*FatFile).Close", Method, 3, ""}, - {"(*File).Close", Method, 0, ""}, - {"(*File).DWARF", Method, 0, ""}, - {"(*File).ImportedLibraries", Method, 0, ""}, - {"(*File).ImportedSymbols", Method, 0, ""}, - {"(*File).Section", Method, 0, ""}, - {"(*File).Segment", Method, 0, ""}, - {"(*FormatError).Error", Method, 0, ""}, - {"(*Section).Data", Method, 0, ""}, - {"(*Section).Open", Method, 0, ""}, - {"(*Segment).Data", Method, 0, ""}, - {"(*Segment).Open", Method, 0, ""}, - {"(Cpu).GoString", Method, 0, ""}, - {"(Cpu).String", Method, 0, ""}, - {"(Dylib).Raw", Method, 0, ""}, - {"(Dysymtab).Raw", Method, 0, ""}, - {"(FatArch).Close", Method, 3, ""}, - {"(FatArch).DWARF", Method, 3, ""}, - {"(FatArch).ImportedLibraries", Method, 3, ""}, - {"(FatArch).ImportedSymbols", Method, 3, ""}, - {"(FatArch).Section", Method, 3, ""}, - {"(FatArch).Segment", Method, 3, ""}, - {"(Load).Raw", Method, 0, ""}, - {"(LoadBytes).Raw", Method, 0, ""}, - {"(LoadCmd).GoString", Method, 0, ""}, - {"(LoadCmd).String", Method, 0, ""}, - {"(RelocTypeARM).GoString", Method, 10, ""}, - {"(RelocTypeARM).String", Method, 10, ""}, - {"(RelocTypeARM64).GoString", Method, 10, ""}, - {"(RelocTypeARM64).String", Method, 10, ""}, - {"(RelocTypeGeneric).GoString", Method, 10, ""}, - {"(RelocTypeGeneric).String", Method, 10, ""}, - {"(RelocTypeX86_64).GoString", Method, 10, ""}, - {"(RelocTypeX86_64).String", Method, 10, ""}, - {"(Rpath).Raw", Method, 10, ""}, - {"(Section).ReadAt", Method, 0, ""}, - {"(Segment).Raw", Method, 0, ""}, - {"(Segment).ReadAt", Method, 0, ""}, - {"(Symtab).Raw", Method, 0, ""}, - {"(Type).GoString", Method, 10, ""}, - {"(Type).String", Method, 10, ""}, - {"ARM64_RELOC_ADDEND", Const, 10, ""}, - {"ARM64_RELOC_BRANCH26", Const, 10, ""}, - {"ARM64_RELOC_GOT_LOAD_PAGE21", Const, 10, ""}, - {"ARM64_RELOC_GOT_LOAD_PAGEOFF12", Const, 10, ""}, - {"ARM64_RELOC_PAGE21", Const, 10, ""}, - {"ARM64_RELOC_PAGEOFF12", Const, 10, ""}, - {"ARM64_RELOC_POINTER_TO_GOT", Const, 10, ""}, - {"ARM64_RELOC_SUBTRACTOR", Const, 10, ""}, - {"ARM64_RELOC_TLVP_LOAD_PAGE21", Const, 10, ""}, - {"ARM64_RELOC_TLVP_LOAD_PAGEOFF12", Const, 10, ""}, - {"ARM64_RELOC_UNSIGNED", Const, 10, ""}, - {"ARM_RELOC_BR24", Const, 10, ""}, - {"ARM_RELOC_HALF", Const, 10, ""}, - {"ARM_RELOC_HALF_SECTDIFF", Const, 10, ""}, - {"ARM_RELOC_LOCAL_SECTDIFF", Const, 10, ""}, - {"ARM_RELOC_PAIR", Const, 10, ""}, - {"ARM_RELOC_PB_LA_PTR", Const, 10, ""}, - {"ARM_RELOC_SECTDIFF", Const, 10, ""}, - {"ARM_RELOC_VANILLA", Const, 10, ""}, - {"ARM_THUMB_32BIT_BRANCH", Const, 10, ""}, - {"ARM_THUMB_RELOC_BR22", Const, 10, ""}, - {"Cpu", Type, 0, ""}, - {"Cpu386", Const, 0, ""}, - {"CpuAmd64", Const, 0, ""}, - {"CpuArm", Const, 3, ""}, - {"CpuArm64", Const, 11, ""}, - {"CpuPpc", Const, 3, ""}, - {"CpuPpc64", Const, 3, ""}, - {"Dylib", Type, 0, ""}, - {"Dylib.CompatVersion", Field, 0, ""}, - {"Dylib.CurrentVersion", Field, 0, ""}, - {"Dylib.LoadBytes", Field, 0, ""}, - {"Dylib.Name", Field, 0, ""}, - {"Dylib.Time", Field, 0, ""}, - {"DylibCmd", Type, 0, ""}, - {"DylibCmd.Cmd", Field, 0, ""}, - {"DylibCmd.CompatVersion", Field, 0, ""}, - {"DylibCmd.CurrentVersion", Field, 0, ""}, - {"DylibCmd.Len", Field, 0, ""}, - {"DylibCmd.Name", Field, 0, ""}, - {"DylibCmd.Time", Field, 0, ""}, - {"Dysymtab", Type, 0, ""}, - {"Dysymtab.DysymtabCmd", Field, 0, ""}, - {"Dysymtab.IndirectSyms", Field, 0, ""}, - {"Dysymtab.LoadBytes", Field, 0, ""}, - {"DysymtabCmd", Type, 0, ""}, - {"DysymtabCmd.Cmd", Field, 0, ""}, - {"DysymtabCmd.Extrefsymoff", Field, 0, ""}, - {"DysymtabCmd.Extreloff", Field, 0, ""}, - {"DysymtabCmd.Iextdefsym", Field, 0, ""}, - {"DysymtabCmd.Ilocalsym", Field, 0, ""}, - {"DysymtabCmd.Indirectsymoff", Field, 0, ""}, - {"DysymtabCmd.Iundefsym", Field, 0, ""}, - {"DysymtabCmd.Len", Field, 0, ""}, - {"DysymtabCmd.Locreloff", Field, 0, ""}, - {"DysymtabCmd.Modtaboff", Field, 0, ""}, - {"DysymtabCmd.Nextdefsym", Field, 0, ""}, - {"DysymtabCmd.Nextrefsyms", Field, 0, ""}, - {"DysymtabCmd.Nextrel", Field, 0, ""}, - {"DysymtabCmd.Nindirectsyms", Field, 0, ""}, - {"DysymtabCmd.Nlocalsym", Field, 0, ""}, - {"DysymtabCmd.Nlocrel", Field, 0, ""}, - {"DysymtabCmd.Nmodtab", Field, 0, ""}, - {"DysymtabCmd.Ntoc", Field, 0, ""}, - {"DysymtabCmd.Nundefsym", Field, 0, ""}, - {"DysymtabCmd.Tocoffset", Field, 0, ""}, - {"ErrNotFat", Var, 3, ""}, - {"FatArch", Type, 3, ""}, - {"FatArch.FatArchHeader", Field, 3, ""}, - {"FatArch.File", Field, 3, ""}, - {"FatArchHeader", Type, 3, ""}, - {"FatArchHeader.Align", Field, 3, ""}, - {"FatArchHeader.Cpu", Field, 3, ""}, - {"FatArchHeader.Offset", Field, 3, ""}, - {"FatArchHeader.Size", Field, 3, ""}, - {"FatArchHeader.SubCpu", Field, 3, ""}, - {"FatFile", Type, 3, ""}, - {"FatFile.Arches", Field, 3, ""}, - {"FatFile.Magic", Field, 3, ""}, - {"File", Type, 0, ""}, - {"File.ByteOrder", Field, 0, ""}, - {"File.Dysymtab", Field, 0, ""}, - {"File.FileHeader", Field, 0, ""}, - {"File.Loads", Field, 0, ""}, - {"File.Sections", Field, 0, ""}, - {"File.Symtab", Field, 0, ""}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.Cmdsz", Field, 0, ""}, - {"FileHeader.Cpu", Field, 0, ""}, - {"FileHeader.Flags", Field, 0, ""}, - {"FileHeader.Magic", Field, 0, ""}, - {"FileHeader.Ncmd", Field, 0, ""}, - {"FileHeader.SubCpu", Field, 0, ""}, - {"FileHeader.Type", Field, 0, ""}, - {"FlagAllModsBound", Const, 10, ""}, - {"FlagAllowStackExecution", Const, 10, ""}, - {"FlagAppExtensionSafe", Const, 10, ""}, - {"FlagBindAtLoad", Const, 10, ""}, - {"FlagBindsToWeak", Const, 10, ""}, - {"FlagCanonical", Const, 10, ""}, - {"FlagDeadStrippableDylib", Const, 10, ""}, - {"FlagDyldLink", Const, 10, ""}, - {"FlagForceFlat", Const, 10, ""}, - {"FlagHasTLVDescriptors", Const, 10, ""}, - {"FlagIncrLink", Const, 10, ""}, - {"FlagLazyInit", Const, 10, ""}, - {"FlagNoFixPrebinding", Const, 10, ""}, - {"FlagNoHeapExecution", Const, 10, ""}, - {"FlagNoMultiDefs", Const, 10, ""}, - {"FlagNoReexportedDylibs", Const, 10, ""}, - {"FlagNoUndefs", Const, 10, ""}, - {"FlagPIE", Const, 10, ""}, - {"FlagPrebindable", Const, 10, ""}, - {"FlagPrebound", Const, 10, ""}, - {"FlagRootSafe", Const, 10, ""}, - {"FlagSetuidSafe", Const, 10, ""}, - {"FlagSplitSegs", Const, 10, ""}, - {"FlagSubsectionsViaSymbols", Const, 10, ""}, - {"FlagTwoLevel", Const, 10, ""}, - {"FlagWeakDefines", Const, 10, ""}, - {"FormatError", Type, 0, ""}, - {"GENERIC_RELOC_LOCAL_SECTDIFF", Const, 10, ""}, - {"GENERIC_RELOC_PAIR", Const, 10, ""}, - {"GENERIC_RELOC_PB_LA_PTR", Const, 10, ""}, - {"GENERIC_RELOC_SECTDIFF", Const, 10, ""}, - {"GENERIC_RELOC_TLV", Const, 10, ""}, - {"GENERIC_RELOC_VANILLA", Const, 10, ""}, - {"Load", Type, 0, ""}, - {"LoadBytes", Type, 0, ""}, - {"LoadCmd", Type, 0, ""}, - {"LoadCmdDylib", Const, 0, ""}, - {"LoadCmdDylinker", Const, 0, ""}, - {"LoadCmdDysymtab", Const, 0, ""}, - {"LoadCmdRpath", Const, 10, ""}, - {"LoadCmdSegment", Const, 0, ""}, - {"LoadCmdSegment64", Const, 0, ""}, - {"LoadCmdSymtab", Const, 0, ""}, - {"LoadCmdThread", Const, 0, ""}, - {"LoadCmdUnixThread", Const, 0, ""}, - {"Magic32", Const, 0, ""}, - {"Magic64", Const, 0, ""}, - {"MagicFat", Const, 3, ""}, - {"NewFatFile", Func, 3, "func(r io.ReaderAt) (*FatFile, error)"}, - {"NewFile", Func, 0, "func(r io.ReaderAt) (*File, error)"}, - {"Nlist32", Type, 0, ""}, - {"Nlist32.Desc", Field, 0, ""}, - {"Nlist32.Name", Field, 0, ""}, - {"Nlist32.Sect", Field, 0, ""}, - {"Nlist32.Type", Field, 0, ""}, - {"Nlist32.Value", Field, 0, ""}, - {"Nlist64", Type, 0, ""}, - {"Nlist64.Desc", Field, 0, ""}, - {"Nlist64.Name", Field, 0, ""}, - {"Nlist64.Sect", Field, 0, ""}, - {"Nlist64.Type", Field, 0, ""}, - {"Nlist64.Value", Field, 0, ""}, - {"Open", Func, 0, "func(name string) (*File, error)"}, - {"OpenFat", Func, 3, "func(name string) (*FatFile, error)"}, - {"Regs386", Type, 0, ""}, - {"Regs386.AX", Field, 0, ""}, - {"Regs386.BP", Field, 0, ""}, - {"Regs386.BX", Field, 0, ""}, - {"Regs386.CS", Field, 0, ""}, - {"Regs386.CX", Field, 0, ""}, - {"Regs386.DI", Field, 0, ""}, - {"Regs386.DS", Field, 0, ""}, - {"Regs386.DX", Field, 0, ""}, - {"Regs386.ES", Field, 0, ""}, - {"Regs386.FLAGS", Field, 0, ""}, - {"Regs386.FS", Field, 0, ""}, - {"Regs386.GS", Field, 0, ""}, - {"Regs386.IP", Field, 0, ""}, - {"Regs386.SI", Field, 0, ""}, - {"Regs386.SP", Field, 0, ""}, - {"Regs386.SS", Field, 0, ""}, - {"RegsAMD64", Type, 0, ""}, - {"RegsAMD64.AX", Field, 0, ""}, - {"RegsAMD64.BP", Field, 0, ""}, - {"RegsAMD64.BX", Field, 0, ""}, - {"RegsAMD64.CS", Field, 0, ""}, - {"RegsAMD64.CX", Field, 0, ""}, - {"RegsAMD64.DI", Field, 0, ""}, - {"RegsAMD64.DX", Field, 0, ""}, - {"RegsAMD64.FLAGS", Field, 0, ""}, - {"RegsAMD64.FS", Field, 0, ""}, - {"RegsAMD64.GS", Field, 0, ""}, - {"RegsAMD64.IP", Field, 0, ""}, - {"RegsAMD64.R10", Field, 0, ""}, - {"RegsAMD64.R11", Field, 0, ""}, - {"RegsAMD64.R12", Field, 0, ""}, - {"RegsAMD64.R13", Field, 0, ""}, - {"RegsAMD64.R14", Field, 0, ""}, - {"RegsAMD64.R15", Field, 0, ""}, - {"RegsAMD64.R8", Field, 0, ""}, - {"RegsAMD64.R9", Field, 0, ""}, - {"RegsAMD64.SI", Field, 0, ""}, - {"RegsAMD64.SP", Field, 0, ""}, - {"Reloc", Type, 10, ""}, - {"Reloc.Addr", Field, 10, ""}, - {"Reloc.Extern", Field, 10, ""}, - {"Reloc.Len", Field, 10, ""}, - {"Reloc.Pcrel", Field, 10, ""}, - {"Reloc.Scattered", Field, 10, ""}, - {"Reloc.Type", Field, 10, ""}, - {"Reloc.Value", Field, 10, ""}, - {"RelocTypeARM", Type, 10, ""}, - {"RelocTypeARM64", Type, 10, ""}, - {"RelocTypeGeneric", Type, 10, ""}, - {"RelocTypeX86_64", Type, 10, ""}, - {"Rpath", Type, 10, ""}, - {"Rpath.LoadBytes", Field, 10, ""}, - {"Rpath.Path", Field, 10, ""}, - {"RpathCmd", Type, 10, ""}, - {"RpathCmd.Cmd", Field, 10, ""}, - {"RpathCmd.Len", Field, 10, ""}, - {"RpathCmd.Path", Field, 10, ""}, - {"Section", Type, 0, ""}, - {"Section.ReaderAt", Field, 0, ""}, - {"Section.Relocs", Field, 10, ""}, - {"Section.SectionHeader", Field, 0, ""}, - {"Section32", Type, 0, ""}, - {"Section32.Addr", Field, 0, ""}, - {"Section32.Align", Field, 0, ""}, - {"Section32.Flags", Field, 0, ""}, - {"Section32.Name", Field, 0, ""}, - {"Section32.Nreloc", Field, 0, ""}, - {"Section32.Offset", Field, 0, ""}, - {"Section32.Reloff", Field, 0, ""}, - {"Section32.Reserve1", Field, 0, ""}, - {"Section32.Reserve2", Field, 0, ""}, - {"Section32.Seg", Field, 0, ""}, - {"Section32.Size", Field, 0, ""}, - {"Section64", Type, 0, ""}, - {"Section64.Addr", Field, 0, ""}, - {"Section64.Align", Field, 0, ""}, - {"Section64.Flags", Field, 0, ""}, - {"Section64.Name", Field, 0, ""}, - {"Section64.Nreloc", Field, 0, ""}, - {"Section64.Offset", Field, 0, ""}, - {"Section64.Reloff", Field, 0, ""}, - {"Section64.Reserve1", Field, 0, ""}, - {"Section64.Reserve2", Field, 0, ""}, - {"Section64.Reserve3", Field, 0, ""}, - {"Section64.Seg", Field, 0, ""}, - {"Section64.Size", Field, 0, ""}, - {"SectionHeader", Type, 0, ""}, - {"SectionHeader.Addr", Field, 0, ""}, - {"SectionHeader.Align", Field, 0, ""}, - {"SectionHeader.Flags", Field, 0, ""}, - {"SectionHeader.Name", Field, 0, ""}, - {"SectionHeader.Nreloc", Field, 0, ""}, - {"SectionHeader.Offset", Field, 0, ""}, - {"SectionHeader.Reloff", Field, 0, ""}, - {"SectionHeader.Seg", Field, 0, ""}, - {"SectionHeader.Size", Field, 0, ""}, - {"Segment", Type, 0, ""}, - {"Segment.LoadBytes", Field, 0, ""}, - {"Segment.ReaderAt", Field, 0, ""}, - {"Segment.SegmentHeader", Field, 0, ""}, - {"Segment32", Type, 0, ""}, - {"Segment32.Addr", Field, 0, ""}, - {"Segment32.Cmd", Field, 0, ""}, - {"Segment32.Filesz", Field, 0, ""}, - {"Segment32.Flag", Field, 0, ""}, - {"Segment32.Len", Field, 0, ""}, - {"Segment32.Maxprot", Field, 0, ""}, - {"Segment32.Memsz", Field, 0, ""}, - {"Segment32.Name", Field, 0, ""}, - {"Segment32.Nsect", Field, 0, ""}, - {"Segment32.Offset", Field, 0, ""}, - {"Segment32.Prot", Field, 0, ""}, - {"Segment64", Type, 0, ""}, - {"Segment64.Addr", Field, 0, ""}, - {"Segment64.Cmd", Field, 0, ""}, - {"Segment64.Filesz", Field, 0, ""}, - {"Segment64.Flag", Field, 0, ""}, - {"Segment64.Len", Field, 0, ""}, - {"Segment64.Maxprot", Field, 0, ""}, - {"Segment64.Memsz", Field, 0, ""}, - {"Segment64.Name", Field, 0, ""}, - {"Segment64.Nsect", Field, 0, ""}, - {"Segment64.Offset", Field, 0, ""}, - {"Segment64.Prot", Field, 0, ""}, - {"SegmentHeader", Type, 0, ""}, - {"SegmentHeader.Addr", Field, 0, ""}, - {"SegmentHeader.Cmd", Field, 0, ""}, - {"SegmentHeader.Filesz", Field, 0, ""}, - {"SegmentHeader.Flag", Field, 0, ""}, - {"SegmentHeader.Len", Field, 0, ""}, - {"SegmentHeader.Maxprot", Field, 0, ""}, - {"SegmentHeader.Memsz", Field, 0, ""}, - {"SegmentHeader.Name", Field, 0, ""}, - {"SegmentHeader.Nsect", Field, 0, ""}, - {"SegmentHeader.Offset", Field, 0, ""}, - {"SegmentHeader.Prot", Field, 0, ""}, - {"Symbol", Type, 0, ""}, - {"Symbol.Desc", Field, 0, ""}, - {"Symbol.Name", Field, 0, ""}, - {"Symbol.Sect", Field, 0, ""}, - {"Symbol.Type", Field, 0, ""}, - {"Symbol.Value", Field, 0, ""}, - {"Symtab", Type, 0, ""}, - {"Symtab.LoadBytes", Field, 0, ""}, - {"Symtab.Syms", Field, 0, ""}, - {"Symtab.SymtabCmd", Field, 0, ""}, - {"SymtabCmd", Type, 0, ""}, - {"SymtabCmd.Cmd", Field, 0, ""}, - {"SymtabCmd.Len", Field, 0, ""}, - {"SymtabCmd.Nsyms", Field, 0, ""}, - {"SymtabCmd.Stroff", Field, 0, ""}, - {"SymtabCmd.Strsize", Field, 0, ""}, - {"SymtabCmd.Symoff", Field, 0, ""}, - {"Thread", Type, 0, ""}, - {"Thread.Cmd", Field, 0, ""}, - {"Thread.Data", Field, 0, ""}, - {"Thread.Len", Field, 0, ""}, - {"Thread.Type", Field, 0, ""}, - {"Type", Type, 0, ""}, - {"TypeBundle", Const, 3, ""}, - {"TypeDylib", Const, 3, ""}, - {"TypeExec", Const, 0, ""}, - {"TypeObj", Const, 0, ""}, - {"X86_64_RELOC_BRANCH", Const, 10, ""}, - {"X86_64_RELOC_GOT", Const, 10, ""}, - {"X86_64_RELOC_GOT_LOAD", Const, 10, ""}, - {"X86_64_RELOC_SIGNED", Const, 10, ""}, - {"X86_64_RELOC_SIGNED_1", Const, 10, ""}, - {"X86_64_RELOC_SIGNED_2", Const, 10, ""}, - {"X86_64_RELOC_SIGNED_4", Const, 10, ""}, - {"X86_64_RELOC_SUBTRACTOR", Const, 10, ""}, - {"X86_64_RELOC_TLV", Const, 10, ""}, - {"X86_64_RELOC_UNSIGNED", Const, 10, ""}, - }, - "debug/pe": { - {"(*COFFSymbol).FullName", Method, 8, ""}, - {"(*File).COFFSymbolReadSectionDefAux", Method, 19, ""}, - {"(*File).Close", Method, 0, ""}, - {"(*File).DWARF", Method, 0, ""}, - {"(*File).ImportedLibraries", Method, 0, ""}, - {"(*File).ImportedSymbols", Method, 0, ""}, - {"(*File).Section", Method, 0, ""}, - {"(*FormatError).Error", Method, 0, ""}, - {"(*Section).Data", Method, 0, ""}, - {"(*Section).Open", Method, 0, ""}, - {"(Section).ReadAt", Method, 0, ""}, - {"(StringTable).String", Method, 8, ""}, - {"COFFSymbol", Type, 1, ""}, - {"COFFSymbol.Name", Field, 1, ""}, - {"COFFSymbol.NumberOfAuxSymbols", Field, 1, ""}, - {"COFFSymbol.SectionNumber", Field, 1, ""}, - {"COFFSymbol.StorageClass", Field, 1, ""}, - {"COFFSymbol.Type", Field, 1, ""}, - {"COFFSymbol.Value", Field, 1, ""}, - {"COFFSymbolAuxFormat5", Type, 19, ""}, - {"COFFSymbolAuxFormat5.Checksum", Field, 19, ""}, - {"COFFSymbolAuxFormat5.NumLineNumbers", Field, 19, ""}, - {"COFFSymbolAuxFormat5.NumRelocs", Field, 19, ""}, - {"COFFSymbolAuxFormat5.SecNum", Field, 19, ""}, - {"COFFSymbolAuxFormat5.Selection", Field, 19, ""}, - {"COFFSymbolAuxFormat5.Size", Field, 19, ""}, - {"COFFSymbolSize", Const, 1, ""}, - {"DataDirectory", Type, 3, ""}, - {"DataDirectory.Size", Field, 3, ""}, - {"DataDirectory.VirtualAddress", Field, 3, ""}, - {"File", Type, 0, ""}, - {"File.COFFSymbols", Field, 8, ""}, - {"File.FileHeader", Field, 0, ""}, - {"File.OptionalHeader", Field, 3, ""}, - {"File.Sections", Field, 0, ""}, - {"File.StringTable", Field, 8, ""}, - {"File.Symbols", Field, 1, ""}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.Characteristics", Field, 0, ""}, - {"FileHeader.Machine", Field, 0, ""}, - {"FileHeader.NumberOfSections", Field, 0, ""}, - {"FileHeader.NumberOfSymbols", Field, 0, ""}, - {"FileHeader.PointerToSymbolTable", Field, 0, ""}, - {"FileHeader.SizeOfOptionalHeader", Field, 0, ""}, - {"FileHeader.TimeDateStamp", Field, 0, ""}, - {"FormatError", Type, 0, ""}, - {"IMAGE_COMDAT_SELECT_ANY", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_ASSOCIATIVE", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_EXACT_MATCH", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_LARGEST", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_NODUPLICATES", Const, 19, ""}, - {"IMAGE_COMDAT_SELECT_SAME_SIZE", Const, 19, ""}, - {"IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_BASERELOC", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_DEBUG", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_EXCEPTION", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_EXPORT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_GLOBALPTR", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_IAT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_IMPORT", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_RESOURCE", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_SECURITY", Const, 11, ""}, - {"IMAGE_DIRECTORY_ENTRY_TLS", Const, 11, ""}, - {"IMAGE_DLLCHARACTERISTICS_APPCONTAINER", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_GUARD_CF", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_NO_BIND", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_NO_ISOLATION", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_NO_SEH", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_NX_COMPAT", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE", Const, 15, ""}, - {"IMAGE_DLLCHARACTERISTICS_WDM_DRIVER", Const, 15, ""}, - {"IMAGE_FILE_32BIT_MACHINE", Const, 15, ""}, - {"IMAGE_FILE_AGGRESIVE_WS_TRIM", Const, 15, ""}, - {"IMAGE_FILE_BYTES_REVERSED_HI", Const, 15, ""}, - {"IMAGE_FILE_BYTES_REVERSED_LO", Const, 15, ""}, - {"IMAGE_FILE_DEBUG_STRIPPED", Const, 15, ""}, - {"IMAGE_FILE_DLL", Const, 15, ""}, - {"IMAGE_FILE_EXECUTABLE_IMAGE", Const, 15, ""}, - {"IMAGE_FILE_LARGE_ADDRESS_AWARE", Const, 15, ""}, - {"IMAGE_FILE_LINE_NUMS_STRIPPED", Const, 15, ""}, - {"IMAGE_FILE_LOCAL_SYMS_STRIPPED", Const, 15, ""}, - {"IMAGE_FILE_MACHINE_AM33", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_AMD64", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_ARM", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_ARM64", Const, 11, ""}, - {"IMAGE_FILE_MACHINE_ARMNT", Const, 12, ""}, - {"IMAGE_FILE_MACHINE_EBC", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_I386", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_IA64", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_LOONGARCH32", Const, 19, ""}, - {"IMAGE_FILE_MACHINE_LOONGARCH64", Const, 19, ""}, - {"IMAGE_FILE_MACHINE_M32R", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_MIPS16", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_MIPSFPU", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_MIPSFPU16", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_POWERPC", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_POWERPCFP", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_R4000", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_RISCV128", Const, 20, ""}, - {"IMAGE_FILE_MACHINE_RISCV32", Const, 20, ""}, - {"IMAGE_FILE_MACHINE_RISCV64", Const, 20, ""}, - {"IMAGE_FILE_MACHINE_SH3", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_SH3DSP", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_SH4", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_SH5", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_THUMB", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_UNKNOWN", Const, 0, ""}, - {"IMAGE_FILE_MACHINE_WCEMIPSV2", Const, 0, ""}, - {"IMAGE_FILE_NET_RUN_FROM_SWAP", Const, 15, ""}, - {"IMAGE_FILE_RELOCS_STRIPPED", Const, 15, ""}, - {"IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP", Const, 15, ""}, - {"IMAGE_FILE_SYSTEM", Const, 15, ""}, - {"IMAGE_FILE_UP_SYSTEM_ONLY", Const, 15, ""}, - {"IMAGE_SCN_CNT_CODE", Const, 19, ""}, - {"IMAGE_SCN_CNT_INITIALIZED_DATA", Const, 19, ""}, - {"IMAGE_SCN_CNT_UNINITIALIZED_DATA", Const, 19, ""}, - {"IMAGE_SCN_LNK_COMDAT", Const, 19, ""}, - {"IMAGE_SCN_MEM_DISCARDABLE", Const, 19, ""}, - {"IMAGE_SCN_MEM_EXECUTE", Const, 19, ""}, - {"IMAGE_SCN_MEM_READ", Const, 19, ""}, - {"IMAGE_SCN_MEM_WRITE", Const, 19, ""}, - {"IMAGE_SUBSYSTEM_EFI_APPLICATION", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_EFI_ROM", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_NATIVE", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_NATIVE_WINDOWS", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_OS2_CUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_POSIX_CUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_UNKNOWN", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_WINDOWS_CE_GUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_WINDOWS_CUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_WINDOWS_GUI", Const, 15, ""}, - {"IMAGE_SUBSYSTEM_XBOX", Const, 15, ""}, - {"ImportDirectory", Type, 0, ""}, - {"ImportDirectory.FirstThunk", Field, 0, ""}, - {"ImportDirectory.ForwarderChain", Field, 0, ""}, - {"ImportDirectory.Name", Field, 0, ""}, - {"ImportDirectory.OriginalFirstThunk", Field, 0, ""}, - {"ImportDirectory.TimeDateStamp", Field, 0, ""}, - {"NewFile", Func, 0, "func(r io.ReaderAt) (*File, error)"}, - {"Open", Func, 0, "func(name string) (*File, error)"}, - {"OptionalHeader32", Type, 3, ""}, - {"OptionalHeader32.AddressOfEntryPoint", Field, 3, ""}, - {"OptionalHeader32.BaseOfCode", Field, 3, ""}, - {"OptionalHeader32.BaseOfData", Field, 3, ""}, - {"OptionalHeader32.CheckSum", Field, 3, ""}, - {"OptionalHeader32.DataDirectory", Field, 3, ""}, - {"OptionalHeader32.DllCharacteristics", Field, 3, ""}, - {"OptionalHeader32.FileAlignment", Field, 3, ""}, - {"OptionalHeader32.ImageBase", Field, 3, ""}, - {"OptionalHeader32.LoaderFlags", Field, 3, ""}, - {"OptionalHeader32.Magic", Field, 3, ""}, - {"OptionalHeader32.MajorImageVersion", Field, 3, ""}, - {"OptionalHeader32.MajorLinkerVersion", Field, 3, ""}, - {"OptionalHeader32.MajorOperatingSystemVersion", Field, 3, ""}, - {"OptionalHeader32.MajorSubsystemVersion", Field, 3, ""}, - {"OptionalHeader32.MinorImageVersion", Field, 3, ""}, - {"OptionalHeader32.MinorLinkerVersion", Field, 3, ""}, - {"OptionalHeader32.MinorOperatingSystemVersion", Field, 3, ""}, - {"OptionalHeader32.MinorSubsystemVersion", Field, 3, ""}, - {"OptionalHeader32.NumberOfRvaAndSizes", Field, 3, ""}, - {"OptionalHeader32.SectionAlignment", Field, 3, ""}, - {"OptionalHeader32.SizeOfCode", Field, 3, ""}, - {"OptionalHeader32.SizeOfHeaders", Field, 3, ""}, - {"OptionalHeader32.SizeOfHeapCommit", Field, 3, ""}, - {"OptionalHeader32.SizeOfHeapReserve", Field, 3, ""}, - {"OptionalHeader32.SizeOfImage", Field, 3, ""}, - {"OptionalHeader32.SizeOfInitializedData", Field, 3, ""}, - {"OptionalHeader32.SizeOfStackCommit", Field, 3, ""}, - {"OptionalHeader32.SizeOfStackReserve", Field, 3, ""}, - {"OptionalHeader32.SizeOfUninitializedData", Field, 3, ""}, - {"OptionalHeader32.Subsystem", Field, 3, ""}, - {"OptionalHeader32.Win32VersionValue", Field, 3, ""}, - {"OptionalHeader64", Type, 3, ""}, - {"OptionalHeader64.AddressOfEntryPoint", Field, 3, ""}, - {"OptionalHeader64.BaseOfCode", Field, 3, ""}, - {"OptionalHeader64.CheckSum", Field, 3, ""}, - {"OptionalHeader64.DataDirectory", Field, 3, ""}, - {"OptionalHeader64.DllCharacteristics", Field, 3, ""}, - {"OptionalHeader64.FileAlignment", Field, 3, ""}, - {"OptionalHeader64.ImageBase", Field, 3, ""}, - {"OptionalHeader64.LoaderFlags", Field, 3, ""}, - {"OptionalHeader64.Magic", Field, 3, ""}, - {"OptionalHeader64.MajorImageVersion", Field, 3, ""}, - {"OptionalHeader64.MajorLinkerVersion", Field, 3, ""}, - {"OptionalHeader64.MajorOperatingSystemVersion", Field, 3, ""}, - {"OptionalHeader64.MajorSubsystemVersion", Field, 3, ""}, - {"OptionalHeader64.MinorImageVersion", Field, 3, ""}, - {"OptionalHeader64.MinorLinkerVersion", Field, 3, ""}, - {"OptionalHeader64.MinorOperatingSystemVersion", Field, 3, ""}, - {"OptionalHeader64.MinorSubsystemVersion", Field, 3, ""}, - {"OptionalHeader64.NumberOfRvaAndSizes", Field, 3, ""}, - {"OptionalHeader64.SectionAlignment", Field, 3, ""}, - {"OptionalHeader64.SizeOfCode", Field, 3, ""}, - {"OptionalHeader64.SizeOfHeaders", Field, 3, ""}, - {"OptionalHeader64.SizeOfHeapCommit", Field, 3, ""}, - {"OptionalHeader64.SizeOfHeapReserve", Field, 3, ""}, - {"OptionalHeader64.SizeOfImage", Field, 3, ""}, - {"OptionalHeader64.SizeOfInitializedData", Field, 3, ""}, - {"OptionalHeader64.SizeOfStackCommit", Field, 3, ""}, - {"OptionalHeader64.SizeOfStackReserve", Field, 3, ""}, - {"OptionalHeader64.SizeOfUninitializedData", Field, 3, ""}, - {"OptionalHeader64.Subsystem", Field, 3, ""}, - {"OptionalHeader64.Win32VersionValue", Field, 3, ""}, - {"Reloc", Type, 8, ""}, - {"Reloc.SymbolTableIndex", Field, 8, ""}, - {"Reloc.Type", Field, 8, ""}, - {"Reloc.VirtualAddress", Field, 8, ""}, - {"Section", Type, 0, ""}, - {"Section.ReaderAt", Field, 0, ""}, - {"Section.Relocs", Field, 8, ""}, - {"Section.SectionHeader", Field, 0, ""}, - {"SectionHeader", Type, 0, ""}, - {"SectionHeader.Characteristics", Field, 0, ""}, - {"SectionHeader.Name", Field, 0, ""}, - {"SectionHeader.NumberOfLineNumbers", Field, 0, ""}, - {"SectionHeader.NumberOfRelocations", Field, 0, ""}, - {"SectionHeader.Offset", Field, 0, ""}, - {"SectionHeader.PointerToLineNumbers", Field, 0, ""}, - {"SectionHeader.PointerToRelocations", Field, 0, ""}, - {"SectionHeader.Size", Field, 0, ""}, - {"SectionHeader.VirtualAddress", Field, 0, ""}, - {"SectionHeader.VirtualSize", Field, 0, ""}, - {"SectionHeader32", Type, 0, ""}, - {"SectionHeader32.Characteristics", Field, 0, ""}, - {"SectionHeader32.Name", Field, 0, ""}, - {"SectionHeader32.NumberOfLineNumbers", Field, 0, ""}, - {"SectionHeader32.NumberOfRelocations", Field, 0, ""}, - {"SectionHeader32.PointerToLineNumbers", Field, 0, ""}, - {"SectionHeader32.PointerToRawData", Field, 0, ""}, - {"SectionHeader32.PointerToRelocations", Field, 0, ""}, - {"SectionHeader32.SizeOfRawData", Field, 0, ""}, - {"SectionHeader32.VirtualAddress", Field, 0, ""}, - {"SectionHeader32.VirtualSize", Field, 0, ""}, - {"StringTable", Type, 8, ""}, - {"Symbol", Type, 1, ""}, - {"Symbol.Name", Field, 1, ""}, - {"Symbol.SectionNumber", Field, 1, ""}, - {"Symbol.StorageClass", Field, 1, ""}, - {"Symbol.Type", Field, 1, ""}, - {"Symbol.Value", Field, 1, ""}, - }, - "debug/plan9obj": { - {"(*File).Close", Method, 3, ""}, - {"(*File).Section", Method, 3, ""}, - {"(*File).Symbols", Method, 3, ""}, - {"(*Section).Data", Method, 3, ""}, - {"(*Section).Open", Method, 3, ""}, - {"(Section).ReadAt", Method, 3, ""}, - {"ErrNoSymbols", Var, 18, ""}, - {"File", Type, 3, ""}, - {"File.FileHeader", Field, 3, ""}, - {"File.Sections", Field, 3, ""}, - {"FileHeader", Type, 3, ""}, - {"FileHeader.Bss", Field, 3, ""}, - {"FileHeader.Entry", Field, 3, ""}, - {"FileHeader.HdrSize", Field, 4, ""}, - {"FileHeader.LoadAddress", Field, 4, ""}, - {"FileHeader.Magic", Field, 3, ""}, - {"FileHeader.PtrSize", Field, 3, ""}, - {"Magic386", Const, 3, ""}, - {"Magic64", Const, 3, ""}, - {"MagicAMD64", Const, 3, ""}, - {"MagicARM", Const, 3, ""}, - {"NewFile", Func, 3, "func(r io.ReaderAt) (*File, error)"}, - {"Open", Func, 3, "func(name string) (*File, error)"}, - {"Section", Type, 3, ""}, - {"Section.ReaderAt", Field, 3, ""}, - {"Section.SectionHeader", Field, 3, ""}, - {"SectionHeader", Type, 3, ""}, - {"SectionHeader.Name", Field, 3, ""}, - {"SectionHeader.Offset", Field, 3, ""}, - {"SectionHeader.Size", Field, 3, ""}, - {"Sym", Type, 3, ""}, - {"Sym.Name", Field, 3, ""}, - {"Sym.Type", Field, 3, ""}, - {"Sym.Value", Field, 3, ""}, - }, - "embed": { - {"(FS).Open", Method, 16, ""}, - {"(FS).ReadDir", Method, 16, ""}, - {"(FS).ReadFile", Method, 16, ""}, - {"FS", Type, 16, ""}, - }, - "encoding": { - {"(BinaryAppender).AppendBinary", Method, 24, ""}, - {"(BinaryMarshaler).MarshalBinary", Method, 2, ""}, - {"(BinaryUnmarshaler).UnmarshalBinary", Method, 2, ""}, - {"(TextAppender).AppendText", Method, 24, ""}, - {"(TextMarshaler).MarshalText", Method, 2, ""}, - {"(TextUnmarshaler).UnmarshalText", Method, 2, ""}, - {"BinaryAppender", Type, 24, ""}, - {"BinaryMarshaler", Type, 2, ""}, - {"BinaryUnmarshaler", Type, 2, ""}, - {"TextAppender", Type, 24, ""}, - {"TextMarshaler", Type, 2, ""}, - {"TextUnmarshaler", Type, 2, ""}, - }, - "encoding/ascii85": { - {"(CorruptInputError).Error", Method, 0, ""}, - {"CorruptInputError", Type, 0, ""}, - {"Decode", Func, 0, "func(dst []byte, src []byte, flush bool) (ndst int, nsrc int, err error)"}, - {"Encode", Func, 0, "func(dst []byte, src []byte) int"}, - {"MaxEncodedLen", Func, 0, "func(n int) int"}, - {"NewDecoder", Func, 0, "func(r io.Reader) io.Reader"}, - {"NewEncoder", Func, 0, "func(w io.Writer) io.WriteCloser"}, - }, - "encoding/asn1": { - {"(BitString).At", Method, 0, ""}, - {"(BitString).RightAlign", Method, 0, ""}, - {"(ObjectIdentifier).Equal", Method, 0, ""}, - {"(ObjectIdentifier).String", Method, 3, ""}, - {"(StructuralError).Error", Method, 0, ""}, - {"(SyntaxError).Error", Method, 0, ""}, - {"BitString", Type, 0, ""}, - {"BitString.BitLength", Field, 0, ""}, - {"BitString.Bytes", Field, 0, ""}, - {"ClassApplication", Const, 6, ""}, - {"ClassContextSpecific", Const, 6, ""}, - {"ClassPrivate", Const, 6, ""}, - {"ClassUniversal", Const, 6, ""}, - {"Enumerated", Type, 0, ""}, - {"Flag", Type, 0, ""}, - {"Marshal", Func, 0, "func(val any) ([]byte, error)"}, - {"MarshalWithParams", Func, 10, "func(val any, params string) ([]byte, error)"}, - {"NullBytes", Var, 9, ""}, - {"NullRawValue", Var, 9, ""}, - {"ObjectIdentifier", Type, 0, ""}, - {"RawContent", Type, 0, ""}, - {"RawValue", Type, 0, ""}, - {"RawValue.Bytes", Field, 0, ""}, - {"RawValue.Class", Field, 0, ""}, - {"RawValue.FullBytes", Field, 0, ""}, - {"RawValue.IsCompound", Field, 0, ""}, - {"RawValue.Tag", Field, 0, ""}, - {"StructuralError", Type, 0, ""}, - {"StructuralError.Msg", Field, 0, ""}, - {"SyntaxError", Type, 0, ""}, - {"SyntaxError.Msg", Field, 0, ""}, - {"TagBMPString", Const, 14, ""}, - {"TagBitString", Const, 6, ""}, - {"TagBoolean", Const, 6, ""}, - {"TagEnum", Const, 6, ""}, - {"TagGeneralString", Const, 6, ""}, - {"TagGeneralizedTime", Const, 6, ""}, - {"TagIA5String", Const, 6, ""}, - {"TagInteger", Const, 6, ""}, - {"TagNull", Const, 9, ""}, - {"TagNumericString", Const, 10, ""}, - {"TagOID", Const, 6, ""}, - {"TagOctetString", Const, 6, ""}, - {"TagPrintableString", Const, 6, ""}, - {"TagSequence", Const, 6, ""}, - {"TagSet", Const, 6, ""}, - {"TagT61String", Const, 6, ""}, - {"TagUTCTime", Const, 6, ""}, - {"TagUTF8String", Const, 6, ""}, - {"Unmarshal", Func, 0, "func(b []byte, val any) (rest []byte, err error)"}, - {"UnmarshalWithParams", Func, 0, "func(b []byte, val any, params string) (rest []byte, err error)"}, - }, - "encoding/base32": { - {"(*Encoding).AppendDecode", Method, 22, ""}, - {"(*Encoding).AppendEncode", Method, 22, ""}, - {"(*Encoding).Decode", Method, 0, ""}, - {"(*Encoding).DecodeString", Method, 0, ""}, - {"(*Encoding).DecodedLen", Method, 0, ""}, - {"(*Encoding).Encode", Method, 0, ""}, - {"(*Encoding).EncodeToString", Method, 0, ""}, - {"(*Encoding).EncodedLen", Method, 0, ""}, - {"(CorruptInputError).Error", Method, 0, ""}, - {"(Encoding).WithPadding", Method, 9, ""}, - {"CorruptInputError", Type, 0, ""}, - {"Encoding", Type, 0, ""}, - {"HexEncoding", Var, 0, ""}, - {"NewDecoder", Func, 0, "func(enc *Encoding, r io.Reader) io.Reader"}, - {"NewEncoder", Func, 0, "func(enc *Encoding, w io.Writer) io.WriteCloser"}, - {"NewEncoding", Func, 0, "func(encoder string) *Encoding"}, - {"NoPadding", Const, 9, ""}, - {"StdEncoding", Var, 0, ""}, - {"StdPadding", Const, 9, ""}, - }, - "encoding/base64": { - {"(*Encoding).AppendDecode", Method, 22, ""}, - {"(*Encoding).AppendEncode", Method, 22, ""}, - {"(*Encoding).Decode", Method, 0, ""}, - {"(*Encoding).DecodeString", Method, 0, ""}, - {"(*Encoding).DecodedLen", Method, 0, ""}, - {"(*Encoding).Encode", Method, 0, ""}, - {"(*Encoding).EncodeToString", Method, 0, ""}, - {"(*Encoding).EncodedLen", Method, 0, ""}, - {"(CorruptInputError).Error", Method, 0, ""}, - {"(Encoding).Strict", Method, 8, ""}, - {"(Encoding).WithPadding", Method, 5, ""}, - {"CorruptInputError", Type, 0, ""}, - {"Encoding", Type, 0, ""}, - {"NewDecoder", Func, 0, "func(enc *Encoding, r io.Reader) io.Reader"}, - {"NewEncoder", Func, 0, "func(enc *Encoding, w io.Writer) io.WriteCloser"}, - {"NewEncoding", Func, 0, "func(encoder string) *Encoding"}, - {"NoPadding", Const, 5, ""}, - {"RawStdEncoding", Var, 5, ""}, - {"RawURLEncoding", Var, 5, ""}, - {"StdEncoding", Var, 0, ""}, - {"StdPadding", Const, 5, ""}, - {"URLEncoding", Var, 0, ""}, - }, - "encoding/binary": { - {"(AppendByteOrder).AppendUint16", Method, 19, ""}, - {"(AppendByteOrder).AppendUint32", Method, 19, ""}, - {"(AppendByteOrder).AppendUint64", Method, 19, ""}, - {"(AppendByteOrder).String", Method, 19, ""}, - {"(ByteOrder).PutUint16", Method, 0, ""}, - {"(ByteOrder).PutUint32", Method, 0, ""}, - {"(ByteOrder).PutUint64", Method, 0, ""}, - {"(ByteOrder).String", Method, 0, ""}, - {"(ByteOrder).Uint16", Method, 0, ""}, - {"(ByteOrder).Uint32", Method, 0, ""}, - {"(ByteOrder).Uint64", Method, 0, ""}, - {"Append", Func, 23, "func(buf []byte, order ByteOrder, data any) ([]byte, error)"}, - {"AppendByteOrder", Type, 19, ""}, - {"AppendUvarint", Func, 19, "func(buf []byte, x uint64) []byte"}, - {"AppendVarint", Func, 19, "func(buf []byte, x int64) []byte"}, - {"BigEndian", Var, 0, ""}, - {"ByteOrder", Type, 0, ""}, - {"Decode", Func, 23, "func(buf []byte, order ByteOrder, data any) (int, error)"}, - {"Encode", Func, 23, "func(buf []byte, order ByteOrder, data any) (int, error)"}, - {"LittleEndian", Var, 0, ""}, - {"MaxVarintLen16", Const, 0, ""}, - {"MaxVarintLen32", Const, 0, ""}, - {"MaxVarintLen64", Const, 0, ""}, - {"NativeEndian", Var, 21, ""}, - {"PutUvarint", Func, 0, "func(buf []byte, x uint64) int"}, - {"PutVarint", Func, 0, "func(buf []byte, x int64) int"}, - {"Read", Func, 0, "func(r io.Reader, order ByteOrder, data any) error"}, - {"ReadUvarint", Func, 0, "func(r io.ByteReader) (uint64, error)"}, - {"ReadVarint", Func, 0, "func(r io.ByteReader) (int64, error)"}, - {"Size", Func, 0, "func(v any) int"}, - {"Uvarint", Func, 0, "func(buf []byte) (uint64, int)"}, - {"Varint", Func, 0, "func(buf []byte) (int64, int)"}, - {"Write", Func, 0, "func(w io.Writer, order ByteOrder, data any) error"}, - }, - "encoding/csv": { - {"(*ParseError).Error", Method, 0, ""}, - {"(*ParseError).Unwrap", Method, 13, ""}, - {"(*Reader).FieldPos", Method, 17, ""}, - {"(*Reader).InputOffset", Method, 19, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).ReadAll", Method, 0, ""}, - {"(*Writer).Error", Method, 1, ""}, - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"(*Writer).WriteAll", Method, 0, ""}, - {"ErrBareQuote", Var, 0, ""}, - {"ErrFieldCount", Var, 0, ""}, - {"ErrQuote", Var, 0, ""}, - {"ErrTrailingComma", Var, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader) *Reader"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"ParseError", Type, 0, ""}, - {"ParseError.Column", Field, 0, ""}, - {"ParseError.Err", Field, 0, ""}, - {"ParseError.Line", Field, 0, ""}, - {"ParseError.StartLine", Field, 10, ""}, - {"Reader", Type, 0, ""}, - {"Reader.Comma", Field, 0, ""}, - {"Reader.Comment", Field, 0, ""}, - {"Reader.FieldsPerRecord", Field, 0, ""}, - {"Reader.LazyQuotes", Field, 0, ""}, - {"Reader.ReuseRecord", Field, 9, ""}, - {"Reader.TrailingComma", Field, 0, ""}, - {"Reader.TrimLeadingSpace", Field, 0, ""}, - {"Writer", Type, 0, ""}, - {"Writer.Comma", Field, 0, ""}, - {"Writer.UseCRLF", Field, 0, ""}, - }, - "encoding/gob": { - {"(*Decoder).Decode", Method, 0, ""}, - {"(*Decoder).DecodeValue", Method, 0, ""}, - {"(*Encoder).Encode", Method, 0, ""}, - {"(*Encoder).EncodeValue", Method, 0, ""}, - {"(GobDecoder).GobDecode", Method, 0, ""}, - {"(GobEncoder).GobEncode", Method, 0, ""}, - {"CommonType", Type, 0, ""}, - {"CommonType.Id", Field, 0, ""}, - {"CommonType.Name", Field, 0, ""}, - {"Decoder", Type, 0, ""}, - {"Encoder", Type, 0, ""}, - {"GobDecoder", Type, 0, ""}, - {"GobEncoder", Type, 0, ""}, - {"NewDecoder", Func, 0, "func(r io.Reader) *Decoder"}, - {"NewEncoder", Func, 0, "func(w io.Writer) *Encoder"}, - {"Register", Func, 0, "func(value any)"}, - {"RegisterName", Func, 0, "func(name string, value any)"}, - }, - "encoding/hex": { - {"(InvalidByteError).Error", Method, 0, ""}, - {"AppendDecode", Func, 22, "func(dst []byte, src []byte) ([]byte, error)"}, - {"AppendEncode", Func, 22, "func(dst []byte, src []byte) []byte"}, - {"Decode", Func, 0, "func(dst []byte, src []byte) (int, error)"}, - {"DecodeString", Func, 0, "func(s string) ([]byte, error)"}, - {"DecodedLen", Func, 0, "func(x int) int"}, - {"Dump", Func, 0, "func(data []byte) string"}, - {"Dumper", Func, 0, "func(w io.Writer) io.WriteCloser"}, - {"Encode", Func, 0, "func(dst []byte, src []byte) int"}, - {"EncodeToString", Func, 0, "func(src []byte) string"}, - {"EncodedLen", Func, 0, "func(n int) int"}, - {"ErrLength", Var, 0, ""}, - {"InvalidByteError", Type, 0, ""}, - {"NewDecoder", Func, 10, "func(r io.Reader) io.Reader"}, - {"NewEncoder", Func, 10, "func(w io.Writer) io.Writer"}, - }, - "encoding/json": { - {"(*Decoder).Buffered", Method, 1, ""}, - {"(*Decoder).Decode", Method, 0, ""}, - {"(*Decoder).DisallowUnknownFields", Method, 10, ""}, - {"(*Decoder).InputOffset", Method, 14, ""}, - {"(*Decoder).More", Method, 5, ""}, - {"(*Decoder).Token", Method, 5, ""}, - {"(*Decoder).UseNumber", Method, 1, ""}, - {"(*Encoder).Encode", Method, 0, ""}, - {"(*Encoder).SetEscapeHTML", Method, 7, ""}, - {"(*Encoder).SetIndent", Method, 7, ""}, - {"(*InvalidUTF8Error).Error", Method, 0, ""}, - {"(*InvalidUnmarshalError).Error", Method, 0, ""}, - {"(*MarshalerError).Error", Method, 0, ""}, - {"(*MarshalerError).Unwrap", Method, 13, ""}, - {"(*Number).UnmarshalJSONFrom", Method, 27, ""}, - {"(*RawMessage).MarshalJSON", Method, 0, ""}, - {"(*RawMessage).UnmarshalJSON", Method, 0, ""}, - {"(*SyntaxError).Error", Method, 0, ""}, - {"(*UnmarshalFieldError).Error", Method, 0, ""}, - {"(*UnmarshalTypeError).Error", Method, 0, ""}, - {"(*UnmarshalTypeError).Unwrap", Method, 27, ""}, - {"(*UnsupportedTypeError).Error", Method, 0, ""}, - {"(*UnsupportedValueError).Error", Method, 0, ""}, - {"(Delim).String", Method, 5, ""}, - {"(Marshaler).MarshalJSON", Method, 0, ""}, - {"(Number).Float64", Method, 1, ""}, - {"(Number).Int64", Method, 1, ""}, - {"(Number).MarshalJSONTo", Method, 27, ""}, - {"(Number).String", Method, 1, ""}, - {"(RawMessage).MarshalJSON", Method, 8, ""}, - {"(Unmarshaler).UnmarshalJSON", Method, 0, ""}, - {"CallMethodsWithLegacySemantics", Func, 27, "func(v bool) Options"}, - {"Compact", Func, 0, "func(dst *bytes.Buffer, src []byte) error"}, - {"Decoder", Type, 0, ""}, - {"DefaultOptionsV1", Func, 27, "func() Options"}, - {"Delim", Type, 5, ""}, - {"Encoder", Type, 0, ""}, - {"FormatByteArrayAsArray", Func, 27, "func(v bool) Options"}, - {"FormatBytesWithLegacySemantics", Func, 27, "func(v bool) Options"}, - {"FormatDurationAsNano", Func, 27, "func(v bool) Options"}, - {"HTMLEscape", Func, 0, "func(dst *bytes.Buffer, src []byte)"}, - {"Indent", Func, 0, "func(dst *bytes.Buffer, src []byte, prefix string, indent string) error"}, - {"InvalidUTF8Error", Type, 0, ""}, - {"InvalidUTF8Error.S", Field, 0, ""}, - {"InvalidUnmarshalError", Type, 0, ""}, - {"InvalidUnmarshalError.Type", Field, 0, ""}, - {"Marshal", Func, 0, "func(v any) ([]byte, error)"}, - {"MarshalIndent", Func, 0, "func(v any, prefix string, indent string) ([]byte, error)"}, - {"Marshaler", Type, 0, ""}, - {"MarshalerError", Type, 0, ""}, - {"MarshalerError.Err", Field, 0, ""}, - {"MarshalerError.Type", Field, 0, ""}, - {"MatchCaseSensitiveDelimiter", Func, 27, "func(v bool) Options"}, - {"MergeWithLegacySemantics", Func, 27, "func(v bool) Options"}, - {"NewDecoder", Func, 0, "func(r io.Reader) *Decoder"}, - {"NewEncoder", Func, 0, "func(w io.Writer) *Encoder"}, - {"Number", Type, 1, ""}, - {"OmitEmptyWithLegacySemantics", Func, 27, "func(v bool) Options"}, - {"Options", Type, 27, ""}, - {"ParseBytesWithLooseRFC4648", Func, 27, "func(v bool) Options"}, - {"ParseTimeWithLooseRFC3339", Func, 27, "func(v bool) Options"}, - {"RawMessage", Type, 0, ""}, - {"ReportErrorsWithLegacySemantics", Func, 27, "func(v bool) Options"}, - {"StringifyWithLegacySemantics", Func, 27, "func(v bool) Options"}, - {"SyntaxError", Type, 0, ""}, - {"SyntaxError.Offset", Field, 0, ""}, - {"Token", Type, 5, ""}, - {"Unmarshal", Func, 0, "func(data []byte, v any) error"}, - {"UnmarshalArrayFromAnyLength", Func, 27, "func(v bool) Options"}, - {"UnmarshalFieldError", Type, 0, ""}, - {"UnmarshalFieldError.Field", Field, 0, ""}, - {"UnmarshalFieldError.Key", Field, 0, ""}, - {"UnmarshalFieldError.Type", Field, 0, ""}, - {"UnmarshalTypeError", Type, 0, ""}, - {"UnmarshalTypeError.Err", Field, 27, ""}, - {"UnmarshalTypeError.Field", Field, 8, ""}, - {"UnmarshalTypeError.Offset", Field, 5, ""}, - {"UnmarshalTypeError.Struct", Field, 8, ""}, - {"UnmarshalTypeError.Type", Field, 0, ""}, - {"UnmarshalTypeError.Value", Field, 0, ""}, - {"Unmarshaler", Type, 0, ""}, - {"UnsupportedTypeError", Type, 0, ""}, - {"UnsupportedTypeError.Type", Field, 0, ""}, - {"UnsupportedValueError", Type, 0, ""}, - {"UnsupportedValueError.Str", Field, 0, ""}, - {"UnsupportedValueError.Value", Field, 0, ""}, - {"Valid", Func, 9, "func(data []byte) bool"}, - }, - "encoding/json/jsontext": { - {"(*Decoder).InputOffset", Method, 27, ""}, - {"(*Decoder).Options", Method, 27, ""}, - {"(*Decoder).PeekKind", Method, 27, ""}, - {"(*Decoder).ReadToken", Method, 27, ""}, - {"(*Decoder).ReadValue", Method, 27, ""}, - {"(*Decoder).Reset", Method, 27, ""}, - {"(*Decoder).SkipValue", Method, 27, ""}, - {"(*Decoder).StackDepth", Method, 27, ""}, - {"(*Decoder).StackIndex", Method, 27, ""}, - {"(*Decoder).StackPointer", Method, 27, ""}, - {"(*Decoder).UnreadBuffer", Method, 27, ""}, - {"(*Encoder).AvailableBuffer", Method, 27, ""}, - {"(*Encoder).Options", Method, 27, ""}, - {"(*Encoder).OutputOffset", Method, 27, ""}, - {"(*Encoder).Reset", Method, 27, ""}, - {"(*Encoder).StackDepth", Method, 27, ""}, - {"(*Encoder).StackIndex", Method, 27, ""}, - {"(*Encoder).StackPointer", Method, 27, ""}, - {"(*Encoder).WriteToken", Method, 27, ""}, - {"(*Encoder).WriteValue", Method, 27, ""}, - {"(*SyntacticError).Error", Method, 27, ""}, - {"(*SyntacticError).Unwrap", Method, 27, ""}, - {"(*Value).Canonicalize", Method, 27, ""}, - {"(*Value).Compact", Method, 27, ""}, - {"(*Value).Format", Method, 27, ""}, - {"(*Value).Indent", Method, 27, ""}, - {"(*Value).UnmarshalJSON", Method, 27, ""}, - {"(Kind).String", Method, 27, ""}, - {"(Pointer).AppendToken", Method, 27, ""}, - {"(Pointer).Contains", Method, 27, ""}, - {"(Pointer).IsValid", Method, 27, ""}, - {"(Pointer).LastToken", Method, 27, ""}, - {"(Pointer).Parent", Method, 27, ""}, - {"(Pointer).Tokens", Method, 27, ""}, - {"(Token).Bool", Method, 27, ""}, - {"(Token).Clone", Method, 27, ""}, - {"(Token).Float", Method, 27, ""}, - {"(Token).Float32", Method, 27, ""}, - {"(Token).Int", Method, 27, ""}, - {"(Token).Kind", Method, 27, ""}, - {"(Token).String", Method, 27, ""}, - {"(Token).Uint", Method, 27, ""}, - {"(Value).Clone", Method, 27, ""}, - {"(Value).IsValid", Method, 27, ""}, - {"(Value).Kind", Method, 27, ""}, - {"(Value).MarshalJSON", Method, 27, ""}, - {"(Value).String", Method, 27, ""}, - {"AllowDuplicateNames", Func, 27, "func(v bool) Options"}, - {"AllowInvalidUTF8", Func, 27, "func(v bool) Options"}, - {"AppendFloat", Func, 27, "func(dst []byte, src float64, bits int) []byte"}, - {"AppendFormat", Func, 27, "func[Bytes ~[]byte | ~string](dst []byte, src Bytes, opts ...Options) ([]byte, error)"}, - {"AppendQuote", Func, 27, "func[Bytes ~[]byte | ~string](dst []byte, src Bytes) ([]byte, error)"}, - {"AppendUnquote", Func, 27, "func[Bytes ~[]byte | ~string](dst []byte, src Bytes) ([]byte, error)"}, - {"BeginArray", Var, 27, ""}, - {"BeginObject", Var, 27, ""}, - {"Bool", Func, 27, "func(b bool) Token"}, - {"CanonicalizeRawFloats", Func, 27, "func(v bool) Options"}, - {"CanonicalizeRawInts", Func, 27, "func(v bool) Options"}, - {"Decoder", Type, 27, ""}, - {"Encoder", Type, 27, ""}, - {"EndArray", Var, 27, ""}, - {"EndObject", Var, 27, ""}, - {"ErrDuplicateName", Var, 27, ""}, - {"ErrNonStringName", Var, 27, ""}, - {"EscapeForHTML", Func, 27, "func(v bool) Options"}, - {"EscapeForJS", Func, 27, "func(v bool) Options"}, - {"False", Var, 27, ""}, - {"Float", Func, 27, "func(n float64) Token"}, - {"Float32", Func, 27, "func(n float32) Token"}, - {"Int", Func, 27, "func(n int64) Token"}, - {"Internal", Var, 27, ""}, - {"Kind", Type, 27, ""}, - {"KindBeginArray", Const, 27, ""}, - {"KindBeginObject", Const, 27, ""}, - {"KindEndArray", Const, 27, ""}, - {"KindEndObject", Const, 27, ""}, - {"KindFalse", Const, 27, ""}, - {"KindInvalid", Const, 27, ""}, - {"KindNull", Const, 27, ""}, - {"KindNumber", Const, 27, ""}, - {"KindString", Const, 27, ""}, - {"KindTrue", Const, 27, ""}, - {"Multiline", Func, 27, "func(v bool) Options"}, - {"NewDecoder", Func, 27, "func(r io.Reader, opts ...Options) *Decoder"}, - {"NewEncoder", Func, 27, "func(w io.Writer, opts ...Options) *Encoder"}, - {"Null", Var, 27, ""}, - {"Options", Type, 27, ""}, - {"Pointer", Type, 27, ""}, - {"PreserveRawStrings", Func, 27, "func(v bool) Options"}, - {"ReorderRawObjects", Func, 27, "func(v bool) Options"}, - {"SpaceAfterColon", Func, 27, "func(v bool) Options"}, - {"SpaceAfterComma", Func, 27, "func(v bool) Options"}, - {"String", Func, 27, "func(s string) Token"}, - {"SyntacticError", Type, 27, ""}, - {"SyntacticError.ByteOffset", Field, 27, ""}, - {"SyntacticError.Err", Field, 27, ""}, - {"SyntacticError.JSONPointer", Field, 27, ""}, - {"Token", Type, 27, ""}, - {"True", Var, 27, ""}, - {"Uint", Func, 27, "func(n uint64) Token"}, - {"Value", Type, 27, ""}, - {"WithIndent", Func, 27, "func(indent string) Options"}, - {"WithIndentPrefix", Func, 27, "func(prefix string) Options"}, - }, - "encoding/json/v2": { - {"(*SemanticError).Error", Method, 27, ""}, - {"(*SemanticError).Unwrap", Method, 27, ""}, - {"(Marshaler).MarshalJSON", Method, 27, ""}, - {"(MarshalerTo).MarshalJSONTo", Method, 27, ""}, - {"(Unmarshaler).UnmarshalJSON", Method, 27, ""}, - {"(UnmarshalerFrom).UnmarshalJSONFrom", Method, 27, ""}, - {"DefaultOptionsV2", Func, 27, "func() Options"}, - {"Deterministic", Func, 27, "func(v bool) Options"}, - {"ErrUnknownName", Var, 27, ""}, - {"FormatNilMapAsNull", Func, 27, "func(v bool) Options"}, - {"FormatNilSliceAsNull", Func, 27, "func(v bool) Options"}, - {"GetOption", Func, 27, "func[T any](opts Options, setter func(T) Options) (T, bool)"}, - {"JoinMarshalers", Func, 27, "func(ms ...*Marshalers) *Marshalers"}, - {"JoinOptions", Func, 27, "func(srcs ...Options) Options"}, - {"JoinUnmarshalers", Func, 27, "func(us ...*Unmarshalers) *Unmarshalers"}, - {"Marshal", Func, 27, "func(in any, opts ...Options) (out []byte, err error)"}, - {"MarshalEncode", Func, 27, "func(out *jsontext.Encoder, in any, opts ...Options) (err error)"}, - {"MarshalFunc", Func, 27, "func[T any](fn func(T) ([]byte, error)) *Marshalers"}, - {"MarshalToFunc", Func, 27, "func[T any](fn func(*jsontext.Encoder, T) error) *Marshalers"}, - {"MarshalWrite", Func, 27, "func(out io.Writer, in any, opts ...Options) (err error)"}, - {"Marshaler", Type, 27, ""}, - {"MarshalerTo", Type, 27, ""}, - {"Marshalers", Type, 27, ""}, - {"MatchCaseInsensitiveNames", Func, 27, "func(v bool) Options"}, - {"OmitZeroStructFields", Func, 27, "func(v bool) Options"}, - {"Options", Type, 27, ""}, - {"RejectUnknownMembers", Func, 27, "func(v bool) Options"}, - {"SemanticError", Type, 27, ""}, - {"SemanticError.ByteOffset", Field, 27, ""}, - {"SemanticError.Err", Field, 27, ""}, - {"SemanticError.GoType", Field, 27, ""}, - {"SemanticError.JSONKind", Field, 27, ""}, - {"SemanticError.JSONPointer", Field, 27, ""}, - {"SemanticError.JSONValue", Field, 27, ""}, - {"StringifyNumbers", Func, 27, "func(v bool) Options"}, - {"Unmarshal", Func, 27, "func(in []byte, out any, opts ...Options) (err error)"}, - {"UnmarshalDecode", Func, 27, "func(in *jsontext.Decoder, out any, opts ...Options) (err error)"}, - {"UnmarshalFromFunc", Func, 27, "func[T any](fn func(*jsontext.Decoder, T) error) *Unmarshalers"}, - {"UnmarshalFunc", Func, 27, "func[T any](fn func([]byte, T) error) *Unmarshalers"}, - {"UnmarshalRead", Func, 27, "func(in io.Reader, out any, opts ...Options) (err error)"}, - {"Unmarshaler", Type, 27, ""}, - {"UnmarshalerFrom", Type, 27, ""}, - {"Unmarshalers", Type, 27, ""}, - {"WithMarshalers", Func, 27, "func(v *Marshalers) Options"}, - {"WithUnmarshalers", Func, 27, "func(v *Unmarshalers) Options"}, - }, - "encoding/pem": { - {"Block", Type, 0, ""}, - {"Block.Bytes", Field, 0, ""}, - {"Block.Headers", Field, 0, ""}, - {"Block.Type", Field, 0, ""}, - {"Decode", Func, 0, "func(data []byte) (p *Block, rest []byte)"}, - {"Encode", Func, 0, "func(out io.Writer, b *Block) error"}, - {"EncodeToMemory", Func, 0, "func(b *Block) []byte"}, - }, - "encoding/xml": { - {"(*Decoder).Decode", Method, 0, ""}, - {"(*Decoder).DecodeElement", Method, 0, ""}, - {"(*Decoder).InputOffset", Method, 4, ""}, - {"(*Decoder).InputPos", Method, 19, ""}, - {"(*Decoder).RawToken", Method, 0, ""}, - {"(*Decoder).Skip", Method, 0, ""}, - {"(*Decoder).Token", Method, 0, ""}, - {"(*Encoder).Close", Method, 20, ""}, - {"(*Encoder).Encode", Method, 0, ""}, - {"(*Encoder).EncodeElement", Method, 2, ""}, - {"(*Encoder).EncodeToken", Method, 2, ""}, - {"(*Encoder).Flush", Method, 2, ""}, - {"(*Encoder).Indent", Method, 1, ""}, - {"(*SyntaxError).Error", Method, 0, ""}, - {"(*TagPathError).Error", Method, 0, ""}, - {"(*UnsupportedTypeError).Error", Method, 0, ""}, - {"(CharData).Copy", Method, 0, ""}, - {"(Comment).Copy", Method, 0, ""}, - {"(Directive).Copy", Method, 0, ""}, - {"(Marshaler).MarshalXML", Method, 2, ""}, - {"(MarshalerAttr).MarshalXMLAttr", Method, 2, ""}, - {"(ProcInst).Copy", Method, 0, ""}, - {"(StartElement).Copy", Method, 0, ""}, - {"(StartElement).End", Method, 2, ""}, - {"(TokenReader).Token", Method, 10, ""}, - {"(UnmarshalError).Error", Method, 0, ""}, - {"(Unmarshaler).UnmarshalXML", Method, 2, ""}, - {"(UnmarshalerAttr).UnmarshalXMLAttr", Method, 2, ""}, - {"Attr", Type, 0, ""}, - {"Attr.Name", Field, 0, ""}, - {"Attr.Value", Field, 0, ""}, - {"CharData", Type, 0, ""}, - {"Comment", Type, 0, ""}, - {"CopyToken", Func, 0, "func(t Token) Token"}, - {"Decoder", Type, 0, ""}, - {"Decoder.AutoClose", Field, 0, ""}, - {"Decoder.CharsetReader", Field, 0, ""}, - {"Decoder.DefaultSpace", Field, 1, ""}, - {"Decoder.Entity", Field, 0, ""}, - {"Decoder.Strict", Field, 0, ""}, - {"Directive", Type, 0, ""}, - {"Encoder", Type, 0, ""}, - {"EndElement", Type, 0, ""}, - {"EndElement.Name", Field, 0, ""}, - {"Escape", Func, 0, "func(w io.Writer, s []byte)"}, - {"EscapeText", Func, 1, "func(w io.Writer, s []byte) error"}, - {"HTMLAutoClose", Var, 0, ""}, - {"HTMLEntity", Var, 0, ""}, - {"Header", Const, 0, ""}, - {"Marshal", Func, 0, "func(v any) ([]byte, error)"}, - {"MarshalIndent", Func, 0, "func(v any, prefix string, indent string) ([]byte, error)"}, - {"Marshaler", Type, 2, ""}, - {"MarshalerAttr", Type, 2, ""}, - {"Name", Type, 0, ""}, - {"Name.Local", Field, 0, ""}, - {"Name.Space", Field, 0, ""}, - {"NewDecoder", Func, 0, "func(r io.Reader) *Decoder"}, - {"NewEncoder", Func, 0, "func(w io.Writer) *Encoder"}, - {"NewTokenDecoder", Func, 10, "func(t TokenReader) *Decoder"}, - {"ProcInst", Type, 0, ""}, - {"ProcInst.Inst", Field, 0, ""}, - {"ProcInst.Target", Field, 0, ""}, - {"StartElement", Type, 0, ""}, - {"StartElement.Attr", Field, 0, ""}, - {"StartElement.Name", Field, 0, ""}, - {"SyntaxError", Type, 0, ""}, - {"SyntaxError.Line", Field, 0, ""}, - {"SyntaxError.Msg", Field, 0, ""}, - {"TagPathError", Type, 0, ""}, - {"TagPathError.Field1", Field, 0, ""}, - {"TagPathError.Field2", Field, 0, ""}, - {"TagPathError.Struct", Field, 0, ""}, - {"TagPathError.Tag1", Field, 0, ""}, - {"TagPathError.Tag2", Field, 0, ""}, - {"Token", Type, 0, ""}, - {"TokenReader", Type, 10, ""}, - {"Unmarshal", Func, 0, "func(data []byte, v any) error"}, - {"UnmarshalError", Type, 0, ""}, - {"Unmarshaler", Type, 2, ""}, - {"UnmarshalerAttr", Type, 2, ""}, - {"UnsupportedTypeError", Type, 0, ""}, - {"UnsupportedTypeError.Type", Field, 0, ""}, - }, - "errors": { - {"As", Func, 13, "func(err error, target any) bool"}, - {"AsType", Func, 26, "func[E error](err error) (E, bool)"}, - {"ErrUnsupported", Var, 21, ""}, - {"Is", Func, 13, "func(err error, target error) bool"}, - {"Join", Func, 20, "func(errs ...error) error"}, - {"New", Func, 0, "func(text string) error"}, - {"Unwrap", Func, 13, "func(err error) error"}, - }, - "expvar": { - {"(*Float).Add", Method, 0, ""}, - {"(*Float).Set", Method, 0, ""}, - {"(*Float).String", Method, 0, ""}, - {"(*Float).Value", Method, 8, ""}, - {"(*Int).Add", Method, 0, ""}, - {"(*Int).Set", Method, 0, ""}, - {"(*Int).String", Method, 0, ""}, - {"(*Int).Value", Method, 8, ""}, - {"(*Map).Add", Method, 0, ""}, - {"(*Map).AddFloat", Method, 0, ""}, - {"(*Map).Delete", Method, 12, ""}, - {"(*Map).Do", Method, 0, ""}, - {"(*Map).Get", Method, 0, ""}, - {"(*Map).Init", Method, 0, ""}, - {"(*Map).Set", Method, 0, ""}, - {"(*Map).String", Method, 0, ""}, - {"(*String).Set", Method, 0, ""}, - {"(*String).String", Method, 0, ""}, - {"(*String).Value", Method, 8, ""}, - {"(Func).String", Method, 0, ""}, - {"(Func).Value", Method, 8, ""}, - {"(Var).String", Method, 0, ""}, - {"Do", Func, 0, "func(f func(KeyValue))"}, - {"Float", Type, 0, ""}, - {"Func", Type, 0, ""}, - {"Get", Func, 0, "func(name string) Var"}, - {"Handler", Func, 8, "func() http.Handler"}, - {"Int", Type, 0, ""}, - {"KeyValue", Type, 0, ""}, - {"KeyValue.Key", Field, 0, ""}, - {"KeyValue.Value", Field, 0, ""}, - {"Map", Type, 0, ""}, - {"NewFloat", Func, 0, "func(name string) *Float"}, - {"NewInt", Func, 0, "func(name string) *Int"}, - {"NewMap", Func, 0, "func(name string) *Map"}, - {"NewString", Func, 0, "func(name string) *String"}, - {"Publish", Func, 0, "func(name string, v Var)"}, - {"String", Type, 0, ""}, - {"Var", Type, 0, ""}, - }, - "flag": { - {"(*FlagSet).Arg", Method, 0, ""}, - {"(*FlagSet).Args", Method, 0, ""}, - {"(*FlagSet).Bool", Method, 0, ""}, - {"(*FlagSet).BoolFunc", Method, 21, ""}, - {"(*FlagSet).BoolVar", Method, 0, ""}, - {"(*FlagSet).Duration", Method, 0, ""}, - {"(*FlagSet).DurationVar", Method, 0, ""}, - {"(*FlagSet).ErrorHandling", Method, 10, ""}, - {"(*FlagSet).Float64", Method, 0, ""}, - {"(*FlagSet).Float64Var", Method, 0, ""}, - {"(*FlagSet).Func", Method, 16, ""}, - {"(*FlagSet).Init", Method, 0, ""}, - {"(*FlagSet).Int", Method, 0, ""}, - {"(*FlagSet).Int64", Method, 0, ""}, - {"(*FlagSet).Int64Var", Method, 0, ""}, - {"(*FlagSet).IntVar", Method, 0, ""}, - {"(*FlagSet).Lookup", Method, 0, ""}, - {"(*FlagSet).NArg", Method, 0, ""}, - {"(*FlagSet).NFlag", Method, 0, ""}, - {"(*FlagSet).Name", Method, 10, ""}, - {"(*FlagSet).Output", Method, 10, ""}, - {"(*FlagSet).Parse", Method, 0, ""}, - {"(*FlagSet).Parsed", Method, 0, ""}, - {"(*FlagSet).PrintDefaults", Method, 0, ""}, - {"(*FlagSet).Set", Method, 0, ""}, - {"(*FlagSet).SetOutput", Method, 0, ""}, - {"(*FlagSet).String", Method, 0, ""}, - {"(*FlagSet).StringVar", Method, 0, ""}, - {"(*FlagSet).TextVar", Method, 19, ""}, - {"(*FlagSet).Uint", Method, 0, ""}, - {"(*FlagSet).Uint64", Method, 0, ""}, - {"(*FlagSet).Uint64Var", Method, 0, ""}, - {"(*FlagSet).UintVar", Method, 0, ""}, - {"(*FlagSet).Var", Method, 0, ""}, - {"(*FlagSet).Visit", Method, 0, ""}, - {"(*FlagSet).VisitAll", Method, 0, ""}, - {"(Getter).Get", Method, 2, ""}, - {"(Getter).Set", Method, 2, ""}, - {"(Getter).String", Method, 2, ""}, - {"(Value).Set", Method, 0, ""}, - {"(Value).String", Method, 0, ""}, - {"Arg", Func, 0, "func(i int) string"}, - {"Args", Func, 0, "func() []string"}, - {"Bool", Func, 0, "func(name string, value bool, usage string) *bool"}, - {"BoolFunc", Func, 21, "func(name string, usage string, fn func(string) error)"}, - {"BoolVar", Func, 0, "func(p *bool, name string, value bool, usage string)"}, - {"CommandLine", Var, 2, ""}, - {"ContinueOnError", Const, 0, ""}, - {"Duration", Func, 0, "func(name string, value time.Duration, usage string) *time.Duration"}, - {"DurationVar", Func, 0, "func(p *time.Duration, name string, value time.Duration, usage string)"}, - {"ErrHelp", Var, 0, ""}, - {"ErrorHandling", Type, 0, ""}, - {"ExitOnError", Const, 0, ""}, - {"Flag", Type, 0, ""}, - {"Flag.DefValue", Field, 0, ""}, - {"Flag.Name", Field, 0, ""}, - {"Flag.Usage", Field, 0, ""}, - {"Flag.Value", Field, 0, ""}, - {"FlagSet", Type, 0, ""}, - {"FlagSet.Usage", Field, 0, ""}, - {"Float64", Func, 0, "func(name string, value float64, usage string) *float64"}, - {"Float64Var", Func, 0, "func(p *float64, name string, value float64, usage string)"}, - {"Func", Func, 16, "func(name string, usage string, fn func(string) error)"}, - {"Getter", Type, 2, ""}, - {"Int", Func, 0, "func(name string, value int, usage string) *int"}, - {"Int64", Func, 0, "func(name string, value int64, usage string) *int64"}, - {"Int64Var", Func, 0, "func(p *int64, name string, value int64, usage string)"}, - {"IntVar", Func, 0, "func(p *int, name string, value int, usage string)"}, - {"Lookup", Func, 0, "func(name string) *Flag"}, - {"NArg", Func, 0, "func() int"}, - {"NFlag", Func, 0, "func() int"}, - {"NewFlagSet", Func, 0, "func(name string, errorHandling ErrorHandling) *FlagSet"}, - {"PanicOnError", Const, 0, ""}, - {"Parse", Func, 0, "func()"}, - {"Parsed", Func, 0, "func() bool"}, - {"PrintDefaults", Func, 0, "func()"}, - {"Set", Func, 0, "func(name string, value string) error"}, - {"String", Func, 0, "func(name string, value string, usage string) *string"}, - {"StringVar", Func, 0, "func(p *string, name string, value string, usage string)"}, - {"TextVar", Func, 19, "func(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string)"}, - {"Uint", Func, 0, "func(name string, value uint, usage string) *uint"}, - {"Uint64", Func, 0, "func(name string, value uint64, usage string) *uint64"}, - {"Uint64Var", Func, 0, "func(p *uint64, name string, value uint64, usage string)"}, - {"UintVar", Func, 0, "func(p *uint, name string, value uint, usage string)"}, - {"UnquoteUsage", Func, 5, "func(flag *Flag) (name string, usage string)"}, - {"Usage", Var, 0, ""}, - {"Value", Type, 0, ""}, - {"Var", Func, 0, "func(value Value, name string, usage string)"}, - {"Visit", Func, 0, "func(fn func(*Flag))"}, - {"VisitAll", Func, 0, "func(fn func(*Flag))"}, - }, - "fmt": { - {"(Formatter).Format", Method, 0, ""}, - {"(GoStringer).GoString", Method, 0, ""}, - {"(ScanState).Read", Method, 0, ""}, - {"(ScanState).ReadRune", Method, 0, ""}, - {"(ScanState).SkipSpace", Method, 0, ""}, - {"(ScanState).Token", Method, 0, ""}, - {"(ScanState).UnreadRune", Method, 0, ""}, - {"(ScanState).Width", Method, 0, ""}, - {"(Scanner).Scan", Method, 0, ""}, - {"(State).Flag", Method, 0, ""}, - {"(State).Precision", Method, 0, ""}, - {"(State).Width", Method, 0, ""}, - {"(State).Write", Method, 0, ""}, - {"(Stringer).String", Method, 0, ""}, - {"Append", Func, 19, "func(b []byte, a ...any) []byte"}, - {"Appendf", Func, 19, "func(b []byte, format string, a ...any) []byte"}, - {"Appendln", Func, 19, "func(b []byte, a ...any) []byte"}, - {"Errorf", Func, 0, "func(format string, a ...any) (err error)"}, - {"FormatString", Func, 20, "func(state State, verb rune) string"}, - {"Formatter", Type, 0, ""}, - {"Fprint", Func, 0, "func(w io.Writer, a ...any) (n int, err error)"}, - {"Fprintf", Func, 0, "func(w io.Writer, format string, a ...any) (n int, err error)"}, - {"Fprintln", Func, 0, "func(w io.Writer, a ...any) (n int, err error)"}, - {"Fscan", Func, 0, "func(r io.Reader, a ...any) (n int, err error)"}, - {"Fscanf", Func, 0, "func(r io.Reader, format string, a ...any) (n int, err error)"}, - {"Fscanln", Func, 0, "func(r io.Reader, a ...any) (n int, err error)"}, - {"GoStringer", Type, 0, ""}, - {"Print", Func, 0, "func(a ...any) (n int, err error)"}, - {"Printf", Func, 0, "func(format string, a ...any) (n int, err error)"}, - {"Println", Func, 0, "func(a ...any) (n int, err error)"}, - {"Scan", Func, 0, "func(a ...any) (n int, err error)"}, - {"ScanState", Type, 0, ""}, - {"Scanf", Func, 0, "func(format string, a ...any) (n int, err error)"}, - {"Scanln", Func, 0, "func(a ...any) (n int, err error)"}, - {"Scanner", Type, 0, ""}, - {"Sprint", Func, 0, "func(a ...any) string"}, - {"Sprintf", Func, 0, "func(format string, a ...any) string"}, - {"Sprintln", Func, 0, "func(a ...any) string"}, - {"Sscan", Func, 0, "func(str string, a ...any) (n int, err error)"}, - {"Sscanf", Func, 0, "func(str string, format string, a ...any) (n int, err error)"}, - {"Sscanln", Func, 0, "func(str string, a ...any) (n int, err error)"}, - {"State", Type, 0, ""}, - {"Stringer", Type, 0, ""}, - }, - "go/ast": { - {"(*ArrayType).End", Method, 0, ""}, - {"(*ArrayType).Pos", Method, 0, ""}, - {"(*AssignStmt).End", Method, 0, ""}, - {"(*AssignStmt).Pos", Method, 0, ""}, - {"(*BadDecl).End", Method, 0, ""}, - {"(*BadDecl).Pos", Method, 0, ""}, - {"(*BadExpr).End", Method, 0, ""}, - {"(*BadExpr).Pos", Method, 0, ""}, - {"(*BadStmt).End", Method, 0, ""}, - {"(*BadStmt).Pos", Method, 0, ""}, - {"(*BasicLit).End", Method, 0, ""}, - {"(*BasicLit).Pos", Method, 0, ""}, - {"(*BinaryExpr).End", Method, 0, ""}, - {"(*BinaryExpr).Pos", Method, 0, ""}, - {"(*BlockStmt).End", Method, 0, ""}, - {"(*BlockStmt).Pos", Method, 0, ""}, - {"(*BranchStmt).End", Method, 0, ""}, - {"(*BranchStmt).Pos", Method, 0, ""}, - {"(*CallExpr).End", Method, 0, ""}, - {"(*CallExpr).Pos", Method, 0, ""}, - {"(*CaseClause).End", Method, 0, ""}, - {"(*CaseClause).Pos", Method, 0, ""}, - {"(*ChanType).End", Method, 0, ""}, - {"(*ChanType).Pos", Method, 0, ""}, - {"(*CommClause).End", Method, 0, ""}, - {"(*CommClause).Pos", Method, 0, ""}, - {"(*Comment).End", Method, 0, ""}, - {"(*Comment).Pos", Method, 0, ""}, - {"(*CommentGroup).End", Method, 0, ""}, - {"(*CommentGroup).Pos", Method, 0, ""}, - {"(*CommentGroup).Text", Method, 0, ""}, - {"(*CompositeLit).End", Method, 0, ""}, - {"(*CompositeLit).Pos", Method, 0, ""}, - {"(*DeclStmt).End", Method, 0, ""}, - {"(*DeclStmt).Pos", Method, 0, ""}, - {"(*DeferStmt).End", Method, 0, ""}, - {"(*DeferStmt).Pos", Method, 0, ""}, - {"(*Directive).End", Method, 26, ""}, - {"(*Directive).ParseArgs", Method, 26, ""}, - {"(*Directive).Pos", Method, 26, ""}, - {"(*Ellipsis).End", Method, 0, ""}, - {"(*Ellipsis).Pos", Method, 0, ""}, - {"(*EmptyStmt).End", Method, 0, ""}, - {"(*EmptyStmt).Pos", Method, 0, ""}, - {"(*ExprStmt).End", Method, 0, ""}, - {"(*ExprStmt).Pos", Method, 0, ""}, - {"(*Field).End", Method, 0, ""}, - {"(*Field).Pos", Method, 0, ""}, - {"(*FieldList).End", Method, 0, ""}, - {"(*FieldList).NumFields", Method, 0, ""}, - {"(*FieldList).Pos", Method, 0, ""}, - {"(*File).End", Method, 0, ""}, - {"(*File).Pos", Method, 0, ""}, - {"(*ForStmt).End", Method, 0, ""}, - {"(*ForStmt).Pos", Method, 0, ""}, - {"(*FuncDecl).End", Method, 0, ""}, - {"(*FuncDecl).Pos", Method, 0, ""}, - {"(*FuncLit).End", Method, 0, ""}, - {"(*FuncLit).Pos", Method, 0, ""}, - {"(*FuncType).End", Method, 0, ""}, - {"(*FuncType).Pos", Method, 0, ""}, - {"(*GenDecl).End", Method, 0, ""}, - {"(*GenDecl).Pos", Method, 0, ""}, - {"(*GoStmt).End", Method, 0, ""}, - {"(*GoStmt).Pos", Method, 0, ""}, - {"(*Ident).End", Method, 0, ""}, - {"(*Ident).IsExported", Method, 0, ""}, - {"(*Ident).Pos", Method, 0, ""}, - {"(*Ident).String", Method, 0, ""}, - {"(*IfStmt).End", Method, 0, ""}, - {"(*IfStmt).Pos", Method, 0, ""}, - {"(*ImportSpec).End", Method, 0, ""}, - {"(*ImportSpec).Pos", Method, 0, ""}, - {"(*IncDecStmt).End", Method, 0, ""}, - {"(*IncDecStmt).Pos", Method, 0, ""}, - {"(*IndexExpr).End", Method, 0, ""}, - {"(*IndexExpr).Pos", Method, 0, ""}, - {"(*IndexListExpr).End", Method, 18, ""}, - {"(*IndexListExpr).Pos", Method, 18, ""}, - {"(*InterfaceType).End", Method, 0, ""}, - {"(*InterfaceType).Pos", Method, 0, ""}, - {"(*KeyValueExpr).End", Method, 0, ""}, - {"(*KeyValueExpr).Pos", Method, 0, ""}, - {"(*LabeledStmt).End", Method, 0, ""}, - {"(*LabeledStmt).Pos", Method, 0, ""}, - {"(*MapType).End", Method, 0, ""}, - {"(*MapType).Pos", Method, 0, ""}, - {"(*Object).Pos", Method, 0, ""}, - {"(*Package).End", Method, 0, ""}, - {"(*Package).Pos", Method, 0, ""}, - {"(*ParenExpr).End", Method, 0, ""}, - {"(*ParenExpr).Pos", Method, 0, ""}, - {"(*RangeStmt).End", Method, 0, ""}, - {"(*RangeStmt).Pos", Method, 0, ""}, - {"(*ReturnStmt).End", Method, 0, ""}, - {"(*ReturnStmt).Pos", Method, 0, ""}, - {"(*Scope).Insert", Method, 0, ""}, - {"(*Scope).Lookup", Method, 0, ""}, - {"(*Scope).String", Method, 0, ""}, - {"(*SelectStmt).End", Method, 0, ""}, - {"(*SelectStmt).Pos", Method, 0, ""}, - {"(*SelectorExpr).End", Method, 0, ""}, - {"(*SelectorExpr).Pos", Method, 0, ""}, - {"(*SendStmt).End", Method, 0, ""}, - {"(*SendStmt).Pos", Method, 0, ""}, - {"(*SliceExpr).End", Method, 0, ""}, - {"(*SliceExpr).Pos", Method, 0, ""}, - {"(*StarExpr).End", Method, 0, ""}, - {"(*StarExpr).Pos", Method, 0, ""}, - {"(*StructType).End", Method, 0, ""}, - {"(*StructType).Pos", Method, 0, ""}, - {"(*SwitchStmt).End", Method, 0, ""}, - {"(*SwitchStmt).Pos", Method, 0, ""}, - {"(*TypeAssertExpr).End", Method, 0, ""}, - {"(*TypeAssertExpr).Pos", Method, 0, ""}, - {"(*TypeSpec).End", Method, 0, ""}, - {"(*TypeSpec).Pos", Method, 0, ""}, - {"(*TypeSwitchStmt).End", Method, 0, ""}, - {"(*TypeSwitchStmt).Pos", Method, 0, ""}, - {"(*UnaryExpr).End", Method, 0, ""}, - {"(*UnaryExpr).Pos", Method, 0, ""}, - {"(*ValueSpec).End", Method, 0, ""}, - {"(*ValueSpec).Pos", Method, 0, ""}, - {"(CommentMap).Comments", Method, 1, ""}, - {"(CommentMap).Filter", Method, 1, ""}, - {"(CommentMap).String", Method, 1, ""}, - {"(CommentMap).Update", Method, 1, ""}, - {"(Decl).End", Method, 0, ""}, - {"(Decl).Pos", Method, 0, ""}, - {"(Expr).End", Method, 0, ""}, - {"(Expr).Pos", Method, 0, ""}, - {"(Node).End", Method, 0, ""}, - {"(Node).Pos", Method, 0, ""}, - {"(ObjKind).String", Method, 0, ""}, - {"(Spec).End", Method, 0, ""}, - {"(Spec).Pos", Method, 0, ""}, - {"(Stmt).End", Method, 0, ""}, - {"(Stmt).Pos", Method, 0, ""}, - {"(Visitor).Visit", Method, 0, ""}, - {"ArrayType", Type, 0, ""}, - {"ArrayType.Elt", Field, 0, ""}, - {"ArrayType.Lbrack", Field, 0, ""}, - {"ArrayType.Len", Field, 0, ""}, - {"AssignStmt", Type, 0, ""}, - {"AssignStmt.Lhs", Field, 0, ""}, - {"AssignStmt.Rhs", Field, 0, ""}, - {"AssignStmt.Tok", Field, 0, ""}, - {"AssignStmt.TokPos", Field, 0, ""}, - {"Bad", Const, 0, ""}, - {"BadDecl", Type, 0, ""}, - {"BadDecl.From", Field, 0, ""}, - {"BadDecl.To", Field, 0, ""}, - {"BadExpr", Type, 0, ""}, - {"BadExpr.From", Field, 0, ""}, - {"BadExpr.To", Field, 0, ""}, - {"BadStmt", Type, 0, ""}, - {"BadStmt.From", Field, 0, ""}, - {"BadStmt.To", Field, 0, ""}, - {"BasicLit", Type, 0, ""}, - {"BasicLit.Kind", Field, 0, ""}, - {"BasicLit.Value", Field, 0, ""}, - {"BasicLit.ValueEnd", Field, 26, ""}, - {"BasicLit.ValuePos", Field, 0, ""}, - {"BinaryExpr", Type, 0, ""}, - {"BinaryExpr.Op", Field, 0, ""}, - {"BinaryExpr.OpPos", Field, 0, ""}, - {"BinaryExpr.X", Field, 0, ""}, - {"BinaryExpr.Y", Field, 0, ""}, - {"BlockStmt", Type, 0, ""}, - {"BlockStmt.Lbrace", Field, 0, ""}, - {"BlockStmt.List", Field, 0, ""}, - {"BlockStmt.Rbrace", Field, 0, ""}, - {"BranchStmt", Type, 0, ""}, - {"BranchStmt.Label", Field, 0, ""}, - {"BranchStmt.Tok", Field, 0, ""}, - {"BranchStmt.TokPos", Field, 0, ""}, - {"CallExpr", Type, 0, ""}, - {"CallExpr.Args", Field, 0, ""}, - {"CallExpr.Ellipsis", Field, 0, ""}, - {"CallExpr.Fun", Field, 0, ""}, - {"CallExpr.Lparen", Field, 0, ""}, - {"CallExpr.Rparen", Field, 0, ""}, - {"CaseClause", Type, 0, ""}, - {"CaseClause.Body", Field, 0, ""}, - {"CaseClause.Case", Field, 0, ""}, - {"CaseClause.Colon", Field, 0, ""}, - {"CaseClause.List", Field, 0, ""}, - {"ChanDir", Type, 0, ""}, - {"ChanType", Type, 0, ""}, - {"ChanType.Arrow", Field, 1, ""}, - {"ChanType.Begin", Field, 0, ""}, - {"ChanType.Dir", Field, 0, ""}, - {"ChanType.Value", Field, 0, ""}, - {"CommClause", Type, 0, ""}, - {"CommClause.Body", Field, 0, ""}, - {"CommClause.Case", Field, 0, ""}, - {"CommClause.Colon", Field, 0, ""}, - {"CommClause.Comm", Field, 0, ""}, - {"Comment", Type, 0, ""}, - {"Comment.Slash", Field, 0, ""}, - {"Comment.Text", Field, 0, ""}, - {"CommentGroup", Type, 0, ""}, - {"CommentGroup.List", Field, 0, ""}, - {"CommentMap", Type, 1, ""}, - {"CompositeLit", Type, 0, ""}, - {"CompositeLit.Elts", Field, 0, ""}, - {"CompositeLit.Incomplete", Field, 11, ""}, - {"CompositeLit.Lbrace", Field, 0, ""}, - {"CompositeLit.Rbrace", Field, 0, ""}, - {"CompositeLit.Type", Field, 0, ""}, - {"Con", Const, 0, ""}, - {"DeclStmt", Type, 0, ""}, - {"DeclStmt.Decl", Field, 0, ""}, - {"DeferStmt", Type, 0, ""}, - {"DeferStmt.Call", Field, 0, ""}, - {"DeferStmt.Defer", Field, 0, ""}, - {"Directive", Type, 26, ""}, - {"Directive.Args", Field, 26, ""}, - {"Directive.ArgsPos", Field, 26, ""}, - {"Directive.Name", Field, 26, ""}, - {"Directive.Slash", Field, 26, ""}, - {"Directive.Tool", Field, 26, ""}, - {"DirectiveArg", Type, 26, ""}, - {"DirectiveArg.Arg", Field, 26, ""}, - {"DirectiveArg.Pos", Field, 26, ""}, - {"Ellipsis", Type, 0, ""}, - {"Ellipsis.Ellipsis", Field, 0, ""}, - {"Ellipsis.Elt", Field, 0, ""}, - {"EmptyStmt", Type, 0, ""}, - {"EmptyStmt.Implicit", Field, 5, ""}, - {"EmptyStmt.Semicolon", Field, 0, ""}, - {"ExprStmt", Type, 0, ""}, - {"ExprStmt.X", Field, 0, ""}, - {"Field", Type, 0, ""}, - {"Field.Comment", Field, 0, ""}, - {"Field.Doc", Field, 0, ""}, - {"Field.Names", Field, 0, ""}, - {"Field.Tag", Field, 0, ""}, - {"Field.Type", Field, 0, ""}, - {"FieldFilter", Type, 0, ""}, - {"FieldList", Type, 0, ""}, - {"FieldList.Closing", Field, 0, ""}, - {"FieldList.List", Field, 0, ""}, - {"FieldList.Opening", Field, 0, ""}, - {"File", Type, 0, ""}, - {"File.Comments", Field, 0, ""}, - {"File.Decls", Field, 0, ""}, - {"File.Doc", Field, 0, ""}, - {"File.FileEnd", Field, 20, ""}, - {"File.FileStart", Field, 20, ""}, - {"File.GoVersion", Field, 21, ""}, - {"File.Imports", Field, 0, ""}, - {"File.Name", Field, 0, ""}, - {"File.Package", Field, 0, ""}, - {"File.Scope", Field, 0, ""}, - {"File.Unresolved", Field, 0, ""}, - {"FileExports", Func, 0, "func(src *File) bool"}, - {"Filter", Type, 0, ""}, - {"FilterDecl", Func, 0, "func(decl Decl, f Filter) bool"}, - {"FilterFile", Func, 0, "func(src *File, f Filter) bool"}, - {"FilterFuncDuplicates", Const, 0, ""}, - {"FilterImportDuplicates", Const, 0, ""}, - {"FilterPackage", Func, 0, "func(pkg *Package, f Filter) bool"}, - {"FilterUnassociatedComments", Const, 0, ""}, - {"ForStmt", Type, 0, ""}, - {"ForStmt.Body", Field, 0, ""}, - {"ForStmt.Cond", Field, 0, ""}, - {"ForStmt.For", Field, 0, ""}, - {"ForStmt.Init", Field, 0, ""}, - {"ForStmt.Post", Field, 0, ""}, - {"Fprint", Func, 0, "func(w io.Writer, fset *token.FileSet, x any, f FieldFilter) error"}, - {"Fun", Const, 0, ""}, - {"FuncDecl", Type, 0, ""}, - {"FuncDecl.Body", Field, 0, ""}, - {"FuncDecl.Doc", Field, 0, ""}, - {"FuncDecl.Name", Field, 0, ""}, - {"FuncDecl.Recv", Field, 0, ""}, - {"FuncDecl.Type", Field, 0, ""}, - {"FuncLit", Type, 0, ""}, - {"FuncLit.Body", Field, 0, ""}, - {"FuncLit.Type", Field, 0, ""}, - {"FuncType", Type, 0, ""}, - {"FuncType.Func", Field, 0, ""}, - {"FuncType.Params", Field, 0, ""}, - {"FuncType.Results", Field, 0, ""}, - {"FuncType.TypeParams", Field, 18, ""}, - {"GenDecl", Type, 0, ""}, - {"GenDecl.Doc", Field, 0, ""}, - {"GenDecl.Lparen", Field, 0, ""}, - {"GenDecl.Rparen", Field, 0, ""}, - {"GenDecl.Specs", Field, 0, ""}, - {"GenDecl.Tok", Field, 0, ""}, - {"GenDecl.TokPos", Field, 0, ""}, - {"GoStmt", Type, 0, ""}, - {"GoStmt.Call", Field, 0, ""}, - {"GoStmt.Go", Field, 0, ""}, - {"Ident", Type, 0, ""}, - {"Ident.Name", Field, 0, ""}, - {"Ident.NamePos", Field, 0, ""}, - {"Ident.Obj", Field, 0, ""}, - {"IfStmt", Type, 0, ""}, - {"IfStmt.Body", Field, 0, ""}, - {"IfStmt.Cond", Field, 0, ""}, - {"IfStmt.Else", Field, 0, ""}, - {"IfStmt.If", Field, 0, ""}, - {"IfStmt.Init", Field, 0, ""}, - {"ImportSpec", Type, 0, ""}, - {"ImportSpec.Comment", Field, 0, ""}, - {"ImportSpec.Doc", Field, 0, ""}, - {"ImportSpec.EndPos", Field, 0, ""}, - {"ImportSpec.Name", Field, 0, ""}, - {"ImportSpec.Path", Field, 0, ""}, - {"Importer", Type, 0, ""}, - {"IncDecStmt", Type, 0, ""}, - {"IncDecStmt.Tok", Field, 0, ""}, - {"IncDecStmt.TokPos", Field, 0, ""}, - {"IncDecStmt.X", Field, 0, ""}, - {"IndexExpr", Type, 0, ""}, - {"IndexExpr.Index", Field, 0, ""}, - {"IndexExpr.Lbrack", Field, 0, ""}, - {"IndexExpr.Rbrack", Field, 0, ""}, - {"IndexExpr.X", Field, 0, ""}, - {"IndexListExpr", Type, 18, ""}, - {"IndexListExpr.Indices", Field, 18, ""}, - {"IndexListExpr.Lbrack", Field, 18, ""}, - {"IndexListExpr.Rbrack", Field, 18, ""}, - {"IndexListExpr.X", Field, 18, ""}, - {"Inspect", Func, 0, "func(node Node, f func(Node) bool)"}, - {"InterfaceType", Type, 0, ""}, - {"InterfaceType.Incomplete", Field, 0, ""}, - {"InterfaceType.Interface", Field, 0, ""}, - {"InterfaceType.Methods", Field, 0, ""}, - {"IsExported", Func, 0, "func(name string) bool"}, - {"IsGenerated", Func, 21, "func(file *File) bool"}, - {"KeyValueExpr", Type, 0, ""}, - {"KeyValueExpr.Colon", Field, 0, ""}, - {"KeyValueExpr.Key", Field, 0, ""}, - {"KeyValueExpr.Value", Field, 0, ""}, - {"LabeledStmt", Type, 0, ""}, - {"LabeledStmt.Colon", Field, 0, ""}, - {"LabeledStmt.Label", Field, 0, ""}, - {"LabeledStmt.Stmt", Field, 0, ""}, - {"Lbl", Const, 0, ""}, - {"MapType", Type, 0, ""}, - {"MapType.Key", Field, 0, ""}, - {"MapType.Map", Field, 0, ""}, - {"MapType.Value", Field, 0, ""}, - {"MergeMode", Type, 0, ""}, - {"MergePackageFiles", Func, 0, "func(pkg *Package, mode MergeMode) *File"}, - {"NewCommentMap", Func, 1, "func(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap"}, - {"NewIdent", Func, 0, "func(name string) *Ident"}, - {"NewObj", Func, 0, "func(kind ObjKind, name string) *Object"}, - {"NewPackage", Func, 0, "func(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error)"}, - {"NewScope", Func, 0, "func(outer *Scope) *Scope"}, - {"Node", Type, 0, ""}, - {"NotNilFilter", Func, 0, "func(_ string, v reflect.Value) bool"}, - {"ObjKind", Type, 0, ""}, - {"Object", Type, 0, ""}, - {"Object.Data", Field, 0, ""}, - {"Object.Decl", Field, 0, ""}, - {"Object.Kind", Field, 0, ""}, - {"Object.Name", Field, 0, ""}, - {"Object.Type", Field, 0, ""}, - {"Package", Type, 0, ""}, - {"Package.Files", Field, 0, ""}, - {"Package.Imports", Field, 0, ""}, - {"Package.Name", Field, 0, ""}, - {"Package.Scope", Field, 0, ""}, - {"PackageExports", Func, 0, "func(pkg *Package) bool"}, - {"ParenExpr", Type, 0, ""}, - {"ParenExpr.Lparen", Field, 0, ""}, - {"ParenExpr.Rparen", Field, 0, ""}, - {"ParenExpr.X", Field, 0, ""}, - {"ParseDirective", Func, 26, "func(pos token.Pos, c string) (Directive, bool)"}, - {"Pkg", Const, 0, ""}, - {"Preorder", Func, 23, "func(root Node) iter.Seq[Node]"}, - {"PreorderStack", Func, 25, "func(root Node, stack []Node, f func(n Node, stack []Node) bool)"}, - {"Print", Func, 0, "func(fset *token.FileSet, x any) error"}, - {"RECV", Const, 0, ""}, - {"RangeStmt", Type, 0, ""}, - {"RangeStmt.Body", Field, 0, ""}, - {"RangeStmt.For", Field, 0, ""}, - {"RangeStmt.Key", Field, 0, ""}, - {"RangeStmt.Range", Field, 20, ""}, - {"RangeStmt.Tok", Field, 0, ""}, - {"RangeStmt.TokPos", Field, 0, ""}, - {"RangeStmt.Value", Field, 0, ""}, - {"RangeStmt.X", Field, 0, ""}, - {"ReturnStmt", Type, 0, ""}, - {"ReturnStmt.Results", Field, 0, ""}, - {"ReturnStmt.Return", Field, 0, ""}, - {"SEND", Const, 0, ""}, - {"Scope", Type, 0, ""}, - {"Scope.Objects", Field, 0, ""}, - {"Scope.Outer", Field, 0, ""}, - {"SelectStmt", Type, 0, ""}, - {"SelectStmt.Body", Field, 0, ""}, - {"SelectStmt.Select", Field, 0, ""}, - {"SelectorExpr", Type, 0, ""}, - {"SelectorExpr.Sel", Field, 0, ""}, - {"SelectorExpr.X", Field, 0, ""}, - {"SendStmt", Type, 0, ""}, - {"SendStmt.Arrow", Field, 0, ""}, - {"SendStmt.Chan", Field, 0, ""}, - {"SendStmt.Value", Field, 0, ""}, - {"SliceExpr", Type, 0, ""}, - {"SliceExpr.High", Field, 0, ""}, - {"SliceExpr.Lbrack", Field, 0, ""}, - {"SliceExpr.Low", Field, 0, ""}, - {"SliceExpr.Max", Field, 2, ""}, - {"SliceExpr.Rbrack", Field, 0, ""}, - {"SliceExpr.Slice3", Field, 2, ""}, - {"SliceExpr.X", Field, 0, ""}, - {"SortImports", Func, 0, "func(fset *token.FileSet, f *File)"}, - {"StarExpr", Type, 0, ""}, - {"StarExpr.Star", Field, 0, ""}, - {"StarExpr.X", Field, 0, ""}, - {"StructType", Type, 0, ""}, - {"StructType.Fields", Field, 0, ""}, - {"StructType.Incomplete", Field, 0, ""}, - {"StructType.Struct", Field, 0, ""}, - {"SwitchStmt", Type, 0, ""}, - {"SwitchStmt.Body", Field, 0, ""}, - {"SwitchStmt.Init", Field, 0, ""}, - {"SwitchStmt.Switch", Field, 0, ""}, - {"SwitchStmt.Tag", Field, 0, ""}, - {"Typ", Const, 0, ""}, - {"TypeAssertExpr", Type, 0, ""}, - {"TypeAssertExpr.Lparen", Field, 2, ""}, - {"TypeAssertExpr.Rparen", Field, 2, ""}, - {"TypeAssertExpr.Type", Field, 0, ""}, - {"TypeAssertExpr.X", Field, 0, ""}, - {"TypeSpec", Type, 0, ""}, - {"TypeSpec.Assign", Field, 9, ""}, - {"TypeSpec.Comment", Field, 0, ""}, - {"TypeSpec.Doc", Field, 0, ""}, - {"TypeSpec.Name", Field, 0, ""}, - {"TypeSpec.Type", Field, 0, ""}, - {"TypeSpec.TypeParams", Field, 18, ""}, - {"TypeSwitchStmt", Type, 0, ""}, - {"TypeSwitchStmt.Assign", Field, 0, ""}, - {"TypeSwitchStmt.Body", Field, 0, ""}, - {"TypeSwitchStmt.Init", Field, 0, ""}, - {"TypeSwitchStmt.Switch", Field, 0, ""}, - {"UnaryExpr", Type, 0, ""}, - {"UnaryExpr.Op", Field, 0, ""}, - {"UnaryExpr.OpPos", Field, 0, ""}, - {"UnaryExpr.X", Field, 0, ""}, - {"Unparen", Func, 22, "func(e Expr) Expr"}, - {"ValueSpec", Type, 0, ""}, - {"ValueSpec.Comment", Field, 0, ""}, - {"ValueSpec.Doc", Field, 0, ""}, - {"ValueSpec.Names", Field, 0, ""}, - {"ValueSpec.Type", Field, 0, ""}, - {"ValueSpec.Values", Field, 0, ""}, - {"Var", Const, 0, ""}, - {"Visitor", Type, 0, ""}, - {"Walk", Func, 0, "func(v Visitor, node Node)"}, - }, - "go/build": { - {"(*Context).Import", Method, 0, ""}, - {"(*Context).ImportDir", Method, 0, ""}, - {"(*Context).MatchFile", Method, 2, ""}, - {"(*Context).SrcDirs", Method, 0, ""}, - {"(*MultiplePackageError).Error", Method, 4, ""}, - {"(*NoGoError).Error", Method, 0, ""}, - {"(*Package).IsCommand", Method, 0, ""}, - {"AllowBinary", Const, 0, ""}, - {"ArchChar", Func, 0, "func(goarch string) (string, error)"}, - {"Context", Type, 0, ""}, - {"Context.BuildTags", Field, 0, ""}, - {"Context.CgoEnabled", Field, 0, ""}, - {"Context.Compiler", Field, 0, ""}, - {"Context.Dir", Field, 14, ""}, - {"Context.GOARCH", Field, 0, ""}, - {"Context.GOOS", Field, 0, ""}, - {"Context.GOPATH", Field, 0, ""}, - {"Context.GOROOT", Field, 0, ""}, - {"Context.HasSubdir", Field, 0, ""}, - {"Context.InstallSuffix", Field, 1, ""}, - {"Context.IsAbsPath", Field, 0, ""}, - {"Context.IsDir", Field, 0, ""}, - {"Context.JoinPath", Field, 0, ""}, - {"Context.OpenFile", Field, 0, ""}, - {"Context.ReadDir", Field, 0, ""}, - {"Context.ReleaseTags", Field, 1, ""}, - {"Context.SplitPathList", Field, 0, ""}, - {"Context.ToolTags", Field, 17, ""}, - {"Context.UseAllFiles", Field, 0, ""}, - {"Default", Var, 0, ""}, - {"Directive", Type, 21, ""}, - {"Directive.Pos", Field, 21, ""}, - {"Directive.Text", Field, 21, ""}, - {"FindOnly", Const, 0, ""}, - {"IgnoreVendor", Const, 6, ""}, - {"Import", Func, 0, "func(path string, srcDir string, mode ImportMode) (*Package, error)"}, - {"ImportComment", Const, 4, ""}, - {"ImportDir", Func, 0, "func(dir string, mode ImportMode) (*Package, error)"}, - {"ImportMode", Type, 0, ""}, - {"IsLocalImport", Func, 0, "func(path string) bool"}, - {"MultiplePackageError", Type, 4, ""}, - {"MultiplePackageError.Dir", Field, 4, ""}, - {"MultiplePackageError.Files", Field, 4, ""}, - {"MultiplePackageError.Packages", Field, 4, ""}, - {"NoGoError", Type, 0, ""}, - {"NoGoError.Dir", Field, 0, ""}, - {"Package", Type, 0, ""}, - {"Package.AllTags", Field, 2, ""}, - {"Package.BinDir", Field, 0, ""}, - {"Package.BinaryOnly", Field, 7, ""}, - {"Package.CFiles", Field, 0, ""}, - {"Package.CXXFiles", Field, 2, ""}, - {"Package.CgoCFLAGS", Field, 0, ""}, - {"Package.CgoCPPFLAGS", Field, 2, ""}, - {"Package.CgoCXXFLAGS", Field, 2, ""}, - {"Package.CgoFFLAGS", Field, 7, ""}, - {"Package.CgoFiles", Field, 0, ""}, - {"Package.CgoLDFLAGS", Field, 0, ""}, - {"Package.CgoPkgConfig", Field, 0, ""}, - {"Package.ConflictDir", Field, 2, ""}, - {"Package.Dir", Field, 0, ""}, - {"Package.Directives", Field, 21, ""}, - {"Package.Doc", Field, 0, ""}, - {"Package.EmbedPatternPos", Field, 16, ""}, - {"Package.EmbedPatterns", Field, 16, ""}, - {"Package.FFiles", Field, 7, ""}, - {"Package.GoFiles", Field, 0, ""}, - {"Package.Goroot", Field, 0, ""}, - {"Package.HFiles", Field, 0, ""}, - {"Package.IgnoredGoFiles", Field, 1, ""}, - {"Package.IgnoredOtherFiles", Field, 16, ""}, - {"Package.ImportComment", Field, 4, ""}, - {"Package.ImportPath", Field, 0, ""}, - {"Package.ImportPos", Field, 0, ""}, - {"Package.Imports", Field, 0, ""}, - {"Package.InvalidGoFiles", Field, 6, ""}, - {"Package.MFiles", Field, 3, ""}, - {"Package.Name", Field, 0, ""}, - {"Package.PkgObj", Field, 0, ""}, - {"Package.PkgRoot", Field, 0, ""}, - {"Package.PkgTargetRoot", Field, 5, ""}, - {"Package.Root", Field, 0, ""}, - {"Package.SFiles", Field, 0, ""}, - {"Package.SrcRoot", Field, 0, ""}, - {"Package.SwigCXXFiles", Field, 1, ""}, - {"Package.SwigFiles", Field, 1, ""}, - {"Package.SysoFiles", Field, 0, ""}, - {"Package.TestDirectives", Field, 21, ""}, - {"Package.TestEmbedPatternPos", Field, 16, ""}, - {"Package.TestEmbedPatterns", Field, 16, ""}, - {"Package.TestGoFiles", Field, 0, ""}, - {"Package.TestImportPos", Field, 0, ""}, - {"Package.TestImports", Field, 0, ""}, - {"Package.XTestDirectives", Field, 21, ""}, - {"Package.XTestEmbedPatternPos", Field, 16, ""}, - {"Package.XTestEmbedPatterns", Field, 16, ""}, - {"Package.XTestGoFiles", Field, 0, ""}, - {"Package.XTestImportPos", Field, 0, ""}, - {"Package.XTestImports", Field, 0, ""}, - {"ToolDir", Var, 0, ""}, - }, - "go/build/constraint": { - {"(*AndExpr).Eval", Method, 16, ""}, - {"(*AndExpr).String", Method, 16, ""}, - {"(*NotExpr).Eval", Method, 16, ""}, - {"(*NotExpr).String", Method, 16, ""}, - {"(*OrExpr).Eval", Method, 16, ""}, - {"(*OrExpr).String", Method, 16, ""}, - {"(*SyntaxError).Error", Method, 16, ""}, - {"(*TagExpr).Eval", Method, 16, ""}, - {"(*TagExpr).String", Method, 16, ""}, - {"(Expr).Eval", Method, 16, ""}, - {"(Expr).String", Method, 16, ""}, - {"AndExpr", Type, 16, ""}, - {"AndExpr.X", Field, 16, ""}, - {"AndExpr.Y", Field, 16, ""}, - {"GoVersion", Func, 21, "func(x Expr) string"}, - {"IsGoBuild", Func, 16, "func(line string) bool"}, - {"IsPlusBuild", Func, 16, "func(line string) bool"}, - {"NotExpr", Type, 16, ""}, - {"NotExpr.X", Field, 16, ""}, - {"OrExpr", Type, 16, ""}, - {"OrExpr.X", Field, 16, ""}, - {"OrExpr.Y", Field, 16, ""}, - {"Parse", Func, 16, "func(line string) (Expr, error)"}, - {"PlusBuildLines", Func, 16, "func(x Expr) ([]string, error)"}, - {"SyntaxError", Type, 16, ""}, - {"SyntaxError.Err", Field, 16, ""}, - {"SyntaxError.Offset", Field, 16, ""}, - {"TagExpr", Type, 16, ""}, - {"TagExpr.Tag", Field, 16, ""}, - }, - "go/constant": { - {"(Kind).String", Method, 18, ""}, - {"(Value).ExactString", Method, 6, ""}, - {"(Value).Kind", Method, 5, ""}, - {"(Value).String", Method, 5, ""}, - {"BinaryOp", Func, 5, "func(x_ Value, op token.Token, y_ Value) Value"}, - {"BitLen", Func, 5, "func(x Value) int"}, - {"Bool", Const, 5, ""}, - {"BoolVal", Func, 5, "func(x Value) bool"}, - {"Bytes", Func, 5, "func(x Value) []byte"}, - {"Compare", Func, 5, "func(x_ Value, op token.Token, y_ Value) bool"}, - {"Complex", Const, 5, ""}, - {"Denom", Func, 5, "func(x Value) Value"}, - {"Float", Const, 5, ""}, - {"Float32Val", Func, 5, "func(x Value) (float32, bool)"}, - {"Float64Val", Func, 5, "func(x Value) (float64, bool)"}, - {"Imag", Func, 5, "func(x Value) Value"}, - {"Int", Const, 5, ""}, - {"Int64Val", Func, 5, "func(x Value) (int64, bool)"}, - {"Kind", Type, 5, ""}, - {"Make", Func, 13, "func(x any) Value"}, - {"MakeBool", Func, 5, "func(b bool) Value"}, - {"MakeFloat64", Func, 5, "func(x float64) Value"}, - {"MakeFromBytes", Func, 5, "func(bytes []byte) Value"}, - {"MakeFromLiteral", Func, 5, "func(lit string, tok token.Token, zero uint) Value"}, - {"MakeImag", Func, 5, "func(x Value) Value"}, - {"MakeInt64", Func, 5, "func(x int64) Value"}, - {"MakeString", Func, 5, "func(s string) Value"}, - {"MakeUint64", Func, 5, "func(x uint64) Value"}, - {"MakeUnknown", Func, 5, "func() Value"}, - {"Num", Func, 5, "func(x Value) Value"}, - {"Real", Func, 5, "func(x Value) Value"}, - {"Shift", Func, 5, "func(x Value, op token.Token, s uint) Value"}, - {"Sign", Func, 5, "func(x Value) int"}, - {"String", Const, 5, ""}, - {"StringLen", Func, 27, "func(x Value) int64"}, - {"StringVal", Func, 5, "func(x Value) string"}, - {"ToComplex", Func, 6, "func(x Value) Value"}, - {"ToFloat", Func, 6, "func(x Value) Value"}, - {"ToInt", Func, 6, "func(x Value) Value"}, - {"Uint64Val", Func, 5, "func(x Value) (uint64, bool)"}, - {"UnaryOp", Func, 5, "func(op token.Token, y Value, prec uint) Value"}, - {"Unknown", Const, 5, ""}, - {"Val", Func, 13, "func(x Value) any"}, - }, - "go/doc": { - {"(*Package).Filter", Method, 0, ""}, - {"(*Package).HTML", Method, 19, ""}, - {"(*Package).Markdown", Method, 19, ""}, - {"(*Package).Parser", Method, 19, ""}, - {"(*Package).Printer", Method, 19, ""}, - {"(*Package).Synopsis", Method, 19, ""}, - {"(*Package).Text", Method, 19, ""}, - {"AllDecls", Const, 0, ""}, - {"AllMethods", Const, 0, ""}, - {"Example", Type, 0, ""}, - {"Example.Code", Field, 0, ""}, - {"Example.Comments", Field, 0, ""}, - {"Example.Doc", Field, 0, ""}, - {"Example.EmptyOutput", Field, 1, ""}, - {"Example.Name", Field, 0, ""}, - {"Example.Order", Field, 1, ""}, - {"Example.Output", Field, 0, ""}, - {"Example.Play", Field, 1, ""}, - {"Example.Suffix", Field, 14, ""}, - {"Example.Unordered", Field, 7, ""}, - {"Examples", Func, 0, "func(testFiles ...*ast.File) []*Example"}, - {"Filter", Type, 0, ""}, - {"Func", Type, 0, ""}, - {"Func.Decl", Field, 0, ""}, - {"Func.Doc", Field, 0, ""}, - {"Func.Examples", Field, 14, ""}, - {"Func.Level", Field, 0, ""}, - {"Func.Name", Field, 0, ""}, - {"Func.Orig", Field, 0, ""}, - {"Func.Recv", Field, 0, ""}, - {"IllegalPrefixes", Var, 1, ""}, - {"IsPredeclared", Func, 8, "func(s string) bool"}, - {"Mode", Type, 0, ""}, - {"New", Func, 0, "func(pkg *ast.Package, importPath string, mode Mode) *Package"}, - {"NewFromFiles", Func, 14, "func(fset *token.FileSet, files []*ast.File, importPath string, opts ...any) (*Package, error)"}, - {"Note", Type, 1, ""}, - {"Note.Body", Field, 1, ""}, - {"Note.End", Field, 1, ""}, - {"Note.Pos", Field, 1, ""}, - {"Note.UID", Field, 1, ""}, - {"Package", Type, 0, ""}, - {"Package.Bugs", Field, 0, ""}, - {"Package.Consts", Field, 0, ""}, - {"Package.Doc", Field, 0, ""}, - {"Package.Examples", Field, 14, ""}, - {"Package.Filenames", Field, 0, ""}, - {"Package.Funcs", Field, 0, ""}, - {"Package.ImportPath", Field, 0, ""}, - {"Package.Imports", Field, 0, ""}, - {"Package.Name", Field, 0, ""}, - {"Package.Notes", Field, 1, ""}, - {"Package.Types", Field, 0, ""}, - {"Package.Vars", Field, 0, ""}, - {"PreserveAST", Const, 12, ""}, - {"Synopsis", Func, 0, "func(text string) string"}, - {"ToHTML", Func, 0, "func(w io.Writer, text string, words map[string]string)"}, - {"ToText", Func, 0, "func(w io.Writer, text string, prefix string, codePrefix string, width int)"}, - {"Type", Type, 0, ""}, - {"Type.Consts", Field, 0, ""}, - {"Type.Decl", Field, 0, ""}, - {"Type.Doc", Field, 0, ""}, - {"Type.Examples", Field, 14, ""}, - {"Type.Funcs", Field, 0, ""}, - {"Type.Methods", Field, 0, ""}, - {"Type.Name", Field, 0, ""}, - {"Type.Vars", Field, 0, ""}, - {"Value", Type, 0, ""}, - {"Value.Decl", Field, 0, ""}, - {"Value.Doc", Field, 0, ""}, - {"Value.Names", Field, 0, ""}, - }, - "go/doc/comment": { - {"(*DocLink).DefaultURL", Method, 19, ""}, - {"(*Heading).DefaultID", Method, 19, ""}, - {"(*List).BlankBefore", Method, 19, ""}, - {"(*List).BlankBetween", Method, 19, ""}, - {"(*Parser).Parse", Method, 19, ""}, - {"(*Printer).Comment", Method, 19, ""}, - {"(*Printer).HTML", Method, 19, ""}, - {"(*Printer).Markdown", Method, 19, ""}, - {"(*Printer).Text", Method, 19, ""}, - {"Code", Type, 19, ""}, - {"Code.Text", Field, 19, ""}, - {"DefaultLookupPackage", Func, 19, "func(name string) (importPath string, ok bool)"}, - {"Doc", Type, 19, ""}, - {"Doc.Content", Field, 19, ""}, - {"Doc.Links", Field, 19, ""}, - {"DocLink", Type, 19, ""}, - {"DocLink.ImportPath", Field, 19, ""}, - {"DocLink.Name", Field, 19, ""}, - {"DocLink.Recv", Field, 19, ""}, - {"DocLink.Text", Field, 19, ""}, - {"Heading", Type, 19, ""}, - {"Heading.Text", Field, 19, ""}, - {"Italic", Type, 19, ""}, - {"Link", Type, 19, ""}, - {"Link.Auto", Field, 19, ""}, - {"Link.Text", Field, 19, ""}, - {"Link.URL", Field, 19, ""}, - {"LinkDef", Type, 19, ""}, - {"LinkDef.Text", Field, 19, ""}, - {"LinkDef.URL", Field, 19, ""}, - {"LinkDef.Used", Field, 19, ""}, - {"List", Type, 19, ""}, - {"List.ForceBlankBefore", Field, 19, ""}, - {"List.ForceBlankBetween", Field, 19, ""}, - {"List.Items", Field, 19, ""}, - {"ListItem", Type, 19, ""}, - {"ListItem.Content", Field, 19, ""}, - {"ListItem.Number", Field, 19, ""}, - {"Paragraph", Type, 19, ""}, - {"Paragraph.Text", Field, 19, ""}, - {"Parser", Type, 19, ""}, - {"Parser.LookupPackage", Field, 19, ""}, - {"Parser.LookupSym", Field, 19, ""}, - {"Parser.Words", Field, 19, ""}, - {"Plain", Type, 19, ""}, - {"Printer", Type, 19, ""}, - {"Printer.DocLinkBaseURL", Field, 19, ""}, - {"Printer.DocLinkURL", Field, 19, ""}, - {"Printer.HeadingID", Field, 19, ""}, - {"Printer.HeadingLevel", Field, 19, ""}, - {"Printer.TextCodePrefix", Field, 19, ""}, - {"Printer.TextPrefix", Field, 19, ""}, - {"Printer.TextWidth", Field, 19, ""}, - }, - "go/format": { - {"Node", Func, 1, "func(dst io.Writer, fset *token.FileSet, node any) error"}, - {"Source", Func, 1, "func(src []byte) ([]byte, error)"}, - }, - "go/importer": { - {"Default", Func, 5, "func() types.Importer"}, - {"For", Func, 5, "func(compiler string, lookup Lookup) types.Importer"}, - {"ForCompiler", Func, 12, "func(fset *token.FileSet, compiler string, lookup Lookup) types.Importer"}, - {"Lookup", Type, 5, ""}, - }, - "go/parser": { - {"AllErrors", Const, 1, ""}, - {"DeclarationErrors", Const, 0, ""}, - {"ImportsOnly", Const, 0, ""}, - {"Mode", Type, 0, ""}, - {"PackageClauseOnly", Const, 0, ""}, - {"ParseComments", Const, 0, ""}, - {"ParseDir", Func, 0, "func(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, mode Mode) (pkgs map[string]*ast.Package, first error)"}, - {"ParseExpr", Func, 0, "func(x string) (ast.Expr, error)"}, - {"ParseExprFrom", Func, 5, "func(fset *token.FileSet, filename string, src any, mode Mode) (expr ast.Expr, err error)"}, - {"ParseFile", Func, 0, "func(fset *token.FileSet, filename string, src any, mode Mode) (f *ast.File, err error)"}, - {"SkipObjectResolution", Const, 17, ""}, - {"SpuriousErrors", Const, 0, ""}, - {"Trace", Const, 0, ""}, - }, - "go/printer": { - {"(*Config).Fprint", Method, 0, ""}, - {"CommentedNode", Type, 0, ""}, - {"CommentedNode.Comments", Field, 0, ""}, - {"CommentedNode.Node", Field, 0, ""}, - {"Config", Type, 0, ""}, - {"Config.Indent", Field, 1, ""}, - {"Config.Mode", Field, 0, ""}, - {"Config.Tabwidth", Field, 0, ""}, - {"Fprint", Func, 0, "func(output io.Writer, fset *token.FileSet, node any) error"}, - {"Mode", Type, 0, ""}, - {"RawFormat", Const, 0, ""}, - {"SourcePos", Const, 0, ""}, - {"TabIndent", Const, 0, ""}, - {"UseSpaces", Const, 0, ""}, - }, - "go/scanner": { - {"(*ErrorList).Add", Method, 0, ""}, - {"(*ErrorList).RemoveMultiples", Method, 0, ""}, - {"(*ErrorList).Reset", Method, 0, ""}, - {"(*Scanner).End", Method, 27, ""}, - {"(*Scanner).Init", Method, 0, ""}, - {"(*Scanner).Scan", Method, 0, ""}, - {"(Error).Error", Method, 0, ""}, - {"(ErrorList).Err", Method, 0, ""}, - {"(ErrorList).Error", Method, 0, ""}, - {"(ErrorList).Len", Method, 0, ""}, - {"(ErrorList).Less", Method, 0, ""}, - {"(ErrorList).Sort", Method, 0, ""}, - {"(ErrorList).Swap", Method, 0, ""}, - {"Error", Type, 0, ""}, - {"Error.Msg", Field, 0, ""}, - {"Error.Pos", Field, 0, ""}, - {"ErrorHandler", Type, 0, ""}, - {"ErrorList", Type, 0, ""}, - {"Mode", Type, 0, ""}, - {"PrintError", Func, 0, "func(w io.Writer, err error)"}, - {"ScanComments", Const, 0, ""}, - {"Scanner", Type, 0, ""}, - {"Scanner.ErrorCount", Field, 0, ""}, - }, - "go/token": { - {"(*File).AddLine", Method, 0, ""}, - {"(*File).AddLineColumnInfo", Method, 11, ""}, - {"(*File).AddLineInfo", Method, 0, ""}, - {"(*File).Base", Method, 0, ""}, - {"(*File).End", Method, 26, ""}, - {"(*File).Line", Method, 0, ""}, - {"(*File).LineCount", Method, 0, ""}, - {"(*File).LineStart", Method, 12, ""}, - {"(*File).Lines", Method, 21, ""}, - {"(*File).MergeLine", Method, 2, ""}, - {"(*File).Name", Method, 0, ""}, - {"(*File).Offset", Method, 0, ""}, - {"(*File).Pos", Method, 0, ""}, - {"(*File).Position", Method, 0, ""}, - {"(*File).PositionFor", Method, 4, ""}, - {"(*File).SetLines", Method, 0, ""}, - {"(*File).SetLinesForContent", Method, 0, ""}, - {"(*File).Size", Method, 0, ""}, - {"(*File).String", Method, 27, ""}, - {"(*FileSet).AddExistingFiles", Method, 25, ""}, - {"(*FileSet).AddFile", Method, 0, ""}, - {"(*FileSet).Base", Method, 0, ""}, - {"(*FileSet).File", Method, 0, ""}, - {"(*FileSet).Iterate", Method, 0, ""}, - {"(*FileSet).Position", Method, 0, ""}, - {"(*FileSet).PositionFor", Method, 4, ""}, - {"(*FileSet).Read", Method, 0, ""}, - {"(*FileSet).RemoveFile", Method, 20, ""}, - {"(*FileSet).Write", Method, 0, ""}, - {"(*Position).IsValid", Method, 0, ""}, - {"(Pos).IsValid", Method, 0, ""}, - {"(Position).String", Method, 0, ""}, - {"(Token).IsKeyword", Method, 0, ""}, - {"(Token).IsLiteral", Method, 0, ""}, - {"(Token).IsOperator", Method, 0, ""}, - {"(Token).Precedence", Method, 0, ""}, - {"(Token).String", Method, 0, ""}, - {"ADD", Const, 0, ""}, - {"ADD_ASSIGN", Const, 0, ""}, - {"AND", Const, 0, ""}, - {"AND_ASSIGN", Const, 0, ""}, - {"AND_NOT", Const, 0, ""}, - {"AND_NOT_ASSIGN", Const, 0, ""}, - {"ARROW", Const, 0, ""}, - {"ASSIGN", Const, 0, ""}, - {"BREAK", Const, 0, ""}, - {"CASE", Const, 0, ""}, - {"CHAN", Const, 0, ""}, - {"CHAR", Const, 0, ""}, - {"COLON", Const, 0, ""}, - {"COMMA", Const, 0, ""}, - {"COMMENT", Const, 0, ""}, - {"CONST", Const, 0, ""}, - {"CONTINUE", Const, 0, ""}, - {"DEC", Const, 0, ""}, - {"DEFAULT", Const, 0, ""}, - {"DEFER", Const, 0, ""}, - {"DEFINE", Const, 0, ""}, - {"ELLIPSIS", Const, 0, ""}, - {"ELSE", Const, 0, ""}, - {"EOF", Const, 0, ""}, - {"EQL", Const, 0, ""}, - {"FALLTHROUGH", Const, 0, ""}, - {"FLOAT", Const, 0, ""}, - {"FOR", Const, 0, ""}, - {"FUNC", Const, 0, ""}, - {"File", Type, 0, ""}, - {"FileSet", Type, 0, ""}, - {"GEQ", Const, 0, ""}, - {"GO", Const, 0, ""}, - {"GOTO", Const, 0, ""}, - {"GTR", Const, 0, ""}, - {"HighestPrec", Const, 0, ""}, - {"IDENT", Const, 0, ""}, - {"IF", Const, 0, ""}, - {"ILLEGAL", Const, 0, ""}, - {"IMAG", Const, 0, ""}, - {"IMPORT", Const, 0, ""}, - {"INC", Const, 0, ""}, - {"INT", Const, 0, ""}, - {"INTERFACE", Const, 0, ""}, - {"IsExported", Func, 13, "func(name string) bool"}, - {"IsIdentifier", Func, 13, "func(name string) bool"}, - {"IsKeyword", Func, 13, "func(name string) bool"}, - {"LAND", Const, 0, ""}, - {"LBRACE", Const, 0, ""}, - {"LBRACK", Const, 0, ""}, - {"LEQ", Const, 0, ""}, - {"LOR", Const, 0, ""}, - {"LPAREN", Const, 0, ""}, - {"LSS", Const, 0, ""}, - {"Lookup", Func, 0, "func(ident string) Token"}, - {"LowestPrec", Const, 0, ""}, - {"MAP", Const, 0, ""}, - {"MUL", Const, 0, ""}, - {"MUL_ASSIGN", Const, 0, ""}, - {"NEQ", Const, 0, ""}, - {"NOT", Const, 0, ""}, - {"NewFileSet", Func, 0, "func() *FileSet"}, - {"NoPos", Const, 0, ""}, - {"OR", Const, 0, ""}, - {"OR_ASSIGN", Const, 0, ""}, - {"PACKAGE", Const, 0, ""}, - {"PERIOD", Const, 0, ""}, - {"Pos", Type, 0, ""}, - {"Position", Type, 0, ""}, - {"Position.Column", Field, 0, ""}, - {"Position.Filename", Field, 0, ""}, - {"Position.Line", Field, 0, ""}, - {"Position.Offset", Field, 0, ""}, - {"QUO", Const, 0, ""}, - {"QUO_ASSIGN", Const, 0, ""}, - {"RANGE", Const, 0, ""}, - {"RBRACE", Const, 0, ""}, - {"RBRACK", Const, 0, ""}, - {"REM", Const, 0, ""}, - {"REM_ASSIGN", Const, 0, ""}, - {"RETURN", Const, 0, ""}, - {"RPAREN", Const, 0, ""}, - {"SELECT", Const, 0, ""}, - {"SEMICOLON", Const, 0, ""}, - {"SHL", Const, 0, ""}, - {"SHL_ASSIGN", Const, 0, ""}, - {"SHR", Const, 0, ""}, - {"SHR_ASSIGN", Const, 0, ""}, - {"STRING", Const, 0, ""}, - {"STRUCT", Const, 0, ""}, - {"SUB", Const, 0, ""}, - {"SUB_ASSIGN", Const, 0, ""}, - {"SWITCH", Const, 0, ""}, - {"TILDE", Const, 18, ""}, - {"TYPE", Const, 0, ""}, - {"Token", Type, 0, ""}, - {"UnaryPrec", Const, 0, ""}, - {"VAR", Const, 0, ""}, - {"XOR", Const, 0, ""}, - {"XOR_ASSIGN", Const, 0, ""}, - }, - "go/types": { - {"(*Alias).Obj", Method, 22, ""}, - {"(*Alias).Origin", Method, 23, ""}, - {"(*Alias).Rhs", Method, 23, ""}, - {"(*Alias).SetTypeParams", Method, 23, ""}, - {"(*Alias).String", Method, 22, ""}, - {"(*Alias).TypeArgs", Method, 23, ""}, - {"(*Alias).TypeParams", Method, 23, ""}, - {"(*Alias).Underlying", Method, 22, ""}, - {"(*ArgumentError).Error", Method, 18, ""}, - {"(*ArgumentError).Unwrap", Method, 18, ""}, - {"(*Array).Elem", Method, 5, ""}, - {"(*Array).Len", Method, 5, ""}, - {"(*Array).String", Method, 5, ""}, - {"(*Array).Underlying", Method, 5, ""}, - {"(*Basic).Info", Method, 5, ""}, - {"(*Basic).Kind", Method, 5, ""}, - {"(*Basic).Name", Method, 5, ""}, - {"(*Basic).String", Method, 5, ""}, - {"(*Basic).Underlying", Method, 5, ""}, - {"(*Builtin).Exported", Method, 5, ""}, - {"(*Builtin).Id", Method, 5, ""}, - {"(*Builtin).Name", Method, 5, ""}, - {"(*Builtin).Parent", Method, 5, ""}, - {"(*Builtin).Pkg", Method, 5, ""}, - {"(*Builtin).Pos", Method, 5, ""}, - {"(*Builtin).String", Method, 5, ""}, - {"(*Builtin).Type", Method, 5, ""}, - {"(*Chan).Dir", Method, 5, ""}, - {"(*Chan).Elem", Method, 5, ""}, - {"(*Chan).String", Method, 5, ""}, - {"(*Chan).Underlying", Method, 5, ""}, - {"(*Checker).Files", Method, 5, ""}, - {"(*Config).Check", Method, 5, ""}, - {"(*Const).Exported", Method, 5, ""}, - {"(*Const).Id", Method, 5, ""}, - {"(*Const).Name", Method, 5, ""}, - {"(*Const).Parent", Method, 5, ""}, - {"(*Const).Pkg", Method, 5, ""}, - {"(*Const).Pos", Method, 5, ""}, - {"(*Const).String", Method, 5, ""}, - {"(*Const).Type", Method, 5, ""}, - {"(*Const).Val", Method, 5, ""}, - {"(*Func).Exported", Method, 5, ""}, - {"(*Func).FullName", Method, 5, ""}, - {"(*Func).Id", Method, 5, ""}, - {"(*Func).Name", Method, 5, ""}, - {"(*Func).Origin", Method, 19, ""}, - {"(*Func).Parent", Method, 5, ""}, - {"(*Func).Pkg", Method, 5, ""}, - {"(*Func).Pos", Method, 5, ""}, - {"(*Func).Scope", Method, 5, ""}, - {"(*Func).Signature", Method, 23, ""}, - {"(*Func).String", Method, 5, ""}, - {"(*Func).Type", Method, 5, ""}, - {"(*Info).ObjectOf", Method, 5, ""}, - {"(*Info).PkgNameOf", Method, 22, ""}, - {"(*Info).TypeOf", Method, 5, ""}, - {"(*Initializer).String", Method, 5, ""}, - {"(*Interface).Complete", Method, 5, ""}, - {"(*Interface).Embedded", Method, 5, ""}, - {"(*Interface).EmbeddedType", Method, 11, ""}, - {"(*Interface).EmbeddedTypes", Method, 24, ""}, - {"(*Interface).Empty", Method, 5, ""}, - {"(*Interface).ExplicitMethod", Method, 5, ""}, - {"(*Interface).ExplicitMethods", Method, 24, ""}, - {"(*Interface).IsComparable", Method, 18, ""}, - {"(*Interface).IsImplicit", Method, 18, ""}, - {"(*Interface).IsMethodSet", Method, 18, ""}, - {"(*Interface).MarkImplicit", Method, 18, ""}, - {"(*Interface).Method", Method, 5, ""}, - {"(*Interface).Methods", Method, 24, ""}, - {"(*Interface).NumEmbeddeds", Method, 5, ""}, - {"(*Interface).NumExplicitMethods", Method, 5, ""}, - {"(*Interface).NumMethods", Method, 5, ""}, - {"(*Interface).String", Method, 5, ""}, - {"(*Interface).Underlying", Method, 5, ""}, - {"(*Label).Exported", Method, 5, ""}, - {"(*Label).Id", Method, 5, ""}, - {"(*Label).Name", Method, 5, ""}, - {"(*Label).Parent", Method, 5, ""}, - {"(*Label).Pkg", Method, 5, ""}, - {"(*Label).Pos", Method, 5, ""}, - {"(*Label).String", Method, 5, ""}, - {"(*Label).Type", Method, 5, ""}, - {"(*Map).Elem", Method, 5, ""}, - {"(*Map).Key", Method, 5, ""}, - {"(*Map).String", Method, 5, ""}, - {"(*Map).Underlying", Method, 5, ""}, - {"(*MethodSet).At", Method, 5, ""}, - {"(*MethodSet).Len", Method, 5, ""}, - {"(*MethodSet).Lookup", Method, 5, ""}, - {"(*MethodSet).Methods", Method, 24, ""}, - {"(*MethodSet).String", Method, 5, ""}, - {"(*Named).AddMethod", Method, 5, ""}, - {"(*Named).Method", Method, 5, ""}, - {"(*Named).Methods", Method, 24, ""}, - {"(*Named).NumMethods", Method, 5, ""}, - {"(*Named).Obj", Method, 5, ""}, - {"(*Named).Origin", Method, 18, ""}, - {"(*Named).SetTypeParams", Method, 18, ""}, - {"(*Named).SetUnderlying", Method, 5, ""}, - {"(*Named).String", Method, 5, ""}, - {"(*Named).TypeArgs", Method, 18, ""}, - {"(*Named).TypeParams", Method, 18, ""}, - {"(*Named).Underlying", Method, 5, ""}, - {"(*Nil).Exported", Method, 5, ""}, - {"(*Nil).Id", Method, 5, ""}, - {"(*Nil).Name", Method, 5, ""}, - {"(*Nil).Parent", Method, 5, ""}, - {"(*Nil).Pkg", Method, 5, ""}, - {"(*Nil).Pos", Method, 5, ""}, - {"(*Nil).String", Method, 5, ""}, - {"(*Nil).Type", Method, 5, ""}, - {"(*Package).Complete", Method, 5, ""}, - {"(*Package).GoVersion", Method, 21, ""}, - {"(*Package).Imports", Method, 5, ""}, - {"(*Package).MarkComplete", Method, 5, ""}, - {"(*Package).Name", Method, 5, ""}, - {"(*Package).Path", Method, 5, ""}, - {"(*Package).Scope", Method, 5, ""}, - {"(*Package).SetImports", Method, 5, ""}, - {"(*Package).SetName", Method, 6, ""}, - {"(*Package).String", Method, 5, ""}, - {"(*PkgName).Exported", Method, 5, ""}, - {"(*PkgName).Id", Method, 5, ""}, - {"(*PkgName).Imported", Method, 5, ""}, - {"(*PkgName).Name", Method, 5, ""}, - {"(*PkgName).Parent", Method, 5, ""}, - {"(*PkgName).Pkg", Method, 5, ""}, - {"(*PkgName).Pos", Method, 5, ""}, - {"(*PkgName).String", Method, 5, ""}, - {"(*PkgName).Type", Method, 5, ""}, - {"(*Pointer).Elem", Method, 5, ""}, - {"(*Pointer).String", Method, 5, ""}, - {"(*Pointer).Underlying", Method, 5, ""}, - {"(*Scope).Child", Method, 5, ""}, - {"(*Scope).Children", Method, 24, ""}, - {"(*Scope).Contains", Method, 5, ""}, - {"(*Scope).End", Method, 5, ""}, - {"(*Scope).Innermost", Method, 5, ""}, - {"(*Scope).Insert", Method, 5, ""}, - {"(*Scope).Len", Method, 5, ""}, - {"(*Scope).Lookup", Method, 5, ""}, - {"(*Scope).LookupParent", Method, 5, ""}, - {"(*Scope).Names", Method, 5, ""}, - {"(*Scope).NumChildren", Method, 5, ""}, - {"(*Scope).Parent", Method, 5, ""}, - {"(*Scope).Pos", Method, 5, ""}, - {"(*Scope).String", Method, 5, ""}, - {"(*Scope).WriteTo", Method, 5, ""}, - {"(*Selection).Index", Method, 5, ""}, - {"(*Selection).Indirect", Method, 5, ""}, - {"(*Selection).Kind", Method, 5, ""}, - {"(*Selection).Obj", Method, 5, ""}, - {"(*Selection).Recv", Method, 5, ""}, - {"(*Selection).String", Method, 5, ""}, - {"(*Selection).Type", Method, 5, ""}, - {"(*Signature).Params", Method, 5, ""}, - {"(*Signature).Recv", Method, 5, ""}, - {"(*Signature).RecvTypeParams", Method, 18, ""}, - {"(*Signature).Results", Method, 5, ""}, - {"(*Signature).String", Method, 5, ""}, - {"(*Signature).TypeParams", Method, 18, ""}, - {"(*Signature).Underlying", Method, 5, ""}, - {"(*Signature).Variadic", Method, 5, ""}, - {"(*Slice).Elem", Method, 5, ""}, - {"(*Slice).String", Method, 5, ""}, - {"(*Slice).Underlying", Method, 5, ""}, - {"(*StdSizes).Alignof", Method, 5, ""}, - {"(*StdSizes).Offsetsof", Method, 5, ""}, - {"(*StdSizes).Sizeof", Method, 5, ""}, - {"(*Struct).Field", Method, 5, ""}, - {"(*Struct).Fields", Method, 24, ""}, - {"(*Struct).NumFields", Method, 5, ""}, - {"(*Struct).String", Method, 5, ""}, - {"(*Struct).Tag", Method, 5, ""}, - {"(*Struct).Underlying", Method, 5, ""}, - {"(*Term).String", Method, 18, ""}, - {"(*Term).Tilde", Method, 18, ""}, - {"(*Term).Type", Method, 18, ""}, - {"(*Tuple).At", Method, 5, ""}, - {"(*Tuple).Len", Method, 5, ""}, - {"(*Tuple).String", Method, 5, ""}, - {"(*Tuple).Underlying", Method, 5, ""}, - {"(*Tuple).Variables", Method, 24, ""}, - {"(*TypeList).At", Method, 18, ""}, - {"(*TypeList).Len", Method, 18, ""}, - {"(*TypeList).String", Method, 27, ""}, - {"(*TypeList).Types", Method, 24, ""}, - {"(*TypeName).Exported", Method, 5, ""}, - {"(*TypeName).Id", Method, 5, ""}, - {"(*TypeName).IsAlias", Method, 9, ""}, - {"(*TypeName).Name", Method, 5, ""}, - {"(*TypeName).Parent", Method, 5, ""}, - {"(*TypeName).Pkg", Method, 5, ""}, - {"(*TypeName).Pos", Method, 5, ""}, - {"(*TypeName).String", Method, 5, ""}, - {"(*TypeName).Type", Method, 5, ""}, - {"(*TypeParam).Constraint", Method, 18, ""}, - {"(*TypeParam).Index", Method, 18, ""}, - {"(*TypeParam).Obj", Method, 18, ""}, - {"(*TypeParam).SetConstraint", Method, 18, ""}, - {"(*TypeParam).String", Method, 18, ""}, - {"(*TypeParam).Underlying", Method, 18, ""}, - {"(*TypeParamList).At", Method, 18, ""}, - {"(*TypeParamList).Len", Method, 18, ""}, - {"(*TypeParamList).String", Method, 27, ""}, - {"(*TypeParamList).TypeParams", Method, 24, ""}, - {"(*Union).Len", Method, 18, ""}, - {"(*Union).String", Method, 18, ""}, - {"(*Union).Term", Method, 18, ""}, - {"(*Union).Terms", Method, 24, ""}, - {"(*Union).Underlying", Method, 18, ""}, - {"(*Var).Anonymous", Method, 5, ""}, - {"(*Var).Embedded", Method, 11, ""}, - {"(*Var).Exported", Method, 5, ""}, - {"(*Var).Id", Method, 5, ""}, - {"(*Var).IsField", Method, 5, ""}, - {"(*Var).Kind", Method, 25, ""}, - {"(*Var).Name", Method, 5, ""}, - {"(*Var).Origin", Method, 19, ""}, - {"(*Var).Parent", Method, 5, ""}, - {"(*Var).Pkg", Method, 5, ""}, - {"(*Var).Pos", Method, 5, ""}, - {"(*Var).SetKind", Method, 25, ""}, - {"(*Var).String", Method, 5, ""}, - {"(*Var).Type", Method, 5, ""}, - {"(Checker).ObjectOf", Method, 5, ""}, - {"(Checker).PkgNameOf", Method, 22, ""}, - {"(Checker).TypeOf", Method, 5, ""}, - {"(Error).Error", Method, 5, ""}, - {"(Hasher).Equal", Method, 27, ""}, - {"(Hasher).Hash", Method, 27, ""}, - {"(HasherIgnoreTags).Equal", Method, 27, ""}, - {"(HasherIgnoreTags).Hash", Method, 27, ""}, - {"(Importer).Import", Method, 5, ""}, - {"(ImporterFrom).Import", Method, 6, ""}, - {"(ImporterFrom).ImportFrom", Method, 6, ""}, - {"(Instance).String", Method, 27, ""}, - {"(Object).Exported", Method, 5, ""}, - {"(Object).Id", Method, 5, ""}, - {"(Object).Name", Method, 5, ""}, - {"(Object).Parent", Method, 5, ""}, - {"(Object).Pkg", Method, 5, ""}, - {"(Object).Pos", Method, 5, ""}, - {"(Object).String", Method, 5, ""}, - {"(Object).Type", Method, 5, ""}, - {"(Sizes).Alignof", Method, 5, ""}, - {"(Sizes).Offsetsof", Method, 5, ""}, - {"(Sizes).Sizeof", Method, 5, ""}, - {"(Type).String", Method, 5, ""}, - {"(Type).Underlying", Method, 5, ""}, - {"(TypeAndValue).Addressable", Method, 5, ""}, - {"(TypeAndValue).Assignable", Method, 5, ""}, - {"(TypeAndValue).HasOk", Method, 5, ""}, - {"(TypeAndValue).IsBuiltin", Method, 5, ""}, - {"(TypeAndValue).IsNil", Method, 5, ""}, - {"(TypeAndValue).IsType", Method, 5, ""}, - {"(TypeAndValue).IsValue", Method, 5, ""}, - {"(TypeAndValue).IsVoid", Method, 5, ""}, - {"(VarKind).String", Method, 25, ""}, - {"Alias", Type, 22, ""}, - {"ArgumentError", Type, 18, ""}, - {"ArgumentError.Err", Field, 18, ""}, - {"ArgumentError.Index", Field, 18, ""}, - {"Array", Type, 5, ""}, - {"AssertableTo", Func, 5, "func(V *Interface, T Type) bool"}, - {"AssignableTo", Func, 5, "func(V Type, T Type) bool"}, - {"Basic", Type, 5, ""}, - {"BasicInfo", Type, 5, ""}, - {"BasicKind", Type, 5, ""}, - {"Bool", Const, 5, ""}, - {"Builtin", Type, 5, ""}, - {"Byte", Const, 5, ""}, - {"Chan", Type, 5, ""}, - {"ChanDir", Type, 5, ""}, - {"CheckExpr", Func, 13, "func(fset *token.FileSet, pkg *Package, pos token.Pos, expr ast.Expr, info *Info) (err error)"}, - {"Checker", Type, 5, ""}, - {"Checker.Info", Field, 5, ""}, - {"Comparable", Func, 5, "func(T Type) bool"}, - {"Complex128", Const, 5, ""}, - {"Complex64", Const, 5, ""}, - {"Config", Type, 5, ""}, - {"Config.Context", Field, 18, ""}, - {"Config.DisableUnusedImportCheck", Field, 5, ""}, - {"Config.Error", Field, 5, ""}, - {"Config.FakeImportC", Field, 5, ""}, - {"Config.GoVersion", Field, 18, ""}, - {"Config.IgnoreFuncBodies", Field, 5, ""}, - {"Config.Importer", Field, 5, ""}, - {"Config.Sizes", Field, 5, ""}, - {"Const", Type, 5, ""}, - {"Context", Type, 18, ""}, - {"ConvertibleTo", Func, 5, "func(V Type, T Type) bool"}, - {"DefPredeclaredTestFuncs", Func, 5, "func()"}, - {"Default", Func, 8, "func(t Type) Type"}, - {"Error", Type, 5, ""}, - {"Error.Fset", Field, 5, ""}, - {"Error.Msg", Field, 5, ""}, - {"Error.Pos", Field, 5, ""}, - {"Error.Soft", Field, 5, ""}, - {"Eval", Func, 5, "func(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ TypeAndValue, err error)"}, - {"ExprString", Func, 5, "func(x ast.Expr) string"}, - {"FieldVal", Const, 5, ""}, - {"FieldVar", Const, 25, ""}, - {"Float32", Const, 5, ""}, - {"Float64", Const, 5, ""}, - {"Func", Type, 5, ""}, - {"Hasher", Type, 27, ""}, - {"HasherIgnoreTags", Type, 27, ""}, - {"Id", Func, 5, "func(pkg *Package, name string) string"}, - {"Identical", Func, 5, "func(x Type, y Type) bool"}, - {"IdenticalIgnoreTags", Func, 8, "func(x Type, y Type) bool"}, - {"Implements", Func, 5, "func(V Type, T *Interface) bool"}, - {"ImportMode", Type, 6, ""}, - {"Importer", Type, 5, ""}, - {"ImporterFrom", Type, 6, ""}, - {"Info", Type, 5, ""}, - {"Info.Defs", Field, 5, ""}, - {"Info.FileVersions", Field, 22, ""}, - {"Info.Implicits", Field, 5, ""}, - {"Info.InitOrder", Field, 5, ""}, - {"Info.Instances", Field, 18, ""}, - {"Info.Scopes", Field, 5, ""}, - {"Info.Selections", Field, 5, ""}, - {"Info.Types", Field, 5, ""}, - {"Info.Uses", Field, 5, ""}, - {"Initializer", Type, 5, ""}, - {"Initializer.Lhs", Field, 5, ""}, - {"Initializer.Rhs", Field, 5, ""}, - {"Instance", Type, 18, ""}, - {"Instance.Type", Field, 18, ""}, - {"Instance.TypeArgs", Field, 18, ""}, - {"Instantiate", Func, 18, "func(ctxt *Context, orig Type, targs []Type, validate bool) (Type, error)"}, - {"Int", Const, 5, ""}, - {"Int16", Const, 5, ""}, - {"Int32", Const, 5, ""}, - {"Int64", Const, 5, ""}, - {"Int8", Const, 5, ""}, - {"Interface", Type, 5, ""}, - {"Invalid", Const, 5, ""}, - {"IsBoolean", Const, 5, ""}, - {"IsComplex", Const, 5, ""}, - {"IsConstType", Const, 5, ""}, - {"IsFloat", Const, 5, ""}, - {"IsInteger", Const, 5, ""}, - {"IsInterface", Func, 5, "func(t Type) bool"}, - {"IsNumeric", Const, 5, ""}, - {"IsOrdered", Const, 5, ""}, - {"IsString", Const, 5, ""}, - {"IsUnsigned", Const, 5, ""}, - {"IsUntyped", Const, 5, ""}, - {"Label", Type, 5, ""}, - {"LocalVar", Const, 25, ""}, - {"LookupFieldOrMethod", Func, 5, "func(T Type, addressable bool, pkg *Package, name string) (obj Object, index []int, indirect bool)"}, - {"LookupSelection", Func, 25, "func(T Type, addressable bool, pkg *Package, name string) (Selection, bool)"}, - {"Map", Type, 5, ""}, - {"MethodExpr", Const, 5, ""}, - {"MethodSet", Type, 5, ""}, - {"MethodVal", Const, 5, ""}, - {"MissingMethod", Func, 5, "func(V Type, T *Interface, static bool) (method *Func, wrongType bool)"}, - {"Named", Type, 5, ""}, - {"NewAlias", Func, 22, "func(obj *TypeName, rhs Type) *Alias"}, - {"NewArray", Func, 5, "func(elem Type, len int64) *Array"}, - {"NewChan", Func, 5, "func(dir ChanDir, elem Type) *Chan"}, - {"NewChecker", Func, 5, "func(conf *Config, fset *token.FileSet, pkg *Package, info *Info) *Checker"}, - {"NewConst", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const"}, - {"NewContext", Func, 18, "func() *Context"}, - {"NewField", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type, embedded bool) *Var"}, - {"NewFunc", Func, 5, "func(pos token.Pos, pkg *Package, name string, sig *Signature) *Func"}, - {"NewInterface", Func, 5, "func(methods []*Func, embeddeds []*Named) *Interface"}, - {"NewInterfaceType", Func, 11, "func(methods []*Func, embeddeds []Type) *Interface"}, - {"NewLabel", Func, 5, "func(pos token.Pos, pkg *Package, name string) *Label"}, - {"NewMap", Func, 5, "func(key Type, elem Type) *Map"}, - {"NewMethodSet", Func, 5, "func(T Type) *MethodSet"}, - {"NewNamed", Func, 5, "func(obj *TypeName, underlying Type, methods []*Func) *Named"}, - {"NewPackage", Func, 5, "func(path string, name string) *Package"}, - {"NewParam", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type) *Var"}, - {"NewPkgName", Func, 5, "func(pos token.Pos, pkg *Package, name string, imported *Package) *PkgName"}, - {"NewPointer", Func, 5, "func(elem Type) *Pointer"}, - {"NewScope", Func, 5, "func(parent *Scope, pos token.Pos, end token.Pos, comment string) *Scope"}, - {"NewSignature", Func, 5, "func(recv *Var, params *Tuple, results *Tuple, variadic bool) *Signature"}, - {"NewSignatureType", Func, 18, "func(recv *Var, recvTypeParams []*TypeParam, typeParams []*TypeParam, params *Tuple, results *Tuple, variadic bool) *Signature"}, - {"NewSlice", Func, 5, "func(elem Type) *Slice"}, - {"NewStruct", Func, 5, "func(fields []*Var, tags []string) *Struct"}, - {"NewTerm", Func, 18, "func(tilde bool, typ Type) *Term"}, - {"NewTuple", Func, 5, "func(x ...*Var) *Tuple"}, - {"NewTypeName", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type) *TypeName"}, - {"NewTypeParam", Func, 18, "func(obj *TypeName, constraint Type) *TypeParam"}, - {"NewUnion", Func, 18, "func(terms []*Term) *Union"}, - {"NewVar", Func, 5, "func(pos token.Pos, pkg *Package, name string, typ Type) *Var"}, - {"Nil", Type, 5, ""}, - {"ObjectString", Func, 5, "func(obj Object, qf Qualifier) string"}, - {"Package", Type, 5, ""}, - {"PackageVar", Const, 25, ""}, - {"ParamVar", Const, 25, ""}, - {"PkgName", Type, 5, ""}, - {"Pointer", Type, 5, ""}, - {"Qualifier", Type, 5, ""}, - {"RecvOnly", Const, 5, ""}, - {"RecvVar", Const, 25, ""}, - {"RelativeTo", Func, 5, "func(pkg *Package) Qualifier"}, - {"ResultVar", Const, 25, ""}, - {"Rune", Const, 5, ""}, - {"Satisfies", Func, 20, "func(V Type, T *Interface) bool"}, - {"Scope", Type, 5, ""}, - {"Selection", Type, 5, ""}, - {"SelectionKind", Type, 5, ""}, - {"SelectionString", Func, 5, "func(s *Selection, qf Qualifier) string"}, - {"SendOnly", Const, 5, ""}, - {"SendRecv", Const, 5, ""}, - {"Signature", Type, 5, ""}, - {"Sizes", Type, 5, ""}, - {"SizesFor", Func, 9, "func(compiler string, arch string) Sizes"}, - {"Slice", Type, 5, ""}, - {"StdSizes", Type, 5, ""}, - {"StdSizes.MaxAlign", Field, 5, ""}, - {"StdSizes.WordSize", Field, 5, ""}, - {"String", Const, 5, ""}, - {"Struct", Type, 5, ""}, - {"Term", Type, 18, ""}, - {"Tuple", Type, 5, ""}, - {"Typ", Var, 5, ""}, - {"Type", Type, 5, ""}, - {"TypeAndValue", Type, 5, ""}, - {"TypeAndValue.Type", Field, 5, ""}, - {"TypeAndValue.Value", Field, 5, ""}, - {"TypeList", Type, 18, ""}, - {"TypeName", Type, 5, ""}, - {"TypeParam", Type, 18, ""}, - {"TypeParamList", Type, 18, ""}, - {"TypeString", Func, 5, "func(typ Type, qf Qualifier) string"}, - {"Uint", Const, 5, ""}, - {"Uint16", Const, 5, ""}, - {"Uint32", Const, 5, ""}, - {"Uint64", Const, 5, ""}, - {"Uint8", Const, 5, ""}, - {"Uintptr", Const, 5, ""}, - {"Unalias", Func, 22, "func(t Type) Type"}, - {"Union", Type, 18, ""}, - {"Universe", Var, 5, ""}, - {"Unsafe", Var, 5, ""}, - {"UnsafePointer", Const, 5, ""}, - {"UntypedBool", Const, 5, ""}, - {"UntypedComplex", Const, 5, ""}, - {"UntypedFloat", Const, 5, ""}, - {"UntypedInt", Const, 5, ""}, - {"UntypedNil", Const, 5, ""}, - {"UntypedRune", Const, 5, ""}, - {"UntypedString", Const, 5, ""}, - {"Var", Type, 5, ""}, - {"VarKind", Type, 25, ""}, - {"WriteExpr", Func, 5, "func(buf *bytes.Buffer, x ast.Expr)"}, - {"WriteSignature", Func, 5, "func(buf *bytes.Buffer, sig *Signature, qf Qualifier)"}, - {"WriteType", Func, 5, "func(buf *bytes.Buffer, typ Type, qf Qualifier)"}, - }, - "go/version": { - {"Compare", Func, 22, "func(x string, y string) int"}, - {"IsValid", Func, 22, "func(x string) bool"}, - {"Lang", Func, 22, "func(x string) string"}, - }, - "hash": { - {"(Cloner).BlockSize", Method, 25, ""}, - {"(Cloner).Clone", Method, 25, ""}, - {"(Cloner).Reset", Method, 25, ""}, - {"(Cloner).Size", Method, 25, ""}, - {"(Cloner).Sum", Method, 25, ""}, - {"(Cloner).Write", Method, 25, ""}, - {"(Hash).BlockSize", Method, 0, ""}, - {"(Hash).Reset", Method, 0, ""}, - {"(Hash).Size", Method, 0, ""}, - {"(Hash).Sum", Method, 0, ""}, - {"(Hash).Write", Method, 0, ""}, - {"(Hash32).BlockSize", Method, 0, ""}, - {"(Hash32).Reset", Method, 0, ""}, - {"(Hash32).Size", Method, 0, ""}, - {"(Hash32).Sum", Method, 0, ""}, - {"(Hash32).Sum32", Method, 0, ""}, - {"(Hash32).Write", Method, 0, ""}, - {"(Hash64).BlockSize", Method, 0, ""}, - {"(Hash64).Reset", Method, 0, ""}, - {"(Hash64).Size", Method, 0, ""}, - {"(Hash64).Sum", Method, 0, ""}, - {"(Hash64).Sum64", Method, 0, ""}, - {"(Hash64).Write", Method, 0, ""}, - {"(XOF).BlockSize", Method, 25, ""}, - {"(XOF).Read", Method, 25, ""}, - {"(XOF).Reset", Method, 25, ""}, - {"(XOF).Write", Method, 25, ""}, - {"Cloner", Type, 25, ""}, - {"Hash", Type, 0, ""}, - {"Hash32", Type, 0, ""}, - {"Hash64", Type, 0, ""}, - {"XOF", Type, 25, ""}, - }, - "hash/adler32": { - {"Checksum", Func, 0, "func(data []byte) uint32"}, - {"New", Func, 0, "func() hash.Hash32"}, - {"Size", Const, 0, ""}, - }, - "hash/crc32": { - {"Castagnoli", Const, 0, ""}, - {"Checksum", Func, 0, "func(data []byte, tab *Table) uint32"}, - {"ChecksumIEEE", Func, 0, "func(data []byte) uint32"}, - {"IEEE", Const, 0, ""}, - {"IEEETable", Var, 0, ""}, - {"Koopman", Const, 0, ""}, - {"MakeTable", Func, 0, "func(poly uint32) *Table"}, - {"New", Func, 0, "func(tab *Table) hash.Hash32"}, - {"NewIEEE", Func, 0, "func() hash.Hash32"}, - {"Size", Const, 0, ""}, - {"Table", Type, 0, ""}, - {"Update", Func, 0, "func(crc uint32, tab *Table, p []byte) uint32"}, - }, - "hash/crc64": { - {"Checksum", Func, 0, "func(data []byte, tab *Table) uint64"}, - {"ECMA", Const, 0, ""}, - {"ISO", Const, 0, ""}, - {"MakeTable", Func, 0, "func(poly uint64) *Table"}, - {"New", Func, 0, "func(tab *Table) hash.Hash64"}, - {"Size", Const, 0, ""}, - {"Table", Type, 0, ""}, - {"Update", Func, 0, "func(crc uint64, tab *Table, p []byte) uint64"}, - }, - "hash/fnv": { - {"New128", Func, 9, "func() hash.Hash"}, - {"New128a", Func, 9, "func() hash.Hash"}, - {"New32", Func, 0, "func() hash.Hash32"}, - {"New32a", Func, 0, "func() hash.Hash32"}, - {"New64", Func, 0, "func() hash.Hash64"}, - {"New64a", Func, 0, "func() hash.Hash64"}, - }, - "hash/maphash": { - {"(*Hash).BlockSize", Method, 14, ""}, - {"(*Hash).Clone", Method, 25, ""}, - {"(*Hash).Reset", Method, 14, ""}, - {"(*Hash).Seed", Method, 14, ""}, - {"(*Hash).SetSeed", Method, 14, ""}, - {"(*Hash).Size", Method, 14, ""}, - {"(*Hash).Sum", Method, 14, ""}, - {"(*Hash).Sum64", Method, 14, ""}, - {"(*Hash).Write", Method, 14, ""}, - {"(*Hash).WriteByte", Method, 14, ""}, - {"(*Hash).WriteString", Method, 14, ""}, - {"(ComparableHasher).Equal", Method, 27, ""}, - {"(ComparableHasher).Hash", Method, 27, ""}, - {"Bytes", Func, 19, "func(seed Seed, b []byte) uint64"}, - {"Comparable", Func, 24, "func[T comparable](seed Seed, v T) uint64"}, - {"ComparableHasher", Type, 27, ""}, - {"Hash", Type, 14, ""}, - {"Hasher", Type, 27, ""}, - {"MakeSeed", Func, 14, "func() Seed"}, - {"Seed", Type, 14, ""}, - {"String", Func, 19, "func(seed Seed, s string) uint64"}, - {"WriteComparable", Func, 24, "func[T comparable](h *Hash, x T)"}, - }, - "html": { - {"EscapeString", Func, 0, "func(s string) string"}, - {"UnescapeString", Func, 0, "func(s string) string"}, - }, - "html/template": { - {"(*Error).Error", Method, 0, ""}, - {"(*Template).AddParseTree", Method, 0, ""}, - {"(*Template).Clone", Method, 0, ""}, - {"(*Template).DefinedTemplates", Method, 6, ""}, - {"(*Template).Delims", Method, 0, ""}, - {"(*Template).Execute", Method, 0, ""}, - {"(*Template).ExecuteTemplate", Method, 0, ""}, - {"(*Template).Funcs", Method, 0, ""}, - {"(*Template).Lookup", Method, 0, ""}, - {"(*Template).Name", Method, 0, ""}, - {"(*Template).New", Method, 0, ""}, - {"(*Template).Option", Method, 5, ""}, - {"(*Template).Parse", Method, 0, ""}, - {"(*Template).ParseFS", Method, 16, ""}, - {"(*Template).ParseFiles", Method, 0, ""}, - {"(*Template).ParseGlob", Method, 0, ""}, - {"(*Template).Templates", Method, 0, ""}, - {"CSS", Type, 0, ""}, - {"ErrAmbigContext", Const, 0, ""}, - {"ErrBadHTML", Const, 0, ""}, - {"ErrBranchEnd", Const, 0, ""}, - {"ErrEndContext", Const, 0, ""}, - {"ErrJSTemplate", Const, 21, ""}, - {"ErrNoSuchTemplate", Const, 0, ""}, - {"ErrOutputContext", Const, 0, ""}, - {"ErrPartialCharset", Const, 0, ""}, - {"ErrPartialEscape", Const, 0, ""}, - {"ErrPredefinedEscaper", Const, 9, ""}, - {"ErrRangeLoopReentry", Const, 0, ""}, - {"ErrSlashAmbig", Const, 0, ""}, - {"Error", Type, 0, ""}, - {"Error.Description", Field, 0, ""}, - {"Error.ErrorCode", Field, 0, ""}, - {"Error.Line", Field, 0, ""}, - {"Error.Name", Field, 0, ""}, - {"Error.Node", Field, 4, ""}, - {"ErrorCode", Type, 0, ""}, - {"FuncMap", Type, 0, ""}, - {"HTML", Type, 0, ""}, - {"HTMLAttr", Type, 0, ""}, - {"HTMLEscape", Func, 0, "func(w io.Writer, b []byte)"}, - {"HTMLEscapeString", Func, 0, "func(s string) string"}, - {"HTMLEscaper", Func, 0, "func(args ...any) string"}, - {"IsTrue", Func, 6, "func(val any) (truth bool, ok bool)"}, - {"JS", Type, 0, ""}, - {"JSEscape", Func, 0, "func(w io.Writer, b []byte)"}, - {"JSEscapeString", Func, 0, "func(s string) string"}, - {"JSEscaper", Func, 0, "func(args ...any) string"}, - {"JSStr", Type, 0, ""}, - {"Must", Func, 0, "func(t *Template, err error) *Template"}, - {"New", Func, 0, "func(name string) *Template"}, - {"OK", Const, 0, ""}, - {"ParseFS", Func, 16, "func(fs fs.FS, patterns ...string) (*Template, error)"}, - {"ParseFiles", Func, 0, "func(filenames ...string) (*Template, error)"}, - {"ParseGlob", Func, 0, "func(pattern string) (*Template, error)"}, - {"Srcset", Type, 10, ""}, - {"Template", Type, 0, ""}, - {"Template.Tree", Field, 2, ""}, - {"URL", Type, 0, ""}, - {"URLQueryEscaper", Func, 0, "func(args ...any) string"}, - }, - "image": { - {"(*Alpha).AlphaAt", Method, 4, ""}, - {"(*Alpha).At", Method, 0, ""}, - {"(*Alpha).Bounds", Method, 0, ""}, - {"(*Alpha).ColorModel", Method, 0, ""}, - {"(*Alpha).Opaque", Method, 0, ""}, - {"(*Alpha).PixOffset", Method, 0, ""}, - {"(*Alpha).RGBA64At", Method, 17, ""}, - {"(*Alpha).Set", Method, 0, ""}, - {"(*Alpha).SetAlpha", Method, 0, ""}, - {"(*Alpha).SetRGBA64", Method, 17, ""}, - {"(*Alpha).SubImage", Method, 0, ""}, - {"(*Alpha16).Alpha16At", Method, 4, ""}, - {"(*Alpha16).At", Method, 0, ""}, - {"(*Alpha16).Bounds", Method, 0, ""}, - {"(*Alpha16).ColorModel", Method, 0, ""}, - {"(*Alpha16).Opaque", Method, 0, ""}, - {"(*Alpha16).PixOffset", Method, 0, ""}, - {"(*Alpha16).RGBA64At", Method, 17, ""}, - {"(*Alpha16).Set", Method, 0, ""}, - {"(*Alpha16).SetAlpha16", Method, 0, ""}, - {"(*Alpha16).SetRGBA64", Method, 17, ""}, - {"(*Alpha16).SubImage", Method, 0, ""}, - {"(*CMYK).At", Method, 5, ""}, - {"(*CMYK).Bounds", Method, 5, ""}, - {"(*CMYK).CMYKAt", Method, 5, ""}, - {"(*CMYK).ColorModel", Method, 5, ""}, - {"(*CMYK).Opaque", Method, 5, ""}, - {"(*CMYK).PixOffset", Method, 5, ""}, - {"(*CMYK).RGBA64At", Method, 17, ""}, - {"(*CMYK).Set", Method, 5, ""}, - {"(*CMYK).SetCMYK", Method, 5, ""}, - {"(*CMYK).SetRGBA64", Method, 17, ""}, - {"(*CMYK).SubImage", Method, 5, ""}, - {"(*Gray).At", Method, 0, ""}, - {"(*Gray).Bounds", Method, 0, ""}, - {"(*Gray).ColorModel", Method, 0, ""}, - {"(*Gray).GrayAt", Method, 4, ""}, - {"(*Gray).Opaque", Method, 0, ""}, - {"(*Gray).PixOffset", Method, 0, ""}, - {"(*Gray).RGBA64At", Method, 17, ""}, - {"(*Gray).Set", Method, 0, ""}, - {"(*Gray).SetGray", Method, 0, ""}, - {"(*Gray).SetRGBA64", Method, 17, ""}, - {"(*Gray).SubImage", Method, 0, ""}, - {"(*Gray16).At", Method, 0, ""}, - {"(*Gray16).Bounds", Method, 0, ""}, - {"(*Gray16).ColorModel", Method, 0, ""}, - {"(*Gray16).Gray16At", Method, 4, ""}, - {"(*Gray16).Opaque", Method, 0, ""}, - {"(*Gray16).PixOffset", Method, 0, ""}, - {"(*Gray16).RGBA64At", Method, 17, ""}, - {"(*Gray16).Set", Method, 0, ""}, - {"(*Gray16).SetGray16", Method, 0, ""}, - {"(*Gray16).SetRGBA64", Method, 17, ""}, - {"(*Gray16).SubImage", Method, 0, ""}, - {"(*NRGBA).At", Method, 0, ""}, - {"(*NRGBA).Bounds", Method, 0, ""}, - {"(*NRGBA).ColorModel", Method, 0, ""}, - {"(*NRGBA).NRGBAAt", Method, 4, ""}, - {"(*NRGBA).Opaque", Method, 0, ""}, - {"(*NRGBA).PixOffset", Method, 0, ""}, - {"(*NRGBA).RGBA64At", Method, 17, ""}, - {"(*NRGBA).Set", Method, 0, ""}, - {"(*NRGBA).SetNRGBA", Method, 0, ""}, - {"(*NRGBA).SetRGBA64", Method, 17, ""}, - {"(*NRGBA).SubImage", Method, 0, ""}, - {"(*NRGBA64).At", Method, 0, ""}, - {"(*NRGBA64).Bounds", Method, 0, ""}, - {"(*NRGBA64).ColorModel", Method, 0, ""}, - {"(*NRGBA64).NRGBA64At", Method, 4, ""}, - {"(*NRGBA64).Opaque", Method, 0, ""}, - {"(*NRGBA64).PixOffset", Method, 0, ""}, - {"(*NRGBA64).RGBA64At", Method, 17, ""}, - {"(*NRGBA64).Set", Method, 0, ""}, - {"(*NRGBA64).SetNRGBA64", Method, 0, ""}, - {"(*NRGBA64).SetRGBA64", Method, 17, ""}, - {"(*NRGBA64).SubImage", Method, 0, ""}, - {"(*NYCbCrA).AOffset", Method, 6, ""}, - {"(*NYCbCrA).At", Method, 6, ""}, - {"(*NYCbCrA).Bounds", Method, 6, ""}, - {"(*NYCbCrA).COffset", Method, 6, ""}, - {"(*NYCbCrA).ColorModel", Method, 6, ""}, - {"(*NYCbCrA).NYCbCrAAt", Method, 6, ""}, - {"(*NYCbCrA).Opaque", Method, 6, ""}, - {"(*NYCbCrA).RGBA64At", Method, 17, ""}, - {"(*NYCbCrA).SubImage", Method, 6, ""}, - {"(*NYCbCrA).YCbCrAt", Method, 6, ""}, - {"(*NYCbCrA).YOffset", Method, 6, ""}, - {"(*Paletted).At", Method, 0, ""}, - {"(*Paletted).Bounds", Method, 0, ""}, - {"(*Paletted).ColorIndexAt", Method, 0, ""}, - {"(*Paletted).ColorModel", Method, 0, ""}, - {"(*Paletted).Opaque", Method, 0, ""}, - {"(*Paletted).PixOffset", Method, 0, ""}, - {"(*Paletted).RGBA64At", Method, 17, ""}, - {"(*Paletted).Set", Method, 0, ""}, - {"(*Paletted).SetColorIndex", Method, 0, ""}, - {"(*Paletted).SetRGBA64", Method, 17, ""}, - {"(*Paletted).SubImage", Method, 0, ""}, - {"(*RGBA).At", Method, 0, ""}, - {"(*RGBA).Bounds", Method, 0, ""}, - {"(*RGBA).ColorModel", Method, 0, ""}, - {"(*RGBA).Opaque", Method, 0, ""}, - {"(*RGBA).PixOffset", Method, 0, ""}, - {"(*RGBA).RGBA64At", Method, 17, ""}, - {"(*RGBA).RGBAAt", Method, 4, ""}, - {"(*RGBA).Set", Method, 0, ""}, - {"(*RGBA).SetRGBA", Method, 0, ""}, - {"(*RGBA).SetRGBA64", Method, 17, ""}, - {"(*RGBA).SubImage", Method, 0, ""}, - {"(*RGBA64).At", Method, 0, ""}, - {"(*RGBA64).Bounds", Method, 0, ""}, - {"(*RGBA64).ColorModel", Method, 0, ""}, - {"(*RGBA64).Opaque", Method, 0, ""}, - {"(*RGBA64).PixOffset", Method, 0, ""}, - {"(*RGBA64).RGBA64At", Method, 4, ""}, - {"(*RGBA64).Set", Method, 0, ""}, - {"(*RGBA64).SetRGBA64", Method, 0, ""}, - {"(*RGBA64).SubImage", Method, 0, ""}, - {"(*Uniform).At", Method, 0, ""}, - {"(*Uniform).Bounds", Method, 0, ""}, - {"(*Uniform).ColorModel", Method, 0, ""}, - {"(*Uniform).Convert", Method, 0, ""}, - {"(*Uniform).Opaque", Method, 0, ""}, - {"(*Uniform).RGBA", Method, 0, ""}, - {"(*Uniform).RGBA64At", Method, 17, ""}, - {"(*YCbCr).At", Method, 0, ""}, - {"(*YCbCr).Bounds", Method, 0, ""}, - {"(*YCbCr).COffset", Method, 0, ""}, - {"(*YCbCr).ColorModel", Method, 0, ""}, - {"(*YCbCr).Opaque", Method, 0, ""}, - {"(*YCbCr).RGBA64At", Method, 17, ""}, - {"(*YCbCr).SubImage", Method, 0, ""}, - {"(*YCbCr).YCbCrAt", Method, 4, ""}, - {"(*YCbCr).YOffset", Method, 0, ""}, - {"(Image).At", Method, 0, ""}, - {"(Image).Bounds", Method, 0, ""}, - {"(Image).ColorModel", Method, 0, ""}, - {"(PalettedImage).At", Method, 0, ""}, - {"(PalettedImage).Bounds", Method, 0, ""}, - {"(PalettedImage).ColorIndexAt", Method, 0, ""}, - {"(PalettedImage).ColorModel", Method, 0, ""}, - {"(Point).Add", Method, 0, ""}, - {"(Point).Div", Method, 0, ""}, - {"(Point).Eq", Method, 0, ""}, - {"(Point).In", Method, 0, ""}, - {"(Point).Mod", Method, 0, ""}, - {"(Point).Mul", Method, 0, ""}, - {"(Point).String", Method, 0, ""}, - {"(Point).Sub", Method, 0, ""}, - {"(RGBA64Image).At", Method, 17, ""}, - {"(RGBA64Image).Bounds", Method, 17, ""}, - {"(RGBA64Image).ColorModel", Method, 17, ""}, - {"(RGBA64Image).RGBA64At", Method, 17, ""}, - {"(Rectangle).Add", Method, 0, ""}, - {"(Rectangle).At", Method, 5, ""}, - {"(Rectangle).Bounds", Method, 5, ""}, - {"(Rectangle).Canon", Method, 0, ""}, - {"(Rectangle).ColorModel", Method, 5, ""}, - {"(Rectangle).Dx", Method, 0, ""}, - {"(Rectangle).Dy", Method, 0, ""}, - {"(Rectangle).Empty", Method, 0, ""}, - {"(Rectangle).Eq", Method, 0, ""}, - {"(Rectangle).In", Method, 0, ""}, - {"(Rectangle).Inset", Method, 0, ""}, - {"(Rectangle).Intersect", Method, 0, ""}, - {"(Rectangle).Overlaps", Method, 0, ""}, - {"(Rectangle).RGBA64At", Method, 17, ""}, - {"(Rectangle).Size", Method, 0, ""}, - {"(Rectangle).String", Method, 0, ""}, - {"(Rectangle).Sub", Method, 0, ""}, - {"(Rectangle).Union", Method, 0, ""}, - {"(YCbCrSubsampleRatio).String", Method, 0, ""}, - {"Alpha", Type, 0, ""}, - {"Alpha.Pix", Field, 0, ""}, - {"Alpha.Rect", Field, 0, ""}, - {"Alpha.Stride", Field, 0, ""}, - {"Alpha16", Type, 0, ""}, - {"Alpha16.Pix", Field, 0, ""}, - {"Alpha16.Rect", Field, 0, ""}, - {"Alpha16.Stride", Field, 0, ""}, - {"Black", Var, 0, ""}, - {"CMYK", Type, 5, ""}, - {"CMYK.Pix", Field, 5, ""}, - {"CMYK.Rect", Field, 5, ""}, - {"CMYK.Stride", Field, 5, ""}, - {"Config", Type, 0, ""}, - {"Config.ColorModel", Field, 0, ""}, - {"Config.Height", Field, 0, ""}, - {"Config.Width", Field, 0, ""}, - {"Decode", Func, 0, "func(r io.Reader) (Image, string, error)"}, - {"DecodeConfig", Func, 0, "func(r io.Reader) (Config, string, error)"}, - {"ErrFormat", Var, 0, ""}, - {"Gray", Type, 0, ""}, - {"Gray.Pix", Field, 0, ""}, - {"Gray.Rect", Field, 0, ""}, - {"Gray.Stride", Field, 0, ""}, - {"Gray16", Type, 0, ""}, - {"Gray16.Pix", Field, 0, ""}, - {"Gray16.Rect", Field, 0, ""}, - {"Gray16.Stride", Field, 0, ""}, - {"Image", Type, 0, ""}, - {"NRGBA", Type, 0, ""}, - {"NRGBA.Pix", Field, 0, ""}, - {"NRGBA.Rect", Field, 0, ""}, - {"NRGBA.Stride", Field, 0, ""}, - {"NRGBA64", Type, 0, ""}, - {"NRGBA64.Pix", Field, 0, ""}, - {"NRGBA64.Rect", Field, 0, ""}, - {"NRGBA64.Stride", Field, 0, ""}, - {"NYCbCrA", Type, 6, ""}, - {"NYCbCrA.A", Field, 6, ""}, - {"NYCbCrA.AStride", Field, 6, ""}, - {"NYCbCrA.YCbCr", Field, 6, ""}, - {"NewAlpha", Func, 0, "func(r Rectangle) *Alpha"}, - {"NewAlpha16", Func, 0, "func(r Rectangle) *Alpha16"}, - {"NewCMYK", Func, 5, "func(r Rectangle) *CMYK"}, - {"NewGray", Func, 0, "func(r Rectangle) *Gray"}, - {"NewGray16", Func, 0, "func(r Rectangle) *Gray16"}, - {"NewNRGBA", Func, 0, "func(r Rectangle) *NRGBA"}, - {"NewNRGBA64", Func, 0, "func(r Rectangle) *NRGBA64"}, - {"NewNYCbCrA", Func, 6, "func(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA"}, - {"NewPaletted", Func, 0, "func(r Rectangle, p color.Palette) *Paletted"}, - {"NewRGBA", Func, 0, "func(r Rectangle) *RGBA"}, - {"NewRGBA64", Func, 0, "func(r Rectangle) *RGBA64"}, - {"NewUniform", Func, 0, "func(c color.Color) *Uniform"}, - {"NewYCbCr", Func, 0, "func(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr"}, - {"Opaque", Var, 0, ""}, - {"Paletted", Type, 0, ""}, - {"Paletted.Palette", Field, 0, ""}, - {"Paletted.Pix", Field, 0, ""}, - {"Paletted.Rect", Field, 0, ""}, - {"Paletted.Stride", Field, 0, ""}, - {"PalettedImage", Type, 0, ""}, - {"Point", Type, 0, ""}, - {"Point.X", Field, 0, ""}, - {"Point.Y", Field, 0, ""}, - {"Pt", Func, 0, "func(X int, Y int) Point"}, - {"RGBA", Type, 0, ""}, - {"RGBA.Pix", Field, 0, ""}, - {"RGBA.Rect", Field, 0, ""}, - {"RGBA.Stride", Field, 0, ""}, - {"RGBA64", Type, 0, ""}, - {"RGBA64.Pix", Field, 0, ""}, - {"RGBA64.Rect", Field, 0, ""}, - {"RGBA64.Stride", Field, 0, ""}, - {"RGBA64Image", Type, 17, ""}, - {"Rect", Func, 0, "func(x0 int, y0 int, x1 int, y1 int) Rectangle"}, - {"Rectangle", Type, 0, ""}, - {"Rectangle.Max", Field, 0, ""}, - {"Rectangle.Min", Field, 0, ""}, - {"RegisterFormat", Func, 0, "func(name string, magic string, decode func(io.Reader) (Image, error), decodeConfig func(io.Reader) (Config, error))"}, - {"Transparent", Var, 0, ""}, - {"Uniform", Type, 0, ""}, - {"Uniform.C", Field, 0, ""}, - {"White", Var, 0, ""}, - {"YCbCr", Type, 0, ""}, - {"YCbCr.CStride", Field, 0, ""}, - {"YCbCr.Cb", Field, 0, ""}, - {"YCbCr.Cr", Field, 0, ""}, - {"YCbCr.Rect", Field, 0, ""}, - {"YCbCr.SubsampleRatio", Field, 0, ""}, - {"YCbCr.Y", Field, 0, ""}, - {"YCbCr.YStride", Field, 0, ""}, - {"YCbCrSubsampleRatio", Type, 0, ""}, - {"YCbCrSubsampleRatio410", Const, 5, ""}, - {"YCbCrSubsampleRatio411", Const, 5, ""}, - {"YCbCrSubsampleRatio420", Const, 0, ""}, - {"YCbCrSubsampleRatio422", Const, 0, ""}, - {"YCbCrSubsampleRatio440", Const, 1, ""}, - {"YCbCrSubsampleRatio444", Const, 0, ""}, - {"ZP", Var, 0, ""}, - {"ZR", Var, 0, ""}, - }, - "image/color": { - {"(Alpha).RGBA", Method, 0, ""}, - {"(Alpha16).RGBA", Method, 0, ""}, - {"(CMYK).RGBA", Method, 5, ""}, - {"(Color).RGBA", Method, 0, ""}, - {"(Gray).RGBA", Method, 0, ""}, - {"(Gray16).RGBA", Method, 0, ""}, - {"(Model).Convert", Method, 0, ""}, - {"(NRGBA).RGBA", Method, 0, ""}, - {"(NRGBA64).RGBA", Method, 0, ""}, - {"(NYCbCrA).RGBA", Method, 6, ""}, - {"(Palette).Convert", Method, 0, ""}, - {"(Palette).Index", Method, 0, ""}, - {"(RGBA).RGBA", Method, 0, ""}, - {"(RGBA64).RGBA", Method, 0, ""}, - {"(YCbCr).RGBA", Method, 0, ""}, - {"Alpha", Type, 0, ""}, - {"Alpha.A", Field, 0, ""}, - {"Alpha16", Type, 0, ""}, - {"Alpha16.A", Field, 0, ""}, - {"Alpha16Model", Var, 0, ""}, - {"AlphaModel", Var, 0, ""}, - {"Black", Var, 0, ""}, - {"CMYK", Type, 5, ""}, - {"CMYK.C", Field, 5, ""}, - {"CMYK.K", Field, 5, ""}, - {"CMYK.M", Field, 5, ""}, - {"CMYK.Y", Field, 5, ""}, - {"CMYKModel", Var, 5, ""}, - {"CMYKToRGB", Func, 5, "func(c uint8, m uint8, y uint8, k uint8) (uint8, uint8, uint8)"}, - {"Color", Type, 0, ""}, - {"Gray", Type, 0, ""}, - {"Gray.Y", Field, 0, ""}, - {"Gray16", Type, 0, ""}, - {"Gray16.Y", Field, 0, ""}, - {"Gray16Model", Var, 0, ""}, - {"GrayModel", Var, 0, ""}, - {"Model", Type, 0, ""}, - {"ModelFunc", Func, 0, "func(f func(Color) Color) Model"}, - {"NRGBA", Type, 0, ""}, - {"NRGBA.A", Field, 0, ""}, - {"NRGBA.B", Field, 0, ""}, - {"NRGBA.G", Field, 0, ""}, - {"NRGBA.R", Field, 0, ""}, - {"NRGBA64", Type, 0, ""}, - {"NRGBA64.A", Field, 0, ""}, - {"NRGBA64.B", Field, 0, ""}, - {"NRGBA64.G", Field, 0, ""}, - {"NRGBA64.R", Field, 0, ""}, - {"NRGBA64Model", Var, 0, ""}, - {"NRGBAModel", Var, 0, ""}, - {"NYCbCrA", Type, 6, ""}, - {"NYCbCrA.A", Field, 6, ""}, - {"NYCbCrA.YCbCr", Field, 6, ""}, - {"NYCbCrAModel", Var, 6, ""}, - {"Opaque", Var, 0, ""}, - {"Palette", Type, 0, ""}, - {"RGBA", Type, 0, ""}, - {"RGBA.A", Field, 0, ""}, - {"RGBA.B", Field, 0, ""}, - {"RGBA.G", Field, 0, ""}, - {"RGBA.R", Field, 0, ""}, - {"RGBA64", Type, 0, ""}, - {"RGBA64.A", Field, 0, ""}, - {"RGBA64.B", Field, 0, ""}, - {"RGBA64.G", Field, 0, ""}, - {"RGBA64.R", Field, 0, ""}, - {"RGBA64Model", Var, 0, ""}, - {"RGBAModel", Var, 0, ""}, - {"RGBToCMYK", Func, 5, "func(r uint8, g uint8, b uint8) (uint8, uint8, uint8, uint8)"}, - {"RGBToYCbCr", Func, 0, "func(r uint8, g uint8, b uint8) (uint8, uint8, uint8)"}, - {"Transparent", Var, 0, ""}, - {"White", Var, 0, ""}, - {"YCbCr", Type, 0, ""}, - {"YCbCr.Cb", Field, 0, ""}, - {"YCbCr.Cr", Field, 0, ""}, - {"YCbCr.Y", Field, 0, ""}, - {"YCbCrModel", Var, 0, ""}, - {"YCbCrToRGB", Func, 0, "func(y uint8, cb uint8, cr uint8) (uint8, uint8, uint8)"}, - }, - "image/color/palette": { - {"Plan9", Var, 2, ""}, - {"WebSafe", Var, 2, ""}, - }, - "image/draw": { - {"(Drawer).Draw", Method, 2, ""}, - {"(Image).At", Method, 0, ""}, - {"(Image).Bounds", Method, 0, ""}, - {"(Image).ColorModel", Method, 0, ""}, - {"(Image).Set", Method, 0, ""}, - {"(Op).Draw", Method, 2, ""}, - {"(Quantizer).Quantize", Method, 2, ""}, - {"(RGBA64Image).At", Method, 17, ""}, - {"(RGBA64Image).Bounds", Method, 17, ""}, - {"(RGBA64Image).ColorModel", Method, 17, ""}, - {"(RGBA64Image).RGBA64At", Method, 17, ""}, - {"(RGBA64Image).Set", Method, 17, ""}, - {"(RGBA64Image).SetRGBA64", Method, 17, ""}, - {"Draw", Func, 0, "func(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)"}, - {"DrawMask", Func, 0, "func(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)"}, - {"Drawer", Type, 2, ""}, - {"FloydSteinberg", Var, 2, ""}, - {"Image", Type, 0, ""}, - {"Op", Type, 0, ""}, - {"Over", Const, 0, ""}, - {"Quantizer", Type, 2, ""}, - {"RGBA64Image", Type, 17, ""}, - {"Src", Const, 0, ""}, - }, - "image/gif": { - {"Decode", Func, 0, "func(r io.Reader) (image.Image, error)"}, - {"DecodeAll", Func, 0, "func(r io.Reader) (*GIF, error)"}, - {"DecodeConfig", Func, 0, "func(r io.Reader) (image.Config, error)"}, - {"DisposalBackground", Const, 5, ""}, - {"DisposalNone", Const, 5, ""}, - {"DisposalPrevious", Const, 5, ""}, - {"Encode", Func, 2, "func(w io.Writer, m image.Image, o *Options) error"}, - {"EncodeAll", Func, 2, "func(w io.Writer, g *GIF) error"}, - {"GIF", Type, 0, ""}, - {"GIF.BackgroundIndex", Field, 5, ""}, - {"GIF.Config", Field, 5, ""}, - {"GIF.Delay", Field, 0, ""}, - {"GIF.Disposal", Field, 5, ""}, - {"GIF.Image", Field, 0, ""}, - {"GIF.LoopCount", Field, 0, ""}, - {"Options", Type, 2, ""}, - {"Options.Drawer", Field, 2, ""}, - {"Options.NumColors", Field, 2, ""}, - {"Options.Quantizer", Field, 2, ""}, - }, - "image/jpeg": { - {"(FormatError).Error", Method, 0, ""}, - {"(Reader).Read", Method, 0, ""}, - {"(Reader).ReadByte", Method, 0, ""}, - {"(UnsupportedError).Error", Method, 0, ""}, - {"Decode", Func, 0, "func(r io.Reader) (image.Image, error)"}, - {"DecodeConfig", Func, 0, "func(r io.Reader) (image.Config, error)"}, - {"DefaultQuality", Const, 0, ""}, - {"Encode", Func, 0, "func(w io.Writer, m image.Image, o *Options) error"}, - {"FormatError", Type, 0, ""}, - {"Options", Type, 0, ""}, - {"Options.Quality", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"UnsupportedError", Type, 0, ""}, - }, - "image/png": { - {"(*Encoder).Encode", Method, 4, ""}, - {"(EncoderBufferPool).Get", Method, 9, ""}, - {"(EncoderBufferPool).Put", Method, 9, ""}, - {"(FormatError).Error", Method, 0, ""}, - {"(UnsupportedError).Error", Method, 0, ""}, - {"BestCompression", Const, 4, ""}, - {"BestSpeed", Const, 4, ""}, - {"CompressionLevel", Type, 4, ""}, - {"Decode", Func, 0, "func(r io.Reader) (image.Image, error)"}, - {"DecodeConfig", Func, 0, "func(r io.Reader) (image.Config, error)"}, - {"DefaultCompression", Const, 4, ""}, - {"Encode", Func, 0, "func(w io.Writer, m image.Image) error"}, - {"Encoder", Type, 4, ""}, - {"Encoder.BufferPool", Field, 9, ""}, - {"Encoder.CompressionLevel", Field, 4, ""}, - {"EncoderBuffer", Type, 9, ""}, - {"EncoderBufferPool", Type, 9, ""}, - {"FormatError", Type, 0, ""}, - {"NoCompression", Const, 4, ""}, - {"UnsupportedError", Type, 0, ""}, - }, - "index/suffixarray": { - {"(*Index).Bytes", Method, 0, ""}, - {"(*Index).FindAllIndex", Method, 0, ""}, - {"(*Index).Lookup", Method, 0, ""}, - {"(*Index).Read", Method, 0, ""}, - {"(*Index).Write", Method, 0, ""}, - {"Index", Type, 0, ""}, - {"New", Func, 0, "func(data []byte) *Index"}, - }, - "io": { - {"(*LimitedReader).Read", Method, 0, ""}, - {"(*OffsetWriter).Seek", Method, 20, ""}, - {"(*OffsetWriter).Write", Method, 20, ""}, - {"(*OffsetWriter).WriteAt", Method, 20, ""}, - {"(*PipeReader).Close", Method, 0, ""}, - {"(*PipeReader).CloseWithError", Method, 0, ""}, - {"(*PipeReader).Read", Method, 0, ""}, - {"(*PipeWriter).Close", Method, 0, ""}, - {"(*PipeWriter).CloseWithError", Method, 0, ""}, - {"(*PipeWriter).Write", Method, 0, ""}, - {"(*SectionReader).Outer", Method, 22, ""}, - {"(*SectionReader).Read", Method, 0, ""}, - {"(*SectionReader).ReadAt", Method, 0, ""}, - {"(*SectionReader).Seek", Method, 0, ""}, - {"(*SectionReader).Size", Method, 0, ""}, - {"(ByteReader).ReadByte", Method, 0, ""}, - {"(ByteScanner).ReadByte", Method, 0, ""}, - {"(ByteScanner).UnreadByte", Method, 0, ""}, - {"(ByteWriter).WriteByte", Method, 1, ""}, - {"(Closer).Close", Method, 0, ""}, - {"(ReadCloser).Close", Method, 0, ""}, - {"(ReadCloser).Read", Method, 0, ""}, - {"(ReadSeekCloser).Close", Method, 16, ""}, - {"(ReadSeekCloser).Read", Method, 16, ""}, - {"(ReadSeekCloser).Seek", Method, 16, ""}, - {"(ReadSeeker).Read", Method, 0, ""}, - {"(ReadSeeker).Seek", Method, 0, ""}, - {"(ReadWriteCloser).Close", Method, 0, ""}, - {"(ReadWriteCloser).Read", Method, 0, ""}, - {"(ReadWriteCloser).Write", Method, 0, ""}, - {"(ReadWriteSeeker).Read", Method, 0, ""}, - {"(ReadWriteSeeker).Seek", Method, 0, ""}, - {"(ReadWriteSeeker).Write", Method, 0, ""}, - {"(ReadWriter).Read", Method, 0, ""}, - {"(ReadWriter).Write", Method, 0, ""}, - {"(Reader).Read", Method, 0, ""}, - {"(ReaderAt).ReadAt", Method, 0, ""}, - {"(ReaderFrom).ReadFrom", Method, 0, ""}, - {"(RuneReader).ReadRune", Method, 0, ""}, - {"(RuneScanner).ReadRune", Method, 0, ""}, - {"(RuneScanner).UnreadRune", Method, 0, ""}, - {"(Seeker).Seek", Method, 0, ""}, - {"(StringWriter).WriteString", Method, 12, ""}, - {"(WriteCloser).Close", Method, 0, ""}, - {"(WriteCloser).Write", Method, 0, ""}, - {"(WriteSeeker).Seek", Method, 0, ""}, - {"(WriteSeeker).Write", Method, 0, ""}, - {"(Writer).Write", Method, 0, ""}, - {"(WriterAt).WriteAt", Method, 0, ""}, - {"(WriterTo).WriteTo", Method, 0, ""}, - {"ByteReader", Type, 0, ""}, - {"ByteScanner", Type, 0, ""}, - {"ByteWriter", Type, 1, ""}, - {"Closer", Type, 0, ""}, - {"Copy", Func, 0, "func(dst Writer, src Reader) (written int64, err error)"}, - {"CopyBuffer", Func, 5, "func(dst Writer, src Reader, buf []byte) (written int64, err error)"}, - {"CopyN", Func, 0, "func(dst Writer, src Reader, n int64) (written int64, err error)"}, - {"Discard", Var, 16, ""}, - {"EOF", Var, 0, ""}, - {"ErrClosedPipe", Var, 0, ""}, - {"ErrNoProgress", Var, 1, ""}, - {"ErrShortBuffer", Var, 0, ""}, - {"ErrShortWrite", Var, 0, ""}, - {"ErrUnexpectedEOF", Var, 0, ""}, - {"LimitReader", Func, 0, "func(r Reader, n int64) Reader"}, - {"LimitedReader", Type, 0, ""}, - {"LimitedReader.N", Field, 0, ""}, - {"LimitedReader.R", Field, 0, ""}, - {"MultiReader", Func, 0, "func(readers ...Reader) Reader"}, - {"MultiWriter", Func, 0, "func(writers ...Writer) Writer"}, - {"NewOffsetWriter", Func, 20, "func(w WriterAt, off int64) *OffsetWriter"}, - {"NewSectionReader", Func, 0, "func(r ReaderAt, off int64, n int64) *SectionReader"}, - {"NopCloser", Func, 16, "func(r Reader) ReadCloser"}, - {"OffsetWriter", Type, 20, ""}, - {"Pipe", Func, 0, "func() (*PipeReader, *PipeWriter)"}, - {"PipeReader", Type, 0, ""}, - {"PipeWriter", Type, 0, ""}, - {"ReadAll", Func, 16, "func(r Reader) ([]byte, error)"}, - {"ReadAtLeast", Func, 0, "func(r Reader, buf []byte, min int) (n int, err error)"}, - {"ReadCloser", Type, 0, ""}, - {"ReadFull", Func, 0, "func(r Reader, buf []byte) (n int, err error)"}, - {"ReadSeekCloser", Type, 16, ""}, - {"ReadSeeker", Type, 0, ""}, - {"ReadWriteCloser", Type, 0, ""}, - {"ReadWriteSeeker", Type, 0, ""}, - {"ReadWriter", Type, 0, ""}, - {"Reader", Type, 0, ""}, - {"ReaderAt", Type, 0, ""}, - {"ReaderFrom", Type, 0, ""}, - {"RuneReader", Type, 0, ""}, - {"RuneScanner", Type, 0, ""}, - {"SectionReader", Type, 0, ""}, - {"SeekCurrent", Const, 7, ""}, - {"SeekEnd", Const, 7, ""}, - {"SeekStart", Const, 7, ""}, - {"Seeker", Type, 0, ""}, - {"StringWriter", Type, 12, ""}, - {"TeeReader", Func, 0, "func(r Reader, w Writer) Reader"}, - {"WriteCloser", Type, 0, ""}, - {"WriteSeeker", Type, 0, ""}, - {"WriteString", Func, 0, "func(w Writer, s string) (n int, err error)"}, - {"Writer", Type, 0, ""}, - {"WriterAt", Type, 0, ""}, - {"WriterTo", Type, 0, ""}, - }, - "io/fs": { - {"(*PathError).Error", Method, 16, ""}, - {"(*PathError).Timeout", Method, 16, ""}, - {"(*PathError).Unwrap", Method, 16, ""}, - {"(DirEntry).Info", Method, 16, ""}, - {"(DirEntry).IsDir", Method, 16, ""}, - {"(DirEntry).Name", Method, 16, ""}, - {"(DirEntry).Type", Method, 16, ""}, - {"(FS).Open", Method, 16, ""}, - {"(File).Close", Method, 16, ""}, - {"(File).Read", Method, 16, ""}, - {"(File).Stat", Method, 16, ""}, - {"(FileInfo).IsDir", Method, 16, ""}, - {"(FileInfo).ModTime", Method, 16, ""}, - {"(FileInfo).Mode", Method, 16, ""}, - {"(FileInfo).Name", Method, 16, ""}, - {"(FileInfo).Size", Method, 16, ""}, - {"(FileInfo).Sys", Method, 16, ""}, - {"(FileMode).IsDir", Method, 16, ""}, - {"(FileMode).IsRegular", Method, 16, ""}, - {"(FileMode).Perm", Method, 16, ""}, - {"(FileMode).String", Method, 16, ""}, - {"(FileMode).Type", Method, 16, ""}, - {"(GlobFS).Glob", Method, 16, ""}, - {"(GlobFS).Open", Method, 16, ""}, - {"(ReadDirFS).Open", Method, 16, ""}, - {"(ReadDirFS).ReadDir", Method, 16, ""}, - {"(ReadDirFile).Close", Method, 16, ""}, - {"(ReadDirFile).Read", Method, 16, ""}, - {"(ReadDirFile).ReadDir", Method, 16, ""}, - {"(ReadDirFile).Stat", Method, 16, ""}, - {"(ReadFileFS).Open", Method, 16, ""}, - {"(ReadFileFS).ReadFile", Method, 16, ""}, - {"(ReadLinkFS).Lstat", Method, 25, ""}, - {"(ReadLinkFS).Open", Method, 25, ""}, - {"(ReadLinkFS).ReadLink", Method, 25, ""}, - {"(StatFS).Open", Method, 16, ""}, - {"(StatFS).Stat", Method, 16, ""}, - {"(SubFS).Open", Method, 16, ""}, - {"(SubFS).Sub", Method, 16, ""}, - {"DirEntry", Type, 16, ""}, - {"ErrClosed", Var, 16, ""}, - {"ErrExist", Var, 16, ""}, - {"ErrInvalid", Var, 16, ""}, - {"ErrNotExist", Var, 16, ""}, - {"ErrPermission", Var, 16, ""}, - {"FS", Type, 16, ""}, - {"File", Type, 16, ""}, - {"FileInfo", Type, 16, ""}, - {"FileInfoToDirEntry", Func, 17, "func(info FileInfo) DirEntry"}, - {"FileMode", Type, 16, ""}, - {"FormatDirEntry", Func, 21, "func(dir DirEntry) string"}, - {"FormatFileInfo", Func, 21, "func(info FileInfo) string"}, - {"Glob", Func, 16, "func(fsys FS, pattern string) (matches []string, err error)"}, - {"GlobFS", Type, 16, ""}, - {"Lstat", Func, 25, "func(fsys FS, name string) (FileInfo, error)"}, - {"ModeAppend", Const, 16, ""}, - {"ModeCharDevice", Const, 16, ""}, - {"ModeDevice", Const, 16, ""}, - {"ModeDir", Const, 16, ""}, - {"ModeExclusive", Const, 16, ""}, - {"ModeIrregular", Const, 16, ""}, - {"ModeNamedPipe", Const, 16, ""}, - {"ModePerm", Const, 16, ""}, - {"ModeSetgid", Const, 16, ""}, - {"ModeSetuid", Const, 16, ""}, - {"ModeSocket", Const, 16, ""}, - {"ModeSticky", Const, 16, ""}, - {"ModeSymlink", Const, 16, ""}, - {"ModeTemporary", Const, 16, ""}, - {"ModeType", Const, 16, ""}, - {"PathError", Type, 16, ""}, - {"PathError.Err", Field, 16, ""}, - {"PathError.Op", Field, 16, ""}, - {"PathError.Path", Field, 16, ""}, - {"ReadDir", Func, 16, "func(fsys FS, name string) ([]DirEntry, error)"}, - {"ReadDirFS", Type, 16, ""}, - {"ReadDirFile", Type, 16, ""}, - {"ReadFile", Func, 16, "func(fsys FS, name string) ([]byte, error)"}, - {"ReadFileFS", Type, 16, ""}, - {"ReadLink", Func, 25, "func(fsys FS, name string) (string, error)"}, - {"ReadLinkFS", Type, 25, ""}, - {"SkipAll", Var, 20, ""}, - {"SkipDir", Var, 16, ""}, - {"Stat", Func, 16, "func(fsys FS, name string) (FileInfo, error)"}, - {"StatFS", Type, 16, ""}, - {"Sub", Func, 16, "func(fsys FS, dir string) (FS, error)"}, - {"SubFS", Type, 16, ""}, - {"ValidPath", Func, 16, "func(name string) bool"}, - {"WalkDir", Func, 16, "func(fsys FS, root string, fn WalkDirFunc) error"}, - {"WalkDirFunc", Type, 16, ""}, - }, - "io/ioutil": { - {"Discard", Var, 0, ""}, - {"NopCloser", Func, 0, "func(r io.Reader) io.ReadCloser"}, - {"ReadAll", Func, 0, "func(r io.Reader) ([]byte, error)"}, - {"ReadDir", Func, 0, "func(dirname string) ([]fs.FileInfo, error)"}, - {"ReadFile", Func, 0, "func(filename string) ([]byte, error)"}, - {"TempDir", Func, 0, "func(dir string, pattern string) (name string, err error)"}, - {"TempFile", Func, 0, "func(dir string, pattern string) (f *os.File, err error)"}, - {"WriteFile", Func, 0, "func(filename string, data []byte, perm fs.FileMode) error"}, - }, - "iter": { - {"Pull", Func, 23, "func[V any](seq Seq[V]) (next func() (V, bool), stop func())"}, - {"Pull2", Func, 23, "func[K, V any](seq Seq2[K, V]) (next func() (K, V, bool), stop func())"}, - {"Seq", Type, 23, ""}, - {"Seq2", Type, 23, ""}, - }, - "log": { - {"(*Logger).Fatal", Method, 0, ""}, - {"(*Logger).Fatalf", Method, 0, ""}, - {"(*Logger).Fatalln", Method, 0, ""}, - {"(*Logger).Flags", Method, 0, ""}, - {"(*Logger).Output", Method, 0, ""}, - {"(*Logger).Panic", Method, 0, ""}, - {"(*Logger).Panicf", Method, 0, ""}, - {"(*Logger).Panicln", Method, 0, ""}, - {"(*Logger).Prefix", Method, 0, ""}, - {"(*Logger).Print", Method, 0, ""}, - {"(*Logger).Printf", Method, 0, ""}, - {"(*Logger).Println", Method, 0, ""}, - {"(*Logger).SetFlags", Method, 0, ""}, - {"(*Logger).SetOutput", Method, 5, ""}, - {"(*Logger).SetPrefix", Method, 0, ""}, - {"(*Logger).Writer", Method, 12, ""}, - {"Default", Func, 16, "func() *Logger"}, - {"Fatal", Func, 0, "func(v ...any)"}, - {"Fatalf", Func, 0, "func(format string, v ...any)"}, - {"Fatalln", Func, 0, "func(v ...any)"}, - {"Flags", Func, 0, "func() int"}, - {"LUTC", Const, 5, ""}, - {"Ldate", Const, 0, ""}, - {"Llongfile", Const, 0, ""}, - {"Lmicroseconds", Const, 0, ""}, - {"Lmsgprefix", Const, 14, ""}, - {"Logger", Type, 0, ""}, - {"Lshortfile", Const, 0, ""}, - {"LstdFlags", Const, 0, ""}, - {"Ltime", Const, 0, ""}, - {"New", Func, 0, "func(out io.Writer, prefix string, flag int) *Logger"}, - {"Output", Func, 5, "func(calldepth int, s string) error"}, - {"Panic", Func, 0, "func(v ...any)"}, - {"Panicf", Func, 0, "func(format string, v ...any)"}, - {"Panicln", Func, 0, "func(v ...any)"}, - {"Prefix", Func, 0, "func() string"}, - {"Print", Func, 0, "func(v ...any)"}, - {"Printf", Func, 0, "func(format string, v ...any)"}, - {"Println", Func, 0, "func(v ...any)"}, - {"SetFlags", Func, 0, "func(flag int)"}, - {"SetOutput", Func, 0, "func(w io.Writer)"}, - {"SetPrefix", Func, 0, "func(prefix string)"}, - {"Writer", Func, 13, "func() io.Writer"}, - }, - "log/slog": { - {"(*JSONHandler).Enabled", Method, 21, ""}, - {"(*JSONHandler).Handle", Method, 21, ""}, - {"(*JSONHandler).WithAttrs", Method, 21, ""}, - {"(*JSONHandler).WithGroup", Method, 21, ""}, - {"(*Level).UnmarshalJSON", Method, 21, ""}, - {"(*Level).UnmarshalText", Method, 21, ""}, - {"(*LevelVar).AppendText", Method, 24, ""}, - {"(*LevelVar).Level", Method, 21, ""}, - {"(*LevelVar).MarshalText", Method, 21, ""}, - {"(*LevelVar).Set", Method, 21, ""}, - {"(*LevelVar).String", Method, 21, ""}, - {"(*LevelVar).UnmarshalText", Method, 21, ""}, - {"(*Logger).Debug", Method, 21, ""}, - {"(*Logger).DebugContext", Method, 21, ""}, - {"(*Logger).Enabled", Method, 21, ""}, - {"(*Logger).Error", Method, 21, ""}, - {"(*Logger).ErrorContext", Method, 21, ""}, - {"(*Logger).Handler", Method, 21, ""}, - {"(*Logger).Info", Method, 21, ""}, - {"(*Logger).InfoContext", Method, 21, ""}, - {"(*Logger).Log", Method, 21, ""}, - {"(*Logger).LogAttrs", Method, 21, ""}, - {"(*Logger).Warn", Method, 21, ""}, - {"(*Logger).WarnContext", Method, 21, ""}, - {"(*Logger).With", Method, 21, ""}, - {"(*Logger).WithGroup", Method, 21, ""}, - {"(*MultiHandler).Enabled", Method, 26, ""}, - {"(*MultiHandler).Handle", Method, 26, ""}, - {"(*MultiHandler).WithAttrs", Method, 26, ""}, - {"(*MultiHandler).WithGroup", Method, 26, ""}, - {"(*Record).Add", Method, 21, ""}, - {"(*Record).AddAttrs", Method, 21, ""}, - {"(*TextHandler).Enabled", Method, 21, ""}, - {"(*TextHandler).Handle", Method, 21, ""}, - {"(*TextHandler).WithAttrs", Method, 21, ""}, - {"(*TextHandler).WithGroup", Method, 21, ""}, - {"(Attr).Equal", Method, 21, ""}, - {"(Attr).String", Method, 21, ""}, - {"(Handler).Enabled", Method, 21, ""}, - {"(Handler).Handle", Method, 21, ""}, - {"(Handler).WithAttrs", Method, 21, ""}, - {"(Handler).WithGroup", Method, 21, ""}, - {"(Kind).String", Method, 21, ""}, - {"(Level).AppendText", Method, 24, ""}, - {"(Level).Level", Method, 21, ""}, - {"(Level).MarshalJSON", Method, 21, ""}, - {"(Level).MarshalText", Method, 21, ""}, - {"(Level).String", Method, 21, ""}, - {"(Leveler).Level", Method, 21, ""}, - {"(LogValuer).LogValue", Method, 21, ""}, - {"(Record).Attrs", Method, 21, ""}, - {"(Record).Clone", Method, 21, ""}, - {"(Record).NumAttrs", Method, 21, ""}, - {"(Record).Source", Method, 25, ""}, - {"(Value).Any", Method, 21, ""}, - {"(Value).Bool", Method, 21, ""}, - {"(Value).Duration", Method, 21, ""}, - {"(Value).Equal", Method, 21, ""}, - {"(Value).Float64", Method, 21, ""}, - {"(Value).Group", Method, 21, ""}, - {"(Value).Int64", Method, 21, ""}, - {"(Value).Kind", Method, 21, ""}, - {"(Value).LogValuer", Method, 21, ""}, - {"(Value).Resolve", Method, 21, ""}, - {"(Value).String", Method, 21, ""}, - {"(Value).Time", Method, 21, ""}, - {"(Value).Uint64", Method, 21, ""}, - {"Any", Func, 21, "func(key string, value any) Attr"}, - {"AnyValue", Func, 21, "func(v any) Value"}, - {"Attr", Type, 21, ""}, - {"Attr.Key", Field, 21, ""}, - {"Attr.Value", Field, 21, ""}, - {"Bool", Func, 21, "func(key string, v bool) Attr"}, - {"BoolValue", Func, 21, "func(v bool) Value"}, - {"Debug", Func, 21, "func(msg string, args ...any)"}, - {"DebugContext", Func, 21, "func(ctx context.Context, msg string, args ...any)"}, - {"Default", Func, 21, "func() *Logger"}, - {"DiscardHandler", Var, 24, ""}, - {"Duration", Func, 21, "func(key string, v time.Duration) Attr"}, - {"DurationValue", Func, 21, "func(v time.Duration) Value"}, - {"Error", Func, 21, "func(msg string, args ...any)"}, - {"ErrorContext", Func, 21, "func(ctx context.Context, msg string, args ...any)"}, - {"Float64", Func, 21, "func(key string, v float64) Attr"}, - {"Float64Value", Func, 21, "func(v float64) Value"}, - {"Group", Func, 21, "func(key string, args ...any) Attr"}, - {"GroupAttrs", Func, 25, "func(key string, attrs ...Attr) Attr"}, - {"GroupValue", Func, 21, "func(as ...Attr) Value"}, - {"Handler", Type, 21, ""}, - {"HandlerOptions", Type, 21, ""}, - {"HandlerOptions.AddSource", Field, 21, ""}, - {"HandlerOptions.Level", Field, 21, ""}, - {"HandlerOptions.ReplaceAttr", Field, 21, ""}, - {"Info", Func, 21, "func(msg string, args ...any)"}, - {"InfoContext", Func, 21, "func(ctx context.Context, msg string, args ...any)"}, - {"Int", Func, 21, "func(key string, value int) Attr"}, - {"Int64", Func, 21, "func(key string, value int64) Attr"}, - {"Int64Value", Func, 21, "func(v int64) Value"}, - {"IntValue", Func, 21, "func(v int) Value"}, - {"JSONHandler", Type, 21, ""}, - {"Kind", Type, 21, ""}, - {"KindAny", Const, 21, ""}, - {"KindBool", Const, 21, ""}, - {"KindDuration", Const, 21, ""}, - {"KindFloat64", Const, 21, ""}, - {"KindGroup", Const, 21, ""}, - {"KindInt64", Const, 21, ""}, - {"KindLogValuer", Const, 21, ""}, - {"KindString", Const, 21, ""}, - {"KindTime", Const, 21, ""}, - {"KindUint64", Const, 21, ""}, - {"Level", Type, 21, ""}, - {"LevelDebug", Const, 21, ""}, - {"LevelError", Const, 21, ""}, - {"LevelInfo", Const, 21, ""}, - {"LevelKey", Const, 21, ""}, - {"LevelVar", Type, 21, ""}, - {"LevelWarn", Const, 21, ""}, - {"Leveler", Type, 21, ""}, - {"Log", Func, 21, "func(ctx context.Context, level Level, msg string, args ...any)"}, - {"LogAttrs", Func, 21, "func(ctx context.Context, level Level, msg string, attrs ...Attr)"}, - {"LogValuer", Type, 21, ""}, - {"Logger", Type, 21, ""}, - {"MessageKey", Const, 21, ""}, - {"MultiHandler", Type, 26, ""}, - {"New", Func, 21, "func(h Handler) *Logger"}, - {"NewJSONHandler", Func, 21, "func(w io.Writer, opts *HandlerOptions) *JSONHandler"}, - {"NewLogLogger", Func, 21, "func(h Handler, level Level) *log.Logger"}, - {"NewMultiHandler", Func, 26, "func(handlers ...Handler) *MultiHandler"}, - {"NewRecord", Func, 21, "func(t time.Time, level Level, msg string, pc uintptr) Record"}, - {"NewTextHandler", Func, 21, "func(w io.Writer, opts *HandlerOptions) *TextHandler"}, - {"Record", Type, 21, ""}, - {"Record.Level", Field, 21, ""}, - {"Record.Message", Field, 21, ""}, - {"Record.PC", Field, 21, ""}, - {"Record.Time", Field, 21, ""}, - {"SetDefault", Func, 21, "func(l *Logger)"}, - {"SetLogLoggerLevel", Func, 22, "func(level Level) (oldLevel Level)"}, - {"Source", Type, 21, ""}, - {"Source.File", Field, 21, ""}, - {"Source.Function", Field, 21, ""}, - {"Source.Line", Field, 21, ""}, - {"SourceKey", Const, 21, ""}, - {"String", Func, 21, "func(key string, value string) Attr"}, - {"StringValue", Func, 21, "func(value string) Value"}, - {"TextHandler", Type, 21, ""}, - {"Time", Func, 21, "func(key string, v time.Time) Attr"}, - {"TimeKey", Const, 21, ""}, - {"TimeValue", Func, 21, "func(v time.Time) Value"}, - {"Uint64", Func, 21, "func(key string, v uint64) Attr"}, - {"Uint64Value", Func, 21, "func(v uint64) Value"}, - {"Value", Type, 21, ""}, - {"Warn", Func, 21, "func(msg string, args ...any)"}, - {"WarnContext", Func, 21, "func(ctx context.Context, msg string, args ...any)"}, - {"With", Func, 21, "func(args ...any) *Logger"}, - }, - "log/syslog": { - {"(*Writer).Alert", Method, 0, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).Crit", Method, 0, ""}, - {"(*Writer).Debug", Method, 0, ""}, - {"(*Writer).Emerg", Method, 0, ""}, - {"(*Writer).Err", Method, 0, ""}, - {"(*Writer).Info", Method, 0, ""}, - {"(*Writer).Notice", Method, 0, ""}, - {"(*Writer).Warning", Method, 0, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"Dial", Func, 0, "func(network string, raddr string, priority Priority, tag string) (*Writer, error)"}, - {"LOG_ALERT", Const, 0, ""}, - {"LOG_AUTH", Const, 1, ""}, - {"LOG_AUTHPRIV", Const, 1, ""}, - {"LOG_CRIT", Const, 0, ""}, - {"LOG_CRON", Const, 1, ""}, - {"LOG_DAEMON", Const, 1, ""}, - {"LOG_DEBUG", Const, 0, ""}, - {"LOG_EMERG", Const, 0, ""}, - {"LOG_ERR", Const, 0, ""}, - {"LOG_FTP", Const, 1, ""}, - {"LOG_INFO", Const, 0, ""}, - {"LOG_KERN", Const, 1, ""}, - {"LOG_LOCAL0", Const, 1, ""}, - {"LOG_LOCAL1", Const, 1, ""}, - {"LOG_LOCAL2", Const, 1, ""}, - {"LOG_LOCAL3", Const, 1, ""}, - {"LOG_LOCAL4", Const, 1, ""}, - {"LOG_LOCAL5", Const, 1, ""}, - {"LOG_LOCAL6", Const, 1, ""}, - {"LOG_LOCAL7", Const, 1, ""}, - {"LOG_LPR", Const, 1, ""}, - {"LOG_MAIL", Const, 1, ""}, - {"LOG_NEWS", Const, 1, ""}, - {"LOG_NOTICE", Const, 0, ""}, - {"LOG_SYSLOG", Const, 1, ""}, - {"LOG_USER", Const, 1, ""}, - {"LOG_UUCP", Const, 1, ""}, - {"LOG_WARNING", Const, 0, ""}, - {"New", Func, 0, "func(priority Priority, tag string) (*Writer, error)"}, - {"NewLogger", Func, 0, "func(p Priority, logFlag int) (*log.Logger, error)"}, - {"Priority", Type, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "maps": { - {"All", Func, 23, "func[Map ~map[K]V, K comparable, V any](m Map) iter.Seq2[K, V]"}, - {"Clone", Func, 21, "func[M ~map[K]V, K comparable, V any](m M) M"}, - {"Collect", Func, 23, "func[K comparable, V any](seq iter.Seq2[K, V]) map[K]V"}, - {"Copy", Func, 21, "func[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](dst M1, src M2)"}, - {"DeleteFunc", Func, 21, "func[M ~map[K]V, K comparable, V any](m M, del func(K, V) bool)"}, - {"Equal", Func, 21, "func[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool"}, - {"EqualFunc", Func, 21, "func[M1 ~map[K]V1, M2 ~map[K]V2, K comparable, V1, V2 any](m1 M1, m2 M2, eq func(V1, V2) bool) bool"}, - {"Insert", Func, 23, "func[Map ~map[K]V, K comparable, V any](m Map, seq iter.Seq2[K, V])"}, - {"Keys", Func, 23, "func[Map ~map[K]V, K comparable, V any](m Map) iter.Seq[K]"}, - {"Values", Func, 23, "func[Map ~map[K]V, K comparable, V any](m Map) iter.Seq[V]"}, - }, - "math": { - {"Abs", Func, 0, "func(x float64) float64"}, - {"Acos", Func, 0, "func(x float64) float64"}, - {"Acosh", Func, 0, "func(x float64) float64"}, - {"Asin", Func, 0, "func(x float64) float64"}, - {"Asinh", Func, 0, "func(x float64) float64"}, - {"Atan", Func, 0, "func(x float64) float64"}, - {"Atan2", Func, 0, "func(y float64, x float64) float64"}, - {"Atanh", Func, 0, "func(x float64) float64"}, - {"Cbrt", Func, 0, "func(x float64) float64"}, - {"Ceil", Func, 0, "func(x float64) float64"}, - {"Copysign", Func, 0, "func(f float64, sign float64) float64"}, - {"Cos", Func, 0, "func(x float64) float64"}, - {"Cosh", Func, 0, "func(x float64) float64"}, - {"Dim", Func, 0, "func(x float64, y float64) float64"}, - {"E", Const, 0, ""}, - {"Erf", Func, 0, "func(x float64) float64"}, - {"Erfc", Func, 0, "func(x float64) float64"}, - {"Erfcinv", Func, 10, "func(x float64) float64"}, - {"Erfinv", Func, 10, "func(x float64) float64"}, - {"Exp", Func, 0, "func(x float64) float64"}, - {"Exp2", Func, 0, "func(x float64) float64"}, - {"Expm1", Func, 0, "func(x float64) float64"}, - {"FMA", Func, 14, "func(x float64, y float64, z float64) float64"}, - {"Float32bits", Func, 0, "func(f float32) uint32"}, - {"Float32frombits", Func, 0, "func(b uint32) float32"}, - {"Float64bits", Func, 0, "func(f float64) uint64"}, - {"Float64frombits", Func, 0, "func(b uint64) float64"}, - {"Floor", Func, 0, "func(x float64) float64"}, - {"Frexp", Func, 0, "func(f float64) (frac float64, exp int)"}, - {"Gamma", Func, 0, "func(x float64) float64"}, - {"Hypot", Func, 0, "func(p float64, q float64) float64"}, - {"Ilogb", Func, 0, "func(x float64) int"}, - {"Inf", Func, 0, "func(sign int) float64"}, - {"IsInf", Func, 0, "func(f float64, sign int) bool"}, - {"IsNaN", Func, 0, "func(f float64) (is bool)"}, - {"J0", Func, 0, "func(x float64) float64"}, - {"J1", Func, 0, "func(x float64) float64"}, - {"Jn", Func, 0, "func(n int, x float64) float64"}, - {"Ldexp", Func, 0, "func(frac float64, exp int) float64"}, - {"Lgamma", Func, 0, "func(x float64) (lgamma float64, sign int)"}, - {"Ln10", Const, 0, ""}, - {"Ln2", Const, 0, ""}, - {"Log", Func, 0, "func(x float64) float64"}, - {"Log10", Func, 0, "func(x float64) float64"}, - {"Log10E", Const, 0, ""}, - {"Log1p", Func, 0, "func(x float64) float64"}, - {"Log2", Func, 0, "func(x float64) float64"}, - {"Log2E", Const, 0, ""}, - {"Logb", Func, 0, "func(x float64) float64"}, - {"Max", Func, 0, "func(x float64, y float64) float64"}, - {"MaxFloat32", Const, 0, ""}, - {"MaxFloat64", Const, 0, ""}, - {"MaxInt", Const, 17, ""}, - {"MaxInt16", Const, 0, ""}, - {"MaxInt32", Const, 0, ""}, - {"MaxInt64", Const, 0, ""}, - {"MaxInt8", Const, 0, ""}, - {"MaxUint", Const, 17, ""}, - {"MaxUint16", Const, 0, ""}, - {"MaxUint32", Const, 0, ""}, - {"MaxUint64", Const, 0, ""}, - {"MaxUint8", Const, 0, ""}, - {"Min", Func, 0, "func(x float64, y float64) float64"}, - {"MinInt", Const, 17, ""}, - {"MinInt16", Const, 0, ""}, - {"MinInt32", Const, 0, ""}, - {"MinInt64", Const, 0, ""}, - {"MinInt8", Const, 0, ""}, - {"Mod", Func, 0, "func(x float64, y float64) float64"}, - {"Modf", Func, 0, "func(f float64) (integer float64, fractional float64)"}, - {"NaN", Func, 0, "func() float64"}, - {"Nextafter", Func, 0, "func(x float64, y float64) (r float64)"}, - {"Nextafter32", Func, 4, "func(x float32, y float32) (r float32)"}, - {"Phi", Const, 0, ""}, - {"Pi", Const, 0, ""}, - {"Pow", Func, 0, "func(x float64, y float64) float64"}, - {"Pow10", Func, 0, "func(n int) float64"}, - {"Remainder", Func, 0, "func(x float64, y float64) float64"}, - {"Round", Func, 10, "func(x float64) float64"}, - {"RoundToEven", Func, 10, "func(x float64) float64"}, - {"Signbit", Func, 0, "func(x float64) bool"}, - {"Sin", Func, 0, "func(x float64) float64"}, - {"Sincos", Func, 0, "func(x float64) (sin float64, cos float64)"}, - {"Sinh", Func, 0, "func(x float64) float64"}, - {"SmallestNonzeroFloat32", Const, 0, ""}, - {"SmallestNonzeroFloat64", Const, 0, ""}, - {"Sqrt", Func, 0, "func(x float64) float64"}, - {"Sqrt2", Const, 0, ""}, - {"SqrtE", Const, 0, ""}, - {"SqrtPhi", Const, 0, ""}, - {"SqrtPi", Const, 0, ""}, - {"Tan", Func, 0, "func(x float64) float64"}, - {"Tanh", Func, 0, "func(x float64) float64"}, - {"Trunc", Func, 0, "func(x float64) float64"}, - {"Y0", Func, 0, "func(x float64) float64"}, - {"Y1", Func, 0, "func(x float64) float64"}, - {"Yn", Func, 0, "func(n int, x float64) float64"}, - }, - "math/big": { - {"(*Float).Abs", Method, 5, ""}, - {"(*Float).Acc", Method, 5, ""}, - {"(*Float).Add", Method, 5, ""}, - {"(*Float).Append", Method, 5, ""}, - {"(*Float).AppendText", Method, 24, ""}, - {"(*Float).Cmp", Method, 5, ""}, - {"(*Float).Copy", Method, 5, ""}, - {"(*Float).Float32", Method, 5, ""}, - {"(*Float).Float64", Method, 5, ""}, - {"(*Float).Format", Method, 5, ""}, - {"(*Float).GobDecode", Method, 7, ""}, - {"(*Float).GobEncode", Method, 7, ""}, - {"(*Float).Int", Method, 5, ""}, - {"(*Float).Int64", Method, 5, ""}, - {"(*Float).IsInf", Method, 5, ""}, - {"(*Float).IsInt", Method, 5, ""}, - {"(*Float).MantExp", Method, 5, ""}, - {"(*Float).MarshalText", Method, 6, ""}, - {"(*Float).MinPrec", Method, 5, ""}, - {"(*Float).Mode", Method, 5, ""}, - {"(*Float).Mul", Method, 5, ""}, - {"(*Float).Neg", Method, 5, ""}, - {"(*Float).Parse", Method, 5, ""}, - {"(*Float).Prec", Method, 5, ""}, - {"(*Float).Quo", Method, 5, ""}, - {"(*Float).Rat", Method, 5, ""}, - {"(*Float).Scan", Method, 8, ""}, - {"(*Float).Set", Method, 5, ""}, - {"(*Float).SetFloat64", Method, 5, ""}, - {"(*Float).SetInf", Method, 5, ""}, - {"(*Float).SetInt", Method, 5, ""}, - {"(*Float).SetInt64", Method, 5, ""}, - {"(*Float).SetMantExp", Method, 5, ""}, - {"(*Float).SetMode", Method, 5, ""}, - {"(*Float).SetPrec", Method, 5, ""}, - {"(*Float).SetRat", Method, 5, ""}, - {"(*Float).SetString", Method, 5, ""}, - {"(*Float).SetUint64", Method, 5, ""}, - {"(*Float).Sign", Method, 5, ""}, - {"(*Float).Signbit", Method, 5, ""}, - {"(*Float).Sqrt", Method, 10, ""}, - {"(*Float).String", Method, 5, ""}, - {"(*Float).Sub", Method, 5, ""}, - {"(*Float).Text", Method, 5, ""}, - {"(*Float).Uint64", Method, 5, ""}, - {"(*Float).UnmarshalText", Method, 6, ""}, - {"(*Int).Abs", Method, 0, ""}, - {"(*Int).Add", Method, 0, ""}, - {"(*Int).And", Method, 0, ""}, - {"(*Int).AndNot", Method, 0, ""}, - {"(*Int).Append", Method, 6, ""}, - {"(*Int).AppendText", Method, 24, ""}, - {"(*Int).Binomial", Method, 0, ""}, - {"(*Int).Bit", Method, 0, ""}, - {"(*Int).BitLen", Method, 0, ""}, - {"(*Int).Bits", Method, 0, ""}, - {"(*Int).Bytes", Method, 0, ""}, - {"(*Int).Cmp", Method, 0, ""}, - {"(*Int).CmpAbs", Method, 10, ""}, - {"(*Int).Div", Method, 0, ""}, - {"(*Int).DivMod", Method, 0, ""}, - {"(*Int).Divide", Method, 27, ""}, - {"(*Int).Exp", Method, 0, ""}, - {"(*Int).FillBytes", Method, 15, ""}, - {"(*Int).Float64", Method, 21, ""}, - {"(*Int).Format", Method, 0, ""}, - {"(*Int).GCD", Method, 0, ""}, - {"(*Int).GobDecode", Method, 0, ""}, - {"(*Int).GobEncode", Method, 0, ""}, - {"(*Int).Int64", Method, 0, ""}, - {"(*Int).IsInt64", Method, 9, ""}, - {"(*Int).IsUint64", Method, 9, ""}, - {"(*Int).Lsh", Method, 0, ""}, - {"(*Int).MarshalJSON", Method, 1, ""}, - {"(*Int).MarshalText", Method, 3, ""}, - {"(*Int).Mod", Method, 0, ""}, - {"(*Int).ModInverse", Method, 0, ""}, - {"(*Int).ModSqrt", Method, 5, ""}, - {"(*Int).Mul", Method, 0, ""}, - {"(*Int).MulRange", Method, 0, ""}, - {"(*Int).Neg", Method, 0, ""}, - {"(*Int).Not", Method, 0, ""}, - {"(*Int).Or", Method, 0, ""}, - {"(*Int).ProbablyPrime", Method, 0, ""}, - {"(*Int).Quo", Method, 0, ""}, - {"(*Int).QuoRem", Method, 0, ""}, - {"(*Int).Rand", Method, 0, ""}, - {"(*Int).Rem", Method, 0, ""}, - {"(*Int).Rsh", Method, 0, ""}, - {"(*Int).Scan", Method, 0, ""}, - {"(*Int).Set", Method, 0, ""}, - {"(*Int).SetBit", Method, 0, ""}, - {"(*Int).SetBits", Method, 0, ""}, - {"(*Int).SetBytes", Method, 0, ""}, - {"(*Int).SetInt64", Method, 0, ""}, - {"(*Int).SetString", Method, 0, ""}, - {"(*Int).SetUint64", Method, 1, ""}, - {"(*Int).Sign", Method, 0, ""}, - {"(*Int).Sqrt", Method, 8, ""}, - {"(*Int).String", Method, 0, ""}, - {"(*Int).Sub", Method, 0, ""}, - {"(*Int).Text", Method, 6, ""}, - {"(*Int).TrailingZeroBits", Method, 13, ""}, - {"(*Int).Uint64", Method, 1, ""}, - {"(*Int).UnmarshalJSON", Method, 1, ""}, - {"(*Int).UnmarshalText", Method, 3, ""}, - {"(*Int).Xor", Method, 0, ""}, - {"(*Rat).Abs", Method, 0, ""}, - {"(*Rat).Add", Method, 0, ""}, - {"(*Rat).AppendText", Method, 24, ""}, - {"(*Rat).Cmp", Method, 0, ""}, - {"(*Rat).Denom", Method, 0, ""}, - {"(*Rat).Float32", Method, 4, ""}, - {"(*Rat).Float64", Method, 1, ""}, - {"(*Rat).FloatPrec", Method, 22, ""}, - {"(*Rat).FloatString", Method, 0, ""}, - {"(*Rat).GobDecode", Method, 0, ""}, - {"(*Rat).GobEncode", Method, 0, ""}, - {"(*Rat).Inv", Method, 0, ""}, - {"(*Rat).IsInt", Method, 0, ""}, - {"(*Rat).MarshalText", Method, 3, ""}, - {"(*Rat).Mul", Method, 0, ""}, - {"(*Rat).Neg", Method, 0, ""}, - {"(*Rat).Num", Method, 0, ""}, - {"(*Rat).Quo", Method, 0, ""}, - {"(*Rat).RatString", Method, 0, ""}, - {"(*Rat).Scan", Method, 0, ""}, - {"(*Rat).Set", Method, 0, ""}, - {"(*Rat).SetFloat64", Method, 1, ""}, - {"(*Rat).SetFrac", Method, 0, ""}, - {"(*Rat).SetFrac64", Method, 0, ""}, - {"(*Rat).SetInt", Method, 0, ""}, - {"(*Rat).SetInt64", Method, 0, ""}, - {"(*Rat).SetString", Method, 0, ""}, - {"(*Rat).SetUint64", Method, 13, ""}, - {"(*Rat).Sign", Method, 0, ""}, - {"(*Rat).String", Method, 0, ""}, - {"(*Rat).Sub", Method, 0, ""}, - {"(*Rat).UnmarshalText", Method, 3, ""}, - {"(Accuracy).String", Method, 5, ""}, - {"(ErrNaN).Error", Method, 5, ""}, - {"(RoundingMode).String", Method, 5, ""}, - {"Above", Const, 5, ""}, - {"Accuracy", Type, 5, ""}, - {"AwayFromZero", Const, 5, ""}, - {"Below", Const, 5, ""}, - {"Ceil", Const, 27, ""}, - {"ErrNaN", Type, 5, ""}, - {"Exact", Const, 5, ""}, - {"Float", Type, 5, ""}, - {"Floor", Const, 27, ""}, - {"Int", Type, 0, ""}, - {"Jacobi", Func, 5, "func(x *Int, y *Int) int"}, - {"MaxBase", Const, 0, ""}, - {"MaxExp", Const, 5, ""}, - {"MaxPrec", Const, 5, ""}, - {"MinExp", Const, 5, ""}, - {"NewFloat", Func, 5, "func(x float64) *Float"}, - {"NewInt", Func, 0, "func(x int64) *Int"}, - {"NewRat", Func, 0, "func(a int64, b int64) *Rat"}, - {"ParseFloat", Func, 5, "func(s string, base int, prec uint, mode RoundingMode) (f *Float, b int, err error)"}, - {"Rat", Type, 0, ""}, - {"Round", Const, 27, ""}, - {"RoundingMode", Type, 5, ""}, - {"ToNearestAway", Const, 5, ""}, - {"ToNearestEven", Const, 5, ""}, - {"ToNegativeInf", Const, 5, ""}, - {"ToPositiveInf", Const, 5, ""}, - {"ToZero", Const, 5, ""}, - {"Trunc", Const, 27, ""}, - {"Word", Type, 0, ""}, - }, - "math/bits": { - {"Add", Func, 12, "func(x uint, y uint, carry uint) (sum uint, carryOut uint)"}, - {"Add32", Func, 12, "func(x uint32, y uint32, carry uint32) (sum uint32, carryOut uint32)"}, - {"Add64", Func, 12, "func(x uint64, y uint64, carry uint64) (sum uint64, carryOut uint64)"}, - {"Div", Func, 12, "func(hi uint, lo uint, y uint) (quo uint, rem uint)"}, - {"Div32", Func, 12, "func(hi uint32, lo uint32, y uint32) (quo uint32, rem uint32)"}, - {"Div64", Func, 12, "func(hi uint64, lo uint64, y uint64) (quo uint64, rem uint64)"}, - {"LeadingZeros", Func, 9, "func(x uint) int"}, - {"LeadingZeros16", Func, 9, "func(x uint16) int"}, - {"LeadingZeros32", Func, 9, "func(x uint32) int"}, - {"LeadingZeros64", Func, 9, "func(x uint64) int"}, - {"LeadingZeros8", Func, 9, "func(x uint8) int"}, - {"Len", Func, 9, "func(x uint) int"}, - {"Len16", Func, 9, "func(x uint16) (n int)"}, - {"Len32", Func, 9, "func(x uint32) (n int)"}, - {"Len64", Func, 9, "func(x uint64) (n int)"}, - {"Len8", Func, 9, "func(x uint8) int"}, - {"Mul", Func, 12, "func(x uint, y uint) (hi uint, lo uint)"}, - {"Mul32", Func, 12, "func(x uint32, y uint32) (hi uint32, lo uint32)"}, - {"Mul64", Func, 12, "func(x uint64, y uint64) (hi uint64, lo uint64)"}, - {"OnesCount", Func, 9, "func(x uint) int"}, - {"OnesCount16", Func, 9, "func(x uint16) int"}, - {"OnesCount32", Func, 9, "func(x uint32) int"}, - {"OnesCount64", Func, 9, "func(x uint64) int"}, - {"OnesCount8", Func, 9, "func(x uint8) int"}, - {"Rem", Func, 14, "func(hi uint, lo uint, y uint) uint"}, - {"Rem32", Func, 14, "func(hi uint32, lo uint32, y uint32) uint32"}, - {"Rem64", Func, 14, "func(hi uint64, lo uint64, y uint64) uint64"}, - {"Reverse", Func, 9, "func(x uint) uint"}, - {"Reverse16", Func, 9, "func(x uint16) uint16"}, - {"Reverse32", Func, 9, "func(x uint32) uint32"}, - {"Reverse64", Func, 9, "func(x uint64) uint64"}, - {"Reverse8", Func, 9, "func(x uint8) uint8"}, - {"ReverseBytes", Func, 9, "func(x uint) uint"}, - {"ReverseBytes16", Func, 9, "func(x uint16) uint16"}, - {"ReverseBytes32", Func, 9, "func(x uint32) uint32"}, - {"ReverseBytes64", Func, 9, "func(x uint64) uint64"}, - {"RotateLeft", Func, 9, "func(x uint, k int) uint"}, - {"RotateLeft16", Func, 9, "func(x uint16, k int) uint16"}, - {"RotateLeft32", Func, 9, "func(x uint32, k int) uint32"}, - {"RotateLeft64", Func, 9, "func(x uint64, k int) uint64"}, - {"RotateLeft8", Func, 9, "func(x uint8, k int) uint8"}, - {"Sub", Func, 12, "func(x uint, y uint, borrow uint) (diff uint, borrowOut uint)"}, - {"Sub32", Func, 12, "func(x uint32, y uint32, borrow uint32) (diff uint32, borrowOut uint32)"}, - {"Sub64", Func, 12, "func(x uint64, y uint64, borrow uint64) (diff uint64, borrowOut uint64)"}, - {"TrailingZeros", Func, 9, "func(x uint) int"}, - {"TrailingZeros16", Func, 9, "func(x uint16) int"}, - {"TrailingZeros32", Func, 9, "func(x uint32) int"}, - {"TrailingZeros64", Func, 9, "func(x uint64) int"}, - {"TrailingZeros8", Func, 9, "func(x uint8) int"}, - {"UintSize", Const, 9, ""}, - }, - "math/cmplx": { - {"Abs", Func, 0, "func(x complex128) float64"}, - {"Acos", Func, 0, "func(x complex128) complex128"}, - {"Acosh", Func, 0, "func(x complex128) complex128"}, - {"Asin", Func, 0, "func(x complex128) complex128"}, - {"Asinh", Func, 0, "func(x complex128) complex128"}, - {"Atan", Func, 0, "func(x complex128) complex128"}, - {"Atanh", Func, 0, "func(x complex128) complex128"}, - {"Conj", Func, 0, "func(x complex128) complex128"}, - {"Cos", Func, 0, "func(x complex128) complex128"}, - {"Cosh", Func, 0, "func(x complex128) complex128"}, - {"Cot", Func, 0, "func(x complex128) complex128"}, - {"Exp", Func, 0, "func(x complex128) complex128"}, - {"Inf", Func, 0, "func() complex128"}, - {"IsInf", Func, 0, "func(x complex128) bool"}, - {"IsNaN", Func, 0, "func(x complex128) bool"}, - {"Log", Func, 0, "func(x complex128) complex128"}, - {"Log10", Func, 0, "func(x complex128) complex128"}, - {"NaN", Func, 0, "func() complex128"}, - {"Phase", Func, 0, "func(x complex128) float64"}, - {"Polar", Func, 0, "func(x complex128) (r float64, θ float64)"}, - {"Pow", Func, 0, "func(x complex128, y complex128) complex128"}, - {"Rect", Func, 0, "func(r float64, θ float64) complex128"}, - {"Sin", Func, 0, "func(x complex128) complex128"}, - {"Sinh", Func, 0, "func(x complex128) complex128"}, - {"Sqrt", Func, 0, "func(x complex128) complex128"}, - {"Tan", Func, 0, "func(x complex128) complex128"}, - {"Tanh", Func, 0, "func(x complex128) complex128"}, - }, - "math/rand": { - {"(*Rand).ExpFloat64", Method, 0, ""}, - {"(*Rand).Float32", Method, 0, ""}, - {"(*Rand).Float64", Method, 0, ""}, - {"(*Rand).Int", Method, 0, ""}, - {"(*Rand).Int31", Method, 0, ""}, - {"(*Rand).Int31n", Method, 0, ""}, - {"(*Rand).Int63", Method, 0, ""}, - {"(*Rand).Int63n", Method, 0, ""}, - {"(*Rand).Intn", Method, 0, ""}, - {"(*Rand).NormFloat64", Method, 0, ""}, - {"(*Rand).Perm", Method, 0, ""}, - {"(*Rand).Read", Method, 6, ""}, - {"(*Rand).Seed", Method, 0, ""}, - {"(*Rand).Shuffle", Method, 10, ""}, - {"(*Rand).Uint32", Method, 0, ""}, - {"(*Rand).Uint64", Method, 8, ""}, - {"(*Zipf).Uint64", Method, 0, ""}, - {"(Source).Int63", Method, 0, ""}, - {"(Source).Seed", Method, 0, ""}, - {"(Source64).Int63", Method, 8, ""}, - {"(Source64).Seed", Method, 8, ""}, - {"(Source64).Uint64", Method, 8, ""}, - {"ExpFloat64", Func, 0, "func() float64"}, - {"Float32", Func, 0, "func() float32"}, - {"Float64", Func, 0, "func() float64"}, - {"Int", Func, 0, "func() int"}, - {"Int31", Func, 0, "func() int32"}, - {"Int31n", Func, 0, "func(n int32) int32"}, - {"Int63", Func, 0, "func() int64"}, - {"Int63n", Func, 0, "func(n int64) int64"}, - {"Intn", Func, 0, "func(n int) int"}, - {"New", Func, 0, "func(src Source) *Rand"}, - {"NewSource", Func, 0, "func(seed int64) Source"}, - {"NewZipf", Func, 0, "func(r *Rand, s float64, v float64, imax uint64) *Zipf"}, - {"NormFloat64", Func, 0, "func() float64"}, - {"Perm", Func, 0, "func(n int) []int"}, - {"Rand", Type, 0, ""}, - {"Read", Func, 6, "func(p []byte) (n int, err error)"}, - {"Seed", Func, 0, "func(seed int64)"}, - {"Shuffle", Func, 10, "func(n int, swap func(i int, j int))"}, - {"Source", Type, 0, ""}, - {"Source64", Type, 8, ""}, - {"Uint32", Func, 0, "func() uint32"}, - {"Uint64", Func, 8, "func() uint64"}, - {"Zipf", Type, 0, ""}, - }, - "math/rand/v2": { - {"(*ChaCha8).AppendBinary", Method, 24, ""}, - {"(*ChaCha8).MarshalBinary", Method, 22, ""}, - {"(*ChaCha8).Read", Method, 23, ""}, - {"(*ChaCha8).Seed", Method, 22, ""}, - {"(*ChaCha8).Uint64", Method, 22, ""}, - {"(*ChaCha8).UnmarshalBinary", Method, 22, ""}, - {"(*PCG).AppendBinary", Method, 24, ""}, - {"(*PCG).MarshalBinary", Method, 22, ""}, - {"(*PCG).Seed", Method, 22, ""}, - {"(*PCG).Uint64", Method, 22, ""}, - {"(*PCG).UnmarshalBinary", Method, 22, ""}, - {"(*Rand).ExpFloat64", Method, 22, ""}, - {"(*Rand).Float32", Method, 22, ""}, - {"(*Rand).Float64", Method, 22, ""}, - {"(*Rand).Int", Method, 22, ""}, - {"(*Rand).Int32", Method, 22, ""}, - {"(*Rand).Int32N", Method, 22, ""}, - {"(*Rand).Int64", Method, 22, ""}, - {"(*Rand).Int64N", Method, 22, ""}, - {"(*Rand).IntN", Method, 22, ""}, - {"(*Rand).N", Method, 27, ""}, - {"(*Rand).NormFloat64", Method, 22, ""}, - {"(*Rand).Perm", Method, 22, ""}, - {"(*Rand).Shuffle", Method, 22, ""}, - {"(*Rand).Uint", Method, 23, ""}, - {"(*Rand).Uint32", Method, 22, ""}, - {"(*Rand).Uint32N", Method, 22, ""}, - {"(*Rand).Uint64", Method, 22, ""}, - {"(*Rand).Uint64N", Method, 22, ""}, - {"(*Rand).UintN", Method, 22, ""}, - {"(*Zipf).Uint64", Method, 22, ""}, - {"(Source).Uint64", Method, 22, ""}, - {"ChaCha8", Type, 22, ""}, - {"ExpFloat64", Func, 22, "func() float64"}, - {"Float32", Func, 22, "func() float32"}, - {"Float64", Func, 22, "func() float64"}, - {"Int", Func, 22, "func() int"}, - {"Int32", Func, 22, "func() int32"}, - {"Int32N", Func, 22, "func(n int32) int32"}, - {"Int64", Func, 22, "func() int64"}, - {"Int64N", Func, 22, "func(n int64) int64"}, - {"IntN", Func, 22, "func(n int) int"}, - {"N", Func, 22, "func[Int intType](n Int) Int"}, - {"New", Func, 22, "func(src Source) *Rand"}, - {"NewChaCha8", Func, 22, "func(seed [32]byte) *ChaCha8"}, - {"NewPCG", Func, 22, "func(seed1 uint64, seed2 uint64) *PCG"}, - {"NewZipf", Func, 22, "func(r *Rand, s float64, v float64, imax uint64) *Zipf"}, - {"NormFloat64", Func, 22, "func() float64"}, - {"PCG", Type, 22, ""}, - {"Perm", Func, 22, "func(n int) []int"}, - {"Rand", Type, 22, ""}, - {"Shuffle", Func, 22, "func(n int, swap func(i int, j int))"}, - {"Source", Type, 22, ""}, - {"Uint", Func, 23, "func() uint"}, - {"Uint32", Func, 22, "func() uint32"}, - {"Uint32N", Func, 22, "func(n uint32) uint32"}, - {"Uint64", Func, 22, "func() uint64"}, - {"Uint64N", Func, 22, "func(n uint64) uint64"}, - {"UintN", Func, 22, "func(n uint) uint"}, - {"Zipf", Type, 22, ""}, - }, - "mime": { - {"(*WordDecoder).Decode", Method, 5, ""}, - {"(*WordDecoder).DecodeHeader", Method, 5, ""}, - {"(WordEncoder).Encode", Method, 5, ""}, - {"AddExtensionType", Func, 0, "func(ext string, typ string) error"}, - {"BEncoding", Const, 5, ""}, - {"ErrInvalidMediaParameter", Var, 9, ""}, - {"ExtensionsByType", Func, 5, "func(typ string) ([]string, error)"}, - {"FormatMediaType", Func, 0, "func(t string, param map[string]string) string"}, - {"ParseMediaType", Func, 0, "func(v string) (mediatype string, params map[string]string, err error)"}, - {"QEncoding", Const, 5, ""}, - {"TypeByExtension", Func, 0, "func(ext string) string"}, - {"WordDecoder", Type, 5, ""}, - {"WordDecoder.CharsetReader", Field, 5, ""}, - {"WordEncoder", Type, 5, ""}, - }, - "mime/multipart": { - {"(*FileHeader).Open", Method, 0, ""}, - {"(*Form).RemoveAll", Method, 0, ""}, - {"(*Part).Close", Method, 0, ""}, - {"(*Part).FileName", Method, 0, ""}, - {"(*Part).FormName", Method, 0, ""}, - {"(*Part).Read", Method, 0, ""}, - {"(*Reader).NextPart", Method, 0, ""}, - {"(*Reader).NextRawPart", Method, 14, ""}, - {"(*Reader).ReadForm", Method, 0, ""}, - {"(*Writer).Boundary", Method, 0, ""}, - {"(*Writer).Close", Method, 0, ""}, - {"(*Writer).CreateFormField", Method, 0, ""}, - {"(*Writer).CreateFormFile", Method, 0, ""}, - {"(*Writer).CreatePart", Method, 0, ""}, - {"(*Writer).FormDataContentType", Method, 0, ""}, - {"(*Writer).SetBoundary", Method, 1, ""}, - {"(*Writer).WriteField", Method, 0, ""}, - {"(File).Close", Method, 0, ""}, - {"(File).Read", Method, 0, ""}, - {"(File).ReadAt", Method, 0, ""}, - {"(File).Seek", Method, 0, ""}, - {"ErrMessageTooLarge", Var, 9, ""}, - {"File", Type, 0, ""}, - {"FileContentDisposition", Func, 25, "func(fieldname string, filename string) string"}, - {"FileHeader", Type, 0, ""}, - {"FileHeader.Filename", Field, 0, ""}, - {"FileHeader.Header", Field, 0, ""}, - {"FileHeader.Size", Field, 9, ""}, - {"Form", Type, 0, ""}, - {"Form.File", Field, 0, ""}, - {"Form.Value", Field, 0, ""}, - {"NewReader", Func, 0, "func(r io.Reader, boundary string) *Reader"}, - {"NewWriter", Func, 0, "func(w io.Writer) *Writer"}, - {"Part", Type, 0, ""}, - {"Part.Header", Field, 0, ""}, - {"Reader", Type, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "mime/quotedprintable": { - {"(*Reader).Read", Method, 5, ""}, - {"(*Writer).Close", Method, 5, ""}, - {"(*Writer).Write", Method, 5, ""}, - {"NewReader", Func, 5, "func(r io.Reader) *Reader"}, - {"NewWriter", Func, 5, "func(w io.Writer) *Writer"}, - {"Reader", Type, 5, ""}, - {"Writer", Type, 5, ""}, - {"Writer.Binary", Field, 5, ""}, - }, - "net": { - {"(*AddrError).Error", Method, 0, ""}, - {"(*AddrError).Temporary", Method, 0, ""}, - {"(*AddrError).Timeout", Method, 0, ""}, - {"(*Buffers).Read", Method, 8, ""}, - {"(*Buffers).WriteTo", Method, 8, ""}, - {"(*DNSConfigError).Error", Method, 0, ""}, - {"(*DNSConfigError).Temporary", Method, 0, ""}, - {"(*DNSConfigError).Timeout", Method, 0, ""}, - {"(*DNSConfigError).Unwrap", Method, 13, ""}, - {"(*DNSError).Error", Method, 0, ""}, - {"(*DNSError).Temporary", Method, 0, ""}, - {"(*DNSError).Timeout", Method, 0, ""}, - {"(*DNSError).Unwrap", Method, 23, ""}, - {"(*Dialer).Dial", Method, 1, ""}, - {"(*Dialer).DialContext", Method, 7, ""}, - {"(*Dialer).DialIP", Method, 26, ""}, - {"(*Dialer).DialTCP", Method, 26, ""}, - {"(*Dialer).DialUDP", Method, 26, ""}, - {"(*Dialer).DialUnix", Method, 26, ""}, - {"(*Dialer).MultipathTCP", Method, 21, ""}, - {"(*Dialer).SetMultipathTCP", Method, 21, ""}, - {"(*IP).UnmarshalText", Method, 2, ""}, - {"(*IPAddr).Network", Method, 0, ""}, - {"(*IPAddr).String", Method, 0, ""}, - {"(*IPConn).Close", Method, 0, ""}, - {"(*IPConn).File", Method, 0, ""}, - {"(*IPConn).LocalAddr", Method, 0, ""}, - {"(*IPConn).Read", Method, 0, ""}, - {"(*IPConn).ReadFrom", Method, 0, ""}, - {"(*IPConn).ReadFromIP", Method, 0, ""}, - {"(*IPConn).ReadMsgIP", Method, 1, ""}, - {"(*IPConn).RemoteAddr", Method, 0, ""}, - {"(*IPConn).SetDeadline", Method, 0, ""}, - {"(*IPConn).SetReadBuffer", Method, 0, ""}, - {"(*IPConn).SetReadDeadline", Method, 0, ""}, - {"(*IPConn).SetWriteBuffer", Method, 0, ""}, - {"(*IPConn).SetWriteDeadline", Method, 0, ""}, - {"(*IPConn).SyscallConn", Method, 9, ""}, - {"(*IPConn).Write", Method, 0, ""}, - {"(*IPConn).WriteMsgIP", Method, 1, ""}, - {"(*IPConn).WriteTo", Method, 0, ""}, - {"(*IPConn).WriteToIP", Method, 0, ""}, - {"(*IPNet).Contains", Method, 0, ""}, - {"(*IPNet).Network", Method, 0, ""}, - {"(*IPNet).String", Method, 0, ""}, - {"(*Interface).Addrs", Method, 0, ""}, - {"(*Interface).MulticastAddrs", Method, 0, ""}, - {"(*ListenConfig).Listen", Method, 11, ""}, - {"(*ListenConfig).ListenPacket", Method, 11, ""}, - {"(*ListenConfig).MultipathTCP", Method, 21, ""}, - {"(*ListenConfig).SetMultipathTCP", Method, 21, ""}, - {"(*OpError).Error", Method, 0, ""}, - {"(*OpError).Temporary", Method, 0, ""}, - {"(*OpError).Timeout", Method, 0, ""}, - {"(*OpError).Unwrap", Method, 13, ""}, - {"(*ParseError).Error", Method, 0, ""}, - {"(*ParseError).Temporary", Method, 17, ""}, - {"(*ParseError).Timeout", Method, 17, ""}, - {"(*Resolver).LookupAddr", Method, 8, ""}, - {"(*Resolver).LookupCNAME", Method, 8, ""}, - {"(*Resolver).LookupHost", Method, 8, ""}, - {"(*Resolver).LookupIP", Method, 15, ""}, - {"(*Resolver).LookupIPAddr", Method, 8, ""}, - {"(*Resolver).LookupMX", Method, 8, ""}, - {"(*Resolver).LookupNS", Method, 8, ""}, - {"(*Resolver).LookupNetIP", Method, 18, ""}, - {"(*Resolver).LookupPort", Method, 8, ""}, - {"(*Resolver).LookupSRV", Method, 8, ""}, - {"(*Resolver).LookupTXT", Method, 8, ""}, - {"(*TCPAddr).AddrPort", Method, 18, ""}, - {"(*TCPAddr).Network", Method, 0, ""}, - {"(*TCPAddr).String", Method, 0, ""}, - {"(*TCPConn).Close", Method, 0, ""}, - {"(*TCPConn).CloseRead", Method, 0, ""}, - {"(*TCPConn).CloseWrite", Method, 0, ""}, - {"(*TCPConn).File", Method, 0, ""}, - {"(*TCPConn).LocalAddr", Method, 0, ""}, - {"(*TCPConn).MultipathTCP", Method, 21, ""}, - {"(*TCPConn).Read", Method, 0, ""}, - {"(*TCPConn).ReadFrom", Method, 0, ""}, - {"(*TCPConn).RemoteAddr", Method, 0, ""}, - {"(*TCPConn).SetDeadline", Method, 0, ""}, - {"(*TCPConn).SetKeepAlive", Method, 0, ""}, - {"(*TCPConn).SetKeepAliveConfig", Method, 23, ""}, - {"(*TCPConn).SetKeepAlivePeriod", Method, 2, ""}, - {"(*TCPConn).SetLinger", Method, 0, ""}, - {"(*TCPConn).SetNoDelay", Method, 0, ""}, - {"(*TCPConn).SetReadBuffer", Method, 0, ""}, - {"(*TCPConn).SetReadDeadline", Method, 0, ""}, - {"(*TCPConn).SetWriteBuffer", Method, 0, ""}, - {"(*TCPConn).SetWriteDeadline", Method, 0, ""}, - {"(*TCPConn).SyscallConn", Method, 9, ""}, - {"(*TCPConn).Write", Method, 0, ""}, - {"(*TCPConn).WriteTo", Method, 22, ""}, - {"(*TCPListener).Accept", Method, 0, ""}, - {"(*TCPListener).AcceptTCP", Method, 0, ""}, - {"(*TCPListener).Addr", Method, 0, ""}, - {"(*TCPListener).Close", Method, 0, ""}, - {"(*TCPListener).File", Method, 0, ""}, - {"(*TCPListener).SetDeadline", Method, 0, ""}, - {"(*TCPListener).SyscallConn", Method, 10, ""}, - {"(*UDPAddr).AddrPort", Method, 18, ""}, - {"(*UDPAddr).Network", Method, 0, ""}, - {"(*UDPAddr).String", Method, 0, ""}, - {"(*UDPConn).Close", Method, 0, ""}, - {"(*UDPConn).File", Method, 0, ""}, - {"(*UDPConn).LocalAddr", Method, 0, ""}, - {"(*UDPConn).Read", Method, 0, ""}, - {"(*UDPConn).ReadFrom", Method, 0, ""}, - {"(*UDPConn).ReadFromUDP", Method, 0, ""}, - {"(*UDPConn).ReadFromUDPAddrPort", Method, 18, ""}, - {"(*UDPConn).ReadMsgUDP", Method, 1, ""}, - {"(*UDPConn).ReadMsgUDPAddrPort", Method, 18, ""}, - {"(*UDPConn).RemoteAddr", Method, 0, ""}, - {"(*UDPConn).SetDeadline", Method, 0, ""}, - {"(*UDPConn).SetReadBuffer", Method, 0, ""}, - {"(*UDPConn).SetReadDeadline", Method, 0, ""}, - {"(*UDPConn).SetWriteBuffer", Method, 0, ""}, - {"(*UDPConn).SetWriteDeadline", Method, 0, ""}, - {"(*UDPConn).SyscallConn", Method, 9, ""}, - {"(*UDPConn).Write", Method, 0, ""}, - {"(*UDPConn).WriteMsgUDP", Method, 1, ""}, - {"(*UDPConn).WriteMsgUDPAddrPort", Method, 18, ""}, - {"(*UDPConn).WriteTo", Method, 0, ""}, - {"(*UDPConn).WriteToUDP", Method, 0, ""}, - {"(*UDPConn).WriteToUDPAddrPort", Method, 18, ""}, - {"(*UnixAddr).Network", Method, 0, ""}, - {"(*UnixAddr).String", Method, 0, ""}, - {"(*UnixConn).Close", Method, 0, ""}, - {"(*UnixConn).CloseRead", Method, 1, ""}, - {"(*UnixConn).CloseWrite", Method, 1, ""}, - {"(*UnixConn).File", Method, 0, ""}, - {"(*UnixConn).LocalAddr", Method, 0, ""}, - {"(*UnixConn).Read", Method, 0, ""}, - {"(*UnixConn).ReadFrom", Method, 0, ""}, - {"(*UnixConn).ReadFromUnix", Method, 0, ""}, - {"(*UnixConn).ReadMsgUnix", Method, 0, ""}, - {"(*UnixConn).RemoteAddr", Method, 0, ""}, - {"(*UnixConn).SetDeadline", Method, 0, ""}, - {"(*UnixConn).SetReadBuffer", Method, 0, ""}, - {"(*UnixConn).SetReadDeadline", Method, 0, ""}, - {"(*UnixConn).SetWriteBuffer", Method, 0, ""}, - {"(*UnixConn).SetWriteDeadline", Method, 0, ""}, - {"(*UnixConn).SyscallConn", Method, 9, ""}, - {"(*UnixConn).Write", Method, 0, ""}, - {"(*UnixConn).WriteMsgUnix", Method, 0, ""}, - {"(*UnixConn).WriteTo", Method, 0, ""}, - {"(*UnixConn).WriteToUnix", Method, 0, ""}, - {"(*UnixListener).Accept", Method, 0, ""}, - {"(*UnixListener).AcceptUnix", Method, 0, ""}, - {"(*UnixListener).Addr", Method, 0, ""}, - {"(*UnixListener).Close", Method, 0, ""}, - {"(*UnixListener).File", Method, 0, ""}, - {"(*UnixListener).SetDeadline", Method, 0, ""}, - {"(*UnixListener).SetUnlinkOnClose", Method, 8, ""}, - {"(*UnixListener).SyscallConn", Method, 10, ""}, - {"(Addr).Network", Method, 0, ""}, - {"(Addr).String", Method, 0, ""}, - {"(Conn).Close", Method, 0, ""}, - {"(Conn).LocalAddr", Method, 0, ""}, - {"(Conn).Read", Method, 0, ""}, - {"(Conn).RemoteAddr", Method, 0, ""}, - {"(Conn).SetDeadline", Method, 0, ""}, - {"(Conn).SetReadDeadline", Method, 0, ""}, - {"(Conn).SetWriteDeadline", Method, 0, ""}, - {"(Conn).Write", Method, 0, ""}, - {"(Error).Error", Method, 0, ""}, - {"(Error).Temporary", Method, 0, ""}, - {"(Error).Timeout", Method, 0, ""}, - {"(Flags).String", Method, 0, ""}, - {"(HardwareAddr).String", Method, 0, ""}, - {"(IP).AppendText", Method, 24, ""}, - {"(IP).DefaultMask", Method, 0, ""}, - {"(IP).Equal", Method, 0, ""}, - {"(IP).IsGlobalUnicast", Method, 0, ""}, - {"(IP).IsInterfaceLocalMulticast", Method, 0, ""}, - {"(IP).IsLinkLocalMulticast", Method, 0, ""}, - {"(IP).IsLinkLocalUnicast", Method, 0, ""}, - {"(IP).IsLoopback", Method, 0, ""}, - {"(IP).IsMulticast", Method, 0, ""}, - {"(IP).IsPrivate", Method, 17, ""}, - {"(IP).IsUnspecified", Method, 0, ""}, - {"(IP).MarshalText", Method, 2, ""}, - {"(IP).Mask", Method, 0, ""}, - {"(IP).String", Method, 0, ""}, - {"(IP).To16", Method, 0, ""}, - {"(IP).To4", Method, 0, ""}, - {"(IPMask).Size", Method, 0, ""}, - {"(IPMask).String", Method, 0, ""}, - {"(InvalidAddrError).Error", Method, 0, ""}, - {"(InvalidAddrError).Temporary", Method, 0, ""}, - {"(InvalidAddrError).Timeout", Method, 0, ""}, - {"(Listener).Accept", Method, 0, ""}, - {"(Listener).Addr", Method, 0, ""}, - {"(Listener).Close", Method, 0, ""}, - {"(PacketConn).Close", Method, 0, ""}, - {"(PacketConn).LocalAddr", Method, 0, ""}, - {"(PacketConn).ReadFrom", Method, 0, ""}, - {"(PacketConn).SetDeadline", Method, 0, ""}, - {"(PacketConn).SetReadDeadline", Method, 0, ""}, - {"(PacketConn).SetWriteDeadline", Method, 0, ""}, - {"(PacketConn).WriteTo", Method, 0, ""}, - {"(UnknownNetworkError).Error", Method, 0, ""}, - {"(UnknownNetworkError).Temporary", Method, 0, ""}, - {"(UnknownNetworkError).Timeout", Method, 0, ""}, - {"Addr", Type, 0, ""}, - {"AddrError", Type, 0, ""}, - {"AddrError.Addr", Field, 0, ""}, - {"AddrError.Err", Field, 0, ""}, - {"Buffers", Type, 8, ""}, - {"CIDRMask", Func, 0, "func(ones int, bits int) IPMask"}, - {"Conn", Type, 0, ""}, - {"DNSConfigError", Type, 0, ""}, - {"DNSConfigError.Err", Field, 0, ""}, - {"DNSError", Type, 0, ""}, - {"DNSError.Err", Field, 0, ""}, - {"DNSError.IsNotFound", Field, 13, ""}, - {"DNSError.IsTemporary", Field, 6, ""}, - {"DNSError.IsTimeout", Field, 0, ""}, - {"DNSError.Name", Field, 0, ""}, - {"DNSError.Server", Field, 0, ""}, - {"DNSError.UnwrapErr", Field, 23, ""}, - {"DefaultResolver", Var, 8, ""}, - {"Dial", Func, 0, "func(network string, address string) (Conn, error)"}, - {"DialIP", Func, 0, "func(network string, laddr *IPAddr, raddr *IPAddr) (*IPConn, error)"}, - {"DialTCP", Func, 0, "func(network string, laddr *TCPAddr, raddr *TCPAddr) (*TCPConn, error)"}, - {"DialTimeout", Func, 0, "func(network string, address string, timeout time.Duration) (Conn, error)"}, - {"DialUDP", Func, 0, "func(network string, laddr *UDPAddr, raddr *UDPAddr) (*UDPConn, error)"}, - {"DialUnix", Func, 0, "func(network string, laddr *UnixAddr, raddr *UnixAddr) (*UnixConn, error)"}, - {"Dialer", Type, 1, ""}, - {"Dialer.Cancel", Field, 6, ""}, - {"Dialer.Control", Field, 11, ""}, - {"Dialer.ControlContext", Field, 20, ""}, - {"Dialer.Deadline", Field, 1, ""}, - {"Dialer.DualStack", Field, 2, ""}, - {"Dialer.FallbackDelay", Field, 5, ""}, - {"Dialer.KeepAlive", Field, 3, ""}, - {"Dialer.KeepAliveConfig", Field, 23, ""}, - {"Dialer.LocalAddr", Field, 1, ""}, - {"Dialer.Resolver", Field, 8, ""}, - {"Dialer.Timeout", Field, 1, ""}, - {"ErrClosed", Var, 16, ""}, - {"ErrWriteToConnected", Var, 0, ""}, - {"Error", Type, 0, ""}, - {"FileConn", Func, 0, "func(f *os.File) (c Conn, err error)"}, - {"FileListener", Func, 0, "func(f *os.File) (ln Listener, err error)"}, - {"FilePacketConn", Func, 0, "func(f *os.File) (c PacketConn, err error)"}, - {"FlagBroadcast", Const, 0, ""}, - {"FlagLoopback", Const, 0, ""}, - {"FlagMulticast", Const, 0, ""}, - {"FlagPointToPoint", Const, 0, ""}, - {"FlagRunning", Const, 20, ""}, - {"FlagUp", Const, 0, ""}, - {"Flags", Type, 0, ""}, - {"HardwareAddr", Type, 0, ""}, - {"IP", Type, 0, ""}, - {"IPAddr", Type, 0, ""}, - {"IPAddr.IP", Field, 0, ""}, - {"IPAddr.Zone", Field, 1, ""}, - {"IPConn", Type, 0, ""}, - {"IPMask", Type, 0, ""}, - {"IPNet", Type, 0, ""}, - {"IPNet.IP", Field, 0, ""}, - {"IPNet.Mask", Field, 0, ""}, - {"IPv4", Func, 0, "func(a byte, b byte, c byte, d byte) IP"}, - {"IPv4Mask", Func, 0, "func(a byte, b byte, c byte, d byte) IPMask"}, - {"IPv4allrouter", Var, 0, ""}, - {"IPv4allsys", Var, 0, ""}, - {"IPv4bcast", Var, 0, ""}, - {"IPv4len", Const, 0, ""}, - {"IPv4zero", Var, 0, ""}, - {"IPv6interfacelocalallnodes", Var, 0, ""}, - {"IPv6len", Const, 0, ""}, - {"IPv6linklocalallnodes", Var, 0, ""}, - {"IPv6linklocalallrouters", Var, 0, ""}, - {"IPv6loopback", Var, 0, ""}, - {"IPv6unspecified", Var, 0, ""}, - {"IPv6zero", Var, 0, ""}, - {"Interface", Type, 0, ""}, - {"Interface.Flags", Field, 0, ""}, - {"Interface.HardwareAddr", Field, 0, ""}, - {"Interface.Index", Field, 0, ""}, - {"Interface.MTU", Field, 0, ""}, - {"Interface.Name", Field, 0, ""}, - {"InterfaceAddrs", Func, 0, "func() ([]Addr, error)"}, - {"InterfaceByIndex", Func, 0, "func(index int) (*Interface, error)"}, - {"InterfaceByName", Func, 0, "func(name string) (*Interface, error)"}, - {"Interfaces", Func, 0, "func() ([]Interface, error)"}, - {"InvalidAddrError", Type, 0, ""}, - {"JoinHostPort", Func, 0, "func(host string, port string) string"}, - {"KeepAliveConfig", Type, 23, ""}, - {"KeepAliveConfig.Count", Field, 23, ""}, - {"KeepAliveConfig.Enable", Field, 23, ""}, - {"KeepAliveConfig.Idle", Field, 23, ""}, - {"KeepAliveConfig.Interval", Field, 23, ""}, - {"Listen", Func, 0, "func(network string, address string) (Listener, error)"}, - {"ListenConfig", Type, 11, ""}, - {"ListenConfig.Control", Field, 11, ""}, - {"ListenConfig.KeepAlive", Field, 13, ""}, - {"ListenConfig.KeepAliveConfig", Field, 23, ""}, - {"ListenIP", Func, 0, "func(network string, laddr *IPAddr) (*IPConn, error)"}, - {"ListenMulticastUDP", Func, 0, "func(network string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, error)"}, - {"ListenPacket", Func, 0, "func(network string, address string) (PacketConn, error)"}, - {"ListenTCP", Func, 0, "func(network string, laddr *TCPAddr) (*TCPListener, error)"}, - {"ListenUDP", Func, 0, "func(network string, laddr *UDPAddr) (*UDPConn, error)"}, - {"ListenUnix", Func, 0, "func(network string, laddr *UnixAddr) (*UnixListener, error)"}, - {"ListenUnixgram", Func, 0, "func(network string, laddr *UnixAddr) (*UnixConn, error)"}, - {"Listener", Type, 0, ""}, - {"LookupAddr", Func, 0, "func(addr string) (names []string, err error)"}, - {"LookupCNAME", Func, 0, "func(host string) (cname string, err error)"}, - {"LookupHost", Func, 0, "func(host string) (addrs []string, err error)"}, - {"LookupIP", Func, 0, "func(host string) ([]IP, error)"}, - {"LookupMX", Func, 0, "func(name string) ([]*MX, error)"}, - {"LookupNS", Func, 1, "func(name string) ([]*NS, error)"}, - {"LookupPort", Func, 0, "func(network string, service string) (port int, err error)"}, - {"LookupSRV", Func, 0, "func(service string, proto string, name string) (cname string, addrs []*SRV, err error)"}, - {"LookupTXT", Func, 0, "func(name string) ([]string, error)"}, - {"MX", Type, 0, ""}, - {"MX.Host", Field, 0, ""}, - {"MX.Pref", Field, 0, ""}, - {"NS", Type, 1, ""}, - {"NS.Host", Field, 1, ""}, - {"OpError", Type, 0, ""}, - {"OpError.Addr", Field, 0, ""}, - {"OpError.Err", Field, 0, ""}, - {"OpError.Net", Field, 0, ""}, - {"OpError.Op", Field, 0, ""}, - {"OpError.Source", Field, 5, ""}, - {"PacketConn", Type, 0, ""}, - {"ParseCIDR", Func, 0, "func(s string) (IP, *IPNet, error)"}, - {"ParseError", Type, 0, ""}, - {"ParseError.Text", Field, 0, ""}, - {"ParseError.Type", Field, 0, ""}, - {"ParseIP", Func, 0, "func(s string) IP"}, - {"ParseMAC", Func, 0, "func(s string) (hw HardwareAddr, err error)"}, - {"Pipe", Func, 0, "func() (Conn, Conn)"}, - {"ResolveIPAddr", Func, 0, "func(network string, address string) (*IPAddr, error)"}, - {"ResolveTCPAddr", Func, 0, "func(network string, address string) (*TCPAddr, error)"}, - {"ResolveUDPAddr", Func, 0, "func(network string, address string) (*UDPAddr, error)"}, - {"ResolveUnixAddr", Func, 0, "func(network string, address string) (*UnixAddr, error)"}, - {"Resolver", Type, 8, ""}, - {"Resolver.Dial", Field, 9, ""}, - {"Resolver.PreferGo", Field, 8, ""}, - {"Resolver.StrictErrors", Field, 9, ""}, - {"SRV", Type, 0, ""}, - {"SRV.Port", Field, 0, ""}, - {"SRV.Priority", Field, 0, ""}, - {"SRV.Target", Field, 0, ""}, - {"SRV.Weight", Field, 0, ""}, - {"SplitHostPort", Func, 0, "func(hostport string) (host string, port string, err error)"}, - {"TCPAddr", Type, 0, ""}, - {"TCPAddr.IP", Field, 0, ""}, - {"TCPAddr.Port", Field, 0, ""}, - {"TCPAddr.Zone", Field, 1, ""}, - {"TCPAddrFromAddrPort", Func, 18, "func(addr netip.AddrPort) *TCPAddr"}, - {"TCPConn", Type, 0, ""}, - {"TCPListener", Type, 0, ""}, - {"UDPAddr", Type, 0, ""}, - {"UDPAddr.IP", Field, 0, ""}, - {"UDPAddr.Port", Field, 0, ""}, - {"UDPAddr.Zone", Field, 1, ""}, - {"UDPAddrFromAddrPort", Func, 18, "func(addr netip.AddrPort) *UDPAddr"}, - {"UDPConn", Type, 0, ""}, - {"UnixAddr", Type, 0, ""}, - {"UnixAddr.Name", Field, 0, ""}, - {"UnixAddr.Net", Field, 0, ""}, - {"UnixConn", Type, 0, ""}, - {"UnixListener", Type, 0, ""}, - {"UnknownNetworkError", Type, 0, ""}, - }, - "net/http": { - {"(*Client).CloseIdleConnections", Method, 12, ""}, - {"(*Client).Do", Method, 0, ""}, - {"(*Client).Get", Method, 0, ""}, - {"(*Client).Head", Method, 0, ""}, - {"(*Client).Post", Method, 0, ""}, - {"(*Client).PostForm", Method, 0, ""}, - {"(*ClientConn).Available", Method, 26, ""}, - {"(*ClientConn).Close", Method, 26, ""}, - {"(*ClientConn).Err", Method, 26, ""}, - {"(*ClientConn).InFlight", Method, 26, ""}, - {"(*ClientConn).Release", Method, 26, ""}, - {"(*ClientConn).Reserve", Method, 26, ""}, - {"(*ClientConn).RoundTrip", Method, 26, ""}, - {"(*ClientConn).SetStateHook", Method, 26, ""}, - {"(*Cookie).String", Method, 0, ""}, - {"(*Cookie).Valid", Method, 18, ""}, - {"(*CrossOriginProtection).AddInsecureBypassPattern", Method, 25, ""}, - {"(*CrossOriginProtection).AddTrustedOrigin", Method, 25, ""}, - {"(*CrossOriginProtection).Check", Method, 25, ""}, - {"(*CrossOriginProtection).Handler", Method, 25, ""}, - {"(*CrossOriginProtection).SetDenyHandler", Method, 25, ""}, - {"(*MaxBytesError).Error", Method, 19, ""}, - {"(*ProtocolError).Error", Method, 0, ""}, - {"(*ProtocolError).Is", Method, 21, ""}, - {"(*Protocols).SetHTTP1", Method, 24, ""}, - {"(*Protocols).SetHTTP2", Method, 24, ""}, - {"(*Protocols).SetUnencryptedHTTP2", Method, 24, ""}, - {"(*Request).AddCookie", Method, 0, ""}, - {"(*Request).BasicAuth", Method, 4, ""}, - {"(*Request).Clone", Method, 13, ""}, - {"(*Request).Context", Method, 7, ""}, - {"(*Request).Cookie", Method, 0, ""}, - {"(*Request).Cookies", Method, 0, ""}, - {"(*Request).CookiesNamed", Method, 23, ""}, - {"(*Request).FormFile", Method, 0, ""}, - {"(*Request).FormValue", Method, 0, ""}, - {"(*Request).MultipartReader", Method, 0, ""}, - {"(*Request).ParseForm", Method, 0, ""}, - {"(*Request).ParseMultipartForm", Method, 0, ""}, - {"(*Request).PathValue", Method, 22, ""}, - {"(*Request).PostFormValue", Method, 1, ""}, - {"(*Request).ProtoAtLeast", Method, 0, ""}, - {"(*Request).Referer", Method, 0, ""}, - {"(*Request).SetBasicAuth", Method, 0, ""}, - {"(*Request).SetPathValue", Method, 22, ""}, - {"(*Request).UserAgent", Method, 0, ""}, - {"(*Request).WithContext", Method, 7, ""}, - {"(*Request).Write", Method, 0, ""}, - {"(*Request).WriteProxy", Method, 0, ""}, - {"(*Response).Cookies", Method, 0, ""}, - {"(*Response).Location", Method, 0, ""}, - {"(*Response).ProtoAtLeast", Method, 0, ""}, - {"(*Response).Write", Method, 0, ""}, - {"(*ResponseController).EnableFullDuplex", Method, 21, ""}, - {"(*ResponseController).Flush", Method, 20, ""}, - {"(*ResponseController).Hijack", Method, 20, ""}, - {"(*ResponseController).SetReadDeadline", Method, 20, ""}, - {"(*ResponseController).SetWriteDeadline", Method, 20, ""}, - {"(*ServeMux).Handle", Method, 0, ""}, - {"(*ServeMux).HandleFunc", Method, 0, ""}, - {"(*ServeMux).Handler", Method, 1, ""}, - {"(*ServeMux).ServeHTTP", Method, 0, ""}, - {"(*Server).Close", Method, 8, ""}, - {"(*Server).ListenAndServe", Method, 0, ""}, - {"(*Server).ListenAndServeTLS", Method, 0, ""}, - {"(*Server).RegisterOnShutdown", Method, 9, ""}, - {"(*Server).Serve", Method, 0, ""}, - {"(*Server).ServeTLS", Method, 9, ""}, - {"(*Server).SetKeepAlivesEnabled", Method, 3, ""}, - {"(*Server).Shutdown", Method, 8, ""}, - {"(*Transport).CancelRequest", Method, 1, ""}, - {"(*Transport).Clone", Method, 13, ""}, - {"(*Transport).CloseIdleConnections", Method, 0, ""}, - {"(*Transport).NewClientConn", Method, 26, ""}, - {"(*Transport).RegisterProtocol", Method, 0, ""}, - {"(*Transport).RoundTrip", Method, 0, ""}, - {"(CloseNotifier).CloseNotify", Method, 1, ""}, - {"(ConnState).String", Method, 3, ""}, - {"(CookieJar).Cookies", Method, 0, ""}, - {"(CookieJar).SetCookies", Method, 0, ""}, - {"(Dir).Open", Method, 0, ""}, - {"(File).Close", Method, 0, ""}, - {"(File).Read", Method, 0, ""}, - {"(File).Readdir", Method, 0, ""}, - {"(File).Seek", Method, 0, ""}, - {"(File).Stat", Method, 0, ""}, - {"(FileSystem).Open", Method, 0, ""}, - {"(Flusher).Flush", Method, 0, ""}, - {"(Handler).ServeHTTP", Method, 0, ""}, - {"(HandlerFunc).ServeHTTP", Method, 0, ""}, - {"(Header).Add", Method, 0, ""}, - {"(Header).Clone", Method, 13, ""}, - {"(Header).Del", Method, 0, ""}, - {"(Header).Get", Method, 0, ""}, - {"(Header).Set", Method, 0, ""}, - {"(Header).Values", Method, 14, ""}, - {"(Header).Write", Method, 0, ""}, - {"(Header).WriteSubset", Method, 0, ""}, - {"(Hijacker).Hijack", Method, 0, ""}, - {"(Protocols).HTTP1", Method, 24, ""}, - {"(Protocols).HTTP2", Method, 24, ""}, - {"(Protocols).String", Method, 24, ""}, - {"(Protocols).UnencryptedHTTP2", Method, 24, ""}, - {"(Pusher).Push", Method, 8, ""}, - {"(ResponseWriter).Header", Method, 0, ""}, - {"(ResponseWriter).Write", Method, 0, ""}, - {"(ResponseWriter).WriteHeader", Method, 0, ""}, - {"(RoundTripper).RoundTrip", Method, 0, ""}, - {"AllowQuerySemicolons", Func, 17, "func(h Handler) Handler"}, - {"CanonicalHeaderKey", Func, 0, "func(s string) string"}, - {"Client", Type, 0, ""}, - {"Client.CheckRedirect", Field, 0, ""}, - {"Client.Jar", Field, 0, ""}, - {"Client.Timeout", Field, 3, ""}, - {"Client.Transport", Field, 0, ""}, - {"ClientConn", Type, 26, ""}, - {"CloseNotifier", Type, 1, ""}, - {"ConnState", Type, 3, ""}, - {"Cookie", Type, 0, ""}, - {"Cookie.Domain", Field, 0, ""}, - {"Cookie.Expires", Field, 0, ""}, - {"Cookie.HttpOnly", Field, 0, ""}, - {"Cookie.MaxAge", Field, 0, ""}, - {"Cookie.Name", Field, 0, ""}, - {"Cookie.Partitioned", Field, 23, ""}, - {"Cookie.Path", Field, 0, ""}, - {"Cookie.Quoted", Field, 23, ""}, - {"Cookie.Raw", Field, 0, ""}, - {"Cookie.RawExpires", Field, 0, ""}, - {"Cookie.SameSite", Field, 11, ""}, - {"Cookie.Secure", Field, 0, ""}, - {"Cookie.Unparsed", Field, 0, ""}, - {"Cookie.Value", Field, 0, ""}, - {"CookieJar", Type, 0, ""}, - {"CrossOriginProtection", Type, 25, ""}, - {"DefaultClient", Var, 0, ""}, - {"DefaultMaxHeaderBytes", Const, 0, ""}, - {"DefaultMaxHeaderValueCount", Const, 27, ""}, - {"DefaultMaxIdleConnsPerHost", Const, 0, ""}, - {"DefaultServeMux", Var, 0, ""}, - {"DefaultTransport", Var, 0, ""}, - {"DetectContentType", Func, 0, "func(data []byte) string"}, - {"Dir", Type, 0, ""}, - {"ErrAbortHandler", Var, 8, ""}, - {"ErrBodyNotAllowed", Var, 0, ""}, - {"ErrBodyReadAfterClose", Var, 0, ""}, - {"ErrContentLength", Var, 0, ""}, - {"ErrHandlerTimeout", Var, 0, ""}, - {"ErrHeaderTooLong", Var, 0, ""}, - {"ErrHijacked", Var, 0, ""}, - {"ErrLineTooLong", Var, 0, ""}, - {"ErrMissingBoundary", Var, 0, ""}, - {"ErrMissingContentLength", Var, 0, ""}, - {"ErrMissingFile", Var, 0, ""}, - {"ErrNoCookie", Var, 0, ""}, - {"ErrNoLocation", Var, 0, ""}, - {"ErrNotMultipart", Var, 0, ""}, - {"ErrNotSupported", Var, 0, ""}, - {"ErrSchemeMismatch", Var, 21, ""}, - {"ErrServerClosed", Var, 8, ""}, - {"ErrShortBody", Var, 0, ""}, - {"ErrSkipAltProtocol", Var, 6, ""}, - {"ErrUnexpectedTrailer", Var, 0, ""}, - {"ErrUseLastResponse", Var, 7, ""}, - {"ErrWriteAfterFlush", Var, 0, ""}, - {"Error", Func, 0, "func(w ResponseWriter, error string, code int)"}, - {"FS", Func, 16, "func(fsys fs.FS) FileSystem"}, - {"File", Type, 0, ""}, - {"FileServer", Func, 0, "func(root FileSystem) Handler"}, - {"FileServerFS", Func, 22, "func(root fs.FS) Handler"}, - {"FileSystem", Type, 0, ""}, - {"Flusher", Type, 0, ""}, - {"Get", Func, 0, "func(url string) (resp *Response, err error)"}, - {"HTTP2Config", Type, 24, ""}, - {"HTTP2Config.CountError", Field, 24, ""}, - {"HTTP2Config.MaxConcurrentStreams", Field, 24, ""}, - {"HTTP2Config.MaxDecoderHeaderTableSize", Field, 24, ""}, - {"HTTP2Config.MaxEncoderHeaderTableSize", Field, 24, ""}, - {"HTTP2Config.MaxReadFrameSize", Field, 24, ""}, - {"HTTP2Config.MaxReceiveBufferPerConnection", Field, 24, ""}, - {"HTTP2Config.MaxReceiveBufferPerStream", Field, 24, ""}, - {"HTTP2Config.PermitProhibitedCipherSuites", Field, 24, ""}, - {"HTTP2Config.PingTimeout", Field, 24, ""}, - {"HTTP2Config.SendPingTimeout", Field, 24, ""}, - {"HTTP2Config.StrictMaxConcurrentRequests", Field, 26, ""}, - {"HTTP2Config.WriteByteTimeout", Field, 24, ""}, - {"Handle", Func, 0, "func(pattern string, handler Handler)"}, - {"HandleFunc", Func, 0, "func(pattern string, handler func(ResponseWriter, *Request))"}, - {"Handler", Type, 0, ""}, - {"HandlerFunc", Type, 0, ""}, - {"Head", Func, 0, "func(url string) (resp *Response, err error)"}, - {"Header", Type, 0, ""}, - {"Hijacker", Type, 0, ""}, - {"ListenAndServe", Func, 0, "func(addr string, handler Handler) error"}, - {"ListenAndServeTLS", Func, 0, "func(addr string, certFile string, keyFile string, handler Handler) error"}, - {"LocalAddrContextKey", Var, 7, ""}, - {"MaxBytesError", Type, 19, ""}, - {"MaxBytesError.Limit", Field, 19, ""}, - {"MaxBytesHandler", Func, 18, "func(h Handler, n int64) Handler"}, - {"MaxBytesReader", Func, 0, "func(w ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser"}, - {"MethodConnect", Const, 6, ""}, - {"MethodDelete", Const, 6, ""}, - {"MethodGet", Const, 6, ""}, - {"MethodHead", Const, 6, ""}, - {"MethodOptions", Const, 6, ""}, - {"MethodPatch", Const, 6, ""}, - {"MethodPost", Const, 6, ""}, - {"MethodPut", Const, 6, ""}, - {"MethodTrace", Const, 6, ""}, - {"NewCrossOriginProtection", Func, 25, "func() *CrossOriginProtection"}, - {"NewFileTransport", Func, 0, "func(fs FileSystem) RoundTripper"}, - {"NewFileTransportFS", Func, 22, "func(fsys fs.FS) RoundTripper"}, - {"NewRequest", Func, 0, "func(method string, url string, body io.Reader) (*Request, error)"}, - {"NewRequestWithContext", Func, 13, "func(ctx context.Context, method string, url string, body io.Reader) (*Request, error)"}, - {"NewResponseController", Func, 20, "func(rw ResponseWriter) *ResponseController"}, - {"NewServeMux", Func, 0, "func() *ServeMux"}, - {"NoBody", Var, 8, ""}, - {"NotFound", Func, 0, "func(w ResponseWriter, r *Request)"}, - {"NotFoundHandler", Func, 0, "func() Handler"}, - {"ParseCookie", Func, 23, "func(line string) (#rv1 []*Cookie, #rv2 error)"}, - {"ParseHTTPVersion", Func, 0, "func(vers string) (major int, minor int, ok bool)"}, - {"ParseSetCookie", Func, 23, "func(line string) (*Cookie, error)"}, - {"ParseTime", Func, 1, "func(text string) (t time.Time, err error)"}, - {"Post", Func, 0, "func(url string, contentType string, body io.Reader) (resp *Response, err error)"}, - {"PostForm", Func, 0, "func(url string, data url.Values) (resp *Response, err error)"}, - {"ProtocolError", Type, 0, ""}, - {"ProtocolError.ErrorString", Field, 0, ""}, - {"Protocols", Type, 24, ""}, - {"ProxyFromEnvironment", Func, 0, "func(req *Request) (*url.URL, error)"}, - {"ProxyURL", Func, 0, "func(fixedURL *url.URL) func(*Request) (*url.URL, error)"}, - {"PushOptions", Type, 8, ""}, - {"PushOptions.Header", Field, 8, ""}, - {"PushOptions.Method", Field, 8, ""}, - {"Pusher", Type, 8, ""}, - {"ReadRequest", Func, 0, "func(b *bufio.Reader) (*Request, error)"}, - {"ReadResponse", Func, 0, "func(r *bufio.Reader, req *Request) (*Response, error)"}, - {"Redirect", Func, 0, "func(w ResponseWriter, r *Request, url string, code int)"}, - {"RedirectHandler", Func, 0, "func(url string, code int) Handler"}, - {"Request", Type, 0, ""}, - {"Request.Body", Field, 0, ""}, - {"Request.Cancel", Field, 5, ""}, - {"Request.Close", Field, 0, ""}, - {"Request.ContentLength", Field, 0, ""}, - {"Request.Form", Field, 0, ""}, - {"Request.GetBody", Field, 8, ""}, - {"Request.Header", Field, 0, ""}, - {"Request.Host", Field, 0, ""}, - {"Request.Method", Field, 0, ""}, - {"Request.MultipartForm", Field, 0, ""}, - {"Request.Pattern", Field, 23, ""}, - {"Request.PostForm", Field, 1, ""}, - {"Request.Proto", Field, 0, ""}, - {"Request.ProtoMajor", Field, 0, ""}, - {"Request.ProtoMinor", Field, 0, ""}, - {"Request.RemoteAddr", Field, 0, ""}, - {"Request.RequestURI", Field, 0, ""}, - {"Request.Response", Field, 7, ""}, - {"Request.TLS", Field, 0, ""}, - {"Request.Trailer", Field, 0, ""}, - {"Request.TransferEncoding", Field, 0, ""}, - {"Request.URL", Field, 0, ""}, - {"Response", Type, 0, ""}, - {"Response.Body", Field, 0, ""}, - {"Response.Close", Field, 0, ""}, - {"Response.ContentLength", Field, 0, ""}, - {"Response.Header", Field, 0, ""}, - {"Response.Proto", Field, 0, ""}, - {"Response.ProtoMajor", Field, 0, ""}, - {"Response.ProtoMinor", Field, 0, ""}, - {"Response.Request", Field, 0, ""}, - {"Response.Status", Field, 0, ""}, - {"Response.StatusCode", Field, 0, ""}, - {"Response.TLS", Field, 3, ""}, - {"Response.Trailer", Field, 0, ""}, - {"Response.TransferEncoding", Field, 0, ""}, - {"Response.Uncompressed", Field, 7, ""}, - {"ResponseController", Type, 20, ""}, - {"ResponseWriter", Type, 0, ""}, - {"RoundTripper", Type, 0, ""}, - {"SameSite", Type, 11, ""}, - {"SameSiteDefaultMode", Const, 11, ""}, - {"SameSiteLaxMode", Const, 11, ""}, - {"SameSiteNoneMode", Const, 13, ""}, - {"SameSiteStrictMode", Const, 11, ""}, - {"Serve", Func, 0, "func(l net.Listener, handler Handler) error"}, - {"ServeContent", Func, 0, "func(w ResponseWriter, req *Request, name string, modtime time.Time, content io.ReadSeeker)"}, - {"ServeFile", Func, 0, "func(w ResponseWriter, r *Request, name string)"}, - {"ServeFileFS", Func, 22, "func(w ResponseWriter, r *Request, fsys fs.FS, name string)"}, - {"ServeMux", Type, 0, ""}, - {"ServeTLS", Func, 9, "func(l net.Listener, handler Handler, certFile string, keyFile string) error"}, - {"Server", Type, 0, ""}, - {"Server.Addr", Field, 0, ""}, - {"Server.BaseContext", Field, 13, ""}, - {"Server.ConnContext", Field, 13, ""}, - {"Server.ConnState", Field, 3, ""}, - {"Server.DisableClientPriority", Field, 27, ""}, - {"Server.DisableGeneralOptionsHandler", Field, 20, ""}, - {"Server.ErrorLog", Field, 3, ""}, - {"Server.HTTP2", Field, 24, ""}, - {"Server.Handler", Field, 0, ""}, - {"Server.IdleTimeout", Field, 8, ""}, - {"Server.MaxHeaderBytes", Field, 0, ""}, - {"Server.MaxHeaderValueCount", Field, 27, ""}, - {"Server.Protocols", Field, 24, ""}, - {"Server.ReadHeaderTimeout", Field, 8, ""}, - {"Server.ReadTimeout", Field, 0, ""}, - {"Server.TLSConfig", Field, 0, ""}, - {"Server.TLSNextProto", Field, 1, ""}, - {"Server.WriteTimeout", Field, 0, ""}, - {"ServerContextKey", Var, 7, ""}, - {"SetCookie", Func, 0, "func(w ResponseWriter, cookie *Cookie)"}, - {"StateActive", Const, 3, ""}, - {"StateClosed", Const, 3, ""}, - {"StateHijacked", Const, 3, ""}, - {"StateIdle", Const, 3, ""}, - {"StateNew", Const, 3, ""}, - {"StatusAccepted", Const, 0, ""}, - {"StatusAlreadyReported", Const, 7, ""}, - {"StatusBadGateway", Const, 0, ""}, - {"StatusBadRequest", Const, 0, ""}, - {"StatusConflict", Const, 0, ""}, - {"StatusContinue", Const, 0, ""}, - {"StatusCreated", Const, 0, ""}, - {"StatusEarlyHints", Const, 13, ""}, - {"StatusExpectationFailed", Const, 0, ""}, - {"StatusFailedDependency", Const, 7, ""}, - {"StatusForbidden", Const, 0, ""}, - {"StatusFound", Const, 0, ""}, - {"StatusGatewayTimeout", Const, 0, ""}, - {"StatusGone", Const, 0, ""}, - {"StatusHTTPVersionNotSupported", Const, 0, ""}, - {"StatusIMUsed", Const, 7, ""}, - {"StatusInsufficientStorage", Const, 7, ""}, - {"StatusInternalServerError", Const, 0, ""}, - {"StatusLengthRequired", Const, 0, ""}, - {"StatusLocked", Const, 7, ""}, - {"StatusLoopDetected", Const, 7, ""}, - {"StatusMethodNotAllowed", Const, 0, ""}, - {"StatusMisdirectedRequest", Const, 11, ""}, - {"StatusMovedPermanently", Const, 0, ""}, - {"StatusMultiStatus", Const, 7, ""}, - {"StatusMultipleChoices", Const, 0, ""}, - {"StatusNetworkAuthenticationRequired", Const, 6, ""}, - {"StatusNoContent", Const, 0, ""}, - {"StatusNonAuthoritativeInfo", Const, 0, ""}, - {"StatusNotAcceptable", Const, 0, ""}, - {"StatusNotExtended", Const, 7, ""}, - {"StatusNotFound", Const, 0, ""}, - {"StatusNotImplemented", Const, 0, ""}, - {"StatusNotModified", Const, 0, ""}, - {"StatusOK", Const, 0, ""}, - {"StatusPartialContent", Const, 0, ""}, - {"StatusPaymentRequired", Const, 0, ""}, - {"StatusPermanentRedirect", Const, 7, ""}, - {"StatusPreconditionFailed", Const, 0, ""}, - {"StatusPreconditionRequired", Const, 6, ""}, - {"StatusProcessing", Const, 7, ""}, - {"StatusProxyAuthRequired", Const, 0, ""}, - {"StatusRequestEntityTooLarge", Const, 0, ""}, - {"StatusRequestHeaderFieldsTooLarge", Const, 6, ""}, - {"StatusRequestTimeout", Const, 0, ""}, - {"StatusRequestURITooLong", Const, 0, ""}, - {"StatusRequestedRangeNotSatisfiable", Const, 0, ""}, - {"StatusResetContent", Const, 0, ""}, - {"StatusSeeOther", Const, 0, ""}, - {"StatusServiceUnavailable", Const, 0, ""}, - {"StatusSwitchingProtocols", Const, 0, ""}, - {"StatusTeapot", Const, 0, ""}, - {"StatusTemporaryRedirect", Const, 0, ""}, - {"StatusText", Func, 0, "func(code int) string"}, - {"StatusTooEarly", Const, 12, ""}, - {"StatusTooManyRequests", Const, 6, ""}, - {"StatusUnauthorized", Const, 0, ""}, - {"StatusUnavailableForLegalReasons", Const, 6, ""}, - {"StatusUnprocessableEntity", Const, 7, ""}, - {"StatusUnsupportedMediaType", Const, 0, ""}, - {"StatusUpgradeRequired", Const, 7, ""}, - {"StatusUseProxy", Const, 0, ""}, - {"StatusVariantAlsoNegotiates", Const, 7, ""}, - {"StripPrefix", Func, 0, "func(prefix string, h Handler) Handler"}, - {"TimeFormat", Const, 0, ""}, - {"TimeoutHandler", Func, 0, "func(h Handler, dt time.Duration, msg string) Handler"}, - {"TrailerPrefix", Const, 8, ""}, - {"Transport", Type, 0, ""}, - {"Transport.Dial", Field, 0, ""}, - {"Transport.DialContext", Field, 7, ""}, - {"Transport.DialTLS", Field, 4, ""}, - {"Transport.DialTLSContext", Field, 14, ""}, - {"Transport.DisableCompression", Field, 0, ""}, - {"Transport.DisableKeepAlives", Field, 0, ""}, - {"Transport.ExpectContinueTimeout", Field, 6, ""}, - {"Transport.ForceAttemptHTTP2", Field, 13, ""}, - {"Transport.GetProxyConnectHeader", Field, 16, ""}, - {"Transport.HTTP2", Field, 24, ""}, - {"Transport.IdleConnTimeout", Field, 7, ""}, - {"Transport.MaxConnsPerHost", Field, 11, ""}, - {"Transport.MaxIdleConns", Field, 7, ""}, - {"Transport.MaxIdleConnsPerHost", Field, 0, ""}, - {"Transport.MaxResponseHeaderBytes", Field, 7, ""}, - {"Transport.OnProxyConnectResponse", Field, 20, ""}, - {"Transport.Protocols", Field, 24, ""}, - {"Transport.Proxy", Field, 0, ""}, - {"Transport.ProxyConnectHeader", Field, 8, ""}, - {"Transport.ReadBufferSize", Field, 13, ""}, - {"Transport.ResponseHeaderTimeout", Field, 1, ""}, - {"Transport.TLSClientConfig", Field, 0, ""}, - {"Transport.TLSHandshakeTimeout", Field, 3, ""}, - {"Transport.TLSNextProto", Field, 6, ""}, - {"Transport.WriteBufferSize", Field, 13, ""}, - }, - "net/http/cgi": { - {"(*Handler).ServeHTTP", Method, 0, ""}, - {"Handler", Type, 0, ""}, - {"Handler.Args", Field, 0, ""}, - {"Handler.Dir", Field, 0, ""}, - {"Handler.Env", Field, 0, ""}, - {"Handler.InheritEnv", Field, 0, ""}, - {"Handler.Logger", Field, 0, ""}, - {"Handler.Path", Field, 0, ""}, - {"Handler.PathLocationHandler", Field, 0, ""}, - {"Handler.Root", Field, 0, ""}, - {"Handler.Stderr", Field, 7, ""}, - {"Request", Func, 0, "func() (*http.Request, error)"}, - {"RequestFromMap", Func, 0, "func(params map[string]string) (*http.Request, error)"}, - {"Serve", Func, 0, "func(handler http.Handler) error"}, - }, - "net/http/cookiejar": { - {"(*Jar).Cookies", Method, 1, ""}, - {"(*Jar).SetCookies", Method, 1, ""}, - {"(PublicSuffixList).PublicSuffix", Method, 1, ""}, - {"(PublicSuffixList).String", Method, 1, ""}, - {"Jar", Type, 1, ""}, - {"New", Func, 1, "func(o *Options) (*Jar, error)"}, - {"Options", Type, 1, ""}, - {"Options.PublicSuffixList", Field, 1, ""}, - {"PublicSuffixList", Type, 1, ""}, - }, - "net/http/fcgi": { - {"ErrConnClosed", Var, 5, ""}, - {"ErrRequestAborted", Var, 5, ""}, - {"ProcessEnv", Func, 9, "func(r *http.Request) map[string]string"}, - {"Serve", Func, 0, "func(l net.Listener, handler http.Handler) error"}, - }, - "net/http/httptest": { - {"(*ResponseRecorder).Flush", Method, 0, ""}, - {"(*ResponseRecorder).Header", Method, 0, ""}, - {"(*ResponseRecorder).Result", Method, 7, ""}, - {"(*ResponseRecorder).Write", Method, 0, ""}, - {"(*ResponseRecorder).WriteHeader", Method, 0, ""}, - {"(*ResponseRecorder).WriteString", Method, 6, ""}, - {"(*Server).Certificate", Method, 9, ""}, - {"(*Server).Client", Method, 9, ""}, - {"(*Server).Close", Method, 0, ""}, - {"(*Server).CloseClientConnections", Method, 0, ""}, - {"(*Server).Start", Method, 0, ""}, - {"(*Server).StartTLS", Method, 0, ""}, - {"DefaultRemoteAddr", Const, 0, ""}, - {"NewRecorder", Func, 0, "func() *ResponseRecorder"}, - {"NewRequest", Func, 7, "func(method string, target string, body io.Reader) *http.Request"}, - {"NewRequestWithContext", Func, 23, "func(ctx context.Context, method string, target string, body io.Reader) *http.Request"}, - {"NewServer", Func, 0, "func(handler http.Handler) *Server"}, - {"NewTLSServer", Func, 0, "func(handler http.Handler) *Server"}, - {"NewTestServer", Func, 27, "func(t testing.TB, handler http.Handler) *Server"}, - {"NewUnstartedServer", Func, 0, "func(handler http.Handler) *Server"}, - {"ResponseRecorder", Type, 0, ""}, - {"ResponseRecorder.Body", Field, 0, ""}, - {"ResponseRecorder.Code", Field, 0, ""}, - {"ResponseRecorder.Flushed", Field, 0, ""}, - {"ResponseRecorder.HeaderMap", Field, 0, ""}, - {"Server", Type, 0, ""}, - {"Server.Config", Field, 0, ""}, - {"Server.EnableHTTP2", Field, 14, ""}, - {"Server.Listener", Field, 0, ""}, - {"Server.TLS", Field, 0, ""}, - {"Server.URL", Field, 0, ""}, - }, - "net/http/httptrace": { - {"ClientTrace", Type, 7, ""}, - {"ClientTrace.ConnectDone", Field, 7, ""}, - {"ClientTrace.ConnectStart", Field, 7, ""}, - {"ClientTrace.DNSDone", Field, 7, ""}, - {"ClientTrace.DNSStart", Field, 7, ""}, - {"ClientTrace.GetConn", Field, 7, ""}, - {"ClientTrace.Got100Continue", Field, 7, ""}, - {"ClientTrace.Got1xxResponse", Field, 11, ""}, - {"ClientTrace.GotConn", Field, 7, ""}, - {"ClientTrace.GotFirstResponseByte", Field, 7, ""}, - {"ClientTrace.PutIdleConn", Field, 7, ""}, - {"ClientTrace.TLSHandshakeDone", Field, 8, ""}, - {"ClientTrace.TLSHandshakeStart", Field, 8, ""}, - {"ClientTrace.Wait100Continue", Field, 7, ""}, - {"ClientTrace.WroteHeaderField", Field, 11, ""}, - {"ClientTrace.WroteHeaders", Field, 7, ""}, - {"ClientTrace.WroteRequest", Field, 7, ""}, - {"ContextClientTrace", Func, 7, "func(ctx context.Context) *ClientTrace"}, - {"DNSDoneInfo", Type, 7, ""}, - {"DNSDoneInfo.Addrs", Field, 7, ""}, - {"DNSDoneInfo.Coalesced", Field, 7, ""}, - {"DNSDoneInfo.Err", Field, 7, ""}, - {"DNSStartInfo", Type, 7, ""}, - {"DNSStartInfo.Host", Field, 7, ""}, - {"GotConnInfo", Type, 7, ""}, - {"GotConnInfo.Conn", Field, 7, ""}, - {"GotConnInfo.IdleTime", Field, 7, ""}, - {"GotConnInfo.Reused", Field, 7, ""}, - {"GotConnInfo.WasIdle", Field, 7, ""}, - {"WithClientTrace", Func, 7, "func(ctx context.Context, trace *ClientTrace) context.Context"}, - {"WroteRequestInfo", Type, 7, ""}, - {"WroteRequestInfo.Err", Field, 7, ""}, - }, - "net/http/httputil": { - {"(*ClientConn).Close", Method, 0, ""}, - {"(*ClientConn).Do", Method, 0, ""}, - {"(*ClientConn).Hijack", Method, 0, ""}, - {"(*ClientConn).Pending", Method, 0, ""}, - {"(*ClientConn).Read", Method, 0, ""}, - {"(*ClientConn).Write", Method, 0, ""}, - {"(*ProxyRequest).SetURL", Method, 20, ""}, - {"(*ProxyRequest).SetXForwarded", Method, 20, ""}, - {"(*ReverseProxy).ServeHTTP", Method, 0, ""}, - {"(*ServerConn).Close", Method, 0, ""}, - {"(*ServerConn).Hijack", Method, 0, ""}, - {"(*ServerConn).Pending", Method, 0, ""}, - {"(*ServerConn).Read", Method, 0, ""}, - {"(*ServerConn).Write", Method, 0, ""}, - {"(BufferPool).Get", Method, 6, ""}, - {"(BufferPool).Put", Method, 6, ""}, - {"BufferPool", Type, 6, ""}, - {"ClientConn", Type, 0, ""}, - {"DumpRequest", Func, 0, "func(req *http.Request, body bool) ([]byte, error)"}, - {"DumpRequestOut", Func, 0, "func(req *http.Request, body bool) ([]byte, error)"}, - {"DumpResponse", Func, 0, "func(resp *http.Response, body bool) ([]byte, error)"}, - {"ErrClosed", Var, 0, ""}, - {"ErrLineTooLong", Var, 0, ""}, - {"ErrPersistEOF", Var, 0, ""}, - {"ErrPipeline", Var, 0, ""}, - {"NewChunkedReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"NewChunkedWriter", Func, 0, "func(w io.Writer) io.WriteCloser"}, - {"NewClientConn", Func, 0, "func(c net.Conn, r *bufio.Reader) *ClientConn"}, - {"NewProxyClientConn", Func, 0, "func(c net.Conn, r *bufio.Reader) *ClientConn"}, - {"NewServerConn", Func, 0, "func(c net.Conn, r *bufio.Reader) *ServerConn"}, - {"NewSingleHostReverseProxy", Func, 0, "func(target *url.URL) *ReverseProxy"}, - {"ProxyRequest", Type, 20, ""}, - {"ProxyRequest.In", Field, 20, ""}, - {"ProxyRequest.Out", Field, 20, ""}, - {"ReverseProxy", Type, 0, ""}, - {"ReverseProxy.BufferPool", Field, 6, ""}, - {"ReverseProxy.Director", Field, 0, ""}, - {"ReverseProxy.ErrorHandler", Field, 11, ""}, - {"ReverseProxy.ErrorLog", Field, 4, ""}, - {"ReverseProxy.FlushInterval", Field, 0, ""}, - {"ReverseProxy.ModifyResponse", Field, 8, ""}, - {"ReverseProxy.Rewrite", Field, 20, ""}, - {"ReverseProxy.Transport", Field, 0, ""}, - {"ServerConn", Type, 0, ""}, - }, - "net/http/pprof": { - {"Cmdline", Func, 0, "func(w http.ResponseWriter, r *http.Request)"}, - {"Handler", Func, 0, "func(name string) http.Handler"}, - {"Index", Func, 0, "func(w http.ResponseWriter, r *http.Request)"}, - {"Profile", Func, 0, "func(w http.ResponseWriter, r *http.Request)"}, - {"Symbol", Func, 0, "func(w http.ResponseWriter, r *http.Request)"}, - {"Trace", Func, 5, "func(w http.ResponseWriter, r *http.Request)"}, - }, - "net/mail": { - {"(*Address).String", Method, 0, ""}, - {"(*AddressParser).Parse", Method, 5, ""}, - {"(*AddressParser).ParseList", Method, 5, ""}, - {"(Header).AddressList", Method, 0, ""}, - {"(Header).Date", Method, 0, ""}, - {"(Header).Get", Method, 0, ""}, - {"Address", Type, 0, ""}, - {"Address.Address", Field, 0, ""}, - {"Address.Name", Field, 0, ""}, - {"AddressParser", Type, 5, ""}, - {"AddressParser.WordDecoder", Field, 5, ""}, - {"ErrHeaderNotPresent", Var, 0, ""}, - {"Header", Type, 0, ""}, - {"Message", Type, 0, ""}, - {"Message.Body", Field, 0, ""}, - {"Message.Header", Field, 0, ""}, - {"ParseAddress", Func, 1, "func(address string) (*Address, error)"}, - {"ParseAddressList", Func, 1, "func(list string) ([]*Address, error)"}, - {"ParseDate", Func, 8, "func(date string) (time.Time, error)"}, - {"ReadMessage", Func, 0, "func(r io.Reader) (msg *Message, err error)"}, - }, - "net/netip": { - {"(*Addr).UnmarshalBinary", Method, 18, ""}, - {"(*Addr).UnmarshalText", Method, 18, ""}, - {"(*AddrPort).UnmarshalBinary", Method, 18, ""}, - {"(*AddrPort).UnmarshalText", Method, 18, ""}, - {"(*Prefix).UnmarshalBinary", Method, 18, ""}, - {"(*Prefix).UnmarshalText", Method, 18, ""}, - {"(Addr).AppendBinary", Method, 24, ""}, - {"(Addr).AppendText", Method, 24, ""}, - {"(Addr).AppendTo", Method, 18, ""}, - {"(Addr).As16", Method, 18, ""}, - {"(Addr).As4", Method, 18, ""}, - {"(Addr).AsSlice", Method, 18, ""}, - {"(Addr).BitLen", Method, 18, ""}, - {"(Addr).Compare", Method, 18, ""}, - {"(Addr).Is4", Method, 18, ""}, - {"(Addr).Is4In6", Method, 18, ""}, - {"(Addr).Is6", Method, 18, ""}, - {"(Addr).IsGlobalUnicast", Method, 18, ""}, - {"(Addr).IsInterfaceLocalMulticast", Method, 18, ""}, - {"(Addr).IsLinkLocalMulticast", Method, 18, ""}, - {"(Addr).IsLinkLocalUnicast", Method, 18, ""}, - {"(Addr).IsLoopback", Method, 18, ""}, - {"(Addr).IsMulticast", Method, 18, ""}, - {"(Addr).IsPrivate", Method, 18, ""}, - {"(Addr).IsUnspecified", Method, 18, ""}, - {"(Addr).IsValid", Method, 18, ""}, - {"(Addr).Less", Method, 18, ""}, - {"(Addr).MarshalBinary", Method, 18, ""}, - {"(Addr).MarshalText", Method, 18, ""}, - {"(Addr).Next", Method, 18, ""}, - {"(Addr).Prefix", Method, 18, ""}, - {"(Addr).Prev", Method, 18, ""}, - {"(Addr).String", Method, 18, ""}, - {"(Addr).StringExpanded", Method, 18, ""}, - {"(Addr).Unmap", Method, 18, ""}, - {"(Addr).WithZone", Method, 18, ""}, - {"(Addr).Zone", Method, 18, ""}, - {"(AddrPort).Addr", Method, 18, ""}, - {"(AddrPort).AppendBinary", Method, 24, ""}, - {"(AddrPort).AppendText", Method, 24, ""}, - {"(AddrPort).AppendTo", Method, 18, ""}, - {"(AddrPort).Compare", Method, 22, ""}, - {"(AddrPort).IsValid", Method, 18, ""}, - {"(AddrPort).MarshalBinary", Method, 18, ""}, - {"(AddrPort).MarshalText", Method, 18, ""}, - {"(AddrPort).Port", Method, 18, ""}, - {"(AddrPort).String", Method, 18, ""}, - {"(Prefix).Addr", Method, 18, ""}, - {"(Prefix).AppendBinary", Method, 24, ""}, - {"(Prefix).AppendText", Method, 24, ""}, - {"(Prefix).AppendTo", Method, 18, ""}, - {"(Prefix).Bits", Method, 18, ""}, - {"(Prefix).Compare", Method, 26, ""}, - {"(Prefix).Contains", Method, 18, ""}, - {"(Prefix).IsSingleIP", Method, 18, ""}, - {"(Prefix).IsValid", Method, 18, ""}, - {"(Prefix).MarshalBinary", Method, 18, ""}, - {"(Prefix).MarshalText", Method, 18, ""}, - {"(Prefix).Masked", Method, 18, ""}, - {"(Prefix).Overlaps", Method, 18, ""}, - {"(Prefix).String", Method, 18, ""}, - {"Addr", Type, 18, ""}, - {"AddrFrom16", Func, 18, "func(addr [16]byte) Addr"}, - {"AddrFrom4", Func, 18, "func(addr [4]byte) Addr"}, - {"AddrFromSlice", Func, 18, "func(slice []byte) (ip Addr, ok bool)"}, - {"AddrPort", Type, 18, ""}, - {"AddrPortFrom", Func, 18, "func(ip Addr, port uint16) AddrPort"}, - {"IPv4Unspecified", Func, 18, "func() Addr"}, - {"IPv6LinkLocalAllNodes", Func, 18, "func() Addr"}, - {"IPv6LinkLocalAllRouters", Func, 20, "func() Addr"}, - {"IPv6Loopback", Func, 20, "func() Addr"}, - {"IPv6Unspecified", Func, 18, "func() Addr"}, - {"MustParseAddr", Func, 18, "func(s string) Addr"}, - {"MustParseAddrPort", Func, 18, "func(s string) AddrPort"}, - {"MustParsePrefix", Func, 18, "func(s string) Prefix"}, - {"ParseAddr", Func, 18, "func(s string) (Addr, error)"}, - {"ParseAddrPort", Func, 18, "func(s string) (AddrPort, error)"}, - {"ParsePrefix", Func, 18, "func(s string) (Prefix, error)"}, - {"Prefix", Type, 18, ""}, - {"PrefixFrom", Func, 18, "func(ip Addr, bits int) Prefix"}, - }, - "net/rpc": { - {"(*Client).Call", Method, 0, ""}, - {"(*Client).Close", Method, 0, ""}, - {"(*Client).Go", Method, 0, ""}, - {"(*Server).Accept", Method, 0, ""}, - {"(*Server).HandleHTTP", Method, 0, ""}, - {"(*Server).Register", Method, 0, ""}, - {"(*Server).RegisterName", Method, 0, ""}, - {"(*Server).ServeCodec", Method, 0, ""}, - {"(*Server).ServeConn", Method, 0, ""}, - {"(*Server).ServeHTTP", Method, 0, ""}, - {"(*Server).ServeRequest", Method, 0, ""}, - {"(ClientCodec).Close", Method, 0, ""}, - {"(ClientCodec).ReadResponseBody", Method, 0, ""}, - {"(ClientCodec).ReadResponseHeader", Method, 0, ""}, - {"(ClientCodec).WriteRequest", Method, 0, ""}, - {"(ServerCodec).Close", Method, 0, ""}, - {"(ServerCodec).ReadRequestBody", Method, 0, ""}, - {"(ServerCodec).ReadRequestHeader", Method, 0, ""}, - {"(ServerCodec).WriteResponse", Method, 0, ""}, - {"(ServerError).Error", Method, 0, ""}, - {"Accept", Func, 0, "func(lis net.Listener)"}, - {"Call", Type, 0, ""}, - {"Call.Args", Field, 0, ""}, - {"Call.Done", Field, 0, ""}, - {"Call.Error", Field, 0, ""}, - {"Call.Reply", Field, 0, ""}, - {"Call.ServiceMethod", Field, 0, ""}, - {"Client", Type, 0, ""}, - {"ClientCodec", Type, 0, ""}, - {"DefaultDebugPath", Const, 0, ""}, - {"DefaultRPCPath", Const, 0, ""}, - {"DefaultServer", Var, 0, ""}, - {"Dial", Func, 0, "func(network string, address string) (*Client, error)"}, - {"DialHTTP", Func, 0, "func(network string, address string) (*Client, error)"}, - {"DialHTTPPath", Func, 0, "func(network string, address string, path string) (*Client, error)"}, - {"ErrShutdown", Var, 0, ""}, - {"HandleHTTP", Func, 0, "func()"}, - {"NewClient", Func, 0, "func(conn io.ReadWriteCloser) *Client"}, - {"NewClientWithCodec", Func, 0, "func(codec ClientCodec) *Client"}, - {"NewServer", Func, 0, "func() *Server"}, - {"Register", Func, 0, "func(rcvr any) error"}, - {"RegisterName", Func, 0, "func(name string, rcvr any) error"}, - {"Request", Type, 0, ""}, - {"Request.Seq", Field, 0, ""}, - {"Request.ServiceMethod", Field, 0, ""}, - {"Response", Type, 0, ""}, - {"Response.Error", Field, 0, ""}, - {"Response.Seq", Field, 0, ""}, - {"Response.ServiceMethod", Field, 0, ""}, - {"ServeCodec", Func, 0, "func(codec ServerCodec)"}, - {"ServeConn", Func, 0, "func(conn io.ReadWriteCloser)"}, - {"ServeRequest", Func, 0, "func(codec ServerCodec) error"}, - {"Server", Type, 0, ""}, - {"ServerCodec", Type, 0, ""}, - {"ServerError", Type, 0, ""}, - }, - "net/rpc/jsonrpc": { - {"Dial", Func, 0, "func(network string, address string) (*rpc.Client, error)"}, - {"NewClient", Func, 0, "func(conn io.ReadWriteCloser) *rpc.Client"}, - {"NewClientCodec", Func, 0, "func(conn io.ReadWriteCloser) rpc.ClientCodec"}, - {"NewServerCodec", Func, 0, "func(conn io.ReadWriteCloser) rpc.ServerCodec"}, - {"ServeConn", Func, 0, "func(conn io.ReadWriteCloser)"}, - }, - "net/smtp": { - {"(*Client).Auth", Method, 0, ""}, - {"(*Client).Close", Method, 2, ""}, - {"(*Client).Data", Method, 0, ""}, - {"(*Client).Extension", Method, 0, ""}, - {"(*Client).Hello", Method, 1, ""}, - {"(*Client).Mail", Method, 0, ""}, - {"(*Client).Noop", Method, 10, ""}, - {"(*Client).Quit", Method, 0, ""}, - {"(*Client).Rcpt", Method, 0, ""}, - {"(*Client).Reset", Method, 0, ""}, - {"(*Client).StartTLS", Method, 0, ""}, - {"(*Client).TLSConnectionState", Method, 5, ""}, - {"(*Client).Verify", Method, 0, ""}, - {"(Auth).Next", Method, 0, ""}, - {"(Auth).Start", Method, 0, ""}, - {"Auth", Type, 0, ""}, - {"CRAMMD5Auth", Func, 0, "func(username string, secret string) Auth"}, - {"Client", Type, 0, ""}, - {"Client.Text", Field, 0, ""}, - {"Dial", Func, 0, "func(addr string) (*Client, error)"}, - {"NewClient", Func, 0, "func(conn net.Conn, host string) (*Client, error)"}, - {"PlainAuth", Func, 0, "func(identity string, username string, password string, host string) Auth"}, - {"SendMail", Func, 0, "func(addr string, a Auth, from string, to []string, msg []byte) error"}, - {"ServerInfo", Type, 0, ""}, - {"ServerInfo.Auth", Field, 0, ""}, - {"ServerInfo.Name", Field, 0, ""}, - {"ServerInfo.TLS", Field, 0, ""}, - }, - "net/textproto": { - {"(*Conn).Close", Method, 0, ""}, - {"(*Conn).Cmd", Method, 0, ""}, - {"(*Conn).DotReader", Method, 0, ""}, - {"(*Conn).DotWriter", Method, 0, ""}, - {"(*Conn).EndRequest", Method, 0, ""}, - {"(*Conn).EndResponse", Method, 0, ""}, - {"(*Conn).Next", Method, 0, ""}, - {"(*Conn).PrintfLine", Method, 0, ""}, - {"(*Conn).ReadCodeLine", Method, 0, ""}, - {"(*Conn).ReadContinuedLine", Method, 0, ""}, - {"(*Conn).ReadContinuedLineBytes", Method, 0, ""}, - {"(*Conn).ReadDotBytes", Method, 0, ""}, - {"(*Conn).ReadDotLines", Method, 0, ""}, - {"(*Conn).ReadLine", Method, 0, ""}, - {"(*Conn).ReadLineBytes", Method, 0, ""}, - {"(*Conn).ReadMIMEHeader", Method, 0, ""}, - {"(*Conn).ReadResponse", Method, 0, ""}, - {"(*Conn).StartRequest", Method, 0, ""}, - {"(*Conn).StartResponse", Method, 0, ""}, - {"(*Error).Error", Method, 0, ""}, - {"(*Pipeline).EndRequest", Method, 0, ""}, - {"(*Pipeline).EndResponse", Method, 0, ""}, - {"(*Pipeline).Next", Method, 0, ""}, - {"(*Pipeline).StartRequest", Method, 0, ""}, - {"(*Pipeline).StartResponse", Method, 0, ""}, - {"(*Reader).DotReader", Method, 0, ""}, - {"(*Reader).ReadCodeLine", Method, 0, ""}, - {"(*Reader).ReadContinuedLine", Method, 0, ""}, - {"(*Reader).ReadContinuedLineBytes", Method, 0, ""}, - {"(*Reader).ReadDotBytes", Method, 0, ""}, - {"(*Reader).ReadDotLines", Method, 0, ""}, - {"(*Reader).ReadLine", Method, 0, ""}, - {"(*Reader).ReadLineBytes", Method, 0, ""}, - {"(*Reader).ReadMIMEHeader", Method, 0, ""}, - {"(*Reader).ReadResponse", Method, 0, ""}, - {"(*Writer).DotWriter", Method, 0, ""}, - {"(*Writer).PrintfLine", Method, 0, ""}, - {"(MIMEHeader).Add", Method, 0, ""}, - {"(MIMEHeader).Del", Method, 0, ""}, - {"(MIMEHeader).Get", Method, 0, ""}, - {"(MIMEHeader).Set", Method, 0, ""}, - {"(MIMEHeader).Values", Method, 14, ""}, - {"(ProtocolError).Error", Method, 0, ""}, - {"CanonicalMIMEHeaderKey", Func, 0, "func(s string) string"}, - {"Conn", Type, 0, ""}, - {"Conn.Pipeline", Field, 0, ""}, - {"Conn.Reader", Field, 0, ""}, - {"Conn.Writer", Field, 0, ""}, - {"Dial", Func, 0, "func(network string, addr string) (*Conn, error)"}, - {"Error", Type, 0, ""}, - {"Error.Code", Field, 0, ""}, - {"Error.Msg", Field, 0, ""}, - {"MIMEHeader", Type, 0, ""}, - {"NewConn", Func, 0, "func(conn io.ReadWriteCloser) *Conn"}, - {"NewReader", Func, 0, "func(r *bufio.Reader) *Reader"}, - {"NewWriter", Func, 0, "func(w *bufio.Writer) *Writer"}, - {"Pipeline", Type, 0, ""}, - {"ProtocolError", Type, 0, ""}, - {"Reader", Type, 0, ""}, - {"Reader.R", Field, 0, ""}, - {"TrimBytes", Func, 1, "func(b []byte) []byte"}, - {"TrimString", Func, 1, "func(s string) string"}, - {"Writer", Type, 0, ""}, - {"Writer.W", Field, 0, ""}, - }, - "net/url": { - {"(*Error).Error", Method, 0, ""}, - {"(*Error).Temporary", Method, 6, ""}, - {"(*Error).Timeout", Method, 6, ""}, - {"(*Error).Unwrap", Method, 13, ""}, - {"(*URL).AppendBinary", Method, 24, ""}, - {"(*URL).Clone", Method, 27, ""}, - {"(*URL).EscapedFragment", Method, 15, ""}, - {"(*URL).EscapedPath", Method, 5, ""}, - {"(*URL).Hostname", Method, 8, ""}, - {"(*URL).IsAbs", Method, 0, ""}, - {"(*URL).JoinPath", Method, 19, ""}, - {"(*URL).MarshalBinary", Method, 8, ""}, - {"(*URL).Parse", Method, 0, ""}, - {"(*URL).Port", Method, 8, ""}, - {"(*URL).Query", Method, 0, ""}, - {"(*URL).Redacted", Method, 15, ""}, - {"(*URL).RequestURI", Method, 0, ""}, - {"(*URL).ResolveReference", Method, 0, ""}, - {"(*URL).String", Method, 0, ""}, - {"(*URL).UnmarshalBinary", Method, 8, ""}, - {"(*Userinfo).Password", Method, 0, ""}, - {"(*Userinfo).String", Method, 0, ""}, - {"(*Userinfo).Username", Method, 0, ""}, - {"(EscapeError).Error", Method, 0, ""}, - {"(InvalidHostError).Error", Method, 6, ""}, - {"(Values).Add", Method, 0, ""}, - {"(Values).Clone", Method, 27, ""}, - {"(Values).Del", Method, 0, ""}, - {"(Values).Encode", Method, 0, ""}, - {"(Values).Get", Method, 0, ""}, - {"(Values).Has", Method, 17, ""}, - {"(Values).Set", Method, 0, ""}, - {"Error", Type, 0, ""}, - {"Error.Err", Field, 0, ""}, - {"Error.Op", Field, 0, ""}, - {"Error.URL", Field, 0, ""}, - {"EscapeError", Type, 0, ""}, - {"InvalidHostError", Type, 6, ""}, - {"JoinPath", Func, 19, "func(base string, elem ...string) (result string, err error)"}, - {"Parse", Func, 0, "func(rawURL string) (*URL, error)"}, - {"ParseQuery", Func, 0, "func(query string) (Values, error)"}, - {"ParseRequestURI", Func, 0, "func(rawURL string) (*URL, error)"}, - {"PathEscape", Func, 8, "func(s string) string"}, - {"PathUnescape", Func, 8, "func(s string) (string, error)"}, - {"QueryEscape", Func, 0, "func(s string) string"}, - {"QueryUnescape", Func, 0, "func(s string) (string, error)"}, - {"URL", Type, 0, ""}, - {"URL.ForceQuery", Field, 7, ""}, - {"URL.Fragment", Field, 0, ""}, - {"URL.Host", Field, 0, ""}, - {"URL.OmitHost", Field, 19, ""}, - {"URL.Opaque", Field, 0, ""}, - {"URL.Path", Field, 0, ""}, - {"URL.RawFragment", Field, 15, ""}, - {"URL.RawPath", Field, 5, ""}, - {"URL.RawQuery", Field, 0, ""}, - {"URL.Scheme", Field, 0, ""}, - {"URL.User", Field, 0, ""}, - {"User", Func, 0, "func(username string) *Userinfo"}, - {"UserPassword", Func, 0, "func(username string, password string) *Userinfo"}, - {"Userinfo", Type, 0, ""}, - {"Values", Type, 0, ""}, - }, - "os": { - {"(*File).Chdir", Method, 0, ""}, - {"(*File).Chmod", Method, 0, ""}, - {"(*File).Chown", Method, 0, ""}, - {"(*File).Close", Method, 0, ""}, - {"(*File).Fd", Method, 0, ""}, - {"(*File).Name", Method, 0, ""}, - {"(*File).Read", Method, 0, ""}, - {"(*File).ReadAt", Method, 0, ""}, - {"(*File).ReadDir", Method, 16, ""}, - {"(*File).ReadFrom", Method, 15, ""}, - {"(*File).Readdir", Method, 0, ""}, - {"(*File).Readdirnames", Method, 0, ""}, - {"(*File).Seek", Method, 0, ""}, - {"(*File).SetDeadline", Method, 10, ""}, - {"(*File).SetReadDeadline", Method, 10, ""}, - {"(*File).SetWriteDeadline", Method, 10, ""}, - {"(*File).Stat", Method, 0, ""}, - {"(*File).Sync", Method, 0, ""}, - {"(*File).SyscallConn", Method, 12, ""}, - {"(*File).Truncate", Method, 0, ""}, - {"(*File).Write", Method, 0, ""}, - {"(*File).WriteAt", Method, 0, ""}, - {"(*File).WriteString", Method, 0, ""}, - {"(*File).WriteTo", Method, 22, ""}, - {"(*LinkError).Error", Method, 0, ""}, - {"(*LinkError).Unwrap", Method, 13, ""}, - {"(*PathError).Error", Method, 0, ""}, - {"(*PathError).Timeout", Method, 10, ""}, - {"(*PathError).Unwrap", Method, 13, ""}, - {"(*Process).Kill", Method, 0, ""}, - {"(*Process).Release", Method, 0, ""}, - {"(*Process).Signal", Method, 0, ""}, - {"(*Process).Wait", Method, 0, ""}, - {"(*Process).WithHandle", Method, 26, ""}, - {"(*ProcessState).ExitCode", Method, 12, ""}, - {"(*ProcessState).Exited", Method, 0, ""}, - {"(*ProcessState).Pid", Method, 0, ""}, - {"(*ProcessState).String", Method, 0, ""}, - {"(*ProcessState).Success", Method, 0, ""}, - {"(*ProcessState).Sys", Method, 0, ""}, - {"(*ProcessState).SysUsage", Method, 0, ""}, - {"(*ProcessState).SystemTime", Method, 0, ""}, - {"(*ProcessState).UserTime", Method, 0, ""}, - {"(*Root).Chmod", Method, 25, ""}, - {"(*Root).Chown", Method, 25, ""}, - {"(*Root).Chtimes", Method, 25, ""}, - {"(*Root).Close", Method, 24, ""}, - {"(*Root).Create", Method, 24, ""}, - {"(*Root).FS", Method, 24, ""}, - {"(*Root).Lchown", Method, 25, ""}, - {"(*Root).Link", Method, 25, ""}, - {"(*Root).Lstat", Method, 24, ""}, - {"(*Root).Mkdir", Method, 24, ""}, - {"(*Root).MkdirAll", Method, 25, ""}, - {"(*Root).Name", Method, 24, ""}, - {"(*Root).Open", Method, 24, ""}, - {"(*Root).OpenFile", Method, 24, ""}, - {"(*Root).OpenRoot", Method, 24, ""}, - {"(*Root).ReadFile", Method, 25, ""}, - {"(*Root).Readlink", Method, 25, ""}, - {"(*Root).Remove", Method, 24, ""}, - {"(*Root).RemoveAll", Method, 25, ""}, - {"(*Root).Rename", Method, 25, ""}, - {"(*Root).Stat", Method, 24, ""}, - {"(*Root).Symlink", Method, 25, ""}, - {"(*Root).WriteFile", Method, 25, ""}, - {"(*SyscallError).Error", Method, 0, ""}, - {"(*SyscallError).Timeout", Method, 10, ""}, - {"(*SyscallError).Unwrap", Method, 13, ""}, - {"(FileInfo).IsDir", Method, 0, ""}, - {"(FileInfo).ModTime", Method, 0, ""}, - {"(FileInfo).Mode", Method, 0, ""}, - {"(FileInfo).Name", Method, 0, ""}, - {"(FileInfo).Size", Method, 0, ""}, - {"(FileInfo).Sys", Method, 0, ""}, - {"(FileMode).IsDir", Method, 0, ""}, - {"(FileMode).IsRegular", Method, 1, ""}, - {"(FileMode).Perm", Method, 0, ""}, - {"(FileMode).String", Method, 0, ""}, - {"(Signal).Signal", Method, 0, ""}, - {"(Signal).String", Method, 0, ""}, - {"Args", Var, 0, ""}, - {"Chdir", Func, 0, "func(dir string) error"}, - {"Chmod", Func, 0, "func(name string, mode FileMode) error"}, - {"Chown", Func, 0, "func(name string, uid int, gid int) error"}, - {"Chtimes", Func, 0, "func(name string, atime time.Time, mtime time.Time) error"}, - {"Clearenv", Func, 0, "func()"}, - {"CopyFS", Func, 23, "func(dir string, fsys fs.FS) error"}, - {"Create", Func, 0, "func(name string) (*File, error)"}, - {"CreateTemp", Func, 16, "func(dir string, pattern string) (*File, error)"}, - {"DevNull", Const, 0, ""}, - {"DirEntry", Type, 16, ""}, - {"DirFS", Func, 16, "func(dir string) fs.FS"}, - {"Environ", Func, 0, "func() []string"}, - {"ErrClosed", Var, 8, ""}, - {"ErrDeadlineExceeded", Var, 15, ""}, - {"ErrExist", Var, 0, ""}, - {"ErrInvalid", Var, 0, ""}, - {"ErrNoDeadline", Var, 10, ""}, - {"ErrNoHandle", Var, 26, ""}, - {"ErrNotExist", Var, 0, ""}, - {"ErrPermission", Var, 0, ""}, - {"ErrProcessDone", Var, 16, ""}, - {"Executable", Func, 8, "func() (string, error)"}, - {"Exit", Func, 0, "func(code int)"}, - {"Expand", Func, 0, "func(s string, mapping func(string) string) string"}, - {"ExpandEnv", Func, 0, "func(s string) string"}, - {"File", Type, 0, ""}, - {"FileInfo", Type, 0, ""}, - {"FileMode", Type, 0, ""}, - {"FindProcess", Func, 0, "func(pid int) (*Process, error)"}, - {"Getegid", Func, 0, "func() int"}, - {"Getenv", Func, 0, "func(key string) string"}, - {"Geteuid", Func, 0, "func() int"}, - {"Getgid", Func, 0, "func() int"}, - {"Getgroups", Func, 0, "func() ([]int, error)"}, - {"Getpagesize", Func, 0, "func() int"}, - {"Getpid", Func, 0, "func() int"}, - {"Getppid", Func, 0, "func() int"}, - {"Getuid", Func, 0, "func() int"}, - {"Getwd", Func, 0, "func() (dir string, err error)"}, - {"Hostname", Func, 0, "func() (name string, err error)"}, - {"Interrupt", Var, 0, ""}, - {"IsExist", Func, 0, "func(err error) bool"}, - {"IsNotExist", Func, 0, "func(err error) bool"}, - {"IsPathSeparator", Func, 0, "func(c uint8) bool"}, - {"IsPermission", Func, 0, "func(err error) bool"}, - {"IsTimeout", Func, 10, "func(err error) bool"}, - {"Kill", Var, 0, ""}, - {"Lchown", Func, 0, "func(name string, uid int, gid int) error"}, - {"Link", Func, 0, "func(oldname string, newname string) error"}, - {"LinkError", Type, 0, ""}, - {"LinkError.Err", Field, 0, ""}, - {"LinkError.New", Field, 0, ""}, - {"LinkError.Old", Field, 0, ""}, - {"LinkError.Op", Field, 0, ""}, - {"LookupEnv", Func, 5, "func(key string) (string, bool)"}, - {"Lstat", Func, 0, "func(name string) (FileInfo, error)"}, - {"Mkdir", Func, 0, "func(name string, perm FileMode) error"}, - {"MkdirAll", Func, 0, "func(path string, perm FileMode) error"}, - {"MkdirTemp", Func, 16, "func(dir string, pattern string) (string, error)"}, - {"ModeAppend", Const, 0, ""}, - {"ModeCharDevice", Const, 0, ""}, - {"ModeDevice", Const, 0, ""}, - {"ModeDir", Const, 0, ""}, - {"ModeExclusive", Const, 0, ""}, - {"ModeIrregular", Const, 11, ""}, - {"ModeNamedPipe", Const, 0, ""}, - {"ModePerm", Const, 0, ""}, - {"ModeSetgid", Const, 0, ""}, - {"ModeSetuid", Const, 0, ""}, - {"ModeSocket", Const, 0, ""}, - {"ModeSticky", Const, 0, ""}, - {"ModeSymlink", Const, 0, ""}, - {"ModeTemporary", Const, 0, ""}, - {"ModeType", Const, 0, ""}, - {"NewFile", Func, 0, "func(fd uintptr, name string) *File"}, - {"NewSyscallError", Func, 0, "func(syscall string, err error) error"}, - {"O_APPEND", Const, 0, ""}, - {"O_CREATE", Const, 0, ""}, - {"O_EXCL", Const, 0, ""}, - {"O_RDONLY", Const, 0, ""}, - {"O_RDWR", Const, 0, ""}, - {"O_SYNC", Const, 0, ""}, - {"O_TRUNC", Const, 0, ""}, - {"O_WRONLY", Const, 0, ""}, - {"Open", Func, 0, "func(name string) (*File, error)"}, - {"OpenFile", Func, 0, "func(name string, flag int, perm FileMode) (*File, error)"}, - {"OpenInRoot", Func, 24, "func(dir string, name string) (*File, error)"}, - {"OpenRoot", Func, 24, "func(name string) (*Root, error)"}, - {"PathError", Type, 0, ""}, - {"PathError.Err", Field, 0, ""}, - {"PathError.Op", Field, 0, ""}, - {"PathError.Path", Field, 0, ""}, - {"PathListSeparator", Const, 0, ""}, - {"PathSeparator", Const, 0, ""}, - {"Pipe", Func, 0, "func() (r *File, w *File, err error)"}, - {"ProcAttr", Type, 0, ""}, - {"ProcAttr.Dir", Field, 0, ""}, - {"ProcAttr.Env", Field, 0, ""}, - {"ProcAttr.Files", Field, 0, ""}, - {"ProcAttr.Sys", Field, 0, ""}, - {"Process", Type, 0, ""}, - {"Process.Pid", Field, 0, ""}, - {"ProcessState", Type, 0, ""}, - {"ReadDir", Func, 16, "func(name string) ([]DirEntry, error)"}, - {"ReadFile", Func, 16, "func(name string) ([]byte, error)"}, - {"Readlink", Func, 0, "func(name string) (string, error)"}, - {"Remove", Func, 0, "func(name string) error"}, - {"RemoveAll", Func, 0, "func(path string) error"}, - {"Rename", Func, 0, "func(oldpath string, newpath string) error"}, - {"Root", Type, 24, ""}, - {"SEEK_CUR", Const, 0, ""}, - {"SEEK_END", Const, 0, ""}, - {"SEEK_SET", Const, 0, ""}, - {"SameFile", Func, 0, "func(fi1 FileInfo, fi2 FileInfo) bool"}, - {"Setenv", Func, 0, "func(key string, value string) error"}, - {"Signal", Type, 0, ""}, - {"StartProcess", Func, 0, "func(name string, argv []string, attr *ProcAttr) (*Process, error)"}, - {"Stat", Func, 0, "func(name string) (FileInfo, error)"}, - {"Stderr", Var, 0, ""}, - {"Stdin", Var, 0, ""}, - {"Stdout", Var, 0, ""}, - {"Symlink", Func, 0, "func(oldname string, newname string) error"}, - {"SyscallError", Type, 0, ""}, - {"SyscallError.Err", Field, 0, ""}, - {"SyscallError.Syscall", Field, 0, ""}, - {"TempDir", Func, 0, "func() string"}, - {"Truncate", Func, 0, "func(name string, size int64) error"}, - {"Unsetenv", Func, 4, "func(key string) error"}, - {"UserCacheDir", Func, 11, "func() (string, error)"}, - {"UserConfigDir", Func, 13, "func() (string, error)"}, - {"UserHomeDir", Func, 12, "func() (string, error)"}, - {"WriteFile", Func, 16, "func(name string, data []byte, perm FileMode) error"}, - }, - "os/exec": { - {"(*Cmd).CombinedOutput", Method, 0, ""}, - {"(*Cmd).Environ", Method, 19, ""}, - {"(*Cmd).Output", Method, 0, ""}, - {"(*Cmd).Run", Method, 0, ""}, - {"(*Cmd).Start", Method, 0, ""}, - {"(*Cmd).StderrPipe", Method, 0, ""}, - {"(*Cmd).StdinPipe", Method, 0, ""}, - {"(*Cmd).StdoutPipe", Method, 0, ""}, - {"(*Cmd).String", Method, 13, ""}, - {"(*Cmd).Wait", Method, 0, ""}, - {"(*Error).Error", Method, 0, ""}, - {"(*Error).Unwrap", Method, 13, ""}, - {"(*ExitError).Error", Method, 0, ""}, - {"(ExitError).ExitCode", Method, 12, ""}, - {"(ExitError).Exited", Method, 0, ""}, - {"(ExitError).Pid", Method, 0, ""}, - {"(ExitError).String", Method, 0, ""}, - {"(ExitError).Success", Method, 0, ""}, - {"(ExitError).Sys", Method, 0, ""}, - {"(ExitError).SysUsage", Method, 0, ""}, - {"(ExitError).SystemTime", Method, 0, ""}, - {"(ExitError).UserTime", Method, 0, ""}, - {"Cmd", Type, 0, ""}, - {"Cmd.Args", Field, 0, ""}, - {"Cmd.Cancel", Field, 20, ""}, - {"Cmd.Dir", Field, 0, ""}, - {"Cmd.Env", Field, 0, ""}, - {"Cmd.Err", Field, 19, ""}, - {"Cmd.ExtraFiles", Field, 0, ""}, - {"Cmd.Path", Field, 0, ""}, - {"Cmd.Process", Field, 0, ""}, - {"Cmd.ProcessState", Field, 0, ""}, - {"Cmd.Stderr", Field, 0, ""}, - {"Cmd.Stdin", Field, 0, ""}, - {"Cmd.Stdout", Field, 0, ""}, - {"Cmd.SysProcAttr", Field, 0, ""}, - {"Cmd.WaitDelay", Field, 20, ""}, - {"Command", Func, 0, "func(name string, arg ...string) *Cmd"}, - {"CommandContext", Func, 7, "func(ctx context.Context, name string, arg ...string) *Cmd"}, - {"ErrDot", Var, 19, ""}, - {"ErrNotFound", Var, 0, ""}, - {"ErrWaitDelay", Var, 20, ""}, - {"Error", Type, 0, ""}, - {"Error.Err", Field, 0, ""}, - {"Error.Name", Field, 0, ""}, - {"ExitError", Type, 0, ""}, - {"ExitError.ProcessState", Field, 0, ""}, - {"ExitError.Stderr", Field, 6, ""}, - {"LookPath", Func, 0, "func(file string) (string, error)"}, - }, - "os/signal": { - {"Ignore", Func, 5, "func(sig ...os.Signal)"}, - {"Ignored", Func, 11, "func(sig os.Signal) bool"}, - {"Notify", Func, 0, "func(c chan<- os.Signal, sig ...os.Signal)"}, - {"NotifyContext", Func, 16, "func(parent context.Context, signals ...os.Signal) (ctx context.Context, stop context.CancelFunc)"}, - {"Reset", Func, 5, "func(sig ...os.Signal)"}, - {"Stop", Func, 1, "func(c chan<- os.Signal)"}, - }, - "os/user": { - {"(*User).GroupIds", Method, 7, ""}, - {"(UnknownGroupError).Error", Method, 7, ""}, - {"(UnknownGroupIdError).Error", Method, 7, ""}, - {"(UnknownUserError).Error", Method, 0, ""}, - {"(UnknownUserIdError).Error", Method, 0, ""}, - {"Current", Func, 0, "func() (*User, error)"}, - {"Group", Type, 7, ""}, - {"Group.Gid", Field, 7, ""}, - {"Group.Name", Field, 7, ""}, - {"Lookup", Func, 0, "func(username string) (*User, error)"}, - {"LookupGroup", Func, 7, "func(name string) (*Group, error)"}, - {"LookupGroupId", Func, 7, "func(gid string) (*Group, error)"}, - {"LookupId", Func, 0, "func(uid string) (*User, error)"}, - {"UnknownGroupError", Type, 7, ""}, - {"UnknownGroupIdError", Type, 7, ""}, - {"UnknownUserError", Type, 0, ""}, - {"UnknownUserIdError", Type, 0, ""}, - {"User", Type, 0, ""}, - {"User.Gid", Field, 0, ""}, - {"User.HomeDir", Field, 0, ""}, - {"User.Name", Field, 0, ""}, - {"User.Uid", Field, 0, ""}, - {"User.Username", Field, 0, ""}, - }, - "path": { - {"Base", Func, 0, "func(path string) string"}, - {"Clean", Func, 0, "func(path string) string"}, - {"Dir", Func, 0, "func(path string) string"}, - {"ErrBadPattern", Var, 0, ""}, - {"Ext", Func, 0, "func(path string) string"}, - {"IsAbs", Func, 0, "func(path string) bool"}, - {"Join", Func, 0, "func(elem ...string) string"}, - {"Match", Func, 0, "func(pattern string, name string) (matched bool, err error)"}, - {"Split", Func, 0, "func(path string) (dir string, file string)"}, - }, - "path/filepath": { - {"Abs", Func, 0, "func(path string) (string, error)"}, - {"Base", Func, 0, "func(path string) string"}, - {"Clean", Func, 0, "func(path string) string"}, - {"Dir", Func, 0, "func(path string) string"}, - {"ErrBadPattern", Var, 0, ""}, - {"EvalSymlinks", Func, 0, "func(path string) (string, error)"}, - {"Ext", Func, 0, "func(path string) string"}, - {"FromSlash", Func, 0, "func(path string) string"}, - {"Glob", Func, 0, "func(pattern string) (matches []string, err error)"}, - {"HasPrefix", Func, 0, "func(p string, prefix string) bool"}, - {"IsAbs", Func, 0, "func(path string) bool"}, - {"IsLocal", Func, 20, "func(path string) bool"}, - {"Join", Func, 0, "func(elem ...string) string"}, - {"ListSeparator", Const, 0, ""}, - {"Localize", Func, 23, "func(path string) (string, error)"}, - {"Match", Func, 0, "func(pattern string, name string) (matched bool, err error)"}, - {"Rel", Func, 0, "func(basePath string, targPath string) (string, error)"}, - {"Separator", Const, 0, ""}, - {"SkipAll", Var, 20, ""}, - {"SkipDir", Var, 0, ""}, - {"Split", Func, 0, "func(path string) (dir string, file string)"}, - {"SplitList", Func, 0, "func(path string) []string"}, - {"ToSlash", Func, 0, "func(path string) string"}, - {"VolumeName", Func, 0, "func(path string) string"}, - {"Walk", Func, 0, "func(root string, fn WalkFunc) error"}, - {"WalkDir", Func, 16, "func(root string, fn fs.WalkDirFunc) error"}, - {"WalkFunc", Type, 0, ""}, - }, - "plugin": { - {"(*Plugin).Lookup", Method, 8, ""}, - {"Open", Func, 8, "func(path string) (*Plugin, error)"}, - {"Plugin", Type, 8, ""}, - {"Symbol", Type, 8, ""}, - }, - "reflect": { - {"(*MapIter).Key", Method, 12, ""}, - {"(*MapIter).Next", Method, 12, ""}, - {"(*MapIter).Reset", Method, 18, ""}, - {"(*MapIter).Value", Method, 12, ""}, - {"(*ValueError).Error", Method, 0, ""}, - {"(ChanDir).String", Method, 0, ""}, - {"(Kind).String", Method, 0, ""}, - {"(Method).IsExported", Method, 17, ""}, - {"(StructField).IsExported", Method, 17, ""}, - {"(StructTag).Get", Method, 0, ""}, - {"(StructTag).Lookup", Method, 7, ""}, - {"(Type).Align", Method, 0, ""}, - {"(Type).AssignableTo", Method, 0, ""}, - {"(Type).Bits", Method, 0, ""}, - {"(Type).CanSeq", Method, 23, ""}, - {"(Type).CanSeq2", Method, 23, ""}, - {"(Type).ChanDir", Method, 0, ""}, - {"(Type).Comparable", Method, 4, ""}, - {"(Type).ConvertibleTo", Method, 1, ""}, - {"(Type).Elem", Method, 0, ""}, - {"(Type).Field", Method, 0, ""}, - {"(Type).FieldAlign", Method, 0, ""}, - {"(Type).FieldByIndex", Method, 0, ""}, - {"(Type).FieldByName", Method, 0, ""}, - {"(Type).FieldByNameFunc", Method, 0, ""}, - {"(Type).Fields", Method, 26, ""}, - {"(Type).Implements", Method, 0, ""}, - {"(Type).In", Method, 0, ""}, - {"(Type).Ins", Method, 26, ""}, - {"(Type).IsVariadic", Method, 0, ""}, - {"(Type).Key", Method, 0, ""}, - {"(Type).Kind", Method, 0, ""}, - {"(Type).Len", Method, 0, ""}, - {"(Type).Method", Method, 0, ""}, - {"(Type).MethodByName", Method, 0, ""}, - {"(Type).Methods", Method, 26, ""}, - {"(Type).Name", Method, 0, ""}, - {"(Type).NumField", Method, 0, ""}, - {"(Type).NumIn", Method, 0, ""}, - {"(Type).NumMethod", Method, 0, ""}, - {"(Type).NumOut", Method, 0, ""}, - {"(Type).Out", Method, 0, ""}, - {"(Type).Outs", Method, 26, ""}, - {"(Type).OverflowComplex", Method, 23, ""}, - {"(Type).OverflowFloat", Method, 23, ""}, - {"(Type).OverflowInt", Method, 23, ""}, - {"(Type).OverflowUint", Method, 23, ""}, - {"(Type).PkgPath", Method, 0, ""}, - {"(Type).Size", Method, 0, ""}, - {"(Type).String", Method, 0, ""}, - {"(Value).Addr", Method, 0, ""}, - {"(Value).Bool", Method, 0, ""}, - {"(Value).Bytes", Method, 0, ""}, - {"(Value).Call", Method, 0, ""}, - {"(Value).CallSlice", Method, 0, ""}, - {"(Value).CanAddr", Method, 0, ""}, - {"(Value).CanComplex", Method, 18, ""}, - {"(Value).CanConvert", Method, 17, ""}, - {"(Value).CanFloat", Method, 18, ""}, - {"(Value).CanInt", Method, 18, ""}, - {"(Value).CanInterface", Method, 0, ""}, - {"(Value).CanSet", Method, 0, ""}, - {"(Value).CanUint", Method, 18, ""}, - {"(Value).Cap", Method, 0, ""}, - {"(Value).Clear", Method, 21, ""}, - {"(Value).Close", Method, 0, ""}, - {"(Value).Comparable", Method, 20, ""}, - {"(Value).Complex", Method, 0, ""}, - {"(Value).Convert", Method, 1, ""}, - {"(Value).Elem", Method, 0, ""}, - {"(Value).Equal", Method, 20, ""}, - {"(Value).Field", Method, 0, ""}, - {"(Value).FieldByIndex", Method, 0, ""}, - {"(Value).FieldByIndexErr", Method, 18, ""}, - {"(Value).FieldByName", Method, 0, ""}, - {"(Value).FieldByNameFunc", Method, 0, ""}, - {"(Value).Fields", Method, 26, ""}, - {"(Value).Float", Method, 0, ""}, - {"(Value).Grow", Method, 20, ""}, - {"(Value).Index", Method, 0, ""}, - {"(Value).Int", Method, 0, ""}, - {"(Value).Interface", Method, 0, ""}, - {"(Value).InterfaceData", Method, 0, ""}, - {"(Value).IsNil", Method, 0, ""}, - {"(Value).IsValid", Method, 0, ""}, - {"(Value).IsZero", Method, 13, ""}, - {"(Value).Kind", Method, 0, ""}, - {"(Value).Len", Method, 0, ""}, - {"(Value).MapIndex", Method, 0, ""}, - {"(Value).MapKeys", Method, 0, ""}, - {"(Value).MapRange", Method, 12, ""}, - {"(Value).Method", Method, 0, ""}, - {"(Value).MethodByName", Method, 0, ""}, - {"(Value).Methods", Method, 26, ""}, - {"(Value).NumField", Method, 0, ""}, - {"(Value).NumMethod", Method, 0, ""}, - {"(Value).OverflowComplex", Method, 0, ""}, - {"(Value).OverflowFloat", Method, 0, ""}, - {"(Value).OverflowInt", Method, 0, ""}, - {"(Value).OverflowUint", Method, 0, ""}, - {"(Value).Pointer", Method, 0, ""}, - {"(Value).Recv", Method, 0, ""}, - {"(Value).Send", Method, 0, ""}, - {"(Value).Seq", Method, 23, ""}, - {"(Value).Seq2", Method, 23, ""}, - {"(Value).Set", Method, 0, ""}, - {"(Value).SetBool", Method, 0, ""}, - {"(Value).SetBytes", Method, 0, ""}, - {"(Value).SetCap", Method, 2, ""}, - {"(Value).SetComplex", Method, 0, ""}, - {"(Value).SetFloat", Method, 0, ""}, - {"(Value).SetInt", Method, 0, ""}, - {"(Value).SetIterKey", Method, 18, ""}, - {"(Value).SetIterValue", Method, 18, ""}, - {"(Value).SetLen", Method, 0, ""}, - {"(Value).SetMapIndex", Method, 0, ""}, - {"(Value).SetPointer", Method, 0, ""}, - {"(Value).SetString", Method, 0, ""}, - {"(Value).SetUint", Method, 0, ""}, - {"(Value).SetZero", Method, 20, ""}, - {"(Value).Slice", Method, 0, ""}, - {"(Value).Slice3", Method, 2, ""}, - {"(Value).String", Method, 0, ""}, - {"(Value).TryRecv", Method, 0, ""}, - {"(Value).TrySend", Method, 0, ""}, - {"(Value).Type", Method, 0, ""}, - {"(Value).Uint", Method, 0, ""}, - {"(Value).UnsafeAddr", Method, 0, ""}, - {"(Value).UnsafePointer", Method, 18, ""}, - {"Append", Func, 0, "func(s Value, x ...Value) Value"}, - {"AppendSlice", Func, 0, "func(s Value, t Value) Value"}, - {"Array", Const, 0, ""}, - {"ArrayOf", Func, 5, "func(length int, elem Type) Type"}, - {"Bool", Const, 0, ""}, - {"BothDir", Const, 0, ""}, - {"Chan", Const, 0, ""}, - {"ChanDir", Type, 0, ""}, - {"ChanOf", Func, 1, "func(dir ChanDir, t Type) Type"}, - {"Complex128", Const, 0, ""}, - {"Complex64", Const, 0, ""}, - {"Copy", Func, 0, "func(dst Value, src Value) int"}, - {"DeepEqual", Func, 0, "func(x any, y any) bool"}, - {"Float32", Const, 0, ""}, - {"Float64", Const, 0, ""}, - {"Func", Const, 0, ""}, - {"FuncOf", Func, 5, "func(in []Type, out []Type, variadic bool) Type"}, - {"Indirect", Func, 0, "func(v Value) Value"}, - {"Int", Const, 0, ""}, - {"Int16", Const, 0, ""}, - {"Int32", Const, 0, ""}, - {"Int64", Const, 0, ""}, - {"Int8", Const, 0, ""}, - {"Interface", Const, 0, ""}, - {"Invalid", Const, 0, ""}, - {"Kind", Type, 0, ""}, - {"MakeChan", Func, 0, "func(typ Type, buffer int) Value"}, - {"MakeFunc", Func, 1, "func(typ Type, fn func(args []Value) (results []Value)) Value"}, - {"MakeMap", Func, 0, "func(typ Type) Value"}, - {"MakeMapWithSize", Func, 9, "func(typ Type, n int) Value"}, - {"MakeSlice", Func, 0, "func(typ Type, len int, cap int) Value"}, - {"Map", Const, 0, ""}, - {"MapIter", Type, 12, ""}, - {"MapOf", Func, 1, "func(key Type, elem Type) Type"}, - {"Method", Type, 0, ""}, - {"Method.Func", Field, 0, ""}, - {"Method.Index", Field, 0, ""}, - {"Method.Name", Field, 0, ""}, - {"Method.PkgPath", Field, 0, ""}, - {"Method.Type", Field, 0, ""}, - {"New", Func, 0, "func(typ Type) Value"}, - {"NewAt", Func, 0, "func(typ Type, p unsafe.Pointer) Value"}, - {"Pointer", Const, 18, ""}, - {"PointerTo", Func, 18, "func(t Type) Type"}, - {"Ptr", Const, 0, ""}, - {"PtrTo", Func, 0, "func(t Type) Type"}, - {"RecvDir", Const, 0, ""}, - {"Select", Func, 1, "func(cases []SelectCase) (chosen int, recv Value, recvOK bool)"}, - {"SelectCase", Type, 1, ""}, - {"SelectCase.Chan", Field, 1, ""}, - {"SelectCase.Dir", Field, 1, ""}, - {"SelectCase.Send", Field, 1, ""}, - {"SelectDefault", Const, 1, ""}, - {"SelectDir", Type, 1, ""}, - {"SelectRecv", Const, 1, ""}, - {"SelectSend", Const, 1, ""}, - {"SendDir", Const, 0, ""}, - {"Slice", Const, 0, ""}, - {"SliceAt", Func, 23, "func(typ Type, p unsafe.Pointer, n int) Value"}, - {"SliceHeader", Type, 0, ""}, - {"SliceHeader.Cap", Field, 0, ""}, - {"SliceHeader.Data", Field, 0, ""}, - {"SliceHeader.Len", Field, 0, ""}, - {"SliceOf", Func, 1, "func(t Type) Type"}, - {"String", Const, 0, ""}, - {"StringHeader", Type, 0, ""}, - {"StringHeader.Data", Field, 0, ""}, - {"StringHeader.Len", Field, 0, ""}, - {"Struct", Const, 0, ""}, - {"StructField", Type, 0, ""}, - {"StructField.Anonymous", Field, 0, ""}, - {"StructField.Index", Field, 0, ""}, - {"StructField.Name", Field, 0, ""}, - {"StructField.Offset", Field, 0, ""}, - {"StructField.PkgPath", Field, 0, ""}, - {"StructField.Tag", Field, 0, ""}, - {"StructField.Type", Field, 0, ""}, - {"StructOf", Func, 7, "func(fields []StructField) Type"}, - {"StructTag", Type, 0, ""}, - {"Swapper", Func, 8, "func(slice any) func(i int, j int)"}, - {"TypeAssert", Func, 25, "func[T any](v Value) (T, bool)"}, - {"TypeFor", Func, 22, "func[T any]() Type"}, - {"TypeOf", Func, 0, "func(i any) Type"}, - {"Uint", Const, 0, ""}, - {"Uint16", Const, 0, ""}, - {"Uint32", Const, 0, ""}, - {"Uint64", Const, 0, ""}, - {"Uint8", Const, 0, ""}, - {"Uintptr", Const, 0, ""}, - {"UnsafePointer", Const, 0, ""}, - {"Value", Type, 0, ""}, - {"ValueError", Type, 0, ""}, - {"ValueError.Kind", Field, 0, ""}, - {"ValueError.Method", Field, 0, ""}, - {"ValueOf", Func, 0, "func(i any) Value"}, - {"VisibleFields", Func, 17, "func(t Type) []StructField"}, - {"Zero", Func, 0, "func(typ Type) Value"}, - }, - "regexp": { - {"(*Regexp).AppendText", Method, 24, ""}, - {"(*Regexp).Copy", Method, 6, ""}, - {"(*Regexp).Expand", Method, 0, ""}, - {"(*Regexp).ExpandString", Method, 0, ""}, - {"(*Regexp).Find", Method, 0, ""}, - {"(*Regexp).FindAll", Method, 0, ""}, - {"(*Regexp).FindAllIndex", Method, 0, ""}, - {"(*Regexp).FindAllString", Method, 0, ""}, - {"(*Regexp).FindAllStringIndex", Method, 0, ""}, - {"(*Regexp).FindAllStringSubmatch", Method, 0, ""}, - {"(*Regexp).FindAllStringSubmatchIndex", Method, 0, ""}, - {"(*Regexp).FindAllSubmatch", Method, 0, ""}, - {"(*Regexp).FindAllSubmatchIndex", Method, 0, ""}, - {"(*Regexp).FindIndex", Method, 0, ""}, - {"(*Regexp).FindReaderIndex", Method, 0, ""}, - {"(*Regexp).FindReaderSubmatchIndex", Method, 0, ""}, - {"(*Regexp).FindString", Method, 0, ""}, - {"(*Regexp).FindStringIndex", Method, 0, ""}, - {"(*Regexp).FindStringSubmatch", Method, 0, ""}, - {"(*Regexp).FindStringSubmatchIndex", Method, 0, ""}, - {"(*Regexp).FindSubmatch", Method, 0, ""}, - {"(*Regexp).FindSubmatchIndex", Method, 0, ""}, - {"(*Regexp).LiteralPrefix", Method, 0, ""}, - {"(*Regexp).Longest", Method, 1, ""}, - {"(*Regexp).MarshalText", Method, 21, ""}, - {"(*Regexp).Match", Method, 0, ""}, - {"(*Regexp).MatchReader", Method, 0, ""}, - {"(*Regexp).MatchString", Method, 0, ""}, - {"(*Regexp).NumSubexp", Method, 0, ""}, - {"(*Regexp).ReplaceAll", Method, 0, ""}, - {"(*Regexp).ReplaceAllFunc", Method, 0, ""}, - {"(*Regexp).ReplaceAllLiteral", Method, 0, ""}, - {"(*Regexp).ReplaceAllLiteralString", Method, 0, ""}, - {"(*Regexp).ReplaceAllString", Method, 0, ""}, - {"(*Regexp).ReplaceAllStringFunc", Method, 0, ""}, - {"(*Regexp).Split", Method, 1, ""}, - {"(*Regexp).String", Method, 0, ""}, - {"(*Regexp).SubexpIndex", Method, 15, ""}, - {"(*Regexp).SubexpNames", Method, 0, ""}, - {"(*Regexp).UnmarshalText", Method, 21, ""}, - {"Compile", Func, 0, "func(expr string) (*Regexp, error)"}, - {"CompilePOSIX", Func, 0, "func(expr string) (*Regexp, error)"}, - {"Match", Func, 0, "func(pattern string, b []byte) (matched bool, err error)"}, - {"MatchReader", Func, 0, "func(pattern string, r io.RuneReader) (matched bool, err error)"}, - {"MatchString", Func, 0, "func(pattern string, s string) (matched bool, err error)"}, - {"MustCompile", Func, 0, "func(str string) *Regexp"}, - {"MustCompilePOSIX", Func, 0, "func(str string) *Regexp"}, - {"QuoteMeta", Func, 0, "func(s string) string"}, - {"Regexp", Type, 0, ""}, - }, - "regexp/syntax": { - {"(*Error).Error", Method, 0, ""}, - {"(*Inst).MatchEmptyWidth", Method, 0, ""}, - {"(*Inst).MatchRune", Method, 0, ""}, - {"(*Inst).MatchRunePos", Method, 3, ""}, - {"(*Inst).String", Method, 0, ""}, - {"(*Prog).Prefix", Method, 0, ""}, - {"(*Prog).StartCond", Method, 0, ""}, - {"(*Prog).String", Method, 0, ""}, - {"(*Regexp).CapNames", Method, 0, ""}, - {"(*Regexp).Equal", Method, 0, ""}, - {"(*Regexp).MaxCap", Method, 0, ""}, - {"(*Regexp).Simplify", Method, 0, ""}, - {"(*Regexp).String", Method, 0, ""}, - {"(ErrorCode).String", Method, 0, ""}, - {"(InstOp).String", Method, 3, ""}, - {"(Op).String", Method, 11, ""}, - {"ClassNL", Const, 0, ""}, - {"Compile", Func, 0, "func(re *Regexp) (*Prog, error)"}, - {"DotNL", Const, 0, ""}, - {"EmptyBeginLine", Const, 0, ""}, - {"EmptyBeginText", Const, 0, ""}, - {"EmptyEndLine", Const, 0, ""}, - {"EmptyEndText", Const, 0, ""}, - {"EmptyNoWordBoundary", Const, 0, ""}, - {"EmptyOp", Type, 0, ""}, - {"EmptyOpContext", Func, 0, "func(r1 rune, r2 rune) EmptyOp"}, - {"EmptyWordBoundary", Const, 0, ""}, - {"ErrInternalError", Const, 0, ""}, - {"ErrInvalidCharClass", Const, 0, ""}, - {"ErrInvalidCharRange", Const, 0, ""}, - {"ErrInvalidEscape", Const, 0, ""}, - {"ErrInvalidNamedCapture", Const, 0, ""}, - {"ErrInvalidPerlOp", Const, 0, ""}, - {"ErrInvalidRepeatOp", Const, 0, ""}, - {"ErrInvalidRepeatSize", Const, 0, ""}, - {"ErrInvalidUTF8", Const, 0, ""}, - {"ErrLarge", Const, 20, ""}, - {"ErrMissingBracket", Const, 0, ""}, - {"ErrMissingParen", Const, 0, ""}, - {"ErrMissingRepeatArgument", Const, 0, ""}, - {"ErrNestingDepth", Const, 19, ""}, - {"ErrTrailingBackslash", Const, 0, ""}, - {"ErrUnexpectedParen", Const, 1, ""}, - {"Error", Type, 0, ""}, - {"Error.Code", Field, 0, ""}, - {"Error.Expr", Field, 0, ""}, - {"ErrorCode", Type, 0, ""}, - {"Flags", Type, 0, ""}, - {"FoldCase", Const, 0, ""}, - {"Inst", Type, 0, ""}, - {"Inst.Arg", Field, 0, ""}, - {"Inst.Op", Field, 0, ""}, - {"Inst.Out", Field, 0, ""}, - {"Inst.Rune", Field, 0, ""}, - {"InstAlt", Const, 0, ""}, - {"InstAltMatch", Const, 0, ""}, - {"InstCapture", Const, 0, ""}, - {"InstEmptyWidth", Const, 0, ""}, - {"InstFail", Const, 0, ""}, - {"InstMatch", Const, 0, ""}, - {"InstNop", Const, 0, ""}, - {"InstOp", Type, 0, ""}, - {"InstRune", Const, 0, ""}, - {"InstRune1", Const, 0, ""}, - {"InstRuneAny", Const, 0, ""}, - {"InstRuneAnyNotNL", Const, 0, ""}, - {"IsWordChar", Func, 0, "func(r rune) bool"}, - {"Literal", Const, 0, ""}, - {"MatchNL", Const, 0, ""}, - {"NonGreedy", Const, 0, ""}, - {"OneLine", Const, 0, ""}, - {"Op", Type, 0, ""}, - {"OpAlternate", Const, 0, ""}, - {"OpAnyChar", Const, 0, ""}, - {"OpAnyCharNotNL", Const, 0, ""}, - {"OpBeginLine", Const, 0, ""}, - {"OpBeginText", Const, 0, ""}, - {"OpCapture", Const, 0, ""}, - {"OpCharClass", Const, 0, ""}, - {"OpConcat", Const, 0, ""}, - {"OpEmptyMatch", Const, 0, ""}, - {"OpEndLine", Const, 0, ""}, - {"OpEndText", Const, 0, ""}, - {"OpLiteral", Const, 0, ""}, - {"OpNoMatch", Const, 0, ""}, - {"OpNoWordBoundary", Const, 0, ""}, - {"OpPlus", Const, 0, ""}, - {"OpQuest", Const, 0, ""}, - {"OpRepeat", Const, 0, ""}, - {"OpStar", Const, 0, ""}, - {"OpWordBoundary", Const, 0, ""}, - {"POSIX", Const, 0, ""}, - {"Parse", Func, 0, "func(s string, flags Flags) (*Regexp, error)"}, - {"Perl", Const, 0, ""}, - {"PerlX", Const, 0, ""}, - {"Prog", Type, 0, ""}, - {"Prog.Inst", Field, 0, ""}, - {"Prog.NumCap", Field, 0, ""}, - {"Prog.Start", Field, 0, ""}, - {"Regexp", Type, 0, ""}, - {"Regexp.Cap", Field, 0, ""}, - {"Regexp.Flags", Field, 0, ""}, - {"Regexp.Max", Field, 0, ""}, - {"Regexp.Min", Field, 0, ""}, - {"Regexp.Name", Field, 0, ""}, - {"Regexp.Op", Field, 0, ""}, - {"Regexp.Rune", Field, 0, ""}, - {"Regexp.Rune0", Field, 0, ""}, - {"Regexp.Sub", Field, 0, ""}, - {"Regexp.Sub0", Field, 0, ""}, - {"Simple", Const, 0, ""}, - {"UnicodeGroups", Const, 0, ""}, - {"WasDollar", Const, 0, ""}, - }, - "runtime": { - {"(*BlockProfileRecord).Stack", Method, 1, ""}, - {"(*Frames).Next", Method, 7, ""}, - {"(*Func).Entry", Method, 0, ""}, - {"(*Func).FileLine", Method, 0, ""}, - {"(*Func).Name", Method, 0, ""}, - {"(*MemProfileRecord).InUseBytes", Method, 0, ""}, - {"(*MemProfileRecord).InUseObjects", Method, 0, ""}, - {"(*MemProfileRecord).Stack", Method, 0, ""}, - {"(*PanicNilError).Error", Method, 21, ""}, - {"(*PanicNilError).RuntimeError", Method, 21, ""}, - {"(*Pinner).Pin", Method, 21, ""}, - {"(*Pinner).Unpin", Method, 21, ""}, - {"(*StackRecord).Stack", Method, 0, ""}, - {"(*TypeAssertionError).Error", Method, 0, ""}, - {"(*TypeAssertionError).RuntimeError", Method, 0, ""}, - {"(Cleanup).Stop", Method, 24, ""}, - {"(Error).Error", Method, 0, ""}, - {"(Error).RuntimeError", Method, 0, ""}, - {"AddCleanup", Func, 24, "func[T, S any](ptr *T, cleanup func(S), arg S) Cleanup"}, - {"BlockProfile", Func, 1, "func(p []BlockProfileRecord) (n int, ok bool)"}, - {"BlockProfileRecord", Type, 1, ""}, - {"BlockProfileRecord.Count", Field, 1, ""}, - {"BlockProfileRecord.Cycles", Field, 1, ""}, - {"BlockProfileRecord.StackRecord", Field, 1, ""}, - {"Breakpoint", Func, 0, "func()"}, - {"CPUProfile", Func, 0, "func() []byte"}, - {"Caller", Func, 0, "func(skip int) (pc uintptr, file string, line int, ok bool)"}, - {"Callers", Func, 0, "func(skip int, pc []uintptr) int"}, - {"CallersFrames", Func, 7, "func(callers []uintptr) *Frames"}, - {"Cleanup", Type, 24, ""}, - {"Compiler", Const, 0, ""}, - {"Error", Type, 0, ""}, - {"Frame", Type, 7, ""}, - {"Frame.Entry", Field, 7, ""}, - {"Frame.File", Field, 7, ""}, - {"Frame.Func", Field, 7, ""}, - {"Frame.Function", Field, 7, ""}, - {"Frame.Line", Field, 7, ""}, - {"Frame.PC", Field, 7, ""}, - {"Frames", Type, 7, ""}, - {"Func", Type, 0, ""}, - {"FuncForPC", Func, 0, "func(pc uintptr) *Func"}, - {"GC", Func, 0, "func()"}, - {"GOARCH", Const, 0, ""}, - {"GOMAXPROCS", Func, 0, "func(n int) int"}, - {"GOOS", Const, 0, ""}, - {"GOROOT", Func, 0, "func() string"}, - {"Goexit", Func, 0, "func()"}, - {"GoroutineProfile", Func, 0, "func(p []StackRecord) (n int, ok bool)"}, - {"Gosched", Func, 0, "func()"}, - {"KeepAlive", Func, 7, "func(x any)"}, - {"LockOSThread", Func, 0, "func()"}, - {"MemProfile", Func, 0, "func(p []MemProfileRecord, inuseZero bool) (n int, ok bool)"}, - {"MemProfileRate", Var, 0, ""}, - {"MemProfileRecord", Type, 0, ""}, - {"MemProfileRecord.AllocBytes", Field, 0, ""}, - {"MemProfileRecord.AllocObjects", Field, 0, ""}, - {"MemProfileRecord.FreeBytes", Field, 0, ""}, - {"MemProfileRecord.FreeObjects", Field, 0, ""}, - {"MemProfileRecord.Stack0", Field, 0, ""}, - {"MemStats", Type, 0, ""}, - {"MemStats.Alloc", Field, 0, ""}, - {"MemStats.BuckHashSys", Field, 0, ""}, - {"MemStats.BySize", Field, 0, ""}, - {"MemStats.DebugGC", Field, 0, ""}, - {"MemStats.EnableGC", Field, 0, ""}, - {"MemStats.Frees", Field, 0, ""}, - {"MemStats.GCCPUFraction", Field, 5, ""}, - {"MemStats.GCSys", Field, 2, ""}, - {"MemStats.HeapAlloc", Field, 0, ""}, - {"MemStats.HeapIdle", Field, 0, ""}, - {"MemStats.HeapInuse", Field, 0, ""}, - {"MemStats.HeapObjects", Field, 0, ""}, - {"MemStats.HeapReleased", Field, 0, ""}, - {"MemStats.HeapSys", Field, 0, ""}, - {"MemStats.LastGC", Field, 0, ""}, - {"MemStats.Lookups", Field, 0, ""}, - {"MemStats.MCacheInuse", Field, 0, ""}, - {"MemStats.MCacheSys", Field, 0, ""}, - {"MemStats.MSpanInuse", Field, 0, ""}, - {"MemStats.MSpanSys", Field, 0, ""}, - {"MemStats.Mallocs", Field, 0, ""}, - {"MemStats.NextGC", Field, 0, ""}, - {"MemStats.NumForcedGC", Field, 8, ""}, - {"MemStats.NumGC", Field, 0, ""}, - {"MemStats.OtherSys", Field, 2, ""}, - {"MemStats.PauseEnd", Field, 4, ""}, - {"MemStats.PauseNs", Field, 0, ""}, - {"MemStats.PauseTotalNs", Field, 0, ""}, - {"MemStats.StackInuse", Field, 0, ""}, - {"MemStats.StackSys", Field, 0, ""}, - {"MemStats.Sys", Field, 0, ""}, - {"MemStats.TotalAlloc", Field, 0, ""}, - {"MutexProfile", Func, 8, "func(p []BlockProfileRecord) (n int, ok bool)"}, - {"NumCPU", Func, 0, "func() int"}, - {"NumCgoCall", Func, 0, "func() int64"}, - {"NumGoroutine", Func, 0, "func() int"}, - {"PanicNilError", Type, 21, ""}, - {"Pinner", Type, 21, ""}, - {"ReadMemStats", Func, 0, "func(m *MemStats)"}, - {"ReadTrace", Func, 5, "func() (buf []byte)"}, - {"SetBlockProfileRate", Func, 1, "func(rate int)"}, - {"SetCPUProfileRate", Func, 0, "func(hz int)"}, - {"SetCgoTraceback", Func, 7, "func(version int, traceback unsafe.Pointer, context unsafe.Pointer, symbolizer unsafe.Pointer)"}, - {"SetDefaultGOMAXPROCS", Func, 25, "func()"}, - {"SetFinalizer", Func, 0, "func(obj any, finalizer any)"}, - {"SetMutexProfileFraction", Func, 8, "func(rate int) int"}, - {"Stack", Func, 0, "func(buf []byte, all bool) int"}, - {"StackRecord", Type, 0, ""}, - {"StackRecord.Stack0", Field, 0, ""}, - {"StartTrace", Func, 5, "func() error"}, - {"StopTrace", Func, 5, "func()"}, - {"ThreadCreateProfile", Func, 0, "func(p []StackRecord) (n int, ok bool)"}, - {"TypeAssertionError", Type, 0, ""}, - {"UnlockOSThread", Func, 0, "func()"}, - {"Version", Func, 0, "func() string"}, - }, - "runtime/cgo": { - {"(Handle).Delete", Method, 17, ""}, - {"(Handle).Value", Method, 17, ""}, - {"Handle", Type, 17, ""}, - {"Incomplete", Type, 20, ""}, - {"NewHandle", Func, 17, ""}, - }, - "runtime/coverage": { - {"ClearCounters", Func, 20, "func() error"}, - {"WriteCounters", Func, 20, "func(w io.Writer) error"}, - {"WriteCountersDir", Func, 20, "func(dir string) error"}, - {"WriteMeta", Func, 20, "func(w io.Writer) error"}, - {"WriteMetaDir", Func, 20, "func(dir string) error"}, - }, - "runtime/debug": { - {"(*BuildInfo).String", Method, 18, ""}, - {"BuildInfo", Type, 12, ""}, - {"BuildInfo.Deps", Field, 12, ""}, - {"BuildInfo.GoVersion", Field, 18, ""}, - {"BuildInfo.Main", Field, 12, ""}, - {"BuildInfo.Path", Field, 12, ""}, - {"BuildInfo.Settings", Field, 18, ""}, - {"BuildSetting", Type, 18, ""}, - {"BuildSetting.Key", Field, 18, ""}, - {"BuildSetting.Value", Field, 18, ""}, - {"CrashOptions", Type, 23, ""}, - {"FreeOSMemory", Func, 1, "func()"}, - {"GCStats", Type, 1, ""}, - {"GCStats.LastGC", Field, 1, ""}, - {"GCStats.NumGC", Field, 1, ""}, - {"GCStats.Pause", Field, 1, ""}, - {"GCStats.PauseEnd", Field, 4, ""}, - {"GCStats.PauseQuantiles", Field, 1, ""}, - {"GCStats.PauseTotal", Field, 1, ""}, - {"Module", Type, 12, ""}, - {"Module.Path", Field, 12, ""}, - {"Module.Replace", Field, 12, ""}, - {"Module.Sum", Field, 12, ""}, - {"Module.Version", Field, 12, ""}, - {"ParseBuildInfo", Func, 18, "func(data string) (bi *BuildInfo, err error)"}, - {"PrintStack", Func, 0, "func()"}, - {"ReadBuildInfo", Func, 12, "func() (info *BuildInfo, ok bool)"}, - {"ReadGCStats", Func, 1, "func(stats *GCStats)"}, - {"SetCrashOutput", Func, 23, "func(f *os.File, opts CrashOptions) error"}, - {"SetGCPercent", Func, 1, "func(percent int) int"}, - {"SetMaxStack", Func, 2, "func(bytes int) int"}, - {"SetMaxThreads", Func, 2, "func(threads int) int"}, - {"SetMemoryLimit", Func, 19, "func(limit int64) int64"}, - {"SetPanicOnFault", Func, 3, "func(enabled bool) bool"}, - {"SetTraceback", Func, 6, "func(level string)"}, - {"Stack", Func, 0, "func() []byte"}, - {"WriteHeapDump", Func, 3, "func(fd uintptr)"}, - }, - "runtime/metrics": { - {"(Value).Float64", Method, 16, ""}, - {"(Value).Float64Histogram", Method, 16, ""}, - {"(Value).Kind", Method, 16, ""}, - {"(Value).Uint64", Method, 16, ""}, - {"All", Func, 16, "func() []Description"}, - {"Description", Type, 16, ""}, - {"Description.Cumulative", Field, 16, ""}, - {"Description.Description", Field, 16, ""}, - {"Description.Kind", Field, 16, ""}, - {"Description.Name", Field, 16, ""}, - {"Float64Histogram", Type, 16, ""}, - {"Float64Histogram.Buckets", Field, 16, ""}, - {"Float64Histogram.Counts", Field, 16, ""}, - {"KindBad", Const, 16, ""}, - {"KindFloat64", Const, 16, ""}, - {"KindFloat64Histogram", Const, 16, ""}, - {"KindUint64", Const, 16, ""}, - {"Read", Func, 16, "func(m []Sample)"}, - {"Sample", Type, 16, ""}, - {"Sample.Name", Field, 16, ""}, - {"Sample.Value", Field, 16, ""}, - {"Value", Type, 16, ""}, - {"ValueKind", Type, 16, ""}, - }, - "runtime/pprof": { - {"(*Profile).Add", Method, 0, ""}, - {"(*Profile).Count", Method, 0, ""}, - {"(*Profile).Name", Method, 0, ""}, - {"(*Profile).Remove", Method, 0, ""}, - {"(*Profile).WriteTo", Method, 0, ""}, - {"Do", Func, 9, "func(ctx context.Context, labels LabelSet, f func(context.Context))"}, - {"ForLabels", Func, 9, "func(ctx context.Context, f func(key string, value string) bool)"}, - {"Label", Func, 9, "func(ctx context.Context, key string) (string, bool)"}, - {"LabelSet", Type, 9, ""}, - {"Labels", Func, 9, "func(args ...string) LabelSet"}, - {"Lookup", Func, 0, "func(name string) *Profile"}, - {"NewProfile", Func, 0, "func(name string) *Profile"}, - {"Profile", Type, 0, ""}, - {"Profiles", Func, 0, "func() []*Profile"}, - {"SetGoroutineLabels", Func, 9, "func(ctx context.Context)"}, - {"StartCPUProfile", Func, 0, "func(w io.Writer) error"}, - {"StopCPUProfile", Func, 0, "func()"}, - {"WithLabels", Func, 9, "func(ctx context.Context, labels LabelSet) context.Context"}, - {"WriteHeapProfile", Func, 0, "func(w io.Writer) error"}, - }, - "runtime/trace": { - {"(*FlightRecorder).Enabled", Method, 25, ""}, - {"(*FlightRecorder).Start", Method, 25, ""}, - {"(*FlightRecorder).Stop", Method, 25, ""}, - {"(*FlightRecorder).WriteTo", Method, 25, ""}, - {"(*Region).End", Method, 11, ""}, - {"(*Task).End", Method, 11, ""}, - {"FlightRecorder", Type, 25, ""}, - {"FlightRecorderConfig", Type, 25, ""}, - {"FlightRecorderConfig.MaxBytes", Field, 25, ""}, - {"FlightRecorderConfig.MinAge", Field, 25, ""}, - {"IsEnabled", Func, 11, "func() bool"}, - {"Log", Func, 11, "func(ctx context.Context, category string, message string)"}, - {"Logf", Func, 11, "func(ctx context.Context, category string, format string, args ...any)"}, - {"NewFlightRecorder", Func, 25, "func(cfg FlightRecorderConfig) *FlightRecorder"}, - {"NewTask", Func, 11, "func(pctx context.Context, taskType string) (ctx context.Context, task *Task)"}, - {"Region", Type, 11, ""}, - {"Start", Func, 5, "func(w io.Writer) error"}, - {"StartRegion", Func, 11, "func(ctx context.Context, regionType string) *Region"}, - {"Stop", Func, 5, "func()"}, - {"Task", Type, 11, ""}, - {"WithRegion", Func, 11, "func(ctx context.Context, regionType string, fn func())"}, - }, - "slices": { - {"All", Func, 23, "func[Slice ~[]E, E any](s Slice) iter.Seq2[int, E]"}, - {"AppendSeq", Func, 23, "func[Slice ~[]E, E any](s Slice, seq iter.Seq[E]) Slice"}, - {"Backward", Func, 23, "func[Slice ~[]E, E any](s Slice) iter.Seq2[int, E]"}, - {"BinarySearch", Func, 21, "func[S ~[]E, E cmp.Ordered](x S, target E) (int, bool)"}, - {"BinarySearchFunc", Func, 21, "func[S ~[]E, E, T any](x S, target T, cmp func(E, T) int) (int, bool)"}, - {"Chunk", Func, 23, "func[Slice ~[]E, E any](s Slice, n int) iter.Seq[Slice]"}, - {"Clip", Func, 21, "func[S ~[]E, E any](s S) S"}, - {"Clone", Func, 21, "func[S ~[]E, E any](s S) S"}, - {"Collect", Func, 23, "func[E any](seq iter.Seq[E]) []E"}, - {"Compact", Func, 21, "func[S ~[]E, E comparable](s S) S"}, - {"CompactFunc", Func, 21, "func[S ~[]E, E any](s S, eq func(E, E) bool) S"}, - {"Compare", Func, 21, "func[S ~[]E, E cmp.Ordered](s1 S, s2 S) int"}, - {"CompareFunc", Func, 21, "func[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, cmp func(E1, E2) int) int"}, - {"Concat", Func, 22, "func[S ~[]E, E any](slices ...S) S"}, - {"Contains", Func, 21, "func[S ~[]E, E comparable](s S, v E) bool"}, - {"ContainsFunc", Func, 21, "func[S ~[]E, E any](s S, f func(E) bool) bool"}, - {"Delete", Func, 21, "func[S ~[]E, E any](s S, i int, j int) S"}, - {"DeleteFunc", Func, 21, "func[S ~[]E, E any](s S, del func(E) bool) S"}, - {"Equal", Func, 21, "func[S ~[]E, E comparable](s1 S, s2 S) bool"}, - {"EqualFunc", Func, 21, "func[S1 ~[]E1, S2 ~[]E2, E1, E2 any](s1 S1, s2 S2, eq func(E1, E2) bool) bool"}, - {"Grow", Func, 21, "func[S ~[]E, E any](s S, n int) S"}, - {"Index", Func, 21, "func[S ~[]E, E comparable](s S, v E) int"}, - {"IndexFunc", Func, 21, "func[S ~[]E, E any](s S, f func(E) bool) int"}, - {"Insert", Func, 21, "func[S ~[]E, E any](s S, i int, v ...E) S"}, - {"IsSorted", Func, 21, "func[S ~[]E, E cmp.Ordered](x S) bool"}, - {"IsSortedFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int) bool"}, - {"Max", Func, 21, "func[S ~[]E, E cmp.Ordered](x S) E"}, - {"MaxFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int) E"}, - {"Min", Func, 21, "func[S ~[]E, E cmp.Ordered](x S) E"}, - {"MinFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int) E"}, - {"Repeat", Func, 23, "func[S ~[]E, E any](x S, count int) S"}, - {"Replace", Func, 21, "func[S ~[]E, E any](s S, i int, j int, v ...E) S"}, - {"Reverse", Func, 21, "func[S ~[]E, E any](s S)"}, - {"Sort", Func, 21, "func[S ~[]E, E cmp.Ordered](x S)"}, - {"SortFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int)"}, - {"SortStableFunc", Func, 21, "func[S ~[]E, E any](x S, cmp func(a E, b E) int)"}, - {"Sorted", Func, 23, "func[E cmp.Ordered](seq iter.Seq[E]) []E"}, - {"SortedFunc", Func, 23, "func[E any](seq iter.Seq[E], cmp func(E, E) int) []E"}, - {"SortedStableFunc", Func, 23, "func[E any](seq iter.Seq[E], cmp func(E, E) int) []E"}, - {"Values", Func, 23, "func[Slice ~[]E, E any](s Slice) iter.Seq[E]"}, - }, - "sort": { - {"(Float64Slice).Len", Method, 0, ""}, - {"(Float64Slice).Less", Method, 0, ""}, - {"(Float64Slice).Search", Method, 0, ""}, - {"(Float64Slice).Sort", Method, 0, ""}, - {"(Float64Slice).Swap", Method, 0, ""}, - {"(IntSlice).Len", Method, 0, ""}, - {"(IntSlice).Less", Method, 0, ""}, - {"(IntSlice).Search", Method, 0, ""}, - {"(IntSlice).Sort", Method, 0, ""}, - {"(IntSlice).Swap", Method, 0, ""}, - {"(Interface).Len", Method, 0, ""}, - {"(Interface).Less", Method, 0, ""}, - {"(Interface).Swap", Method, 0, ""}, - {"(StringSlice).Len", Method, 0, ""}, - {"(StringSlice).Less", Method, 0, ""}, - {"(StringSlice).Search", Method, 0, ""}, - {"(StringSlice).Sort", Method, 0, ""}, - {"(StringSlice).Swap", Method, 0, ""}, - {"Find", Func, 19, "func(n int, cmp func(int) int) (i int, found bool)"}, - {"Float64Slice", Type, 0, ""}, - {"Float64s", Func, 0, "func(x []float64)"}, - {"Float64sAreSorted", Func, 0, "func(x []float64) bool"}, - {"IntSlice", Type, 0, ""}, - {"Interface", Type, 0, ""}, - {"Ints", Func, 0, "func(x []int)"}, - {"IntsAreSorted", Func, 0, "func(x []int) bool"}, - {"IsSorted", Func, 0, "func(data Interface) bool"}, - {"Reverse", Func, 1, "func(data Interface) Interface"}, - {"Search", Func, 0, "func(n int, f func(int) bool) int"}, - {"SearchFloat64s", Func, 0, "func(a []float64, x float64) int"}, - {"SearchInts", Func, 0, "func(a []int, x int) int"}, - {"SearchStrings", Func, 0, "func(a []string, x string) int"}, - {"Slice", Func, 8, "func(x any, less func(i int, j int) bool)"}, - {"SliceIsSorted", Func, 8, "func(x any, less func(i int, j int) bool) bool"}, - {"SliceStable", Func, 8, "func(x any, less func(i int, j int) bool)"}, - {"Sort", Func, 0, "func(data Interface)"}, - {"Stable", Func, 2, "func(data Interface)"}, - {"StringSlice", Type, 0, ""}, - {"Strings", Func, 0, "func(x []string)"}, - {"StringsAreSorted", Func, 0, "func(x []string) bool"}, - }, - "strconv": { - {"(*NumError).Error", Method, 0, ""}, - {"(*NumError).Unwrap", Method, 14, ""}, - {"AppendBool", Func, 0, "func(dst []byte, b bool) []byte"}, - {"AppendFloat", Func, 0, "func(dst []byte, f float64, fmt byte, prec int, bitSize int) []byte"}, - {"AppendInt", Func, 0, "func(dst []byte, i int64, base int) []byte"}, - {"AppendQuote", Func, 0, "func(dst []byte, s string) []byte"}, - {"AppendQuoteRune", Func, 0, "func(dst []byte, r rune) []byte"}, - {"AppendQuoteRuneToASCII", Func, 0, "func(dst []byte, r rune) []byte"}, - {"AppendQuoteRuneToGraphic", Func, 6, "func(dst []byte, r rune) []byte"}, - {"AppendQuoteToASCII", Func, 0, "func(dst []byte, s string) []byte"}, - {"AppendQuoteToGraphic", Func, 6, "func(dst []byte, s string) []byte"}, - {"AppendUint", Func, 0, "func(dst []byte, i uint64, base int) []byte"}, - {"Atoi", Func, 0, "func(s string) (int, error)"}, - {"CanBackquote", Func, 0, "func(s string) bool"}, - {"ErrRange", Var, 0, ""}, - {"ErrSyntax", Var, 0, ""}, - {"FormatBool", Func, 0, "func(b bool) string"}, - {"FormatComplex", Func, 15, "func(c complex128, fmt byte, prec int, bitSize int) string"}, - {"FormatFloat", Func, 0, "func(f float64, fmt byte, prec int, bitSize int) string"}, - {"FormatInt", Func, 0, "func(i int64, base int) string"}, - {"FormatUint", Func, 0, "func(i uint64, base int) string"}, - {"IntSize", Const, 0, ""}, - {"IsGraphic", Func, 6, "func(r rune) bool"}, - {"IsPrint", Func, 0, "func(r rune) bool"}, - {"Itoa", Func, 0, "func(i int) string"}, - {"NumError", Type, 0, ""}, - {"NumError.Err", Field, 0, ""}, - {"NumError.Func", Field, 0, ""}, - {"NumError.Num", Field, 0, ""}, - {"ParseBool", Func, 0, "func(str string) (bool, error)"}, - {"ParseComplex", Func, 15, "func(s string, bitSize int) (complex128, error)"}, - {"ParseFloat", Func, 0, "func(s string, bitSize int) (float64, error)"}, - {"ParseInt", Func, 0, "func(s string, base int, bitSize int) (i int64, err error)"}, - {"ParseUint", Func, 0, "func(s string, base int, bitSize int) (uint64, error)"}, - {"Quote", Func, 0, "func(s string) string"}, - {"QuoteRune", Func, 0, "func(r rune) string"}, - {"QuoteRuneToASCII", Func, 0, "func(r rune) string"}, - {"QuoteRuneToGraphic", Func, 6, "func(r rune) string"}, - {"QuoteToASCII", Func, 0, "func(s string) string"}, - {"QuoteToGraphic", Func, 6, "func(s string) string"}, - {"QuotedPrefix", Func, 17, "func(s string) (string, error)"}, - {"Unquote", Func, 0, "func(s string) (string, error)"}, - {"UnquoteChar", Func, 0, "func(s string, quote byte) (value rune, multibyte bool, tail string, err error)"}, - }, - "strings": { - {"(*Builder).Cap", Method, 12, ""}, - {"(*Builder).Grow", Method, 10, ""}, - {"(*Builder).Len", Method, 10, ""}, - {"(*Builder).Reset", Method, 10, ""}, - {"(*Builder).String", Method, 10, ""}, - {"(*Builder).Write", Method, 10, ""}, - {"(*Builder).WriteByte", Method, 10, ""}, - {"(*Builder).WriteRune", Method, 10, ""}, - {"(*Builder).WriteString", Method, 10, ""}, - {"(*Reader).Len", Method, 0, ""}, - {"(*Reader).Read", Method, 0, ""}, - {"(*Reader).ReadAt", Method, 0, ""}, - {"(*Reader).ReadByte", Method, 0, ""}, - {"(*Reader).ReadRune", Method, 0, ""}, - {"(*Reader).Reset", Method, 7, ""}, - {"(*Reader).Seek", Method, 0, ""}, - {"(*Reader).Size", Method, 5, ""}, - {"(*Reader).UnreadByte", Method, 0, ""}, - {"(*Reader).UnreadRune", Method, 0, ""}, - {"(*Reader).WriteTo", Method, 1, ""}, - {"(*Replacer).Replace", Method, 0, ""}, - {"(*Replacer).WriteString", Method, 0, ""}, - {"Builder", Type, 10, ""}, - {"Clone", Func, 18, "func(s string) string"}, - {"Compare", Func, 5, "func(a string, b string) int"}, - {"Contains", Func, 0, "func(s string, substr string) bool"}, - {"ContainsAny", Func, 0, "func(s string, chars string) bool"}, - {"ContainsFunc", Func, 21, "func(s string, f func(rune) bool) bool"}, - {"ContainsRune", Func, 0, "func(s string, r rune) bool"}, - {"Count", Func, 0, "func(s string, substr string) int"}, - {"Cut", Func, 18, "func(s string, sep string) (before string, after string, found bool)"}, - {"CutLast", Func, 27, "func(s string, sep string) (before string, after string, found bool)"}, - {"CutPrefix", Func, 20, "func(s string, prefix string) (after string, found bool)"}, - {"CutSuffix", Func, 20, "func(s string, suffix string) (before string, found bool)"}, - {"EqualFold", Func, 0, "func(s string, t string) bool"}, - {"Fields", Func, 0, "func(s string) []string"}, - {"FieldsFunc", Func, 0, "func(s string, f func(rune) bool) []string"}, - {"FieldsFuncSeq", Func, 24, "func(s string, f func(rune) bool) iter.Seq[string]"}, - {"FieldsSeq", Func, 24, "func(s string) iter.Seq[string]"}, - {"HasPrefix", Func, 0, "func(s string, prefix string) bool"}, - {"HasSuffix", Func, 0, "func(s string, suffix string) bool"}, - {"Index", Func, 0, "func(s string, substr string) int"}, - {"IndexAny", Func, 0, "func(s string, chars string) int"}, - {"IndexByte", Func, 2, "func(s string, c byte) int"}, - {"IndexFunc", Func, 0, "func(s string, f func(rune) bool) int"}, - {"IndexRune", Func, 0, "func(s string, r rune) int"}, - {"Join", Func, 0, "func(elems []string, sep string) string"}, - {"LastIndex", Func, 0, "func(s string, substr string) int"}, - {"LastIndexAny", Func, 0, "func(s string, chars string) int"}, - {"LastIndexByte", Func, 5, "func(s string, c byte) int"}, - {"LastIndexFunc", Func, 0, "func(s string, f func(rune) bool) int"}, - {"Lines", Func, 24, "func(s string) iter.Seq[string]"}, - {"Map", Func, 0, "func(mapping func(rune) rune, s string) string"}, - {"NewReader", Func, 0, "func(s string) *Reader"}, - {"NewReplacer", Func, 0, "func(oldnew ...string) *Replacer"}, - {"Reader", Type, 0, ""}, - {"Repeat", Func, 0, "func(s string, count int) string"}, - {"Replace", Func, 0, "func(s string, old string, new string, n int) string"}, - {"ReplaceAll", Func, 12, "func(s string, old string, new string) string"}, - {"Replacer", Type, 0, ""}, - {"Split", Func, 0, "func(s string, sep string) []string"}, - {"SplitAfter", Func, 0, "func(s string, sep string) []string"}, - {"SplitAfterN", Func, 0, "func(s string, sep string, n int) []string"}, - {"SplitAfterSeq", Func, 24, "func(s string, sep string) iter.Seq[string]"}, - {"SplitN", Func, 0, "func(s string, sep string, n int) []string"}, - {"SplitSeq", Func, 24, "func(s string, sep string) iter.Seq[string]"}, - {"Title", Func, 0, "func(s string) string"}, - {"ToLower", Func, 0, "func(s string) string"}, - {"ToLowerSpecial", Func, 0, "func(c unicode.SpecialCase, s string) string"}, - {"ToTitle", Func, 0, "func(s string) string"}, - {"ToTitleSpecial", Func, 0, "func(c unicode.SpecialCase, s string) string"}, - {"ToUpper", Func, 0, "func(s string) string"}, - {"ToUpperSpecial", Func, 0, "func(c unicode.SpecialCase, s string) string"}, - {"ToValidUTF8", Func, 13, "func(s string, replacement string) string"}, - {"Trim", Func, 0, "func(s string, cutset string) string"}, - {"TrimFunc", Func, 0, "func(s string, f func(rune) bool) string"}, - {"TrimLeft", Func, 0, "func(s string, cutset string) string"}, - {"TrimLeftFunc", Func, 0, "func(s string, f func(rune) bool) string"}, - {"TrimPrefix", Func, 1, "func(s string, prefix string) string"}, - {"TrimRight", Func, 0, "func(s string, cutset string) string"}, - {"TrimRightFunc", Func, 0, "func(s string, f func(rune) bool) string"}, - {"TrimSpace", Func, 0, "func(s string) string"}, - {"TrimSuffix", Func, 1, "func(s string, suffix string) string"}, - }, - "structs": { - {"HostLayout", Type, 23, ""}, - }, - "sync": { - {"(*Cond).Broadcast", Method, 0, ""}, - {"(*Cond).Signal", Method, 0, ""}, - {"(*Cond).Wait", Method, 0, ""}, - {"(*Map).Clear", Method, 23, ""}, - {"(*Map).CompareAndDelete", Method, 20, ""}, - {"(*Map).CompareAndSwap", Method, 20, ""}, - {"(*Map).Delete", Method, 9, ""}, - {"(*Map).Load", Method, 9, ""}, - {"(*Map).LoadAndDelete", Method, 15, ""}, - {"(*Map).LoadOrStore", Method, 9, ""}, - {"(*Map).Range", Method, 9, ""}, - {"(*Map).Store", Method, 9, ""}, - {"(*Map).Swap", Method, 20, ""}, - {"(*Mutex).Lock", Method, 0, ""}, - {"(*Mutex).TryLock", Method, 18, ""}, - {"(*Mutex).Unlock", Method, 0, ""}, - {"(*Once).Do", Method, 0, ""}, - {"(*Pool).Get", Method, 3, ""}, - {"(*Pool).Put", Method, 3, ""}, - {"(*RWMutex).Lock", Method, 0, ""}, - {"(*RWMutex).RLock", Method, 0, ""}, - {"(*RWMutex).RLocker", Method, 0, ""}, - {"(*RWMutex).RUnlock", Method, 0, ""}, - {"(*RWMutex).TryLock", Method, 18, ""}, - {"(*RWMutex).TryRLock", Method, 18, ""}, - {"(*RWMutex).Unlock", Method, 0, ""}, - {"(*WaitGroup).Add", Method, 0, ""}, - {"(*WaitGroup).Done", Method, 0, ""}, - {"(*WaitGroup).Go", Method, 25, ""}, - {"(*WaitGroup).Wait", Method, 0, ""}, - {"(Locker).Lock", Method, 0, ""}, - {"(Locker).Unlock", Method, 0, ""}, - {"Cond", Type, 0, ""}, - {"Cond.L", Field, 0, ""}, - {"Locker", Type, 0, ""}, - {"Map", Type, 9, ""}, - {"Mutex", Type, 0, ""}, - {"NewCond", Func, 0, "func(l Locker) *Cond"}, - {"Once", Type, 0, ""}, - {"OnceFunc", Func, 21, "func(f func()) func()"}, - {"OnceValue", Func, 21, "func[T any](f func() T) func() T"}, - {"OnceValues", Func, 21, "func[T1, T2 any](f func() (T1, T2)) func() (T1, T2)"}, - {"Pool", Type, 3, ""}, - {"Pool.New", Field, 3, ""}, - {"RWMutex", Type, 0, ""}, - {"WaitGroup", Type, 0, ""}, - }, - "sync/atomic": { - {"(*Bool).CompareAndSwap", Method, 19, ""}, - {"(*Bool).Load", Method, 19, ""}, - {"(*Bool).Store", Method, 19, ""}, - {"(*Bool).Swap", Method, 19, ""}, - {"(*Int32).Add", Method, 19, ""}, - {"(*Int32).And", Method, 23, ""}, - {"(*Int32).CompareAndSwap", Method, 19, ""}, - {"(*Int32).Load", Method, 19, ""}, - {"(*Int32).Or", Method, 23, ""}, - {"(*Int32).Store", Method, 19, ""}, - {"(*Int32).Swap", Method, 19, ""}, - {"(*Int64).Add", Method, 19, ""}, - {"(*Int64).And", Method, 23, ""}, - {"(*Int64).CompareAndSwap", Method, 19, ""}, - {"(*Int64).Load", Method, 19, ""}, - {"(*Int64).Or", Method, 23, ""}, - {"(*Int64).Store", Method, 19, ""}, - {"(*Int64).Swap", Method, 19, ""}, - {"(*Pointer).CompareAndSwap", Method, 19, ""}, - {"(*Pointer).Load", Method, 19, ""}, - {"(*Pointer).Store", Method, 19, ""}, - {"(*Pointer).Swap", Method, 19, ""}, - {"(*Uint32).Add", Method, 19, ""}, - {"(*Uint32).And", Method, 23, ""}, - {"(*Uint32).CompareAndSwap", Method, 19, ""}, - {"(*Uint32).Load", Method, 19, ""}, - {"(*Uint32).Or", Method, 23, ""}, - {"(*Uint32).Store", Method, 19, ""}, - {"(*Uint32).Swap", Method, 19, ""}, - {"(*Uint64).Add", Method, 19, ""}, - {"(*Uint64).And", Method, 23, ""}, - {"(*Uint64).CompareAndSwap", Method, 19, ""}, - {"(*Uint64).Load", Method, 19, ""}, - {"(*Uint64).Or", Method, 23, ""}, - {"(*Uint64).Store", Method, 19, ""}, - {"(*Uint64).Swap", Method, 19, ""}, - {"(*Uintptr).Add", Method, 19, ""}, - {"(*Uintptr).And", Method, 23, ""}, - {"(*Uintptr).CompareAndSwap", Method, 19, ""}, - {"(*Uintptr).Load", Method, 19, ""}, - {"(*Uintptr).Or", Method, 23, ""}, - {"(*Uintptr).Store", Method, 19, ""}, - {"(*Uintptr).Swap", Method, 19, ""}, - {"(*Value).CompareAndSwap", Method, 17, ""}, - {"(*Value).Load", Method, 4, ""}, - {"(*Value).Store", Method, 4, ""}, - {"(*Value).Swap", Method, 17, ""}, - {"AddInt32", Func, 0, "func(addr *int32, delta int32) (new int32)"}, - {"AddInt64", Func, 0, "func(addr *int64, delta int64) (new int64)"}, - {"AddUint32", Func, 0, "func(addr *uint32, delta uint32) (new uint32)"}, - {"AddUint64", Func, 0, "func(addr *uint64, delta uint64) (new uint64)"}, - {"AddUintptr", Func, 0, "func(addr *uintptr, delta uintptr) (new uintptr)"}, - {"AndInt32", Func, 23, "func(addr *int32, mask int32) (old int32)"}, - {"AndInt64", Func, 23, "func(addr *int64, mask int64) (old int64)"}, - {"AndUint32", Func, 23, "func(addr *uint32, mask uint32) (old uint32)"}, - {"AndUint64", Func, 23, "func(addr *uint64, mask uint64) (old uint64)"}, - {"AndUintptr", Func, 23, "func(addr *uintptr, mask uintptr) (old uintptr)"}, - {"Bool", Type, 19, ""}, - {"CompareAndSwapInt32", Func, 0, "func(addr *int32, old int32, new int32) (swapped bool)"}, - {"CompareAndSwapInt64", Func, 0, "func(addr *int64, old int64, new int64) (swapped bool)"}, - {"CompareAndSwapPointer", Func, 0, "func(addr *unsafe.Pointer, old unsafe.Pointer, new unsafe.Pointer) (swapped bool)"}, - {"CompareAndSwapUint32", Func, 0, "func(addr *uint32, old uint32, new uint32) (swapped bool)"}, - {"CompareAndSwapUint64", Func, 0, "func(addr *uint64, old uint64, new uint64) (swapped bool)"}, - {"CompareAndSwapUintptr", Func, 0, "func(addr *uintptr, old uintptr, new uintptr) (swapped bool)"}, - {"Int32", Type, 19, ""}, - {"Int64", Type, 19, ""}, - {"LoadInt32", Func, 0, "func(addr *int32) (val int32)"}, - {"LoadInt64", Func, 0, "func(addr *int64) (val int64)"}, - {"LoadPointer", Func, 0, "func(addr *unsafe.Pointer) (val unsafe.Pointer)"}, - {"LoadUint32", Func, 0, "func(addr *uint32) (val uint32)"}, - {"LoadUint64", Func, 0, "func(addr *uint64) (val uint64)"}, - {"LoadUintptr", Func, 0, "func(addr *uintptr) (val uintptr)"}, - {"OrInt32", Func, 23, "func(addr *int32, mask int32) (old int32)"}, - {"OrInt64", Func, 23, "func(addr *int64, mask int64) (old int64)"}, - {"OrUint32", Func, 23, "func(addr *uint32, mask uint32) (old uint32)"}, - {"OrUint64", Func, 23, "func(addr *uint64, mask uint64) (old uint64)"}, - {"OrUintptr", Func, 23, "func(addr *uintptr, mask uintptr) (old uintptr)"}, - {"Pointer", Type, 19, ""}, - {"StoreInt32", Func, 0, "func(addr *int32, val int32)"}, - {"StoreInt64", Func, 0, "func(addr *int64, val int64)"}, - {"StorePointer", Func, 0, "func(addr *unsafe.Pointer, val unsafe.Pointer)"}, - {"StoreUint32", Func, 0, "func(addr *uint32, val uint32)"}, - {"StoreUint64", Func, 0, "func(addr *uint64, val uint64)"}, - {"StoreUintptr", Func, 0, "func(addr *uintptr, val uintptr)"}, - {"SwapInt32", Func, 2, "func(addr *int32, new int32) (old int32)"}, - {"SwapInt64", Func, 2, "func(addr *int64, new int64) (old int64)"}, - {"SwapPointer", Func, 2, "func(addr *unsafe.Pointer, new unsafe.Pointer) (old unsafe.Pointer)"}, - {"SwapUint32", Func, 2, "func(addr *uint32, new uint32) (old uint32)"}, - {"SwapUint64", Func, 2, "func(addr *uint64, new uint64) (old uint64)"}, - {"SwapUintptr", Func, 2, "func(addr *uintptr, new uintptr) (old uintptr)"}, - {"Uint32", Type, 19, ""}, - {"Uint64", Type, 19, ""}, - {"Uintptr", Type, 19, ""}, - {"Value", Type, 4, ""}, - }, - "syscall": { - {"(*Cmsghdr).SetLen", Method, 0, ""}, - {"(*DLL).FindProc", Method, 0, ""}, - {"(*DLL).MustFindProc", Method, 0, ""}, - {"(*DLL).Release", Method, 0, ""}, - {"(*DLLError).Error", Method, 0, ""}, - {"(*DLLError).Unwrap", Method, 16, ""}, - {"(*Filetime).Nanoseconds", Method, 0, ""}, - {"(*Iovec).SetLen", Method, 0, ""}, - {"(*LazyDLL).Handle", Method, 0, ""}, - {"(*LazyDLL).Load", Method, 0, ""}, - {"(*LazyDLL).NewProc", Method, 0, ""}, - {"(*LazyProc).Addr", Method, 0, ""}, - {"(*LazyProc).Call", Method, 0, ""}, - {"(*LazyProc).Find", Method, 0, ""}, - {"(*Msghdr).SetControllen", Method, 0, ""}, - {"(*Proc).Addr", Method, 0, ""}, - {"(*Proc).Call", Method, 0, ""}, - {"(*PtraceRegs).PC", Method, 0, ""}, - {"(*PtraceRegs).SetPC", Method, 0, ""}, - {"(*RawSockaddrAny).Sockaddr", Method, 0, ""}, - {"(*SID).Copy", Method, 0, ""}, - {"(*SID).Len", Method, 0, ""}, - {"(*SID).LookupAccount", Method, 0, ""}, - {"(*SID).String", Method, 0, ""}, - {"(*Timespec).Nano", Method, 0, ""}, - {"(*Timespec).Unix", Method, 0, ""}, - {"(*Timeval).Nano", Method, 0, ""}, - {"(*Timeval).Nanoseconds", Method, 0, ""}, - {"(*Timeval).Unix", Method, 0, ""}, - {"(Conn).SyscallConn", Method, 9, ""}, - {"(Errno).Error", Method, 0, ""}, - {"(Errno).Is", Method, 13, ""}, - {"(Errno).Temporary", Method, 0, ""}, - {"(Errno).Timeout", Method, 0, ""}, - {"(RawConn).Control", Method, 9, ""}, - {"(RawConn).Read", Method, 9, ""}, - {"(RawConn).Write", Method, 9, ""}, - {"(Signal).Signal", Method, 0, ""}, - {"(Signal).String", Method, 0, ""}, - {"(Token).Close", Method, 0, ""}, - {"(Token).GetTokenPrimaryGroup", Method, 0, ""}, - {"(Token).GetTokenUser", Method, 0, ""}, - {"(Token).GetUserProfileDirectory", Method, 0, ""}, - {"(WaitStatus).Continued", Method, 0, ""}, - {"(WaitStatus).CoreDump", Method, 0, ""}, - {"(WaitStatus).ExitStatus", Method, 0, ""}, - {"(WaitStatus).Exited", Method, 0, ""}, - {"(WaitStatus).Signal", Method, 0, ""}, - {"(WaitStatus).Signaled", Method, 0, ""}, - {"(WaitStatus).StopSignal", Method, 0, ""}, - {"(WaitStatus).Stopped", Method, 0, ""}, - {"(WaitStatus).TrapCause", Method, 0, ""}, - {"AF_ALG", Const, 0, ""}, - {"AF_APPLETALK", Const, 0, ""}, - {"AF_ARP", Const, 0, ""}, - {"AF_ASH", Const, 0, ""}, - {"AF_ATM", Const, 0, ""}, - {"AF_ATMPVC", Const, 0, ""}, - {"AF_ATMSVC", Const, 0, ""}, - {"AF_AX25", Const, 0, ""}, - {"AF_BLUETOOTH", Const, 0, ""}, - {"AF_BRIDGE", Const, 0, ""}, - {"AF_CAIF", Const, 0, ""}, - {"AF_CAN", Const, 0, ""}, - {"AF_CCITT", Const, 0, ""}, - {"AF_CHAOS", Const, 0, ""}, - {"AF_CNT", Const, 0, ""}, - {"AF_COIP", Const, 0, ""}, - {"AF_DATAKIT", Const, 0, ""}, - {"AF_DECnet", Const, 0, ""}, - {"AF_DLI", Const, 0, ""}, - {"AF_E164", Const, 0, ""}, - {"AF_ECMA", Const, 0, ""}, - {"AF_ECONET", Const, 0, ""}, - {"AF_ENCAP", Const, 1, ""}, - {"AF_FILE", Const, 0, ""}, - {"AF_HYLINK", Const, 0, ""}, - {"AF_IEEE80211", Const, 0, ""}, - {"AF_IEEE802154", Const, 0, ""}, - {"AF_IMPLINK", Const, 0, ""}, - {"AF_INET", Const, 0, ""}, - {"AF_INET6", Const, 0, ""}, - {"AF_INET6_SDP", Const, 3, ""}, - {"AF_INET_SDP", Const, 3, ""}, - {"AF_IPX", Const, 0, ""}, - {"AF_IRDA", Const, 0, ""}, - {"AF_ISDN", Const, 0, ""}, - {"AF_ISO", Const, 0, ""}, - {"AF_IUCV", Const, 0, ""}, - {"AF_KEY", Const, 0, ""}, - {"AF_LAT", Const, 0, ""}, - {"AF_LINK", Const, 0, ""}, - {"AF_LLC", Const, 0, ""}, - {"AF_LOCAL", Const, 0, ""}, - {"AF_MAX", Const, 0, ""}, - {"AF_MPLS", Const, 1, ""}, - {"AF_NATM", Const, 0, ""}, - {"AF_NDRV", Const, 0, ""}, - {"AF_NETBEUI", Const, 0, ""}, - {"AF_NETBIOS", Const, 0, ""}, - {"AF_NETGRAPH", Const, 0, ""}, - {"AF_NETLINK", Const, 0, ""}, - {"AF_NETROM", Const, 0, ""}, - {"AF_NS", Const, 0, ""}, - {"AF_OROUTE", Const, 1, ""}, - {"AF_OSI", Const, 0, ""}, - {"AF_PACKET", Const, 0, ""}, - {"AF_PHONET", Const, 0, ""}, - {"AF_PPP", Const, 0, ""}, - {"AF_PPPOX", Const, 0, ""}, - {"AF_PUP", Const, 0, ""}, - {"AF_RDS", Const, 0, ""}, - {"AF_RESERVED_36", Const, 0, ""}, - {"AF_ROSE", Const, 0, ""}, - {"AF_ROUTE", Const, 0, ""}, - {"AF_RXRPC", Const, 0, ""}, - {"AF_SCLUSTER", Const, 0, ""}, - {"AF_SECURITY", Const, 0, ""}, - {"AF_SIP", Const, 0, ""}, - {"AF_SLOW", Const, 0, ""}, - {"AF_SNA", Const, 0, ""}, - {"AF_SYSTEM", Const, 0, ""}, - {"AF_TIPC", Const, 0, ""}, - {"AF_UNIX", Const, 0, ""}, - {"AF_UNSPEC", Const, 0, ""}, - {"AF_UTUN", Const, 16, ""}, - {"AF_VENDOR00", Const, 0, ""}, - {"AF_VENDOR01", Const, 0, ""}, - {"AF_VENDOR02", Const, 0, ""}, - {"AF_VENDOR03", Const, 0, ""}, - {"AF_VENDOR04", Const, 0, ""}, - {"AF_VENDOR05", Const, 0, ""}, - {"AF_VENDOR06", Const, 0, ""}, - {"AF_VENDOR07", Const, 0, ""}, - {"AF_VENDOR08", Const, 0, ""}, - {"AF_VENDOR09", Const, 0, ""}, - {"AF_VENDOR10", Const, 0, ""}, - {"AF_VENDOR11", Const, 0, ""}, - {"AF_VENDOR12", Const, 0, ""}, - {"AF_VENDOR13", Const, 0, ""}, - {"AF_VENDOR14", Const, 0, ""}, - {"AF_VENDOR15", Const, 0, ""}, - {"AF_VENDOR16", Const, 0, ""}, - {"AF_VENDOR17", Const, 0, ""}, - {"AF_VENDOR18", Const, 0, ""}, - {"AF_VENDOR19", Const, 0, ""}, - {"AF_VENDOR20", Const, 0, ""}, - {"AF_VENDOR21", Const, 0, ""}, - {"AF_VENDOR22", Const, 0, ""}, - {"AF_VENDOR23", Const, 0, ""}, - {"AF_VENDOR24", Const, 0, ""}, - {"AF_VENDOR25", Const, 0, ""}, - {"AF_VENDOR26", Const, 0, ""}, - {"AF_VENDOR27", Const, 0, ""}, - {"AF_VENDOR28", Const, 0, ""}, - {"AF_VENDOR29", Const, 0, ""}, - {"AF_VENDOR30", Const, 0, ""}, - {"AF_VENDOR31", Const, 0, ""}, - {"AF_VENDOR32", Const, 0, ""}, - {"AF_VENDOR33", Const, 0, ""}, - {"AF_VENDOR34", Const, 0, ""}, - {"AF_VENDOR35", Const, 0, ""}, - {"AF_VENDOR36", Const, 0, ""}, - {"AF_VENDOR37", Const, 0, ""}, - {"AF_VENDOR38", Const, 0, ""}, - {"AF_VENDOR39", Const, 0, ""}, - {"AF_VENDOR40", Const, 0, ""}, - {"AF_VENDOR41", Const, 0, ""}, - {"AF_VENDOR42", Const, 0, ""}, - {"AF_VENDOR43", Const, 0, ""}, - {"AF_VENDOR44", Const, 0, ""}, - {"AF_VENDOR45", Const, 0, ""}, - {"AF_VENDOR46", Const, 0, ""}, - {"AF_VENDOR47", Const, 0, ""}, - {"AF_WANPIPE", Const, 0, ""}, - {"AF_X25", Const, 0, ""}, - {"AI_CANONNAME", Const, 1, ""}, - {"AI_NUMERICHOST", Const, 1, ""}, - {"AI_PASSIVE", Const, 1, ""}, - {"APPLICATION_ERROR", Const, 0, ""}, - {"ARPHRD_ADAPT", Const, 0, ""}, - {"ARPHRD_APPLETLK", Const, 0, ""}, - {"ARPHRD_ARCNET", Const, 0, ""}, - {"ARPHRD_ASH", Const, 0, ""}, - {"ARPHRD_ATM", Const, 0, ""}, - {"ARPHRD_AX25", Const, 0, ""}, - {"ARPHRD_BIF", Const, 0, ""}, - {"ARPHRD_CHAOS", Const, 0, ""}, - {"ARPHRD_CISCO", Const, 0, ""}, - {"ARPHRD_CSLIP", Const, 0, ""}, - {"ARPHRD_CSLIP6", Const, 0, ""}, - {"ARPHRD_DDCMP", Const, 0, ""}, - {"ARPHRD_DLCI", Const, 0, ""}, - {"ARPHRD_ECONET", Const, 0, ""}, - {"ARPHRD_EETHER", Const, 0, ""}, - {"ARPHRD_ETHER", Const, 0, ""}, - {"ARPHRD_EUI64", Const, 0, ""}, - {"ARPHRD_FCAL", Const, 0, ""}, - {"ARPHRD_FCFABRIC", Const, 0, ""}, - {"ARPHRD_FCPL", Const, 0, ""}, - {"ARPHRD_FCPP", Const, 0, ""}, - {"ARPHRD_FDDI", Const, 0, ""}, - {"ARPHRD_FRAD", Const, 0, ""}, - {"ARPHRD_FRELAY", Const, 1, ""}, - {"ARPHRD_HDLC", Const, 0, ""}, - {"ARPHRD_HIPPI", Const, 0, ""}, - {"ARPHRD_HWX25", Const, 0, ""}, - {"ARPHRD_IEEE1394", Const, 0, ""}, - {"ARPHRD_IEEE802", Const, 0, ""}, - {"ARPHRD_IEEE80211", Const, 0, ""}, - {"ARPHRD_IEEE80211_PRISM", Const, 0, ""}, - {"ARPHRD_IEEE80211_RADIOTAP", Const, 0, ""}, - {"ARPHRD_IEEE802154", Const, 0, ""}, - {"ARPHRD_IEEE802154_PHY", Const, 0, ""}, - {"ARPHRD_IEEE802_TR", Const, 0, ""}, - {"ARPHRD_INFINIBAND", Const, 0, ""}, - {"ARPHRD_IPDDP", Const, 0, ""}, - {"ARPHRD_IPGRE", Const, 0, ""}, - {"ARPHRD_IRDA", Const, 0, ""}, - {"ARPHRD_LAPB", Const, 0, ""}, - {"ARPHRD_LOCALTLK", Const, 0, ""}, - {"ARPHRD_LOOPBACK", Const, 0, ""}, - {"ARPHRD_METRICOM", Const, 0, ""}, - {"ARPHRD_NETROM", Const, 0, ""}, - {"ARPHRD_NONE", Const, 0, ""}, - {"ARPHRD_PIMREG", Const, 0, ""}, - {"ARPHRD_PPP", Const, 0, ""}, - {"ARPHRD_PRONET", Const, 0, ""}, - {"ARPHRD_RAWHDLC", Const, 0, ""}, - {"ARPHRD_ROSE", Const, 0, ""}, - {"ARPHRD_RSRVD", Const, 0, ""}, - {"ARPHRD_SIT", Const, 0, ""}, - {"ARPHRD_SKIP", Const, 0, ""}, - {"ARPHRD_SLIP", Const, 0, ""}, - {"ARPHRD_SLIP6", Const, 0, ""}, - {"ARPHRD_STRIP", Const, 1, ""}, - {"ARPHRD_TUNNEL", Const, 0, ""}, - {"ARPHRD_TUNNEL6", Const, 0, ""}, - {"ARPHRD_VOID", Const, 0, ""}, - {"ARPHRD_X25", Const, 0, ""}, - {"AUTHTYPE_CLIENT", Const, 0, ""}, - {"AUTHTYPE_SERVER", Const, 0, ""}, - {"Accept", Func, 0, "func(fd int) (nfd int, sa Sockaddr, err error)"}, - {"Accept4", Func, 1, "func(fd int, flags int) (nfd int, sa Sockaddr, err error)"}, - {"AcceptEx", Func, 0, ""}, - {"Access", Func, 0, "func(path string, mode uint32) (err error)"}, - {"Acct", Func, 0, "func(path string) (err error)"}, - {"AddrinfoW", Type, 1, ""}, - {"AddrinfoW.Addr", Field, 1, ""}, - {"AddrinfoW.Addrlen", Field, 1, ""}, - {"AddrinfoW.Canonname", Field, 1, ""}, - {"AddrinfoW.Family", Field, 1, ""}, - {"AddrinfoW.Flags", Field, 1, ""}, - {"AddrinfoW.Next", Field, 1, ""}, - {"AddrinfoW.Protocol", Field, 1, ""}, - {"AddrinfoW.Socktype", Field, 1, ""}, - {"Adjtime", Func, 0, ""}, - {"Adjtimex", Func, 0, "func(buf *Timex) (state int, err error)"}, - {"AllThreadsSyscall", Func, 16, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"AllThreadsSyscall6", Func, 16, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"AttachLsf", Func, 0, "func(fd int, i []SockFilter) error"}, - {"B0", Const, 0, ""}, - {"B1000000", Const, 0, ""}, - {"B110", Const, 0, ""}, - {"B115200", Const, 0, ""}, - {"B1152000", Const, 0, ""}, - {"B1200", Const, 0, ""}, - {"B134", Const, 0, ""}, - {"B14400", Const, 1, ""}, - {"B150", Const, 0, ""}, - {"B1500000", Const, 0, ""}, - {"B1800", Const, 0, ""}, - {"B19200", Const, 0, ""}, - {"B200", Const, 0, ""}, - {"B2000000", Const, 0, ""}, - {"B230400", Const, 0, ""}, - {"B2400", Const, 0, ""}, - {"B2500000", Const, 0, ""}, - {"B28800", Const, 1, ""}, - {"B300", Const, 0, ""}, - {"B3000000", Const, 0, ""}, - {"B3500000", Const, 0, ""}, - {"B38400", Const, 0, ""}, - {"B4000000", Const, 0, ""}, - {"B460800", Const, 0, ""}, - {"B4800", Const, 0, ""}, - {"B50", Const, 0, ""}, - {"B500000", Const, 0, ""}, - {"B57600", Const, 0, ""}, - {"B576000", Const, 0, ""}, - {"B600", Const, 0, ""}, - {"B7200", Const, 1, ""}, - {"B75", Const, 0, ""}, - {"B76800", Const, 1, ""}, - {"B921600", Const, 0, ""}, - {"B9600", Const, 0, ""}, - {"BASE_PROTOCOL", Const, 2, ""}, - {"BIOCFEEDBACK", Const, 0, ""}, - {"BIOCFLUSH", Const, 0, ""}, - {"BIOCGBLEN", Const, 0, ""}, - {"BIOCGDIRECTION", Const, 0, ""}, - {"BIOCGDIRFILT", Const, 1, ""}, - {"BIOCGDLT", Const, 0, ""}, - {"BIOCGDLTLIST", Const, 0, ""}, - {"BIOCGETBUFMODE", Const, 0, ""}, - {"BIOCGETIF", Const, 0, ""}, - {"BIOCGETZMAX", Const, 0, ""}, - {"BIOCGFEEDBACK", Const, 1, ""}, - {"BIOCGFILDROP", Const, 1, ""}, - {"BIOCGHDRCMPLT", Const, 0, ""}, - {"BIOCGRSIG", Const, 0, ""}, - {"BIOCGRTIMEOUT", Const, 0, ""}, - {"BIOCGSEESENT", Const, 0, ""}, - {"BIOCGSTATS", Const, 0, ""}, - {"BIOCGSTATSOLD", Const, 1, ""}, - {"BIOCGTSTAMP", Const, 1, ""}, - {"BIOCIMMEDIATE", Const, 0, ""}, - {"BIOCLOCK", Const, 0, ""}, - {"BIOCPROMISC", Const, 0, ""}, - {"BIOCROTZBUF", Const, 0, ""}, - {"BIOCSBLEN", Const, 0, ""}, - {"BIOCSDIRECTION", Const, 0, ""}, - {"BIOCSDIRFILT", Const, 1, ""}, - {"BIOCSDLT", Const, 0, ""}, - {"BIOCSETBUFMODE", Const, 0, ""}, - {"BIOCSETF", Const, 0, ""}, - {"BIOCSETFNR", Const, 0, ""}, - {"BIOCSETIF", Const, 0, ""}, - {"BIOCSETWF", Const, 0, ""}, - {"BIOCSETZBUF", Const, 0, ""}, - {"BIOCSFEEDBACK", Const, 1, ""}, - {"BIOCSFILDROP", Const, 1, ""}, - {"BIOCSHDRCMPLT", Const, 0, ""}, - {"BIOCSRSIG", Const, 0, ""}, - {"BIOCSRTIMEOUT", Const, 0, ""}, - {"BIOCSSEESENT", Const, 0, ""}, - {"BIOCSTCPF", Const, 1, ""}, - {"BIOCSTSTAMP", Const, 1, ""}, - {"BIOCSUDPF", Const, 1, ""}, - {"BIOCVERSION", Const, 0, ""}, - {"BPF_A", Const, 0, ""}, - {"BPF_ABS", Const, 0, ""}, - {"BPF_ADD", Const, 0, ""}, - {"BPF_ALIGNMENT", Const, 0, ""}, - {"BPF_ALIGNMENT32", Const, 1, ""}, - {"BPF_ALU", Const, 0, ""}, - {"BPF_AND", Const, 0, ""}, - {"BPF_B", Const, 0, ""}, - {"BPF_BUFMODE_BUFFER", Const, 0, ""}, - {"BPF_BUFMODE_ZBUF", Const, 0, ""}, - {"BPF_DFLTBUFSIZE", Const, 1, ""}, - {"BPF_DIRECTION_IN", Const, 1, ""}, - {"BPF_DIRECTION_OUT", Const, 1, ""}, - {"BPF_DIV", Const, 0, ""}, - {"BPF_H", Const, 0, ""}, - {"BPF_IMM", Const, 0, ""}, - {"BPF_IND", Const, 0, ""}, - {"BPF_JA", Const, 0, ""}, - {"BPF_JEQ", Const, 0, ""}, - {"BPF_JGE", Const, 0, ""}, - {"BPF_JGT", Const, 0, ""}, - {"BPF_JMP", Const, 0, ""}, - {"BPF_JSET", Const, 0, ""}, - {"BPF_K", Const, 0, ""}, - {"BPF_LD", Const, 0, ""}, - {"BPF_LDX", Const, 0, ""}, - {"BPF_LEN", Const, 0, ""}, - {"BPF_LSH", Const, 0, ""}, - {"BPF_MAJOR_VERSION", Const, 0, ""}, - {"BPF_MAXBUFSIZE", Const, 0, ""}, - {"BPF_MAXINSNS", Const, 0, ""}, - {"BPF_MEM", Const, 0, ""}, - {"BPF_MEMWORDS", Const, 0, ""}, - {"BPF_MINBUFSIZE", Const, 0, ""}, - {"BPF_MINOR_VERSION", Const, 0, ""}, - {"BPF_MISC", Const, 0, ""}, - {"BPF_MSH", Const, 0, ""}, - {"BPF_MUL", Const, 0, ""}, - {"BPF_NEG", Const, 0, ""}, - {"BPF_OR", Const, 0, ""}, - {"BPF_RELEASE", Const, 0, ""}, - {"BPF_RET", Const, 0, ""}, - {"BPF_RSH", Const, 0, ""}, - {"BPF_ST", Const, 0, ""}, - {"BPF_STX", Const, 0, ""}, - {"BPF_SUB", Const, 0, ""}, - {"BPF_TAX", Const, 0, ""}, - {"BPF_TXA", Const, 0, ""}, - {"BPF_T_BINTIME", Const, 1, ""}, - {"BPF_T_BINTIME_FAST", Const, 1, ""}, - {"BPF_T_BINTIME_MONOTONIC", Const, 1, ""}, - {"BPF_T_BINTIME_MONOTONIC_FAST", Const, 1, ""}, - {"BPF_T_FAST", Const, 1, ""}, - {"BPF_T_FLAG_MASK", Const, 1, ""}, - {"BPF_T_FORMAT_MASK", Const, 1, ""}, - {"BPF_T_MICROTIME", Const, 1, ""}, - {"BPF_T_MICROTIME_FAST", Const, 1, ""}, - {"BPF_T_MICROTIME_MONOTONIC", Const, 1, ""}, - {"BPF_T_MICROTIME_MONOTONIC_FAST", Const, 1, ""}, - {"BPF_T_MONOTONIC", Const, 1, ""}, - {"BPF_T_MONOTONIC_FAST", Const, 1, ""}, - {"BPF_T_NANOTIME", Const, 1, ""}, - {"BPF_T_NANOTIME_FAST", Const, 1, ""}, - {"BPF_T_NANOTIME_MONOTONIC", Const, 1, ""}, - {"BPF_T_NANOTIME_MONOTONIC_FAST", Const, 1, ""}, - {"BPF_T_NONE", Const, 1, ""}, - {"BPF_T_NORMAL", Const, 1, ""}, - {"BPF_W", Const, 0, ""}, - {"BPF_X", Const, 0, ""}, - {"BRKINT", Const, 0, ""}, - {"Bind", Func, 0, "func(fd int, sa Sockaddr) (err error)"}, - {"BindToDevice", Func, 0, "func(fd int, device string) (err error)"}, - {"BpfBuflen", Func, 0, ""}, - {"BpfDatalink", Func, 0, ""}, - {"BpfHdr", Type, 0, ""}, - {"BpfHdr.Caplen", Field, 0, ""}, - {"BpfHdr.Datalen", Field, 0, ""}, - {"BpfHdr.Hdrlen", Field, 0, ""}, - {"BpfHdr.Pad_cgo_0", Field, 0, ""}, - {"BpfHdr.Tstamp", Field, 0, ""}, - {"BpfHeadercmpl", Func, 0, ""}, - {"BpfInsn", Type, 0, ""}, - {"BpfInsn.Code", Field, 0, ""}, - {"BpfInsn.Jf", Field, 0, ""}, - {"BpfInsn.Jt", Field, 0, ""}, - {"BpfInsn.K", Field, 0, ""}, - {"BpfInterface", Func, 0, ""}, - {"BpfJump", Func, 0, ""}, - {"BpfProgram", Type, 0, ""}, - {"BpfProgram.Insns", Field, 0, ""}, - {"BpfProgram.Len", Field, 0, ""}, - {"BpfProgram.Pad_cgo_0", Field, 0, ""}, - {"BpfStat", Type, 0, ""}, - {"BpfStat.Capt", Field, 2, ""}, - {"BpfStat.Drop", Field, 0, ""}, - {"BpfStat.Padding", Field, 2, ""}, - {"BpfStat.Recv", Field, 0, ""}, - {"BpfStats", Func, 0, ""}, - {"BpfStmt", Func, 0, ""}, - {"BpfTimeout", Func, 0, ""}, - {"BpfTimeval", Type, 2, ""}, - {"BpfTimeval.Sec", Field, 2, ""}, - {"BpfTimeval.Usec", Field, 2, ""}, - {"BpfVersion", Type, 0, ""}, - {"BpfVersion.Major", Field, 0, ""}, - {"BpfVersion.Minor", Field, 0, ""}, - {"BpfZbuf", Type, 0, ""}, - {"BpfZbuf.Bufa", Field, 0, ""}, - {"BpfZbuf.Bufb", Field, 0, ""}, - {"BpfZbuf.Buflen", Field, 0, ""}, - {"BpfZbufHeader", Type, 0, ""}, - {"BpfZbufHeader.Kernel_gen", Field, 0, ""}, - {"BpfZbufHeader.Kernel_len", Field, 0, ""}, - {"BpfZbufHeader.User_gen", Field, 0, ""}, - {"BpfZbufHeader.X_bzh_pad", Field, 0, ""}, - {"ByHandleFileInformation", Type, 0, ""}, - {"ByHandleFileInformation.CreationTime", Field, 0, ""}, - {"ByHandleFileInformation.FileAttributes", Field, 0, ""}, - {"ByHandleFileInformation.FileIndexHigh", Field, 0, ""}, - {"ByHandleFileInformation.FileIndexLow", Field, 0, ""}, - {"ByHandleFileInformation.FileSizeHigh", Field, 0, ""}, - {"ByHandleFileInformation.FileSizeLow", Field, 0, ""}, - {"ByHandleFileInformation.LastAccessTime", Field, 0, ""}, - {"ByHandleFileInformation.LastWriteTime", Field, 0, ""}, - {"ByHandleFileInformation.NumberOfLinks", Field, 0, ""}, - {"ByHandleFileInformation.VolumeSerialNumber", Field, 0, ""}, - {"BytePtrFromString", Func, 1, "func(s string) (*byte, error)"}, - {"ByteSliceFromString", Func, 1, "func(s string) ([]byte, error)"}, - {"CCR0_FLUSH", Const, 1, ""}, - {"CERT_CHAIN_POLICY_AUTHENTICODE", Const, 0, ""}, - {"CERT_CHAIN_POLICY_AUTHENTICODE_TS", Const, 0, ""}, - {"CERT_CHAIN_POLICY_BASE", Const, 0, ""}, - {"CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", Const, 0, ""}, - {"CERT_CHAIN_POLICY_EV", Const, 0, ""}, - {"CERT_CHAIN_POLICY_MICROSOFT_ROOT", Const, 0, ""}, - {"CERT_CHAIN_POLICY_NT_AUTH", Const, 0, ""}, - {"CERT_CHAIN_POLICY_SSL", Const, 0, ""}, - {"CERT_E_CN_NO_MATCH", Const, 0, ""}, - {"CERT_E_EXPIRED", Const, 0, ""}, - {"CERT_E_PURPOSE", Const, 0, ""}, - {"CERT_E_ROLE", Const, 0, ""}, - {"CERT_E_UNTRUSTEDROOT", Const, 0, ""}, - {"CERT_STORE_ADD_ALWAYS", Const, 0, ""}, - {"CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", Const, 0, ""}, - {"CERT_STORE_PROV_MEMORY", Const, 0, ""}, - {"CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", Const, 0, ""}, - {"CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", Const, 0, ""}, - {"CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", Const, 0, ""}, - {"CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", Const, 0, ""}, - {"CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", Const, 0, ""}, - {"CERT_TRUST_INVALID_BASIC_CONSTRAINTS", Const, 0, ""}, - {"CERT_TRUST_INVALID_EXTENSION", Const, 0, ""}, - {"CERT_TRUST_INVALID_NAME_CONSTRAINTS", Const, 0, ""}, - {"CERT_TRUST_INVALID_POLICY_CONSTRAINTS", Const, 0, ""}, - {"CERT_TRUST_IS_CYCLIC", Const, 0, ""}, - {"CERT_TRUST_IS_EXPLICIT_DISTRUST", Const, 0, ""}, - {"CERT_TRUST_IS_NOT_SIGNATURE_VALID", Const, 0, ""}, - {"CERT_TRUST_IS_NOT_TIME_VALID", Const, 0, ""}, - {"CERT_TRUST_IS_NOT_VALID_FOR_USAGE", Const, 0, ""}, - {"CERT_TRUST_IS_OFFLINE_REVOCATION", Const, 0, ""}, - {"CERT_TRUST_IS_REVOKED", Const, 0, ""}, - {"CERT_TRUST_IS_UNTRUSTED_ROOT", Const, 0, ""}, - {"CERT_TRUST_NO_ERROR", Const, 0, ""}, - {"CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", Const, 0, ""}, - {"CERT_TRUST_REVOCATION_STATUS_UNKNOWN", Const, 0, ""}, - {"CFLUSH", Const, 1, ""}, - {"CLOCAL", Const, 0, ""}, - {"CLONE_CHILD_CLEARTID", Const, 2, ""}, - {"CLONE_CHILD_SETTID", Const, 2, ""}, - {"CLONE_CLEAR_SIGHAND", Const, 20, ""}, - {"CLONE_CSIGNAL", Const, 3, ""}, - {"CLONE_DETACHED", Const, 2, ""}, - {"CLONE_FILES", Const, 2, ""}, - {"CLONE_FS", Const, 2, ""}, - {"CLONE_INTO_CGROUP", Const, 20, ""}, - {"CLONE_IO", Const, 2, ""}, - {"CLONE_NEWCGROUP", Const, 20, ""}, - {"CLONE_NEWIPC", Const, 2, ""}, - {"CLONE_NEWNET", Const, 2, ""}, - {"CLONE_NEWNS", Const, 2, ""}, - {"CLONE_NEWPID", Const, 2, ""}, - {"CLONE_NEWTIME", Const, 20, ""}, - {"CLONE_NEWUSER", Const, 2, ""}, - {"CLONE_NEWUTS", Const, 2, ""}, - {"CLONE_PARENT", Const, 2, ""}, - {"CLONE_PARENT_SETTID", Const, 2, ""}, - {"CLONE_PID", Const, 3, ""}, - {"CLONE_PIDFD", Const, 20, ""}, - {"CLONE_PTRACE", Const, 2, ""}, - {"CLONE_SETTLS", Const, 2, ""}, - {"CLONE_SIGHAND", Const, 2, ""}, - {"CLONE_SYSVSEM", Const, 2, ""}, - {"CLONE_THREAD", Const, 2, ""}, - {"CLONE_UNTRACED", Const, 2, ""}, - {"CLONE_VFORK", Const, 2, ""}, - {"CLONE_VM", Const, 2, ""}, - {"CPUID_CFLUSH", Const, 1, ""}, - {"CREAD", Const, 0, ""}, - {"CREATE_ALWAYS", Const, 0, ""}, - {"CREATE_NEW", Const, 0, ""}, - {"CREATE_NEW_PROCESS_GROUP", Const, 1, ""}, - {"CREATE_UNICODE_ENVIRONMENT", Const, 0, ""}, - {"CRYPT_DEFAULT_CONTAINER_OPTIONAL", Const, 0, ""}, - {"CRYPT_DELETEKEYSET", Const, 0, ""}, - {"CRYPT_MACHINE_KEYSET", Const, 0, ""}, - {"CRYPT_NEWKEYSET", Const, 0, ""}, - {"CRYPT_SILENT", Const, 0, ""}, - {"CRYPT_VERIFYCONTEXT", Const, 0, ""}, - {"CS5", Const, 0, ""}, - {"CS6", Const, 0, ""}, - {"CS7", Const, 0, ""}, - {"CS8", Const, 0, ""}, - {"CSIZE", Const, 0, ""}, - {"CSTART", Const, 1, ""}, - {"CSTATUS", Const, 1, ""}, - {"CSTOP", Const, 1, ""}, - {"CSTOPB", Const, 0, ""}, - {"CSUSP", Const, 1, ""}, - {"CTL_MAXNAME", Const, 0, ""}, - {"CTL_NET", Const, 0, ""}, - {"CTL_QUERY", Const, 1, ""}, - {"CTRL_BREAK_EVENT", Const, 1, ""}, - {"CTRL_CLOSE_EVENT", Const, 14, ""}, - {"CTRL_C_EVENT", Const, 1, ""}, - {"CTRL_LOGOFF_EVENT", Const, 14, ""}, - {"CTRL_SHUTDOWN_EVENT", Const, 14, ""}, - {"CancelIo", Func, 0, ""}, - {"CancelIoEx", Func, 1, ""}, - {"CertAddCertificateContextToStore", Func, 0, ""}, - {"CertChainContext", Type, 0, ""}, - {"CertChainContext.ChainCount", Field, 0, ""}, - {"CertChainContext.Chains", Field, 0, ""}, - {"CertChainContext.HasRevocationFreshnessTime", Field, 0, ""}, - {"CertChainContext.LowerQualityChainCount", Field, 0, ""}, - {"CertChainContext.LowerQualityChains", Field, 0, ""}, - {"CertChainContext.RevocationFreshnessTime", Field, 0, ""}, - {"CertChainContext.Size", Field, 0, ""}, - {"CertChainContext.TrustStatus", Field, 0, ""}, - {"CertChainElement", Type, 0, ""}, - {"CertChainElement.ApplicationUsage", Field, 0, ""}, - {"CertChainElement.CertContext", Field, 0, ""}, - {"CertChainElement.ExtendedErrorInfo", Field, 0, ""}, - {"CertChainElement.IssuanceUsage", Field, 0, ""}, - {"CertChainElement.RevocationInfo", Field, 0, ""}, - {"CertChainElement.Size", Field, 0, ""}, - {"CertChainElement.TrustStatus", Field, 0, ""}, - {"CertChainPara", Type, 0, ""}, - {"CertChainPara.CacheResync", Field, 0, ""}, - {"CertChainPara.CheckRevocationFreshnessTime", Field, 0, ""}, - {"CertChainPara.RequestedUsage", Field, 0, ""}, - {"CertChainPara.RequstedIssuancePolicy", Field, 0, ""}, - {"CertChainPara.RevocationFreshnessTime", Field, 0, ""}, - {"CertChainPara.Size", Field, 0, ""}, - {"CertChainPara.URLRetrievalTimeout", Field, 0, ""}, - {"CertChainPolicyPara", Type, 0, ""}, - {"CertChainPolicyPara.ExtraPolicyPara", Field, 0, ""}, - {"CertChainPolicyPara.Flags", Field, 0, ""}, - {"CertChainPolicyPara.Size", Field, 0, ""}, - {"CertChainPolicyStatus", Type, 0, ""}, - {"CertChainPolicyStatus.ChainIndex", Field, 0, ""}, - {"CertChainPolicyStatus.ElementIndex", Field, 0, ""}, - {"CertChainPolicyStatus.Error", Field, 0, ""}, - {"CertChainPolicyStatus.ExtraPolicyStatus", Field, 0, ""}, - {"CertChainPolicyStatus.Size", Field, 0, ""}, - {"CertCloseStore", Func, 0, ""}, - {"CertContext", Type, 0, ""}, - {"CertContext.CertInfo", Field, 0, ""}, - {"CertContext.EncodedCert", Field, 0, ""}, - {"CertContext.EncodingType", Field, 0, ""}, - {"CertContext.Length", Field, 0, ""}, - {"CertContext.Store", Field, 0, ""}, - {"CertCreateCertificateContext", Func, 0, ""}, - {"CertEnhKeyUsage", Type, 0, ""}, - {"CertEnhKeyUsage.Length", Field, 0, ""}, - {"CertEnhKeyUsage.UsageIdentifiers", Field, 0, ""}, - {"CertEnumCertificatesInStore", Func, 0, ""}, - {"CertFreeCertificateChain", Func, 0, ""}, - {"CertFreeCertificateContext", Func, 0, ""}, - {"CertGetCertificateChain", Func, 0, ""}, - {"CertInfo", Type, 11, ""}, - {"CertOpenStore", Func, 0, ""}, - {"CertOpenSystemStore", Func, 0, ""}, - {"CertRevocationCrlInfo", Type, 11, ""}, - {"CertRevocationInfo", Type, 0, ""}, - {"CertRevocationInfo.CrlInfo", Field, 0, ""}, - {"CertRevocationInfo.FreshnessTime", Field, 0, ""}, - {"CertRevocationInfo.HasFreshnessTime", Field, 0, ""}, - {"CertRevocationInfo.OidSpecificInfo", Field, 0, ""}, - {"CertRevocationInfo.RevocationOid", Field, 0, ""}, - {"CertRevocationInfo.RevocationResult", Field, 0, ""}, - {"CertRevocationInfo.Size", Field, 0, ""}, - {"CertSimpleChain", Type, 0, ""}, - {"CertSimpleChain.Elements", Field, 0, ""}, - {"CertSimpleChain.HasRevocationFreshnessTime", Field, 0, ""}, - {"CertSimpleChain.NumElements", Field, 0, ""}, - {"CertSimpleChain.RevocationFreshnessTime", Field, 0, ""}, - {"CertSimpleChain.Size", Field, 0, ""}, - {"CertSimpleChain.TrustListInfo", Field, 0, ""}, - {"CertSimpleChain.TrustStatus", Field, 0, ""}, - {"CertTrustListInfo", Type, 11, ""}, - {"CertTrustStatus", Type, 0, ""}, - {"CertTrustStatus.ErrorStatus", Field, 0, ""}, - {"CertTrustStatus.InfoStatus", Field, 0, ""}, - {"CertUsageMatch", Type, 0, ""}, - {"CertUsageMatch.Type", Field, 0, ""}, - {"CertUsageMatch.Usage", Field, 0, ""}, - {"CertVerifyCertificateChainPolicy", Func, 0, ""}, - {"Chdir", Func, 0, "func(path string) (err error)"}, - {"CheckBpfVersion", Func, 0, ""}, - {"Chflags", Func, 0, ""}, - {"Chmod", Func, 0, "func(path string, mode uint32) (err error)"}, - {"Chown", Func, 0, "func(path string, uid int, gid int) (err error)"}, - {"Chroot", Func, 0, "func(path string) (err error)"}, - {"Clearenv", Func, 0, "func()"}, - {"Close", Func, 0, "func(fd int) (err error)"}, - {"CloseHandle", Func, 0, ""}, - {"CloseOnExec", Func, 0, "func(fd int)"}, - {"Closesocket", Func, 0, ""}, - {"CmsgLen", Func, 0, "func(datalen int) int"}, - {"CmsgSpace", Func, 0, "func(datalen int) int"}, - {"Cmsghdr", Type, 0, ""}, - {"Cmsghdr.Len", Field, 0, ""}, - {"Cmsghdr.Level", Field, 0, ""}, - {"Cmsghdr.Type", Field, 0, ""}, - {"Cmsghdr.X__cmsg_data", Field, 0, ""}, - {"CommandLineToArgv", Func, 0, ""}, - {"ComputerName", Func, 0, ""}, - {"Conn", Type, 9, ""}, - {"Connect", Func, 0, "func(fd int, sa Sockaddr) (err error)"}, - {"ConnectEx", Func, 1, ""}, - {"ConvertSidToStringSid", Func, 0, ""}, - {"ConvertStringSidToSid", Func, 0, ""}, - {"CopySid", Func, 0, ""}, - {"Creat", Func, 0, "func(path string, mode uint32) (fd int, err error)"}, - {"CreateDirectory", Func, 0, ""}, - {"CreateFile", Func, 0, ""}, - {"CreateFileMapping", Func, 0, ""}, - {"CreateHardLink", Func, 4, ""}, - {"CreateIoCompletionPort", Func, 0, ""}, - {"CreatePipe", Func, 0, ""}, - {"CreateProcess", Func, 0, ""}, - {"CreateProcessAsUser", Func, 10, ""}, - {"CreateSymbolicLink", Func, 4, ""}, - {"CreateToolhelp32Snapshot", Func, 4, ""}, - {"Credential", Type, 0, ""}, - {"Credential.Gid", Field, 0, ""}, - {"Credential.Groups", Field, 0, ""}, - {"Credential.NoSetGroups", Field, 9, ""}, - {"Credential.Uid", Field, 0, ""}, - {"CryptAcquireContext", Func, 0, ""}, - {"CryptGenRandom", Func, 0, ""}, - {"CryptReleaseContext", Func, 0, ""}, - {"DIOCBSFLUSH", Const, 1, ""}, - {"DIOCOSFPFLUSH", Const, 1, ""}, - {"DLL", Type, 0, ""}, - {"DLL.Handle", Field, 0, ""}, - {"DLL.Name", Field, 0, ""}, - {"DLLError", Type, 0, ""}, - {"DLLError.Err", Field, 0, ""}, - {"DLLError.Msg", Field, 0, ""}, - {"DLLError.ObjName", Field, 0, ""}, - {"DLT_A429", Const, 0, ""}, - {"DLT_A653_ICM", Const, 0, ""}, - {"DLT_AIRONET_HEADER", Const, 0, ""}, - {"DLT_AOS", Const, 1, ""}, - {"DLT_APPLE_IP_OVER_IEEE1394", Const, 0, ""}, - {"DLT_ARCNET", Const, 0, ""}, - {"DLT_ARCNET_LINUX", Const, 0, ""}, - {"DLT_ATM_CLIP", Const, 0, ""}, - {"DLT_ATM_RFC1483", Const, 0, ""}, - {"DLT_AURORA", Const, 0, ""}, - {"DLT_AX25", Const, 0, ""}, - {"DLT_AX25_KISS", Const, 0, ""}, - {"DLT_BACNET_MS_TP", Const, 0, ""}, - {"DLT_BLUETOOTH_HCI_H4", Const, 0, ""}, - {"DLT_BLUETOOTH_HCI_H4_WITH_PHDR", Const, 0, ""}, - {"DLT_CAN20B", Const, 0, ""}, - {"DLT_CAN_SOCKETCAN", Const, 1, ""}, - {"DLT_CHAOS", Const, 0, ""}, - {"DLT_CHDLC", Const, 0, ""}, - {"DLT_CISCO_IOS", Const, 0, ""}, - {"DLT_C_HDLC", Const, 0, ""}, - {"DLT_C_HDLC_WITH_DIR", Const, 0, ""}, - {"DLT_DBUS", Const, 1, ""}, - {"DLT_DECT", Const, 1, ""}, - {"DLT_DOCSIS", Const, 0, ""}, - {"DLT_DVB_CI", Const, 1, ""}, - {"DLT_ECONET", Const, 0, ""}, - {"DLT_EN10MB", Const, 0, ""}, - {"DLT_EN3MB", Const, 0, ""}, - {"DLT_ENC", Const, 0, ""}, - {"DLT_ERF", Const, 0, ""}, - {"DLT_ERF_ETH", Const, 0, ""}, - {"DLT_ERF_POS", Const, 0, ""}, - {"DLT_FC_2", Const, 1, ""}, - {"DLT_FC_2_WITH_FRAME_DELIMS", Const, 1, ""}, - {"DLT_FDDI", Const, 0, ""}, - {"DLT_FLEXRAY", Const, 0, ""}, - {"DLT_FRELAY", Const, 0, ""}, - {"DLT_FRELAY_WITH_DIR", Const, 0, ""}, - {"DLT_GCOM_SERIAL", Const, 0, ""}, - {"DLT_GCOM_T1E1", Const, 0, ""}, - {"DLT_GPF_F", Const, 0, ""}, - {"DLT_GPF_T", Const, 0, ""}, - {"DLT_GPRS_LLC", Const, 0, ""}, - {"DLT_GSMTAP_ABIS", Const, 1, ""}, - {"DLT_GSMTAP_UM", Const, 1, ""}, - {"DLT_HDLC", Const, 1, ""}, - {"DLT_HHDLC", Const, 0, ""}, - {"DLT_HIPPI", Const, 1, ""}, - {"DLT_IBM_SN", Const, 0, ""}, - {"DLT_IBM_SP", Const, 0, ""}, - {"DLT_IEEE802", Const, 0, ""}, - {"DLT_IEEE802_11", Const, 0, ""}, - {"DLT_IEEE802_11_RADIO", Const, 0, ""}, - {"DLT_IEEE802_11_RADIO_AVS", Const, 0, ""}, - {"DLT_IEEE802_15_4", Const, 0, ""}, - {"DLT_IEEE802_15_4_LINUX", Const, 0, ""}, - {"DLT_IEEE802_15_4_NOFCS", Const, 1, ""}, - {"DLT_IEEE802_15_4_NONASK_PHY", Const, 0, ""}, - {"DLT_IEEE802_16_MAC_CPS", Const, 0, ""}, - {"DLT_IEEE802_16_MAC_CPS_RADIO", Const, 0, ""}, - {"DLT_IPFILTER", Const, 0, ""}, - {"DLT_IPMB", Const, 0, ""}, - {"DLT_IPMB_LINUX", Const, 0, ""}, - {"DLT_IPNET", Const, 1, ""}, - {"DLT_IPOIB", Const, 1, ""}, - {"DLT_IPV4", Const, 1, ""}, - {"DLT_IPV6", Const, 1, ""}, - {"DLT_IP_OVER_FC", Const, 0, ""}, - {"DLT_JUNIPER_ATM1", Const, 0, ""}, - {"DLT_JUNIPER_ATM2", Const, 0, ""}, - {"DLT_JUNIPER_ATM_CEMIC", Const, 1, ""}, - {"DLT_JUNIPER_CHDLC", Const, 0, ""}, - {"DLT_JUNIPER_ES", Const, 0, ""}, - {"DLT_JUNIPER_ETHER", Const, 0, ""}, - {"DLT_JUNIPER_FIBRECHANNEL", Const, 1, ""}, - {"DLT_JUNIPER_FRELAY", Const, 0, ""}, - {"DLT_JUNIPER_GGSN", Const, 0, ""}, - {"DLT_JUNIPER_ISM", Const, 0, ""}, - {"DLT_JUNIPER_MFR", Const, 0, ""}, - {"DLT_JUNIPER_MLFR", Const, 0, ""}, - {"DLT_JUNIPER_MLPPP", Const, 0, ""}, - {"DLT_JUNIPER_MONITOR", Const, 0, ""}, - {"DLT_JUNIPER_PIC_PEER", Const, 0, ""}, - {"DLT_JUNIPER_PPP", Const, 0, ""}, - {"DLT_JUNIPER_PPPOE", Const, 0, ""}, - {"DLT_JUNIPER_PPPOE_ATM", Const, 0, ""}, - {"DLT_JUNIPER_SERVICES", Const, 0, ""}, - {"DLT_JUNIPER_SRX_E2E", Const, 1, ""}, - {"DLT_JUNIPER_ST", Const, 0, ""}, - {"DLT_JUNIPER_VP", Const, 0, ""}, - {"DLT_JUNIPER_VS", Const, 1, ""}, - {"DLT_LAPB_WITH_DIR", Const, 0, ""}, - {"DLT_LAPD", Const, 0, ""}, - {"DLT_LIN", Const, 0, ""}, - {"DLT_LINUX_EVDEV", Const, 1, ""}, - {"DLT_LINUX_IRDA", Const, 0, ""}, - {"DLT_LINUX_LAPD", Const, 0, ""}, - {"DLT_LINUX_PPP_WITHDIRECTION", Const, 0, ""}, - {"DLT_LINUX_SLL", Const, 0, ""}, - {"DLT_LOOP", Const, 0, ""}, - {"DLT_LTALK", Const, 0, ""}, - {"DLT_MATCHING_MAX", Const, 1, ""}, - {"DLT_MATCHING_MIN", Const, 1, ""}, - {"DLT_MFR", Const, 0, ""}, - {"DLT_MOST", Const, 0, ""}, - {"DLT_MPEG_2_TS", Const, 1, ""}, - {"DLT_MPLS", Const, 1, ""}, - {"DLT_MTP2", Const, 0, ""}, - {"DLT_MTP2_WITH_PHDR", Const, 0, ""}, - {"DLT_MTP3", Const, 0, ""}, - {"DLT_MUX27010", Const, 1, ""}, - {"DLT_NETANALYZER", Const, 1, ""}, - {"DLT_NETANALYZER_TRANSPARENT", Const, 1, ""}, - {"DLT_NFC_LLCP", Const, 1, ""}, - {"DLT_NFLOG", Const, 1, ""}, - {"DLT_NG40", Const, 1, ""}, - {"DLT_NULL", Const, 0, ""}, - {"DLT_PCI_EXP", Const, 0, ""}, - {"DLT_PFLOG", Const, 0, ""}, - {"DLT_PFSYNC", Const, 0, ""}, - {"DLT_PPI", Const, 0, ""}, - {"DLT_PPP", Const, 0, ""}, - {"DLT_PPP_BSDOS", Const, 0, ""}, - {"DLT_PPP_ETHER", Const, 0, ""}, - {"DLT_PPP_PPPD", Const, 0, ""}, - {"DLT_PPP_SERIAL", Const, 0, ""}, - {"DLT_PPP_WITH_DIR", Const, 0, ""}, - {"DLT_PPP_WITH_DIRECTION", Const, 0, ""}, - {"DLT_PRISM_HEADER", Const, 0, ""}, - {"DLT_PRONET", Const, 0, ""}, - {"DLT_RAIF1", Const, 0, ""}, - {"DLT_RAW", Const, 0, ""}, - {"DLT_RAWAF_MASK", Const, 1, ""}, - {"DLT_RIO", Const, 0, ""}, - {"DLT_SCCP", Const, 0, ""}, - {"DLT_SITA", Const, 0, ""}, - {"DLT_SLIP", Const, 0, ""}, - {"DLT_SLIP_BSDOS", Const, 0, ""}, - {"DLT_STANAG_5066_D_PDU", Const, 1, ""}, - {"DLT_SUNATM", Const, 0, ""}, - {"DLT_SYMANTEC_FIREWALL", Const, 0, ""}, - {"DLT_TZSP", Const, 0, ""}, - {"DLT_USB", Const, 0, ""}, - {"DLT_USB_LINUX", Const, 0, ""}, - {"DLT_USB_LINUX_MMAPPED", Const, 1, ""}, - {"DLT_USER0", Const, 0, ""}, - {"DLT_USER1", Const, 0, ""}, - {"DLT_USER10", Const, 0, ""}, - {"DLT_USER11", Const, 0, ""}, - {"DLT_USER12", Const, 0, ""}, - {"DLT_USER13", Const, 0, ""}, - {"DLT_USER14", Const, 0, ""}, - {"DLT_USER15", Const, 0, ""}, - {"DLT_USER2", Const, 0, ""}, - {"DLT_USER3", Const, 0, ""}, - {"DLT_USER4", Const, 0, ""}, - {"DLT_USER5", Const, 0, ""}, - {"DLT_USER6", Const, 0, ""}, - {"DLT_USER7", Const, 0, ""}, - {"DLT_USER8", Const, 0, ""}, - {"DLT_USER9", Const, 0, ""}, - {"DLT_WIHART", Const, 1, ""}, - {"DLT_X2E_SERIAL", Const, 0, ""}, - {"DLT_X2E_XORAYA", Const, 0, ""}, - {"DNSMXData", Type, 0, ""}, - {"DNSMXData.NameExchange", Field, 0, ""}, - {"DNSMXData.Pad", Field, 0, ""}, - {"DNSMXData.Preference", Field, 0, ""}, - {"DNSPTRData", Type, 0, ""}, - {"DNSPTRData.Host", Field, 0, ""}, - {"DNSRecord", Type, 0, ""}, - {"DNSRecord.Data", Field, 0, ""}, - {"DNSRecord.Dw", Field, 0, ""}, - {"DNSRecord.Length", Field, 0, ""}, - {"DNSRecord.Name", Field, 0, ""}, - {"DNSRecord.Next", Field, 0, ""}, - {"DNSRecord.Reserved", Field, 0, ""}, - {"DNSRecord.Ttl", Field, 0, ""}, - {"DNSRecord.Type", Field, 0, ""}, - {"DNSSRVData", Type, 0, ""}, - {"DNSSRVData.Pad", Field, 0, ""}, - {"DNSSRVData.Port", Field, 0, ""}, - {"DNSSRVData.Priority", Field, 0, ""}, - {"DNSSRVData.Target", Field, 0, ""}, - {"DNSSRVData.Weight", Field, 0, ""}, - {"DNSTXTData", Type, 0, ""}, - {"DNSTXTData.StringArray", Field, 0, ""}, - {"DNSTXTData.StringCount", Field, 0, ""}, - {"DNS_INFO_NO_RECORDS", Const, 4, ""}, - {"DNS_TYPE_A", Const, 0, ""}, - {"DNS_TYPE_A6", Const, 0, ""}, - {"DNS_TYPE_AAAA", Const, 0, ""}, - {"DNS_TYPE_ADDRS", Const, 0, ""}, - {"DNS_TYPE_AFSDB", Const, 0, ""}, - {"DNS_TYPE_ALL", Const, 0, ""}, - {"DNS_TYPE_ANY", Const, 0, ""}, - {"DNS_TYPE_ATMA", Const, 0, ""}, - {"DNS_TYPE_AXFR", Const, 0, ""}, - {"DNS_TYPE_CERT", Const, 0, ""}, - {"DNS_TYPE_CNAME", Const, 0, ""}, - {"DNS_TYPE_DHCID", Const, 0, ""}, - {"DNS_TYPE_DNAME", Const, 0, ""}, - {"DNS_TYPE_DNSKEY", Const, 0, ""}, - {"DNS_TYPE_DS", Const, 0, ""}, - {"DNS_TYPE_EID", Const, 0, ""}, - {"DNS_TYPE_GID", Const, 0, ""}, - {"DNS_TYPE_GPOS", Const, 0, ""}, - {"DNS_TYPE_HINFO", Const, 0, ""}, - {"DNS_TYPE_ISDN", Const, 0, ""}, - {"DNS_TYPE_IXFR", Const, 0, ""}, - {"DNS_TYPE_KEY", Const, 0, ""}, - {"DNS_TYPE_KX", Const, 0, ""}, - {"DNS_TYPE_LOC", Const, 0, ""}, - {"DNS_TYPE_MAILA", Const, 0, ""}, - {"DNS_TYPE_MAILB", Const, 0, ""}, - {"DNS_TYPE_MB", Const, 0, ""}, - {"DNS_TYPE_MD", Const, 0, ""}, - {"DNS_TYPE_MF", Const, 0, ""}, - {"DNS_TYPE_MG", Const, 0, ""}, - {"DNS_TYPE_MINFO", Const, 0, ""}, - {"DNS_TYPE_MR", Const, 0, ""}, - {"DNS_TYPE_MX", Const, 0, ""}, - {"DNS_TYPE_NAPTR", Const, 0, ""}, - {"DNS_TYPE_NBSTAT", Const, 0, ""}, - {"DNS_TYPE_NIMLOC", Const, 0, ""}, - {"DNS_TYPE_NS", Const, 0, ""}, - {"DNS_TYPE_NSAP", Const, 0, ""}, - {"DNS_TYPE_NSAPPTR", Const, 0, ""}, - {"DNS_TYPE_NSEC", Const, 0, ""}, - {"DNS_TYPE_NULL", Const, 0, ""}, - {"DNS_TYPE_NXT", Const, 0, ""}, - {"DNS_TYPE_OPT", Const, 0, ""}, - {"DNS_TYPE_PTR", Const, 0, ""}, - {"DNS_TYPE_PX", Const, 0, ""}, - {"DNS_TYPE_RP", Const, 0, ""}, - {"DNS_TYPE_RRSIG", Const, 0, ""}, - {"DNS_TYPE_RT", Const, 0, ""}, - {"DNS_TYPE_SIG", Const, 0, ""}, - {"DNS_TYPE_SINK", Const, 0, ""}, - {"DNS_TYPE_SOA", Const, 0, ""}, - {"DNS_TYPE_SRV", Const, 0, ""}, - {"DNS_TYPE_TEXT", Const, 0, ""}, - {"DNS_TYPE_TKEY", Const, 0, ""}, - {"DNS_TYPE_TSIG", Const, 0, ""}, - {"DNS_TYPE_UID", Const, 0, ""}, - {"DNS_TYPE_UINFO", Const, 0, ""}, - {"DNS_TYPE_UNSPEC", Const, 0, ""}, - {"DNS_TYPE_WINS", Const, 0, ""}, - {"DNS_TYPE_WINSR", Const, 0, ""}, - {"DNS_TYPE_WKS", Const, 0, ""}, - {"DNS_TYPE_X25", Const, 0, ""}, - {"DT_BLK", Const, 0, ""}, - {"DT_CHR", Const, 0, ""}, - {"DT_DIR", Const, 0, ""}, - {"DT_FIFO", Const, 0, ""}, - {"DT_LNK", Const, 0, ""}, - {"DT_REG", Const, 0, ""}, - {"DT_SOCK", Const, 0, ""}, - {"DT_UNKNOWN", Const, 0, ""}, - {"DT_WHT", Const, 0, ""}, - {"DUPLICATE_CLOSE_SOURCE", Const, 0, ""}, - {"DUPLICATE_SAME_ACCESS", Const, 0, ""}, - {"DeleteFile", Func, 0, ""}, - {"DetachLsf", Func, 0, "func(fd int) error"}, - {"DeviceIoControl", Func, 4, ""}, - {"Dirent", Type, 0, ""}, - {"Dirent.Fileno", Field, 0, ""}, - {"Dirent.Ino", Field, 0, ""}, - {"Dirent.Name", Field, 0, ""}, - {"Dirent.Namlen", Field, 0, ""}, - {"Dirent.Off", Field, 0, ""}, - {"Dirent.Pad0", Field, 12, ""}, - {"Dirent.Pad1", Field, 12, ""}, - {"Dirent.Pad_cgo_0", Field, 0, ""}, - {"Dirent.Reclen", Field, 0, ""}, - {"Dirent.Seekoff", Field, 0, ""}, - {"Dirent.Type", Field, 0, ""}, - {"Dirent.X__d_padding", Field, 3, ""}, - {"DnsNameCompare", Func, 4, ""}, - {"DnsQuery", Func, 0, ""}, - {"DnsRecordListFree", Func, 0, ""}, - {"DnsSectionAdditional", Const, 4, ""}, - {"DnsSectionAnswer", Const, 4, ""}, - {"DnsSectionAuthority", Const, 4, ""}, - {"DnsSectionQuestion", Const, 4, ""}, - {"Dup", Func, 0, "func(oldfd int) (fd int, err error)"}, - {"Dup2", Func, 0, "func(oldfd int, newfd int) (err error)"}, - {"Dup3", Func, 2, "func(oldfd int, newfd int, flags int) (err error)"}, - {"DuplicateHandle", Func, 0, ""}, - {"E2BIG", Const, 0, ""}, - {"EACCES", Const, 0, ""}, - {"EADDRINUSE", Const, 0, ""}, - {"EADDRNOTAVAIL", Const, 0, ""}, - {"EADV", Const, 0, ""}, - {"EAFNOSUPPORT", Const, 0, ""}, - {"EAGAIN", Const, 0, ""}, - {"EALREADY", Const, 0, ""}, - {"EAUTH", Const, 0, ""}, - {"EBADARCH", Const, 0, ""}, - {"EBADE", Const, 0, ""}, - {"EBADEXEC", Const, 0, ""}, - {"EBADF", Const, 0, ""}, - {"EBADFD", Const, 0, ""}, - {"EBADMACHO", Const, 0, ""}, - {"EBADMSG", Const, 0, ""}, - {"EBADR", Const, 0, ""}, - {"EBADRPC", Const, 0, ""}, - {"EBADRQC", Const, 0, ""}, - {"EBADSLT", Const, 0, ""}, - {"EBFONT", Const, 0, ""}, - {"EBUSY", Const, 0, ""}, - {"ECANCELED", Const, 0, ""}, - {"ECAPMODE", Const, 1, ""}, - {"ECHILD", Const, 0, ""}, - {"ECHO", Const, 0, ""}, - {"ECHOCTL", Const, 0, ""}, - {"ECHOE", Const, 0, ""}, - {"ECHOK", Const, 0, ""}, - {"ECHOKE", Const, 0, ""}, - {"ECHONL", Const, 0, ""}, - {"ECHOPRT", Const, 0, ""}, - {"ECHRNG", Const, 0, ""}, - {"ECOMM", Const, 0, ""}, - {"ECONNABORTED", Const, 0, ""}, - {"ECONNREFUSED", Const, 0, ""}, - {"ECONNRESET", Const, 0, ""}, - {"EDEADLK", Const, 0, ""}, - {"EDEADLOCK", Const, 0, ""}, - {"EDESTADDRREQ", Const, 0, ""}, - {"EDEVERR", Const, 0, ""}, - {"EDOM", Const, 0, ""}, - {"EDOOFUS", Const, 0, ""}, - {"EDOTDOT", Const, 0, ""}, - {"EDQUOT", Const, 0, ""}, - {"EEXIST", Const, 0, ""}, - {"EFAULT", Const, 0, ""}, - {"EFBIG", Const, 0, ""}, - {"EFER_LMA", Const, 1, ""}, - {"EFER_LME", Const, 1, ""}, - {"EFER_NXE", Const, 1, ""}, - {"EFER_SCE", Const, 1, ""}, - {"EFTYPE", Const, 0, ""}, - {"EHOSTDOWN", Const, 0, ""}, - {"EHOSTUNREACH", Const, 0, ""}, - {"EHWPOISON", Const, 0, ""}, - {"EIDRM", Const, 0, ""}, - {"EILSEQ", Const, 0, ""}, - {"EINPROGRESS", Const, 0, ""}, - {"EINTR", Const, 0, ""}, - {"EINVAL", Const, 0, ""}, - {"EIO", Const, 0, ""}, - {"EIPSEC", Const, 1, ""}, - {"EISCONN", Const, 0, ""}, - {"EISDIR", Const, 0, ""}, - {"EISNAM", Const, 0, ""}, - {"EKEYEXPIRED", Const, 0, ""}, - {"EKEYREJECTED", Const, 0, ""}, - {"EKEYREVOKED", Const, 0, ""}, - {"EL2HLT", Const, 0, ""}, - {"EL2NSYNC", Const, 0, ""}, - {"EL3HLT", Const, 0, ""}, - {"EL3RST", Const, 0, ""}, - {"ELAST", Const, 0, ""}, - {"ELF_NGREG", Const, 0, ""}, - {"ELF_PRARGSZ", Const, 0, ""}, - {"ELIBACC", Const, 0, ""}, - {"ELIBBAD", Const, 0, ""}, - {"ELIBEXEC", Const, 0, ""}, - {"ELIBMAX", Const, 0, ""}, - {"ELIBSCN", Const, 0, ""}, - {"ELNRNG", Const, 0, ""}, - {"ELOOP", Const, 0, ""}, - {"EMEDIUMTYPE", Const, 0, ""}, - {"EMFILE", Const, 0, ""}, - {"EMLINK", Const, 0, ""}, - {"EMSGSIZE", Const, 0, ""}, - {"EMT_TAGOVF", Const, 1, ""}, - {"EMULTIHOP", Const, 0, ""}, - {"EMUL_ENABLED", Const, 1, ""}, - {"EMUL_LINUX", Const, 1, ""}, - {"EMUL_LINUX32", Const, 1, ""}, - {"EMUL_MAXID", Const, 1, ""}, - {"EMUL_NATIVE", Const, 1, ""}, - {"ENAMETOOLONG", Const, 0, ""}, - {"ENAVAIL", Const, 0, ""}, - {"ENDRUNDISC", Const, 1, ""}, - {"ENEEDAUTH", Const, 0, ""}, - {"ENETDOWN", Const, 0, ""}, - {"ENETRESET", Const, 0, ""}, - {"ENETUNREACH", Const, 0, ""}, - {"ENFILE", Const, 0, ""}, - {"ENOANO", Const, 0, ""}, - {"ENOATTR", Const, 0, ""}, - {"ENOBUFS", Const, 0, ""}, - {"ENOCSI", Const, 0, ""}, - {"ENODATA", Const, 0, ""}, - {"ENODEV", Const, 0, ""}, - {"ENOENT", Const, 0, ""}, - {"ENOEXEC", Const, 0, ""}, - {"ENOKEY", Const, 0, ""}, - {"ENOLCK", Const, 0, ""}, - {"ENOLINK", Const, 0, ""}, - {"ENOMEDIUM", Const, 0, ""}, - {"ENOMEM", Const, 0, ""}, - {"ENOMSG", Const, 0, ""}, - {"ENONET", Const, 0, ""}, - {"ENOPKG", Const, 0, ""}, - {"ENOPOLICY", Const, 0, ""}, - {"ENOPROTOOPT", Const, 0, ""}, - {"ENOSPC", Const, 0, ""}, - {"ENOSR", Const, 0, ""}, - {"ENOSTR", Const, 0, ""}, - {"ENOSYS", Const, 0, ""}, - {"ENOTBLK", Const, 0, ""}, - {"ENOTCAPABLE", Const, 0, ""}, - {"ENOTCONN", Const, 0, ""}, - {"ENOTDIR", Const, 0, ""}, - {"ENOTEMPTY", Const, 0, ""}, - {"ENOTNAM", Const, 0, ""}, - {"ENOTRECOVERABLE", Const, 0, ""}, - {"ENOTSOCK", Const, 0, ""}, - {"ENOTSUP", Const, 0, ""}, - {"ENOTTY", Const, 0, ""}, - {"ENOTUNIQ", Const, 0, ""}, - {"ENXIO", Const, 0, ""}, - {"EN_SW_CTL_INF", Const, 1, ""}, - {"EN_SW_CTL_PREC", Const, 1, ""}, - {"EN_SW_CTL_ROUND", Const, 1, ""}, - {"EN_SW_DATACHAIN", Const, 1, ""}, - {"EN_SW_DENORM", Const, 1, ""}, - {"EN_SW_INVOP", Const, 1, ""}, - {"EN_SW_OVERFLOW", Const, 1, ""}, - {"EN_SW_PRECLOSS", Const, 1, ""}, - {"EN_SW_UNDERFLOW", Const, 1, ""}, - {"EN_SW_ZERODIV", Const, 1, ""}, - {"EOPNOTSUPP", Const, 0, ""}, - {"EOVERFLOW", Const, 0, ""}, - {"EOWNERDEAD", Const, 0, ""}, - {"EPERM", Const, 0, ""}, - {"EPFNOSUPPORT", Const, 0, ""}, - {"EPIPE", Const, 0, ""}, - {"EPOLLERR", Const, 0, ""}, - {"EPOLLET", Const, 0, ""}, - {"EPOLLHUP", Const, 0, ""}, - {"EPOLLIN", Const, 0, ""}, - {"EPOLLMSG", Const, 0, ""}, - {"EPOLLONESHOT", Const, 0, ""}, - {"EPOLLOUT", Const, 0, ""}, - {"EPOLLPRI", Const, 0, ""}, - {"EPOLLRDBAND", Const, 0, ""}, - {"EPOLLRDHUP", Const, 0, ""}, - {"EPOLLRDNORM", Const, 0, ""}, - {"EPOLLWRBAND", Const, 0, ""}, - {"EPOLLWRNORM", Const, 0, ""}, - {"EPOLL_CLOEXEC", Const, 0, ""}, - {"EPOLL_CTL_ADD", Const, 0, ""}, - {"EPOLL_CTL_DEL", Const, 0, ""}, - {"EPOLL_CTL_MOD", Const, 0, ""}, - {"EPOLL_NONBLOCK", Const, 0, ""}, - {"EPROCLIM", Const, 0, ""}, - {"EPROCUNAVAIL", Const, 0, ""}, - {"EPROGMISMATCH", Const, 0, ""}, - {"EPROGUNAVAIL", Const, 0, ""}, - {"EPROTO", Const, 0, ""}, - {"EPROTONOSUPPORT", Const, 0, ""}, - {"EPROTOTYPE", Const, 0, ""}, - {"EPWROFF", Const, 0, ""}, - {"EQFULL", Const, 16, ""}, - {"ERANGE", Const, 0, ""}, - {"EREMCHG", Const, 0, ""}, - {"EREMOTE", Const, 0, ""}, - {"EREMOTEIO", Const, 0, ""}, - {"ERESTART", Const, 0, ""}, - {"ERFKILL", Const, 0, ""}, - {"EROFS", Const, 0, ""}, - {"ERPCMISMATCH", Const, 0, ""}, - {"ERROR_ACCESS_DENIED", Const, 0, ""}, - {"ERROR_ALREADY_EXISTS", Const, 0, ""}, - {"ERROR_BROKEN_PIPE", Const, 0, ""}, - {"ERROR_BUFFER_OVERFLOW", Const, 0, ""}, - {"ERROR_DIR_NOT_EMPTY", Const, 8, ""}, - {"ERROR_ENVVAR_NOT_FOUND", Const, 0, ""}, - {"ERROR_FILE_EXISTS", Const, 0, ""}, - {"ERROR_FILE_NOT_FOUND", Const, 0, ""}, - {"ERROR_HANDLE_EOF", Const, 2, ""}, - {"ERROR_INSUFFICIENT_BUFFER", Const, 0, ""}, - {"ERROR_IO_PENDING", Const, 0, ""}, - {"ERROR_MOD_NOT_FOUND", Const, 0, ""}, - {"ERROR_MORE_DATA", Const, 3, ""}, - {"ERROR_NETNAME_DELETED", Const, 3, ""}, - {"ERROR_NOT_FOUND", Const, 1, ""}, - {"ERROR_NO_MORE_FILES", Const, 0, ""}, - {"ERROR_OPERATION_ABORTED", Const, 0, ""}, - {"ERROR_PATH_NOT_FOUND", Const, 0, ""}, - {"ERROR_PRIVILEGE_NOT_HELD", Const, 4, ""}, - {"ERROR_PROC_NOT_FOUND", Const, 0, ""}, - {"ESHLIBVERS", Const, 0, ""}, - {"ESHUTDOWN", Const, 0, ""}, - {"ESOCKTNOSUPPORT", Const, 0, ""}, - {"ESPIPE", Const, 0, ""}, - {"ESRCH", Const, 0, ""}, - {"ESRMNT", Const, 0, ""}, - {"ESTALE", Const, 0, ""}, - {"ESTRPIPE", Const, 0, ""}, - {"ETHERCAP_JUMBO_MTU", Const, 1, ""}, - {"ETHERCAP_VLAN_HWTAGGING", Const, 1, ""}, - {"ETHERCAP_VLAN_MTU", Const, 1, ""}, - {"ETHERMIN", Const, 1, ""}, - {"ETHERMTU", Const, 1, ""}, - {"ETHERMTU_JUMBO", Const, 1, ""}, - {"ETHERTYPE_8023", Const, 1, ""}, - {"ETHERTYPE_AARP", Const, 1, ""}, - {"ETHERTYPE_ACCTON", Const, 1, ""}, - {"ETHERTYPE_AEONIC", Const, 1, ""}, - {"ETHERTYPE_ALPHA", Const, 1, ""}, - {"ETHERTYPE_AMBER", Const, 1, ""}, - {"ETHERTYPE_AMOEBA", Const, 1, ""}, - {"ETHERTYPE_AOE", Const, 1, ""}, - {"ETHERTYPE_APOLLO", Const, 1, ""}, - {"ETHERTYPE_APOLLODOMAIN", Const, 1, ""}, - {"ETHERTYPE_APPLETALK", Const, 1, ""}, - {"ETHERTYPE_APPLITEK", Const, 1, ""}, - {"ETHERTYPE_ARGONAUT", Const, 1, ""}, - {"ETHERTYPE_ARP", Const, 1, ""}, - {"ETHERTYPE_AT", Const, 1, ""}, - {"ETHERTYPE_ATALK", Const, 1, ""}, - {"ETHERTYPE_ATOMIC", Const, 1, ""}, - {"ETHERTYPE_ATT", Const, 1, ""}, - {"ETHERTYPE_ATTSTANFORD", Const, 1, ""}, - {"ETHERTYPE_AUTOPHON", Const, 1, ""}, - {"ETHERTYPE_AXIS", Const, 1, ""}, - {"ETHERTYPE_BCLOOP", Const, 1, ""}, - {"ETHERTYPE_BOFL", Const, 1, ""}, - {"ETHERTYPE_CABLETRON", Const, 1, ""}, - {"ETHERTYPE_CHAOS", Const, 1, ""}, - {"ETHERTYPE_COMDESIGN", Const, 1, ""}, - {"ETHERTYPE_COMPUGRAPHIC", Const, 1, ""}, - {"ETHERTYPE_COUNTERPOINT", Const, 1, ""}, - {"ETHERTYPE_CRONUS", Const, 1, ""}, - {"ETHERTYPE_CRONUSVLN", Const, 1, ""}, - {"ETHERTYPE_DCA", Const, 1, ""}, - {"ETHERTYPE_DDE", Const, 1, ""}, - {"ETHERTYPE_DEBNI", Const, 1, ""}, - {"ETHERTYPE_DECAM", Const, 1, ""}, - {"ETHERTYPE_DECCUST", Const, 1, ""}, - {"ETHERTYPE_DECDIAG", Const, 1, ""}, - {"ETHERTYPE_DECDNS", Const, 1, ""}, - {"ETHERTYPE_DECDTS", Const, 1, ""}, - {"ETHERTYPE_DECEXPER", Const, 1, ""}, - {"ETHERTYPE_DECLAST", Const, 1, ""}, - {"ETHERTYPE_DECLTM", Const, 1, ""}, - {"ETHERTYPE_DECMUMPS", Const, 1, ""}, - {"ETHERTYPE_DECNETBIOS", Const, 1, ""}, - {"ETHERTYPE_DELTACON", Const, 1, ""}, - {"ETHERTYPE_DIDDLE", Const, 1, ""}, - {"ETHERTYPE_DLOG1", Const, 1, ""}, - {"ETHERTYPE_DLOG2", Const, 1, ""}, - {"ETHERTYPE_DN", Const, 1, ""}, - {"ETHERTYPE_DOGFIGHT", Const, 1, ""}, - {"ETHERTYPE_DSMD", Const, 1, ""}, - {"ETHERTYPE_ECMA", Const, 1, ""}, - {"ETHERTYPE_ENCRYPT", Const, 1, ""}, - {"ETHERTYPE_ES", Const, 1, ""}, - {"ETHERTYPE_EXCELAN", Const, 1, ""}, - {"ETHERTYPE_EXPERDATA", Const, 1, ""}, - {"ETHERTYPE_FLIP", Const, 1, ""}, - {"ETHERTYPE_FLOWCONTROL", Const, 1, ""}, - {"ETHERTYPE_FRARP", Const, 1, ""}, - {"ETHERTYPE_GENDYN", Const, 1, ""}, - {"ETHERTYPE_HAYES", Const, 1, ""}, - {"ETHERTYPE_HIPPI_FP", Const, 1, ""}, - {"ETHERTYPE_HITACHI", Const, 1, ""}, - {"ETHERTYPE_HP", Const, 1, ""}, - {"ETHERTYPE_IEEEPUP", Const, 1, ""}, - {"ETHERTYPE_IEEEPUPAT", Const, 1, ""}, - {"ETHERTYPE_IMLBL", Const, 1, ""}, - {"ETHERTYPE_IMLBLDIAG", Const, 1, ""}, - {"ETHERTYPE_IP", Const, 1, ""}, - {"ETHERTYPE_IPAS", Const, 1, ""}, - {"ETHERTYPE_IPV6", Const, 1, ""}, - {"ETHERTYPE_IPX", Const, 1, ""}, - {"ETHERTYPE_IPXNEW", Const, 1, ""}, - {"ETHERTYPE_KALPANA", Const, 1, ""}, - {"ETHERTYPE_LANBRIDGE", Const, 1, ""}, - {"ETHERTYPE_LANPROBE", Const, 1, ""}, - {"ETHERTYPE_LAT", Const, 1, ""}, - {"ETHERTYPE_LBACK", Const, 1, ""}, - {"ETHERTYPE_LITTLE", Const, 1, ""}, - {"ETHERTYPE_LLDP", Const, 1, ""}, - {"ETHERTYPE_LOGICRAFT", Const, 1, ""}, - {"ETHERTYPE_LOOPBACK", Const, 1, ""}, - {"ETHERTYPE_MATRA", Const, 1, ""}, - {"ETHERTYPE_MAX", Const, 1, ""}, - {"ETHERTYPE_MERIT", Const, 1, ""}, - {"ETHERTYPE_MICP", Const, 1, ""}, - {"ETHERTYPE_MOPDL", Const, 1, ""}, - {"ETHERTYPE_MOPRC", Const, 1, ""}, - {"ETHERTYPE_MOTOROLA", Const, 1, ""}, - {"ETHERTYPE_MPLS", Const, 1, ""}, - {"ETHERTYPE_MPLS_MCAST", Const, 1, ""}, - {"ETHERTYPE_MUMPS", Const, 1, ""}, - {"ETHERTYPE_NBPCC", Const, 1, ""}, - {"ETHERTYPE_NBPCLAIM", Const, 1, ""}, - {"ETHERTYPE_NBPCLREQ", Const, 1, ""}, - {"ETHERTYPE_NBPCLRSP", Const, 1, ""}, - {"ETHERTYPE_NBPCREQ", Const, 1, ""}, - {"ETHERTYPE_NBPCRSP", Const, 1, ""}, - {"ETHERTYPE_NBPDG", Const, 1, ""}, - {"ETHERTYPE_NBPDGB", Const, 1, ""}, - {"ETHERTYPE_NBPDLTE", Const, 1, ""}, - {"ETHERTYPE_NBPRAR", Const, 1, ""}, - {"ETHERTYPE_NBPRAS", Const, 1, ""}, - {"ETHERTYPE_NBPRST", Const, 1, ""}, - {"ETHERTYPE_NBPSCD", Const, 1, ""}, - {"ETHERTYPE_NBPVCD", Const, 1, ""}, - {"ETHERTYPE_NBS", Const, 1, ""}, - {"ETHERTYPE_NCD", Const, 1, ""}, - {"ETHERTYPE_NESTAR", Const, 1, ""}, - {"ETHERTYPE_NETBEUI", Const, 1, ""}, - {"ETHERTYPE_NOVELL", Const, 1, ""}, - {"ETHERTYPE_NS", Const, 1, ""}, - {"ETHERTYPE_NSAT", Const, 1, ""}, - {"ETHERTYPE_NSCOMPAT", Const, 1, ""}, - {"ETHERTYPE_NTRAILER", Const, 1, ""}, - {"ETHERTYPE_OS9", Const, 1, ""}, - {"ETHERTYPE_OS9NET", Const, 1, ""}, - {"ETHERTYPE_PACER", Const, 1, ""}, - {"ETHERTYPE_PAE", Const, 1, ""}, - {"ETHERTYPE_PCS", Const, 1, ""}, - {"ETHERTYPE_PLANNING", Const, 1, ""}, - {"ETHERTYPE_PPP", Const, 1, ""}, - {"ETHERTYPE_PPPOE", Const, 1, ""}, - {"ETHERTYPE_PPPOEDISC", Const, 1, ""}, - {"ETHERTYPE_PRIMENTS", Const, 1, ""}, - {"ETHERTYPE_PUP", Const, 1, ""}, - {"ETHERTYPE_PUPAT", Const, 1, ""}, - {"ETHERTYPE_QINQ", Const, 1, ""}, - {"ETHERTYPE_RACAL", Const, 1, ""}, - {"ETHERTYPE_RATIONAL", Const, 1, ""}, - {"ETHERTYPE_RAWFR", Const, 1, ""}, - {"ETHERTYPE_RCL", Const, 1, ""}, - {"ETHERTYPE_RDP", Const, 1, ""}, - {"ETHERTYPE_RETIX", Const, 1, ""}, - {"ETHERTYPE_REVARP", Const, 1, ""}, - {"ETHERTYPE_SCA", Const, 1, ""}, - {"ETHERTYPE_SECTRA", Const, 1, ""}, - {"ETHERTYPE_SECUREDATA", Const, 1, ""}, - {"ETHERTYPE_SGITW", Const, 1, ""}, - {"ETHERTYPE_SG_BOUNCE", Const, 1, ""}, - {"ETHERTYPE_SG_DIAG", Const, 1, ""}, - {"ETHERTYPE_SG_NETGAMES", Const, 1, ""}, - {"ETHERTYPE_SG_RESV", Const, 1, ""}, - {"ETHERTYPE_SIMNET", Const, 1, ""}, - {"ETHERTYPE_SLOW", Const, 1, ""}, - {"ETHERTYPE_SLOWPROTOCOLS", Const, 1, ""}, - {"ETHERTYPE_SNA", Const, 1, ""}, - {"ETHERTYPE_SNMP", Const, 1, ""}, - {"ETHERTYPE_SONIX", Const, 1, ""}, - {"ETHERTYPE_SPIDER", Const, 1, ""}, - {"ETHERTYPE_SPRITE", Const, 1, ""}, - {"ETHERTYPE_STP", Const, 1, ""}, - {"ETHERTYPE_TALARIS", Const, 1, ""}, - {"ETHERTYPE_TALARISMC", Const, 1, ""}, - {"ETHERTYPE_TCPCOMP", Const, 1, ""}, - {"ETHERTYPE_TCPSM", Const, 1, ""}, - {"ETHERTYPE_TEC", Const, 1, ""}, - {"ETHERTYPE_TIGAN", Const, 1, ""}, - {"ETHERTYPE_TRAIL", Const, 1, ""}, - {"ETHERTYPE_TRANSETHER", Const, 1, ""}, - {"ETHERTYPE_TYMSHARE", Const, 1, ""}, - {"ETHERTYPE_UBBST", Const, 1, ""}, - {"ETHERTYPE_UBDEBUG", Const, 1, ""}, - {"ETHERTYPE_UBDIAGLOOP", Const, 1, ""}, - {"ETHERTYPE_UBDL", Const, 1, ""}, - {"ETHERTYPE_UBNIU", Const, 1, ""}, - {"ETHERTYPE_UBNMC", Const, 1, ""}, - {"ETHERTYPE_VALID", Const, 1, ""}, - {"ETHERTYPE_VARIAN", Const, 1, ""}, - {"ETHERTYPE_VAXELN", Const, 1, ""}, - {"ETHERTYPE_VEECO", Const, 1, ""}, - {"ETHERTYPE_VEXP", Const, 1, ""}, - {"ETHERTYPE_VGLAB", Const, 1, ""}, - {"ETHERTYPE_VINES", Const, 1, ""}, - {"ETHERTYPE_VINESECHO", Const, 1, ""}, - {"ETHERTYPE_VINESLOOP", Const, 1, ""}, - {"ETHERTYPE_VITAL", Const, 1, ""}, - {"ETHERTYPE_VLAN", Const, 1, ""}, - {"ETHERTYPE_VLTLMAN", Const, 1, ""}, - {"ETHERTYPE_VPROD", Const, 1, ""}, - {"ETHERTYPE_VURESERVED", Const, 1, ""}, - {"ETHERTYPE_WATERLOO", Const, 1, ""}, - {"ETHERTYPE_WELLFLEET", Const, 1, ""}, - {"ETHERTYPE_X25", Const, 1, ""}, - {"ETHERTYPE_X75", Const, 1, ""}, - {"ETHERTYPE_XNSSM", Const, 1, ""}, - {"ETHERTYPE_XTP", Const, 1, ""}, - {"ETHER_ADDR_LEN", Const, 1, ""}, - {"ETHER_ALIGN", Const, 1, ""}, - {"ETHER_CRC_LEN", Const, 1, ""}, - {"ETHER_CRC_POLY_BE", Const, 1, ""}, - {"ETHER_CRC_POLY_LE", Const, 1, ""}, - {"ETHER_HDR_LEN", Const, 1, ""}, - {"ETHER_MAX_DIX_LEN", Const, 1, ""}, - {"ETHER_MAX_LEN", Const, 1, ""}, - {"ETHER_MAX_LEN_JUMBO", Const, 1, ""}, - {"ETHER_MIN_LEN", Const, 1, ""}, - {"ETHER_PPPOE_ENCAP_LEN", Const, 1, ""}, - {"ETHER_TYPE_LEN", Const, 1, ""}, - {"ETHER_VLAN_ENCAP_LEN", Const, 1, ""}, - {"ETH_P_1588", Const, 0, ""}, - {"ETH_P_8021Q", Const, 0, ""}, - {"ETH_P_802_2", Const, 0, ""}, - {"ETH_P_802_3", Const, 0, ""}, - {"ETH_P_AARP", Const, 0, ""}, - {"ETH_P_ALL", Const, 0, ""}, - {"ETH_P_AOE", Const, 0, ""}, - {"ETH_P_ARCNET", Const, 0, ""}, - {"ETH_P_ARP", Const, 0, ""}, - {"ETH_P_ATALK", Const, 0, ""}, - {"ETH_P_ATMFATE", Const, 0, ""}, - {"ETH_P_ATMMPOA", Const, 0, ""}, - {"ETH_P_AX25", Const, 0, ""}, - {"ETH_P_BPQ", Const, 0, ""}, - {"ETH_P_CAIF", Const, 0, ""}, - {"ETH_P_CAN", Const, 0, ""}, - {"ETH_P_CONTROL", Const, 0, ""}, - {"ETH_P_CUST", Const, 0, ""}, - {"ETH_P_DDCMP", Const, 0, ""}, - {"ETH_P_DEC", Const, 0, ""}, - {"ETH_P_DIAG", Const, 0, ""}, - {"ETH_P_DNA_DL", Const, 0, ""}, - {"ETH_P_DNA_RC", Const, 0, ""}, - {"ETH_P_DNA_RT", Const, 0, ""}, - {"ETH_P_DSA", Const, 0, ""}, - {"ETH_P_ECONET", Const, 0, ""}, - {"ETH_P_EDSA", Const, 0, ""}, - {"ETH_P_FCOE", Const, 0, ""}, - {"ETH_P_FIP", Const, 0, ""}, - {"ETH_P_HDLC", Const, 0, ""}, - {"ETH_P_IEEE802154", Const, 0, ""}, - {"ETH_P_IEEEPUP", Const, 0, ""}, - {"ETH_P_IEEEPUPAT", Const, 0, ""}, - {"ETH_P_IP", Const, 0, ""}, - {"ETH_P_IPV6", Const, 0, ""}, - {"ETH_P_IPX", Const, 0, ""}, - {"ETH_P_IRDA", Const, 0, ""}, - {"ETH_P_LAT", Const, 0, ""}, - {"ETH_P_LINK_CTL", Const, 0, ""}, - {"ETH_P_LOCALTALK", Const, 0, ""}, - {"ETH_P_LOOP", Const, 0, ""}, - {"ETH_P_MOBITEX", Const, 0, ""}, - {"ETH_P_MPLS_MC", Const, 0, ""}, - {"ETH_P_MPLS_UC", Const, 0, ""}, - {"ETH_P_PAE", Const, 0, ""}, - {"ETH_P_PAUSE", Const, 0, ""}, - {"ETH_P_PHONET", Const, 0, ""}, - {"ETH_P_PPPTALK", Const, 0, ""}, - {"ETH_P_PPP_DISC", Const, 0, ""}, - {"ETH_P_PPP_MP", Const, 0, ""}, - {"ETH_P_PPP_SES", Const, 0, ""}, - {"ETH_P_PUP", Const, 0, ""}, - {"ETH_P_PUPAT", Const, 0, ""}, - {"ETH_P_RARP", Const, 0, ""}, - {"ETH_P_SCA", Const, 0, ""}, - {"ETH_P_SLOW", Const, 0, ""}, - {"ETH_P_SNAP", Const, 0, ""}, - {"ETH_P_TEB", Const, 0, ""}, - {"ETH_P_TIPC", Const, 0, ""}, - {"ETH_P_TRAILER", Const, 0, ""}, - {"ETH_P_TR_802_2", Const, 0, ""}, - {"ETH_P_WAN_PPP", Const, 0, ""}, - {"ETH_P_WCCP", Const, 0, ""}, - {"ETH_P_X25", Const, 0, ""}, - {"ETIME", Const, 0, ""}, - {"ETIMEDOUT", Const, 0, ""}, - {"ETOOMANYREFS", Const, 0, ""}, - {"ETXTBSY", Const, 0, ""}, - {"EUCLEAN", Const, 0, ""}, - {"EUNATCH", Const, 0, ""}, - {"EUSERS", Const, 0, ""}, - {"EVFILT_AIO", Const, 0, ""}, - {"EVFILT_FS", Const, 0, ""}, - {"EVFILT_LIO", Const, 0, ""}, - {"EVFILT_MACHPORT", Const, 0, ""}, - {"EVFILT_PROC", Const, 0, ""}, - {"EVFILT_READ", Const, 0, ""}, - {"EVFILT_SIGNAL", Const, 0, ""}, - {"EVFILT_SYSCOUNT", Const, 0, ""}, - {"EVFILT_THREADMARKER", Const, 0, ""}, - {"EVFILT_TIMER", Const, 0, ""}, - {"EVFILT_USER", Const, 0, ""}, - {"EVFILT_VM", Const, 0, ""}, - {"EVFILT_VNODE", Const, 0, ""}, - {"EVFILT_WRITE", Const, 0, ""}, - {"EV_ADD", Const, 0, ""}, - {"EV_CLEAR", Const, 0, ""}, - {"EV_DELETE", Const, 0, ""}, - {"EV_DISABLE", Const, 0, ""}, - {"EV_DISPATCH", Const, 0, ""}, - {"EV_DROP", Const, 3, ""}, - {"EV_ENABLE", Const, 0, ""}, - {"EV_EOF", Const, 0, ""}, - {"EV_ERROR", Const, 0, ""}, - {"EV_FLAG0", Const, 0, ""}, - {"EV_FLAG1", Const, 0, ""}, - {"EV_ONESHOT", Const, 0, ""}, - {"EV_OOBAND", Const, 0, ""}, - {"EV_POLL", Const, 0, ""}, - {"EV_RECEIPT", Const, 0, ""}, - {"EV_SYSFLAGS", Const, 0, ""}, - {"EWINDOWS", Const, 0, ""}, - {"EWOULDBLOCK", Const, 0, ""}, - {"EXDEV", Const, 0, ""}, - {"EXFULL", Const, 0, ""}, - {"EXTA", Const, 0, ""}, - {"EXTB", Const, 0, ""}, - {"EXTPROC", Const, 0, ""}, - {"Environ", Func, 0, "func() []string"}, - {"EpollCreate", Func, 0, "func(size int) (fd int, err error)"}, - {"EpollCreate1", Func, 0, "func(flag int) (fd int, err error)"}, - {"EpollCtl", Func, 0, "func(epfd int, op int, fd int, event *EpollEvent) (err error)"}, - {"EpollEvent", Type, 0, ""}, - {"EpollEvent.Events", Field, 0, ""}, - {"EpollEvent.Fd", Field, 0, ""}, - {"EpollEvent.Pad", Field, 0, ""}, - {"EpollEvent.PadFd", Field, 0, ""}, - {"EpollWait", Func, 0, "func(epfd int, events []EpollEvent, msec int) (n int, err error)"}, - {"Errno", Type, 0, ""}, - {"EscapeArg", Func, 0, ""}, - {"Exchangedata", Func, 0, ""}, - {"Exec", Func, 0, "func(argv0 string, argv []string, envv []string) (err error)"}, - {"Exit", Func, 0, "func(code int)"}, - {"ExitProcess", Func, 0, ""}, - {"FD_CLOEXEC", Const, 0, ""}, - {"FD_SETSIZE", Const, 0, ""}, - {"FILE_ACTION_ADDED", Const, 0, ""}, - {"FILE_ACTION_MODIFIED", Const, 0, ""}, - {"FILE_ACTION_REMOVED", Const, 0, ""}, - {"FILE_ACTION_RENAMED_NEW_NAME", Const, 0, ""}, - {"FILE_ACTION_RENAMED_OLD_NAME", Const, 0, ""}, - {"FILE_APPEND_DATA", Const, 0, ""}, - {"FILE_ATTRIBUTE_ARCHIVE", Const, 0, ""}, - {"FILE_ATTRIBUTE_DIRECTORY", Const, 0, ""}, - {"FILE_ATTRIBUTE_HIDDEN", Const, 0, ""}, - {"FILE_ATTRIBUTE_NORMAL", Const, 0, ""}, - {"FILE_ATTRIBUTE_READONLY", Const, 0, ""}, - {"FILE_ATTRIBUTE_REPARSE_POINT", Const, 4, ""}, - {"FILE_ATTRIBUTE_SYSTEM", Const, 0, ""}, - {"FILE_BEGIN", Const, 0, ""}, - {"FILE_CURRENT", Const, 0, ""}, - {"FILE_END", Const, 0, ""}, - {"FILE_FLAG_BACKUP_SEMANTICS", Const, 0, ""}, - {"FILE_FLAG_OPEN_REPARSE_POINT", Const, 4, ""}, - {"FILE_FLAG_OVERLAPPED", Const, 0, ""}, - {"FILE_LIST_DIRECTORY", Const, 0, ""}, - {"FILE_MAP_COPY", Const, 0, ""}, - {"FILE_MAP_EXECUTE", Const, 0, ""}, - {"FILE_MAP_READ", Const, 0, ""}, - {"FILE_MAP_WRITE", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_ATTRIBUTES", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_CREATION", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_DIR_NAME", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_FILE_NAME", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_LAST_ACCESS", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_LAST_WRITE", Const, 0, ""}, - {"FILE_NOTIFY_CHANGE_SIZE", Const, 0, ""}, - {"FILE_SHARE_DELETE", Const, 0, ""}, - {"FILE_SHARE_READ", Const, 0, ""}, - {"FILE_SHARE_WRITE", Const, 0, ""}, - {"FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", Const, 2, ""}, - {"FILE_SKIP_SET_EVENT_ON_HANDLE", Const, 2, ""}, - {"FILE_TYPE_CHAR", Const, 0, ""}, - {"FILE_TYPE_DISK", Const, 0, ""}, - {"FILE_TYPE_PIPE", Const, 0, ""}, - {"FILE_TYPE_REMOTE", Const, 0, ""}, - {"FILE_TYPE_UNKNOWN", Const, 0, ""}, - {"FILE_WRITE_ATTRIBUTES", Const, 0, ""}, - {"FLUSHO", Const, 0, ""}, - {"FORMAT_MESSAGE_ALLOCATE_BUFFER", Const, 0, ""}, - {"FORMAT_MESSAGE_ARGUMENT_ARRAY", Const, 0, ""}, - {"FORMAT_MESSAGE_FROM_HMODULE", Const, 0, ""}, - {"FORMAT_MESSAGE_FROM_STRING", Const, 0, ""}, - {"FORMAT_MESSAGE_FROM_SYSTEM", Const, 0, ""}, - {"FORMAT_MESSAGE_IGNORE_INSERTS", Const, 0, ""}, - {"FORMAT_MESSAGE_MAX_WIDTH_MASK", Const, 0, ""}, - {"FSCTL_GET_REPARSE_POINT", Const, 4, ""}, - {"F_ADDFILESIGS", Const, 0, ""}, - {"F_ADDSIGS", Const, 0, ""}, - {"F_ALLOCATEALL", Const, 0, ""}, - {"F_ALLOCATECONTIG", Const, 0, ""}, - {"F_CANCEL", Const, 0, ""}, - {"F_CHKCLEAN", Const, 0, ""}, - {"F_CLOSEM", Const, 1, ""}, - {"F_DUP2FD", Const, 0, ""}, - {"F_DUP2FD_CLOEXEC", Const, 1, ""}, - {"F_DUPFD", Const, 0, ""}, - {"F_DUPFD_CLOEXEC", Const, 0, ""}, - {"F_EXLCK", Const, 0, ""}, - {"F_FINDSIGS", Const, 16, ""}, - {"F_FLUSH_DATA", Const, 0, ""}, - {"F_FREEZE_FS", Const, 0, ""}, - {"F_FSCTL", Const, 1, ""}, - {"F_FSDIRMASK", Const, 1, ""}, - {"F_FSIN", Const, 1, ""}, - {"F_FSINOUT", Const, 1, ""}, - {"F_FSOUT", Const, 1, ""}, - {"F_FSPRIV", Const, 1, ""}, - {"F_FSVOID", Const, 1, ""}, - {"F_FULLFSYNC", Const, 0, ""}, - {"F_GETCODEDIR", Const, 16, ""}, - {"F_GETFD", Const, 0, ""}, - {"F_GETFL", Const, 0, ""}, - {"F_GETLEASE", Const, 0, ""}, - {"F_GETLK", Const, 0, ""}, - {"F_GETLK64", Const, 0, ""}, - {"F_GETLKPID", Const, 0, ""}, - {"F_GETNOSIGPIPE", Const, 0, ""}, - {"F_GETOWN", Const, 0, ""}, - {"F_GETOWN_EX", Const, 0, ""}, - {"F_GETPATH", Const, 0, ""}, - {"F_GETPATH_MTMINFO", Const, 0, ""}, - {"F_GETPIPE_SZ", Const, 0, ""}, - {"F_GETPROTECTIONCLASS", Const, 0, ""}, - {"F_GETPROTECTIONLEVEL", Const, 16, ""}, - {"F_GETSIG", Const, 0, ""}, - {"F_GLOBAL_NOCACHE", Const, 0, ""}, - {"F_LOCK", Const, 0, ""}, - {"F_LOG2PHYS", Const, 0, ""}, - {"F_LOG2PHYS_EXT", Const, 0, ""}, - {"F_MARKDEPENDENCY", Const, 0, ""}, - {"F_MAXFD", Const, 1, ""}, - {"F_NOCACHE", Const, 0, ""}, - {"F_NODIRECT", Const, 0, ""}, - {"F_NOTIFY", Const, 0, ""}, - {"F_OGETLK", Const, 0, ""}, - {"F_OK", Const, 0, ""}, - {"F_OSETLK", Const, 0, ""}, - {"F_OSETLKW", Const, 0, ""}, - {"F_PARAM_MASK", Const, 1, ""}, - {"F_PARAM_MAX", Const, 1, ""}, - {"F_PATHPKG_CHECK", Const, 0, ""}, - {"F_PEOFPOSMODE", Const, 0, ""}, - {"F_PREALLOCATE", Const, 0, ""}, - {"F_RDADVISE", Const, 0, ""}, - {"F_RDAHEAD", Const, 0, ""}, - {"F_RDLCK", Const, 0, ""}, - {"F_READAHEAD", Const, 0, ""}, - {"F_READBOOTSTRAP", Const, 0, ""}, - {"F_SETBACKINGSTORE", Const, 0, ""}, - {"F_SETFD", Const, 0, ""}, - {"F_SETFL", Const, 0, ""}, - {"F_SETLEASE", Const, 0, ""}, - {"F_SETLK", Const, 0, ""}, - {"F_SETLK64", Const, 0, ""}, - {"F_SETLKW", Const, 0, ""}, - {"F_SETLKW64", Const, 0, ""}, - {"F_SETLKWTIMEOUT", Const, 16, ""}, - {"F_SETLK_REMOTE", Const, 0, ""}, - {"F_SETNOSIGPIPE", Const, 0, ""}, - {"F_SETOWN", Const, 0, ""}, - {"F_SETOWN_EX", Const, 0, ""}, - {"F_SETPIPE_SZ", Const, 0, ""}, - {"F_SETPROTECTIONCLASS", Const, 0, ""}, - {"F_SETSIG", Const, 0, ""}, - {"F_SETSIZE", Const, 0, ""}, - {"F_SHLCK", Const, 0, ""}, - {"F_SINGLE_WRITER", Const, 16, ""}, - {"F_TEST", Const, 0, ""}, - {"F_THAW_FS", Const, 0, ""}, - {"F_TLOCK", Const, 0, ""}, - {"F_TRANSCODEKEY", Const, 16, ""}, - {"F_ULOCK", Const, 0, ""}, - {"F_UNLCK", Const, 0, ""}, - {"F_UNLCKSYS", Const, 0, ""}, - {"F_VOLPOSMODE", Const, 0, ""}, - {"F_WRITEBOOTSTRAP", Const, 0, ""}, - {"F_WRLCK", Const, 0, ""}, - {"Faccessat", Func, 0, "func(dirfd int, path string, mode uint32, flags int) (err error)"}, - {"Fallocate", Func, 0, "func(fd int, mode uint32, off int64, len int64) (err error)"}, - {"Fbootstraptransfer_t", Type, 0, ""}, - {"Fbootstraptransfer_t.Buffer", Field, 0, ""}, - {"Fbootstraptransfer_t.Length", Field, 0, ""}, - {"Fbootstraptransfer_t.Offset", Field, 0, ""}, - {"Fchdir", Func, 0, "func(fd int) (err error)"}, - {"Fchflags", Func, 0, ""}, - {"Fchmod", Func, 0, "func(fd int, mode uint32) (err error)"}, - {"Fchmodat", Func, 0, "func(dirfd int, path string, mode uint32, flags int) error"}, - {"Fchown", Func, 0, "func(fd int, uid int, gid int) (err error)"}, - {"Fchownat", Func, 0, "func(dirfd int, path string, uid int, gid int, flags int) (err error)"}, - {"FcntlFlock", Func, 3, "func(fd uintptr, cmd int, lk *Flock_t) error"}, - {"FdSet", Type, 0, ""}, - {"FdSet.Bits", Field, 0, ""}, - {"FdSet.X__fds_bits", Field, 0, ""}, - {"Fdatasync", Func, 0, "func(fd int) (err error)"}, - {"FileNotifyInformation", Type, 0, ""}, - {"FileNotifyInformation.Action", Field, 0, ""}, - {"FileNotifyInformation.FileName", Field, 0, ""}, - {"FileNotifyInformation.FileNameLength", Field, 0, ""}, - {"FileNotifyInformation.NextEntryOffset", Field, 0, ""}, - {"Filetime", Type, 0, ""}, - {"Filetime.HighDateTime", Field, 0, ""}, - {"Filetime.LowDateTime", Field, 0, ""}, - {"FindClose", Func, 0, ""}, - {"FindFirstFile", Func, 0, ""}, - {"FindNextFile", Func, 0, ""}, - {"Flock", Func, 0, "func(fd int, how int) (err error)"}, - {"Flock_t", Type, 0, ""}, - {"Flock_t.Len", Field, 0, ""}, - {"Flock_t.Pad_cgo_0", Field, 0, ""}, - {"Flock_t.Pad_cgo_1", Field, 3, ""}, - {"Flock_t.Pid", Field, 0, ""}, - {"Flock_t.Start", Field, 0, ""}, - {"Flock_t.Sysid", Field, 0, ""}, - {"Flock_t.Type", Field, 0, ""}, - {"Flock_t.Whence", Field, 0, ""}, - {"FlushBpf", Func, 0, ""}, - {"FlushFileBuffers", Func, 0, ""}, - {"FlushViewOfFile", Func, 0, ""}, - {"ForkExec", Func, 0, "func(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)"}, - {"ForkLock", Var, 0, ""}, - {"FormatMessage", Func, 0, ""}, - {"Fpathconf", Func, 0, ""}, - {"FreeAddrInfoW", Func, 1, ""}, - {"FreeEnvironmentStrings", Func, 0, ""}, - {"FreeLibrary", Func, 0, ""}, - {"Fsid", Type, 0, ""}, - {"Fsid.Val", Field, 0, ""}, - {"Fsid.X__fsid_val", Field, 2, ""}, - {"Fsid.X__val", Field, 0, ""}, - {"Fstat", Func, 0, "func(fd int, stat *Stat_t) (err error)"}, - {"Fstatat", Func, 12, ""}, - {"Fstatfs", Func, 0, "func(fd int, buf *Statfs_t) (err error)"}, - {"Fstore_t", Type, 0, ""}, - {"Fstore_t.Bytesalloc", Field, 0, ""}, - {"Fstore_t.Flags", Field, 0, ""}, - {"Fstore_t.Length", Field, 0, ""}, - {"Fstore_t.Offset", Field, 0, ""}, - {"Fstore_t.Posmode", Field, 0, ""}, - {"Fsync", Func, 0, "func(fd int) (err error)"}, - {"Ftruncate", Func, 0, "func(fd int, length int64) (err error)"}, - {"FullPath", Func, 4, ""}, - {"Futimes", Func, 0, "func(fd int, tv []Timeval) (err error)"}, - {"Futimesat", Func, 0, "func(dirfd int, path string, tv []Timeval) (err error)"}, - {"GENERIC_ALL", Const, 0, ""}, - {"GENERIC_EXECUTE", Const, 0, ""}, - {"GENERIC_READ", Const, 0, ""}, - {"GENERIC_WRITE", Const, 0, ""}, - {"GUID", Type, 1, ""}, - {"GUID.Data1", Field, 1, ""}, - {"GUID.Data2", Field, 1, ""}, - {"GUID.Data3", Field, 1, ""}, - {"GUID.Data4", Field, 1, ""}, - {"GetAcceptExSockaddrs", Func, 0, ""}, - {"GetAdaptersInfo", Func, 0, ""}, - {"GetAddrInfoW", Func, 1, ""}, - {"GetCommandLine", Func, 0, ""}, - {"GetComputerName", Func, 0, ""}, - {"GetConsoleMode", Func, 1, ""}, - {"GetCurrentDirectory", Func, 0, ""}, - {"GetCurrentProcess", Func, 0, ""}, - {"GetEnvironmentStrings", Func, 0, ""}, - {"GetEnvironmentVariable", Func, 0, ""}, - {"GetExitCodeProcess", Func, 0, ""}, - {"GetFileAttributes", Func, 0, ""}, - {"GetFileAttributesEx", Func, 0, ""}, - {"GetFileExInfoStandard", Const, 0, ""}, - {"GetFileExMaxInfoLevel", Const, 0, ""}, - {"GetFileInformationByHandle", Func, 0, ""}, - {"GetFileType", Func, 0, ""}, - {"GetFullPathName", Func, 0, ""}, - {"GetHostByName", Func, 0, ""}, - {"GetIfEntry", Func, 0, ""}, - {"GetLastError", Func, 0, ""}, - {"GetLengthSid", Func, 0, ""}, - {"GetLongPathName", Func, 0, ""}, - {"GetProcAddress", Func, 0, ""}, - {"GetProcessTimes", Func, 0, ""}, - {"GetProtoByName", Func, 0, ""}, - {"GetQueuedCompletionStatus", Func, 0, ""}, - {"GetServByName", Func, 0, ""}, - {"GetShortPathName", Func, 0, ""}, - {"GetStartupInfo", Func, 0, ""}, - {"GetStdHandle", Func, 0, ""}, - {"GetSystemTimeAsFileTime", Func, 0, ""}, - {"GetTempPath", Func, 0, ""}, - {"GetTimeZoneInformation", Func, 0, ""}, - {"GetTokenInformation", Func, 0, ""}, - {"GetUserNameEx", Func, 0, ""}, - {"GetUserProfileDirectory", Func, 0, ""}, - {"GetVersion", Func, 0, ""}, - {"Getcwd", Func, 0, "func(buf []byte) (n int, err error)"}, - {"Getdents", Func, 0, "func(fd int, buf []byte) (n int, err error)"}, - {"Getdirentries", Func, 0, ""}, - {"Getdtablesize", Func, 0, ""}, - {"Getegid", Func, 0, "func() (egid int)"}, - {"Getenv", Func, 0, "func(key string) (value string, found bool)"}, - {"Geteuid", Func, 0, "func() (euid int)"}, - {"Getfsstat", Func, 0, ""}, - {"Getgid", Func, 0, "func() (gid int)"}, - {"Getgroups", Func, 0, "func() (gids []int, err error)"}, - {"Getpagesize", Func, 0, "func() int"}, - {"Getpeername", Func, 0, "func(fd int) (sa Sockaddr, err error)"}, - {"Getpgid", Func, 0, "func(pid int) (pgid int, err error)"}, - {"Getpgrp", Func, 0, "func() (pid int)"}, - {"Getpid", Func, 0, "func() (pid int)"}, - {"Getppid", Func, 0, "func() (ppid int)"}, - {"Getpriority", Func, 0, "func(which int, who int) (prio int, err error)"}, - {"Getrlimit", Func, 0, "func(resource int, rlim *Rlimit) (err error)"}, - {"Getrusage", Func, 0, "func(who int, rusage *Rusage) (err error)"}, - {"Getsid", Func, 0, ""}, - {"Getsockname", Func, 0, "func(fd int) (sa Sockaddr, err error)"}, - {"Getsockopt", Func, 1, ""}, - {"GetsockoptByte", Func, 0, ""}, - {"GetsockoptICMPv6Filter", Func, 2, "func(fd int, level int, opt int) (*ICMPv6Filter, error)"}, - {"GetsockoptIPMreq", Func, 0, "func(fd int, level int, opt int) (*IPMreq, error)"}, - {"GetsockoptIPMreqn", Func, 0, "func(fd int, level int, opt int) (*IPMreqn, error)"}, - {"GetsockoptIPv6MTUInfo", Func, 2, "func(fd int, level int, opt int) (*IPv6MTUInfo, error)"}, - {"GetsockoptIPv6Mreq", Func, 0, "func(fd int, level int, opt int) (*IPv6Mreq, error)"}, - {"GetsockoptInet4Addr", Func, 0, "func(fd int, level int, opt int) (value [4]byte, err error)"}, - {"GetsockoptInt", Func, 0, "func(fd int, level int, opt int) (value int, err error)"}, - {"GetsockoptUcred", Func, 1, "func(fd int, level int, opt int) (*Ucred, error)"}, - {"Gettid", Func, 0, "func() (tid int)"}, - {"Gettimeofday", Func, 0, "func(tv *Timeval) (err error)"}, - {"Getuid", Func, 0, "func() (uid int)"}, - {"Getwd", Func, 0, "func() (wd string, err error)"}, - {"Getxattr", Func, 1, "func(path string, attr string, dest []byte) (sz int, err error)"}, - {"HANDLE_FLAG_INHERIT", Const, 0, ""}, - {"HKEY_CLASSES_ROOT", Const, 0, ""}, - {"HKEY_CURRENT_CONFIG", Const, 0, ""}, - {"HKEY_CURRENT_USER", Const, 0, ""}, - {"HKEY_DYN_DATA", Const, 0, ""}, - {"HKEY_LOCAL_MACHINE", Const, 0, ""}, - {"HKEY_PERFORMANCE_DATA", Const, 0, ""}, - {"HKEY_USERS", Const, 0, ""}, - {"HUPCL", Const, 0, ""}, - {"Handle", Type, 0, ""}, - {"Hostent", Type, 0, ""}, - {"Hostent.AddrList", Field, 0, ""}, - {"Hostent.AddrType", Field, 0, ""}, - {"Hostent.Aliases", Field, 0, ""}, - {"Hostent.Length", Field, 0, ""}, - {"Hostent.Name", Field, 0, ""}, - {"ICANON", Const, 0, ""}, - {"ICMP6_FILTER", Const, 2, ""}, - {"ICMPV6_FILTER", Const, 2, ""}, - {"ICMPv6Filter", Type, 2, ""}, - {"ICMPv6Filter.Data", Field, 2, ""}, - {"ICMPv6Filter.Filt", Field, 2, ""}, - {"ICRNL", Const, 0, ""}, - {"IEXTEN", Const, 0, ""}, - {"IFAN_ARRIVAL", Const, 1, ""}, - {"IFAN_DEPARTURE", Const, 1, ""}, - {"IFA_ADDRESS", Const, 0, ""}, - {"IFA_ANYCAST", Const, 0, ""}, - {"IFA_BROADCAST", Const, 0, ""}, - {"IFA_CACHEINFO", Const, 0, ""}, - {"IFA_F_DADFAILED", Const, 0, ""}, - {"IFA_F_DEPRECATED", Const, 0, ""}, - {"IFA_F_HOMEADDRESS", Const, 0, ""}, - {"IFA_F_NODAD", Const, 0, ""}, - {"IFA_F_OPTIMISTIC", Const, 0, ""}, - {"IFA_F_PERMANENT", Const, 0, ""}, - {"IFA_F_SECONDARY", Const, 0, ""}, - {"IFA_F_TEMPORARY", Const, 0, ""}, - {"IFA_F_TENTATIVE", Const, 0, ""}, - {"IFA_LABEL", Const, 0, ""}, - {"IFA_LOCAL", Const, 0, ""}, - {"IFA_MAX", Const, 0, ""}, - {"IFA_MULTICAST", Const, 0, ""}, - {"IFA_ROUTE", Const, 1, ""}, - {"IFA_UNSPEC", Const, 0, ""}, - {"IFF_ALLMULTI", Const, 0, ""}, - {"IFF_ALTPHYS", Const, 0, ""}, - {"IFF_AUTOMEDIA", Const, 0, ""}, - {"IFF_BROADCAST", Const, 0, ""}, - {"IFF_CANTCHANGE", Const, 0, ""}, - {"IFF_CANTCONFIG", Const, 1, ""}, - {"IFF_DEBUG", Const, 0, ""}, - {"IFF_DRV_OACTIVE", Const, 0, ""}, - {"IFF_DRV_RUNNING", Const, 0, ""}, - {"IFF_DYING", Const, 0, ""}, - {"IFF_DYNAMIC", Const, 0, ""}, - {"IFF_LINK0", Const, 0, ""}, - {"IFF_LINK1", Const, 0, ""}, - {"IFF_LINK2", Const, 0, ""}, - {"IFF_LOOPBACK", Const, 0, ""}, - {"IFF_MASTER", Const, 0, ""}, - {"IFF_MONITOR", Const, 0, ""}, - {"IFF_MULTICAST", Const, 0, ""}, - {"IFF_NOARP", Const, 0, ""}, - {"IFF_NOTRAILERS", Const, 0, ""}, - {"IFF_NO_PI", Const, 0, ""}, - {"IFF_OACTIVE", Const, 0, ""}, - {"IFF_ONE_QUEUE", Const, 0, ""}, - {"IFF_POINTOPOINT", Const, 0, ""}, - {"IFF_POINTTOPOINT", Const, 0, ""}, - {"IFF_PORTSEL", Const, 0, ""}, - {"IFF_PPROMISC", Const, 0, ""}, - {"IFF_PROMISC", Const, 0, ""}, - {"IFF_RENAMING", Const, 0, ""}, - {"IFF_RUNNING", Const, 0, ""}, - {"IFF_SIMPLEX", Const, 0, ""}, - {"IFF_SLAVE", Const, 0, ""}, - {"IFF_SMART", Const, 0, ""}, - {"IFF_STATICARP", Const, 0, ""}, - {"IFF_TAP", Const, 0, ""}, - {"IFF_TUN", Const, 0, ""}, - {"IFF_TUN_EXCL", Const, 0, ""}, - {"IFF_UP", Const, 0, ""}, - {"IFF_VNET_HDR", Const, 0, ""}, - {"IFLA_ADDRESS", Const, 0, ""}, - {"IFLA_BROADCAST", Const, 0, ""}, - {"IFLA_COST", Const, 0, ""}, - {"IFLA_IFALIAS", Const, 0, ""}, - {"IFLA_IFNAME", Const, 0, ""}, - {"IFLA_LINK", Const, 0, ""}, - {"IFLA_LINKINFO", Const, 0, ""}, - {"IFLA_LINKMODE", Const, 0, ""}, - {"IFLA_MAP", Const, 0, ""}, - {"IFLA_MASTER", Const, 0, ""}, - {"IFLA_MAX", Const, 0, ""}, - {"IFLA_MTU", Const, 0, ""}, - {"IFLA_NET_NS_PID", Const, 0, ""}, - {"IFLA_OPERSTATE", Const, 0, ""}, - {"IFLA_PRIORITY", Const, 0, ""}, - {"IFLA_PROTINFO", Const, 0, ""}, - {"IFLA_QDISC", Const, 0, ""}, - {"IFLA_STATS", Const, 0, ""}, - {"IFLA_TXQLEN", Const, 0, ""}, - {"IFLA_UNSPEC", Const, 0, ""}, - {"IFLA_WEIGHT", Const, 0, ""}, - {"IFLA_WIRELESS", Const, 0, ""}, - {"IFNAMSIZ", Const, 0, ""}, - {"IFT_1822", Const, 0, ""}, - {"IFT_A12MPPSWITCH", Const, 0, ""}, - {"IFT_AAL2", Const, 0, ""}, - {"IFT_AAL5", Const, 0, ""}, - {"IFT_ADSL", Const, 0, ""}, - {"IFT_AFLANE8023", Const, 0, ""}, - {"IFT_AFLANE8025", Const, 0, ""}, - {"IFT_ARAP", Const, 0, ""}, - {"IFT_ARCNET", Const, 0, ""}, - {"IFT_ARCNETPLUS", Const, 0, ""}, - {"IFT_ASYNC", Const, 0, ""}, - {"IFT_ATM", Const, 0, ""}, - {"IFT_ATMDXI", Const, 0, ""}, - {"IFT_ATMFUNI", Const, 0, ""}, - {"IFT_ATMIMA", Const, 0, ""}, - {"IFT_ATMLOGICAL", Const, 0, ""}, - {"IFT_ATMRADIO", Const, 0, ""}, - {"IFT_ATMSUBINTERFACE", Const, 0, ""}, - {"IFT_ATMVCIENDPT", Const, 0, ""}, - {"IFT_ATMVIRTUAL", Const, 0, ""}, - {"IFT_BGPPOLICYACCOUNTING", Const, 0, ""}, - {"IFT_BLUETOOTH", Const, 1, ""}, - {"IFT_BRIDGE", Const, 0, ""}, - {"IFT_BSC", Const, 0, ""}, - {"IFT_CARP", Const, 0, ""}, - {"IFT_CCTEMUL", Const, 0, ""}, - {"IFT_CELLULAR", Const, 0, ""}, - {"IFT_CEPT", Const, 0, ""}, - {"IFT_CES", Const, 0, ""}, - {"IFT_CHANNEL", Const, 0, ""}, - {"IFT_CNR", Const, 0, ""}, - {"IFT_COFFEE", Const, 0, ""}, - {"IFT_COMPOSITELINK", Const, 0, ""}, - {"IFT_DCN", Const, 0, ""}, - {"IFT_DIGITALPOWERLINE", Const, 0, ""}, - {"IFT_DIGITALWRAPPEROVERHEADCHANNEL", Const, 0, ""}, - {"IFT_DLSW", Const, 0, ""}, - {"IFT_DOCSCABLEDOWNSTREAM", Const, 0, ""}, - {"IFT_DOCSCABLEMACLAYER", Const, 0, ""}, - {"IFT_DOCSCABLEUPSTREAM", Const, 0, ""}, - {"IFT_DOCSCABLEUPSTREAMCHANNEL", Const, 1, ""}, - {"IFT_DS0", Const, 0, ""}, - {"IFT_DS0BUNDLE", Const, 0, ""}, - {"IFT_DS1FDL", Const, 0, ""}, - {"IFT_DS3", Const, 0, ""}, - {"IFT_DTM", Const, 0, ""}, - {"IFT_DUMMY", Const, 1, ""}, - {"IFT_DVBASILN", Const, 0, ""}, - {"IFT_DVBASIOUT", Const, 0, ""}, - {"IFT_DVBRCCDOWNSTREAM", Const, 0, ""}, - {"IFT_DVBRCCMACLAYER", Const, 0, ""}, - {"IFT_DVBRCCUPSTREAM", Const, 0, ""}, - {"IFT_ECONET", Const, 1, ""}, - {"IFT_ENC", Const, 0, ""}, - {"IFT_EON", Const, 0, ""}, - {"IFT_EPLRS", Const, 0, ""}, - {"IFT_ESCON", Const, 0, ""}, - {"IFT_ETHER", Const, 0, ""}, - {"IFT_FAITH", Const, 0, ""}, - {"IFT_FAST", Const, 0, ""}, - {"IFT_FASTETHER", Const, 0, ""}, - {"IFT_FASTETHERFX", Const, 0, ""}, - {"IFT_FDDI", Const, 0, ""}, - {"IFT_FIBRECHANNEL", Const, 0, ""}, - {"IFT_FRAMERELAYINTERCONNECT", Const, 0, ""}, - {"IFT_FRAMERELAYMPI", Const, 0, ""}, - {"IFT_FRDLCIENDPT", Const, 0, ""}, - {"IFT_FRELAY", Const, 0, ""}, - {"IFT_FRELAYDCE", Const, 0, ""}, - {"IFT_FRF16MFRBUNDLE", Const, 0, ""}, - {"IFT_FRFORWARD", Const, 0, ""}, - {"IFT_G703AT2MB", Const, 0, ""}, - {"IFT_G703AT64K", Const, 0, ""}, - {"IFT_GIF", Const, 0, ""}, - {"IFT_GIGABITETHERNET", Const, 0, ""}, - {"IFT_GR303IDT", Const, 0, ""}, - {"IFT_GR303RDT", Const, 0, ""}, - {"IFT_H323GATEKEEPER", Const, 0, ""}, - {"IFT_H323PROXY", Const, 0, ""}, - {"IFT_HDH1822", Const, 0, ""}, - {"IFT_HDLC", Const, 0, ""}, - {"IFT_HDSL2", Const, 0, ""}, - {"IFT_HIPERLAN2", Const, 0, ""}, - {"IFT_HIPPI", Const, 0, ""}, - {"IFT_HIPPIINTERFACE", Const, 0, ""}, - {"IFT_HOSTPAD", Const, 0, ""}, - {"IFT_HSSI", Const, 0, ""}, - {"IFT_HY", Const, 0, ""}, - {"IFT_IBM370PARCHAN", Const, 0, ""}, - {"IFT_IDSL", Const, 0, ""}, - {"IFT_IEEE1394", Const, 0, ""}, - {"IFT_IEEE80211", Const, 0, ""}, - {"IFT_IEEE80212", Const, 0, ""}, - {"IFT_IEEE8023ADLAG", Const, 0, ""}, - {"IFT_IFGSN", Const, 0, ""}, - {"IFT_IMT", Const, 0, ""}, - {"IFT_INFINIBAND", Const, 1, ""}, - {"IFT_INTERLEAVE", Const, 0, ""}, - {"IFT_IP", Const, 0, ""}, - {"IFT_IPFORWARD", Const, 0, ""}, - {"IFT_IPOVERATM", Const, 0, ""}, - {"IFT_IPOVERCDLC", Const, 0, ""}, - {"IFT_IPOVERCLAW", Const, 0, ""}, - {"IFT_IPSWITCH", Const, 0, ""}, - {"IFT_IPXIP", Const, 0, ""}, - {"IFT_ISDN", Const, 0, ""}, - {"IFT_ISDNBASIC", Const, 0, ""}, - {"IFT_ISDNPRIMARY", Const, 0, ""}, - {"IFT_ISDNS", Const, 0, ""}, - {"IFT_ISDNU", Const, 0, ""}, - {"IFT_ISO88022LLC", Const, 0, ""}, - {"IFT_ISO88023", Const, 0, ""}, - {"IFT_ISO88024", Const, 0, ""}, - {"IFT_ISO88025", Const, 0, ""}, - {"IFT_ISO88025CRFPINT", Const, 0, ""}, - {"IFT_ISO88025DTR", Const, 0, ""}, - {"IFT_ISO88025FIBER", Const, 0, ""}, - {"IFT_ISO88026", Const, 0, ""}, - {"IFT_ISUP", Const, 0, ""}, - {"IFT_L2VLAN", Const, 0, ""}, - {"IFT_L3IPVLAN", Const, 0, ""}, - {"IFT_L3IPXVLAN", Const, 0, ""}, - {"IFT_LAPB", Const, 0, ""}, - {"IFT_LAPD", Const, 0, ""}, - {"IFT_LAPF", Const, 0, ""}, - {"IFT_LINEGROUP", Const, 1, ""}, - {"IFT_LOCALTALK", Const, 0, ""}, - {"IFT_LOOP", Const, 0, ""}, - {"IFT_MEDIAMAILOVERIP", Const, 0, ""}, - {"IFT_MFSIGLINK", Const, 0, ""}, - {"IFT_MIOX25", Const, 0, ""}, - {"IFT_MODEM", Const, 0, ""}, - {"IFT_MPC", Const, 0, ""}, - {"IFT_MPLS", Const, 0, ""}, - {"IFT_MPLSTUNNEL", Const, 0, ""}, - {"IFT_MSDSL", Const, 0, ""}, - {"IFT_MVL", Const, 0, ""}, - {"IFT_MYRINET", Const, 0, ""}, - {"IFT_NFAS", Const, 0, ""}, - {"IFT_NSIP", Const, 0, ""}, - {"IFT_OPTICALCHANNEL", Const, 0, ""}, - {"IFT_OPTICALTRANSPORT", Const, 0, ""}, - {"IFT_OTHER", Const, 0, ""}, - {"IFT_P10", Const, 0, ""}, - {"IFT_P80", Const, 0, ""}, - {"IFT_PARA", Const, 0, ""}, - {"IFT_PDP", Const, 0, ""}, - {"IFT_PFLOG", Const, 0, ""}, - {"IFT_PFLOW", Const, 1, ""}, - {"IFT_PFSYNC", Const, 0, ""}, - {"IFT_PLC", Const, 0, ""}, - {"IFT_PON155", Const, 1, ""}, - {"IFT_PON622", Const, 1, ""}, - {"IFT_POS", Const, 0, ""}, - {"IFT_PPP", Const, 0, ""}, - {"IFT_PPPMULTILINKBUNDLE", Const, 0, ""}, - {"IFT_PROPATM", Const, 1, ""}, - {"IFT_PROPBWAP2MP", Const, 0, ""}, - {"IFT_PROPCNLS", Const, 0, ""}, - {"IFT_PROPDOCSWIRELESSDOWNSTREAM", Const, 0, ""}, - {"IFT_PROPDOCSWIRELESSMACLAYER", Const, 0, ""}, - {"IFT_PROPDOCSWIRELESSUPSTREAM", Const, 0, ""}, - {"IFT_PROPMUX", Const, 0, ""}, - {"IFT_PROPVIRTUAL", Const, 0, ""}, - {"IFT_PROPWIRELESSP2P", Const, 0, ""}, - {"IFT_PTPSERIAL", Const, 0, ""}, - {"IFT_PVC", Const, 0, ""}, - {"IFT_Q2931", Const, 1, ""}, - {"IFT_QLLC", Const, 0, ""}, - {"IFT_RADIOMAC", Const, 0, ""}, - {"IFT_RADSL", Const, 0, ""}, - {"IFT_REACHDSL", Const, 0, ""}, - {"IFT_RFC1483", Const, 0, ""}, - {"IFT_RS232", Const, 0, ""}, - {"IFT_RSRB", Const, 0, ""}, - {"IFT_SDLC", Const, 0, ""}, - {"IFT_SDSL", Const, 0, ""}, - {"IFT_SHDSL", Const, 0, ""}, - {"IFT_SIP", Const, 0, ""}, - {"IFT_SIPSIG", Const, 1, ""}, - {"IFT_SIPTG", Const, 1, ""}, - {"IFT_SLIP", Const, 0, ""}, - {"IFT_SMDSDXI", Const, 0, ""}, - {"IFT_SMDSICIP", Const, 0, ""}, - {"IFT_SONET", Const, 0, ""}, - {"IFT_SONETOVERHEADCHANNEL", Const, 0, ""}, - {"IFT_SONETPATH", Const, 0, ""}, - {"IFT_SONETVT", Const, 0, ""}, - {"IFT_SRP", Const, 0, ""}, - {"IFT_SS7SIGLINK", Const, 0, ""}, - {"IFT_STACKTOSTACK", Const, 0, ""}, - {"IFT_STARLAN", Const, 0, ""}, - {"IFT_STF", Const, 0, ""}, - {"IFT_T1", Const, 0, ""}, - {"IFT_TDLC", Const, 0, ""}, - {"IFT_TELINK", Const, 1, ""}, - {"IFT_TERMPAD", Const, 0, ""}, - {"IFT_TR008", Const, 0, ""}, - {"IFT_TRANSPHDLC", Const, 0, ""}, - {"IFT_TUNNEL", Const, 0, ""}, - {"IFT_ULTRA", Const, 0, ""}, - {"IFT_USB", Const, 0, ""}, - {"IFT_V11", Const, 0, ""}, - {"IFT_V35", Const, 0, ""}, - {"IFT_V36", Const, 0, ""}, - {"IFT_V37", Const, 0, ""}, - {"IFT_VDSL", Const, 0, ""}, - {"IFT_VIRTUALIPADDRESS", Const, 0, ""}, - {"IFT_VIRTUALTG", Const, 1, ""}, - {"IFT_VOICEDID", Const, 1, ""}, - {"IFT_VOICEEM", Const, 0, ""}, - {"IFT_VOICEEMFGD", Const, 1, ""}, - {"IFT_VOICEENCAP", Const, 0, ""}, - {"IFT_VOICEFGDEANA", Const, 1, ""}, - {"IFT_VOICEFXO", Const, 0, ""}, - {"IFT_VOICEFXS", Const, 0, ""}, - {"IFT_VOICEOVERATM", Const, 0, ""}, - {"IFT_VOICEOVERCABLE", Const, 1, ""}, - {"IFT_VOICEOVERFRAMERELAY", Const, 0, ""}, - {"IFT_VOICEOVERIP", Const, 0, ""}, - {"IFT_X213", Const, 0, ""}, - {"IFT_X25", Const, 0, ""}, - {"IFT_X25DDN", Const, 0, ""}, - {"IFT_X25HUNTGROUP", Const, 0, ""}, - {"IFT_X25MLP", Const, 0, ""}, - {"IFT_X25PLE", Const, 0, ""}, - {"IFT_XETHER", Const, 0, ""}, - {"IGNBRK", Const, 0, ""}, - {"IGNCR", Const, 0, ""}, - {"IGNORE", Const, 0, ""}, - {"IGNPAR", Const, 0, ""}, - {"IMAXBEL", Const, 0, ""}, - {"INFINITE", Const, 0, ""}, - {"INLCR", Const, 0, ""}, - {"INPCK", Const, 0, ""}, - {"INVALID_FILE_ATTRIBUTES", Const, 0, ""}, - {"IN_ACCESS", Const, 0, ""}, - {"IN_ALL_EVENTS", Const, 0, ""}, - {"IN_ATTRIB", Const, 0, ""}, - {"IN_CLASSA_HOST", Const, 0, ""}, - {"IN_CLASSA_MAX", Const, 0, ""}, - {"IN_CLASSA_NET", Const, 0, ""}, - {"IN_CLASSA_NSHIFT", Const, 0, ""}, - {"IN_CLASSB_HOST", Const, 0, ""}, - {"IN_CLASSB_MAX", Const, 0, ""}, - {"IN_CLASSB_NET", Const, 0, ""}, - {"IN_CLASSB_NSHIFT", Const, 0, ""}, - {"IN_CLASSC_HOST", Const, 0, ""}, - {"IN_CLASSC_NET", Const, 0, ""}, - {"IN_CLASSC_NSHIFT", Const, 0, ""}, - {"IN_CLASSD_HOST", Const, 0, ""}, - {"IN_CLASSD_NET", Const, 0, ""}, - {"IN_CLASSD_NSHIFT", Const, 0, ""}, - {"IN_CLOEXEC", Const, 0, ""}, - {"IN_CLOSE", Const, 0, ""}, - {"IN_CLOSE_NOWRITE", Const, 0, ""}, - {"IN_CLOSE_WRITE", Const, 0, ""}, - {"IN_CREATE", Const, 0, ""}, - {"IN_DELETE", Const, 0, ""}, - {"IN_DELETE_SELF", Const, 0, ""}, - {"IN_DONT_FOLLOW", Const, 0, ""}, - {"IN_EXCL_UNLINK", Const, 0, ""}, - {"IN_IGNORED", Const, 0, ""}, - {"IN_ISDIR", Const, 0, ""}, - {"IN_LINKLOCALNETNUM", Const, 0, ""}, - {"IN_LOOPBACKNET", Const, 0, ""}, - {"IN_MASK_ADD", Const, 0, ""}, - {"IN_MODIFY", Const, 0, ""}, - {"IN_MOVE", Const, 0, ""}, - {"IN_MOVED_FROM", Const, 0, ""}, - {"IN_MOVED_TO", Const, 0, ""}, - {"IN_MOVE_SELF", Const, 0, ""}, - {"IN_NONBLOCK", Const, 0, ""}, - {"IN_ONESHOT", Const, 0, ""}, - {"IN_ONLYDIR", Const, 0, ""}, - {"IN_OPEN", Const, 0, ""}, - {"IN_Q_OVERFLOW", Const, 0, ""}, - {"IN_RFC3021_HOST", Const, 1, ""}, - {"IN_RFC3021_MASK", Const, 1, ""}, - {"IN_RFC3021_NET", Const, 1, ""}, - {"IN_RFC3021_NSHIFT", Const, 1, ""}, - {"IN_UNMOUNT", Const, 0, ""}, - {"IOC_IN", Const, 1, ""}, - {"IOC_INOUT", Const, 1, ""}, - {"IOC_OUT", Const, 1, ""}, - {"IOC_VENDOR", Const, 3, ""}, - {"IOC_WS2", Const, 1, ""}, - {"IO_REPARSE_TAG_SYMLINK", Const, 4, ""}, - {"IPMreq", Type, 0, ""}, - {"IPMreq.Interface", Field, 0, ""}, - {"IPMreq.Multiaddr", Field, 0, ""}, - {"IPMreqn", Type, 0, ""}, - {"IPMreqn.Address", Field, 0, ""}, - {"IPMreqn.Ifindex", Field, 0, ""}, - {"IPMreqn.Multiaddr", Field, 0, ""}, - {"IPPROTO_3PC", Const, 0, ""}, - {"IPPROTO_ADFS", Const, 0, ""}, - {"IPPROTO_AH", Const, 0, ""}, - {"IPPROTO_AHIP", Const, 0, ""}, - {"IPPROTO_APES", Const, 0, ""}, - {"IPPROTO_ARGUS", Const, 0, ""}, - {"IPPROTO_AX25", Const, 0, ""}, - {"IPPROTO_BHA", Const, 0, ""}, - {"IPPROTO_BLT", Const, 0, ""}, - {"IPPROTO_BRSATMON", Const, 0, ""}, - {"IPPROTO_CARP", Const, 0, ""}, - {"IPPROTO_CFTP", Const, 0, ""}, - {"IPPROTO_CHAOS", Const, 0, ""}, - {"IPPROTO_CMTP", Const, 0, ""}, - {"IPPROTO_COMP", Const, 0, ""}, - {"IPPROTO_CPHB", Const, 0, ""}, - {"IPPROTO_CPNX", Const, 0, ""}, - {"IPPROTO_DCCP", Const, 0, ""}, - {"IPPROTO_DDP", Const, 0, ""}, - {"IPPROTO_DGP", Const, 0, ""}, - {"IPPROTO_DIVERT", Const, 0, ""}, - {"IPPROTO_DIVERT_INIT", Const, 3, ""}, - {"IPPROTO_DIVERT_RESP", Const, 3, ""}, - {"IPPROTO_DONE", Const, 0, ""}, - {"IPPROTO_DSTOPTS", Const, 0, ""}, - {"IPPROTO_EGP", Const, 0, ""}, - {"IPPROTO_EMCON", Const, 0, ""}, - {"IPPROTO_ENCAP", Const, 0, ""}, - {"IPPROTO_EON", Const, 0, ""}, - {"IPPROTO_ESP", Const, 0, ""}, - {"IPPROTO_ETHERIP", Const, 0, ""}, - {"IPPROTO_FRAGMENT", Const, 0, ""}, - {"IPPROTO_GGP", Const, 0, ""}, - {"IPPROTO_GMTP", Const, 0, ""}, - {"IPPROTO_GRE", Const, 0, ""}, - {"IPPROTO_HELLO", Const, 0, ""}, - {"IPPROTO_HMP", Const, 0, ""}, - {"IPPROTO_HOPOPTS", Const, 0, ""}, - {"IPPROTO_ICMP", Const, 0, ""}, - {"IPPROTO_ICMPV6", Const, 0, ""}, - {"IPPROTO_IDP", Const, 0, ""}, - {"IPPROTO_IDPR", Const, 0, ""}, - {"IPPROTO_IDRP", Const, 0, ""}, - {"IPPROTO_IGMP", Const, 0, ""}, - {"IPPROTO_IGP", Const, 0, ""}, - {"IPPROTO_IGRP", Const, 0, ""}, - {"IPPROTO_IL", Const, 0, ""}, - {"IPPROTO_INLSP", Const, 0, ""}, - {"IPPROTO_INP", Const, 0, ""}, - {"IPPROTO_IP", Const, 0, ""}, - {"IPPROTO_IPCOMP", Const, 0, ""}, - {"IPPROTO_IPCV", Const, 0, ""}, - {"IPPROTO_IPEIP", Const, 0, ""}, - {"IPPROTO_IPIP", Const, 0, ""}, - {"IPPROTO_IPPC", Const, 0, ""}, - {"IPPROTO_IPV4", Const, 0, ""}, - {"IPPROTO_IPV6", Const, 0, ""}, - {"IPPROTO_IPV6_ICMP", Const, 1, ""}, - {"IPPROTO_IRTP", Const, 0, ""}, - {"IPPROTO_KRYPTOLAN", Const, 0, ""}, - {"IPPROTO_LARP", Const, 0, ""}, - {"IPPROTO_LEAF1", Const, 0, ""}, - {"IPPROTO_LEAF2", Const, 0, ""}, - {"IPPROTO_MAX", Const, 0, ""}, - {"IPPROTO_MAXID", Const, 0, ""}, - {"IPPROTO_MEAS", Const, 0, ""}, - {"IPPROTO_MH", Const, 1, ""}, - {"IPPROTO_MHRP", Const, 0, ""}, - {"IPPROTO_MICP", Const, 0, ""}, - {"IPPROTO_MOBILE", Const, 0, ""}, - {"IPPROTO_MPLS", Const, 1, ""}, - {"IPPROTO_MTP", Const, 0, ""}, - {"IPPROTO_MUX", Const, 0, ""}, - {"IPPROTO_ND", Const, 0, ""}, - {"IPPROTO_NHRP", Const, 0, ""}, - {"IPPROTO_NONE", Const, 0, ""}, - {"IPPROTO_NSP", Const, 0, ""}, - {"IPPROTO_NVPII", Const, 0, ""}, - {"IPPROTO_OLD_DIVERT", Const, 0, ""}, - {"IPPROTO_OSPFIGP", Const, 0, ""}, - {"IPPROTO_PFSYNC", Const, 0, ""}, - {"IPPROTO_PGM", Const, 0, ""}, - {"IPPROTO_PIGP", Const, 0, ""}, - {"IPPROTO_PIM", Const, 0, ""}, - {"IPPROTO_PRM", Const, 0, ""}, - {"IPPROTO_PUP", Const, 0, ""}, - {"IPPROTO_PVP", Const, 0, ""}, - {"IPPROTO_RAW", Const, 0, ""}, - {"IPPROTO_RCCMON", Const, 0, ""}, - {"IPPROTO_RDP", Const, 0, ""}, - {"IPPROTO_ROUTING", Const, 0, ""}, - {"IPPROTO_RSVP", Const, 0, ""}, - {"IPPROTO_RVD", Const, 0, ""}, - {"IPPROTO_SATEXPAK", Const, 0, ""}, - {"IPPROTO_SATMON", Const, 0, ""}, - {"IPPROTO_SCCSP", Const, 0, ""}, - {"IPPROTO_SCTP", Const, 0, ""}, - {"IPPROTO_SDRP", Const, 0, ""}, - {"IPPROTO_SEND", Const, 1, ""}, - {"IPPROTO_SEP", Const, 0, ""}, - {"IPPROTO_SKIP", Const, 0, ""}, - {"IPPROTO_SPACER", Const, 0, ""}, - {"IPPROTO_SRPC", Const, 0, ""}, - {"IPPROTO_ST", Const, 0, ""}, - {"IPPROTO_SVMTP", Const, 0, ""}, - {"IPPROTO_SWIPE", Const, 0, ""}, - {"IPPROTO_TCF", Const, 0, ""}, - {"IPPROTO_TCP", Const, 0, ""}, - {"IPPROTO_TLSP", Const, 0, ""}, - {"IPPROTO_TP", Const, 0, ""}, - {"IPPROTO_TPXX", Const, 0, ""}, - {"IPPROTO_TRUNK1", Const, 0, ""}, - {"IPPROTO_TRUNK2", Const, 0, ""}, - {"IPPROTO_TTP", Const, 0, ""}, - {"IPPROTO_UDP", Const, 0, ""}, - {"IPPROTO_UDPLITE", Const, 0, ""}, - {"IPPROTO_VINES", Const, 0, ""}, - {"IPPROTO_VISA", Const, 0, ""}, - {"IPPROTO_VMTP", Const, 0, ""}, - {"IPPROTO_VRRP", Const, 1, ""}, - {"IPPROTO_WBEXPAK", Const, 0, ""}, - {"IPPROTO_WBMON", Const, 0, ""}, - {"IPPROTO_WSN", Const, 0, ""}, - {"IPPROTO_XNET", Const, 0, ""}, - {"IPPROTO_XTP", Const, 0, ""}, - {"IPV6_2292DSTOPTS", Const, 0, ""}, - {"IPV6_2292HOPLIMIT", Const, 0, ""}, - {"IPV6_2292HOPOPTS", Const, 0, ""}, - {"IPV6_2292NEXTHOP", Const, 0, ""}, - {"IPV6_2292PKTINFO", Const, 0, ""}, - {"IPV6_2292PKTOPTIONS", Const, 0, ""}, - {"IPV6_2292RTHDR", Const, 0, ""}, - {"IPV6_ADDRFORM", Const, 0, ""}, - {"IPV6_ADD_MEMBERSHIP", Const, 0, ""}, - {"IPV6_AUTHHDR", Const, 0, ""}, - {"IPV6_AUTH_LEVEL", Const, 1, ""}, - {"IPV6_AUTOFLOWLABEL", Const, 0, ""}, - {"IPV6_BINDANY", Const, 0, ""}, - {"IPV6_BINDV6ONLY", Const, 0, ""}, - {"IPV6_BOUND_IF", Const, 0, ""}, - {"IPV6_CHECKSUM", Const, 0, ""}, - {"IPV6_DEFAULT_MULTICAST_HOPS", Const, 0, ""}, - {"IPV6_DEFAULT_MULTICAST_LOOP", Const, 0, ""}, - {"IPV6_DEFHLIM", Const, 0, ""}, - {"IPV6_DONTFRAG", Const, 0, ""}, - {"IPV6_DROP_MEMBERSHIP", Const, 0, ""}, - {"IPV6_DSTOPTS", Const, 0, ""}, - {"IPV6_ESP_NETWORK_LEVEL", Const, 1, ""}, - {"IPV6_ESP_TRANS_LEVEL", Const, 1, ""}, - {"IPV6_FAITH", Const, 0, ""}, - {"IPV6_FLOWINFO_MASK", Const, 0, ""}, - {"IPV6_FLOWLABEL_MASK", Const, 0, ""}, - {"IPV6_FRAGTTL", Const, 0, ""}, - {"IPV6_FW_ADD", Const, 0, ""}, - {"IPV6_FW_DEL", Const, 0, ""}, - {"IPV6_FW_FLUSH", Const, 0, ""}, - {"IPV6_FW_GET", Const, 0, ""}, - {"IPV6_FW_ZERO", Const, 0, ""}, - {"IPV6_HLIMDEC", Const, 0, ""}, - {"IPV6_HOPLIMIT", Const, 0, ""}, - {"IPV6_HOPOPTS", Const, 0, ""}, - {"IPV6_IPCOMP_LEVEL", Const, 1, ""}, - {"IPV6_IPSEC_POLICY", Const, 0, ""}, - {"IPV6_JOIN_ANYCAST", Const, 0, ""}, - {"IPV6_JOIN_GROUP", Const, 0, ""}, - {"IPV6_LEAVE_ANYCAST", Const, 0, ""}, - {"IPV6_LEAVE_GROUP", Const, 0, ""}, - {"IPV6_MAXHLIM", Const, 0, ""}, - {"IPV6_MAXOPTHDR", Const, 0, ""}, - {"IPV6_MAXPACKET", Const, 0, ""}, - {"IPV6_MAX_GROUP_SRC_FILTER", Const, 0, ""}, - {"IPV6_MAX_MEMBERSHIPS", Const, 0, ""}, - {"IPV6_MAX_SOCK_SRC_FILTER", Const, 0, ""}, - {"IPV6_MIN_MEMBERSHIPS", Const, 0, ""}, - {"IPV6_MMTU", Const, 0, ""}, - {"IPV6_MSFILTER", Const, 0, ""}, - {"IPV6_MTU", Const, 0, ""}, - {"IPV6_MTU_DISCOVER", Const, 0, ""}, - {"IPV6_MULTICAST_HOPS", Const, 0, ""}, - {"IPV6_MULTICAST_IF", Const, 0, ""}, - {"IPV6_MULTICAST_LOOP", Const, 0, ""}, - {"IPV6_NEXTHOP", Const, 0, ""}, - {"IPV6_OPTIONS", Const, 1, ""}, - {"IPV6_PATHMTU", Const, 0, ""}, - {"IPV6_PIPEX", Const, 1, ""}, - {"IPV6_PKTINFO", Const, 0, ""}, - {"IPV6_PMTUDISC_DO", Const, 0, ""}, - {"IPV6_PMTUDISC_DONT", Const, 0, ""}, - {"IPV6_PMTUDISC_PROBE", Const, 0, ""}, - {"IPV6_PMTUDISC_WANT", Const, 0, ""}, - {"IPV6_PORTRANGE", Const, 0, ""}, - {"IPV6_PORTRANGE_DEFAULT", Const, 0, ""}, - {"IPV6_PORTRANGE_HIGH", Const, 0, ""}, - {"IPV6_PORTRANGE_LOW", Const, 0, ""}, - {"IPV6_PREFER_TEMPADDR", Const, 0, ""}, - {"IPV6_RECVDSTOPTS", Const, 0, ""}, - {"IPV6_RECVDSTPORT", Const, 3, ""}, - {"IPV6_RECVERR", Const, 0, ""}, - {"IPV6_RECVHOPLIMIT", Const, 0, ""}, - {"IPV6_RECVHOPOPTS", Const, 0, ""}, - {"IPV6_RECVPATHMTU", Const, 0, ""}, - {"IPV6_RECVPKTINFO", Const, 0, ""}, - {"IPV6_RECVRTHDR", Const, 0, ""}, - {"IPV6_RECVTCLASS", Const, 0, ""}, - {"IPV6_ROUTER_ALERT", Const, 0, ""}, - {"IPV6_RTABLE", Const, 1, ""}, - {"IPV6_RTHDR", Const, 0, ""}, - {"IPV6_RTHDRDSTOPTS", Const, 0, ""}, - {"IPV6_RTHDR_LOOSE", Const, 0, ""}, - {"IPV6_RTHDR_STRICT", Const, 0, ""}, - {"IPV6_RTHDR_TYPE_0", Const, 0, ""}, - {"IPV6_RXDSTOPTS", Const, 0, ""}, - {"IPV6_RXHOPOPTS", Const, 0, ""}, - {"IPV6_SOCKOPT_RESERVED1", Const, 0, ""}, - {"IPV6_TCLASS", Const, 0, ""}, - {"IPV6_UNICAST_HOPS", Const, 0, ""}, - {"IPV6_USE_MIN_MTU", Const, 0, ""}, - {"IPV6_V6ONLY", Const, 0, ""}, - {"IPV6_VERSION", Const, 0, ""}, - {"IPV6_VERSION_MASK", Const, 0, ""}, - {"IPV6_XFRM_POLICY", Const, 0, ""}, - {"IP_ADD_MEMBERSHIP", Const, 0, ""}, - {"IP_ADD_SOURCE_MEMBERSHIP", Const, 0, ""}, - {"IP_AUTH_LEVEL", Const, 1, ""}, - {"IP_BINDANY", Const, 0, ""}, - {"IP_BLOCK_SOURCE", Const, 0, ""}, - {"IP_BOUND_IF", Const, 0, ""}, - {"IP_DEFAULT_MULTICAST_LOOP", Const, 0, ""}, - {"IP_DEFAULT_MULTICAST_TTL", Const, 0, ""}, - {"IP_DF", Const, 0, ""}, - {"IP_DIVERTFL", Const, 3, ""}, - {"IP_DONTFRAG", Const, 0, ""}, - {"IP_DROP_MEMBERSHIP", Const, 0, ""}, - {"IP_DROP_SOURCE_MEMBERSHIP", Const, 0, ""}, - {"IP_DUMMYNET3", Const, 0, ""}, - {"IP_DUMMYNET_CONFIGURE", Const, 0, ""}, - {"IP_DUMMYNET_DEL", Const, 0, ""}, - {"IP_DUMMYNET_FLUSH", Const, 0, ""}, - {"IP_DUMMYNET_GET", Const, 0, ""}, - {"IP_EF", Const, 1, ""}, - {"IP_ERRORMTU", Const, 1, ""}, - {"IP_ESP_NETWORK_LEVEL", Const, 1, ""}, - {"IP_ESP_TRANS_LEVEL", Const, 1, ""}, - {"IP_FAITH", Const, 0, ""}, - {"IP_FREEBIND", Const, 0, ""}, - {"IP_FW3", Const, 0, ""}, - {"IP_FW_ADD", Const, 0, ""}, - {"IP_FW_DEL", Const, 0, ""}, - {"IP_FW_FLUSH", Const, 0, ""}, - {"IP_FW_GET", Const, 0, ""}, - {"IP_FW_NAT_CFG", Const, 0, ""}, - {"IP_FW_NAT_DEL", Const, 0, ""}, - {"IP_FW_NAT_GET_CONFIG", Const, 0, ""}, - {"IP_FW_NAT_GET_LOG", Const, 0, ""}, - {"IP_FW_RESETLOG", Const, 0, ""}, - {"IP_FW_TABLE_ADD", Const, 0, ""}, - {"IP_FW_TABLE_DEL", Const, 0, ""}, - {"IP_FW_TABLE_FLUSH", Const, 0, ""}, - {"IP_FW_TABLE_GETSIZE", Const, 0, ""}, - {"IP_FW_TABLE_LIST", Const, 0, ""}, - {"IP_FW_ZERO", Const, 0, ""}, - {"IP_HDRINCL", Const, 0, ""}, - {"IP_IPCOMP_LEVEL", Const, 1, ""}, - {"IP_IPSECFLOWINFO", Const, 1, ""}, - {"IP_IPSEC_LOCAL_AUTH", Const, 1, ""}, - {"IP_IPSEC_LOCAL_CRED", Const, 1, ""}, - {"IP_IPSEC_LOCAL_ID", Const, 1, ""}, - {"IP_IPSEC_POLICY", Const, 0, ""}, - {"IP_IPSEC_REMOTE_AUTH", Const, 1, ""}, - {"IP_IPSEC_REMOTE_CRED", Const, 1, ""}, - {"IP_IPSEC_REMOTE_ID", Const, 1, ""}, - {"IP_MAXPACKET", Const, 0, ""}, - {"IP_MAX_GROUP_SRC_FILTER", Const, 0, ""}, - {"IP_MAX_MEMBERSHIPS", Const, 0, ""}, - {"IP_MAX_SOCK_MUTE_FILTER", Const, 0, ""}, - {"IP_MAX_SOCK_SRC_FILTER", Const, 0, ""}, - {"IP_MAX_SOURCE_FILTER", Const, 0, ""}, - {"IP_MF", Const, 0, ""}, - {"IP_MINFRAGSIZE", Const, 1, ""}, - {"IP_MINTTL", Const, 0, ""}, - {"IP_MIN_MEMBERSHIPS", Const, 0, ""}, - {"IP_MSFILTER", Const, 0, ""}, - {"IP_MSS", Const, 0, ""}, - {"IP_MTU", Const, 0, ""}, - {"IP_MTU_DISCOVER", Const, 0, ""}, - {"IP_MULTICAST_IF", Const, 0, ""}, - {"IP_MULTICAST_IFINDEX", Const, 0, ""}, - {"IP_MULTICAST_LOOP", Const, 0, ""}, - {"IP_MULTICAST_TTL", Const, 0, ""}, - {"IP_MULTICAST_VIF", Const, 0, ""}, - {"IP_NAT__XXX", Const, 0, ""}, - {"IP_OFFMASK", Const, 0, ""}, - {"IP_OLD_FW_ADD", Const, 0, ""}, - {"IP_OLD_FW_DEL", Const, 0, ""}, - {"IP_OLD_FW_FLUSH", Const, 0, ""}, - {"IP_OLD_FW_GET", Const, 0, ""}, - {"IP_OLD_FW_RESETLOG", Const, 0, ""}, - {"IP_OLD_FW_ZERO", Const, 0, ""}, - {"IP_ONESBCAST", Const, 0, ""}, - {"IP_OPTIONS", Const, 0, ""}, - {"IP_ORIGDSTADDR", Const, 0, ""}, - {"IP_PASSSEC", Const, 0, ""}, - {"IP_PIPEX", Const, 1, ""}, - {"IP_PKTINFO", Const, 0, ""}, - {"IP_PKTOPTIONS", Const, 0, ""}, - {"IP_PMTUDISC", Const, 0, ""}, - {"IP_PMTUDISC_DO", Const, 0, ""}, - {"IP_PMTUDISC_DONT", Const, 0, ""}, - {"IP_PMTUDISC_PROBE", Const, 0, ""}, - {"IP_PMTUDISC_WANT", Const, 0, ""}, - {"IP_PORTRANGE", Const, 0, ""}, - {"IP_PORTRANGE_DEFAULT", Const, 0, ""}, - {"IP_PORTRANGE_HIGH", Const, 0, ""}, - {"IP_PORTRANGE_LOW", Const, 0, ""}, - {"IP_RECVDSTADDR", Const, 0, ""}, - {"IP_RECVDSTPORT", Const, 1, ""}, - {"IP_RECVERR", Const, 0, ""}, - {"IP_RECVIF", Const, 0, ""}, - {"IP_RECVOPTS", Const, 0, ""}, - {"IP_RECVORIGDSTADDR", Const, 0, ""}, - {"IP_RECVPKTINFO", Const, 0, ""}, - {"IP_RECVRETOPTS", Const, 0, ""}, - {"IP_RECVRTABLE", Const, 1, ""}, - {"IP_RECVTOS", Const, 0, ""}, - {"IP_RECVTTL", Const, 0, ""}, - {"IP_RETOPTS", Const, 0, ""}, - {"IP_RF", Const, 0, ""}, - {"IP_ROUTER_ALERT", Const, 0, ""}, - {"IP_RSVP_OFF", Const, 0, ""}, - {"IP_RSVP_ON", Const, 0, ""}, - {"IP_RSVP_VIF_OFF", Const, 0, ""}, - {"IP_RSVP_VIF_ON", Const, 0, ""}, - {"IP_RTABLE", Const, 1, ""}, - {"IP_SENDSRCADDR", Const, 0, ""}, - {"IP_STRIPHDR", Const, 0, ""}, - {"IP_TOS", Const, 0, ""}, - {"IP_TRAFFIC_MGT_BACKGROUND", Const, 0, ""}, - {"IP_TRANSPARENT", Const, 0, ""}, - {"IP_TTL", Const, 0, ""}, - {"IP_UNBLOCK_SOURCE", Const, 0, ""}, - {"IP_XFRM_POLICY", Const, 0, ""}, - {"IPv6MTUInfo", Type, 2, ""}, - {"IPv6MTUInfo.Addr", Field, 2, ""}, - {"IPv6MTUInfo.Mtu", Field, 2, ""}, - {"IPv6Mreq", Type, 0, ""}, - {"IPv6Mreq.Interface", Field, 0, ""}, - {"IPv6Mreq.Multiaddr", Field, 0, ""}, - {"ISIG", Const, 0, ""}, - {"ISTRIP", Const, 0, ""}, - {"IUCLC", Const, 0, ""}, - {"IUTF8", Const, 0, ""}, - {"IXANY", Const, 0, ""}, - {"IXOFF", Const, 0, ""}, - {"IXON", Const, 0, ""}, - {"IfAddrmsg", Type, 0, ""}, - {"IfAddrmsg.Family", Field, 0, ""}, - {"IfAddrmsg.Flags", Field, 0, ""}, - {"IfAddrmsg.Index", Field, 0, ""}, - {"IfAddrmsg.Prefixlen", Field, 0, ""}, - {"IfAddrmsg.Scope", Field, 0, ""}, - {"IfAnnounceMsghdr", Type, 1, ""}, - {"IfAnnounceMsghdr.Hdrlen", Field, 2, ""}, - {"IfAnnounceMsghdr.Index", Field, 1, ""}, - {"IfAnnounceMsghdr.Msglen", Field, 1, ""}, - {"IfAnnounceMsghdr.Name", Field, 1, ""}, - {"IfAnnounceMsghdr.Type", Field, 1, ""}, - {"IfAnnounceMsghdr.Version", Field, 1, ""}, - {"IfAnnounceMsghdr.What", Field, 1, ""}, - {"IfData", Type, 0, ""}, - {"IfData.Addrlen", Field, 0, ""}, - {"IfData.Baudrate", Field, 0, ""}, - {"IfData.Capabilities", Field, 2, ""}, - {"IfData.Collisions", Field, 0, ""}, - {"IfData.Datalen", Field, 0, ""}, - {"IfData.Epoch", Field, 0, ""}, - {"IfData.Hdrlen", Field, 0, ""}, - {"IfData.Hwassist", Field, 0, ""}, - {"IfData.Ibytes", Field, 0, ""}, - {"IfData.Ierrors", Field, 0, ""}, - {"IfData.Imcasts", Field, 0, ""}, - {"IfData.Ipackets", Field, 0, ""}, - {"IfData.Iqdrops", Field, 0, ""}, - {"IfData.Lastchange", Field, 0, ""}, - {"IfData.Link_state", Field, 0, ""}, - {"IfData.Mclpool", Field, 2, ""}, - {"IfData.Metric", Field, 0, ""}, - {"IfData.Mtu", Field, 0, ""}, - {"IfData.Noproto", Field, 0, ""}, - {"IfData.Obytes", Field, 0, ""}, - {"IfData.Oerrors", Field, 0, ""}, - {"IfData.Omcasts", Field, 0, ""}, - {"IfData.Opackets", Field, 0, ""}, - {"IfData.Pad", Field, 2, ""}, - {"IfData.Pad_cgo_0", Field, 2, ""}, - {"IfData.Pad_cgo_1", Field, 2, ""}, - {"IfData.Physical", Field, 0, ""}, - {"IfData.Recvquota", Field, 0, ""}, - {"IfData.Recvtiming", Field, 0, ""}, - {"IfData.Reserved1", Field, 0, ""}, - {"IfData.Reserved2", Field, 0, ""}, - {"IfData.Spare_char1", Field, 0, ""}, - {"IfData.Spare_char2", Field, 0, ""}, - {"IfData.Type", Field, 0, ""}, - {"IfData.Typelen", Field, 0, ""}, - {"IfData.Unused1", Field, 0, ""}, - {"IfData.Unused2", Field, 0, ""}, - {"IfData.Xmitquota", Field, 0, ""}, - {"IfData.Xmittiming", Field, 0, ""}, - {"IfInfomsg", Type, 0, ""}, - {"IfInfomsg.Change", Field, 0, ""}, - {"IfInfomsg.Family", Field, 0, ""}, - {"IfInfomsg.Flags", Field, 0, ""}, - {"IfInfomsg.Index", Field, 0, ""}, - {"IfInfomsg.Type", Field, 0, ""}, - {"IfInfomsg.X__ifi_pad", Field, 0, ""}, - {"IfMsghdr", Type, 0, ""}, - {"IfMsghdr.Addrs", Field, 0, ""}, - {"IfMsghdr.Data", Field, 0, ""}, - {"IfMsghdr.Flags", Field, 0, ""}, - {"IfMsghdr.Hdrlen", Field, 2, ""}, - {"IfMsghdr.Index", Field, 0, ""}, - {"IfMsghdr.Msglen", Field, 0, ""}, - {"IfMsghdr.Pad1", Field, 2, ""}, - {"IfMsghdr.Pad2", Field, 2, ""}, - {"IfMsghdr.Pad_cgo_0", Field, 0, ""}, - {"IfMsghdr.Pad_cgo_1", Field, 2, ""}, - {"IfMsghdr.Tableid", Field, 2, ""}, - {"IfMsghdr.Type", Field, 0, ""}, - {"IfMsghdr.Version", Field, 0, ""}, - {"IfMsghdr.Xflags", Field, 2, ""}, - {"IfaMsghdr", Type, 0, ""}, - {"IfaMsghdr.Addrs", Field, 0, ""}, - {"IfaMsghdr.Flags", Field, 0, ""}, - {"IfaMsghdr.Hdrlen", Field, 2, ""}, - {"IfaMsghdr.Index", Field, 0, ""}, - {"IfaMsghdr.Metric", Field, 0, ""}, - {"IfaMsghdr.Msglen", Field, 0, ""}, - {"IfaMsghdr.Pad1", Field, 2, ""}, - {"IfaMsghdr.Pad2", Field, 2, ""}, - {"IfaMsghdr.Pad_cgo_0", Field, 0, ""}, - {"IfaMsghdr.Tableid", Field, 2, ""}, - {"IfaMsghdr.Type", Field, 0, ""}, - {"IfaMsghdr.Version", Field, 0, ""}, - {"IfmaMsghdr", Type, 0, ""}, - {"IfmaMsghdr.Addrs", Field, 0, ""}, - {"IfmaMsghdr.Flags", Field, 0, ""}, - {"IfmaMsghdr.Index", Field, 0, ""}, - {"IfmaMsghdr.Msglen", Field, 0, ""}, - {"IfmaMsghdr.Pad_cgo_0", Field, 0, ""}, - {"IfmaMsghdr.Type", Field, 0, ""}, - {"IfmaMsghdr.Version", Field, 0, ""}, - {"IfmaMsghdr2", Type, 0, ""}, - {"IfmaMsghdr2.Addrs", Field, 0, ""}, - {"IfmaMsghdr2.Flags", Field, 0, ""}, - {"IfmaMsghdr2.Index", Field, 0, ""}, - {"IfmaMsghdr2.Msglen", Field, 0, ""}, - {"IfmaMsghdr2.Pad_cgo_0", Field, 0, ""}, - {"IfmaMsghdr2.Refcount", Field, 0, ""}, - {"IfmaMsghdr2.Type", Field, 0, ""}, - {"IfmaMsghdr2.Version", Field, 0, ""}, - {"ImplementsGetwd", Const, 0, ""}, - {"Inet4Pktinfo", Type, 0, ""}, - {"Inet4Pktinfo.Addr", Field, 0, ""}, - {"Inet4Pktinfo.Ifindex", Field, 0, ""}, - {"Inet4Pktinfo.Spec_dst", Field, 0, ""}, - {"Inet6Pktinfo", Type, 0, ""}, - {"Inet6Pktinfo.Addr", Field, 0, ""}, - {"Inet6Pktinfo.Ifindex", Field, 0, ""}, - {"InotifyAddWatch", Func, 0, "func(fd int, pathname string, mask uint32) (watchdesc int, err error)"}, - {"InotifyEvent", Type, 0, ""}, - {"InotifyEvent.Cookie", Field, 0, ""}, - {"InotifyEvent.Len", Field, 0, ""}, - {"InotifyEvent.Mask", Field, 0, ""}, - {"InotifyEvent.Name", Field, 0, ""}, - {"InotifyEvent.Wd", Field, 0, ""}, - {"InotifyInit", Func, 0, "func() (fd int, err error)"}, - {"InotifyInit1", Func, 0, "func(flags int) (fd int, err error)"}, - {"InotifyRmWatch", Func, 0, "func(fd int, watchdesc uint32) (success int, err error)"}, - {"InterfaceAddrMessage", Type, 0, ""}, - {"InterfaceAddrMessage.Data", Field, 0, ""}, - {"InterfaceAddrMessage.Header", Field, 0, ""}, - {"InterfaceAnnounceMessage", Type, 1, ""}, - {"InterfaceAnnounceMessage.Header", Field, 1, ""}, - {"InterfaceInfo", Type, 0, ""}, - {"InterfaceInfo.Address", Field, 0, ""}, - {"InterfaceInfo.BroadcastAddress", Field, 0, ""}, - {"InterfaceInfo.Flags", Field, 0, ""}, - {"InterfaceInfo.Netmask", Field, 0, ""}, - {"InterfaceMessage", Type, 0, ""}, - {"InterfaceMessage.Data", Field, 0, ""}, - {"InterfaceMessage.Header", Field, 0, ""}, - {"InterfaceMulticastAddrMessage", Type, 0, ""}, - {"InterfaceMulticastAddrMessage.Data", Field, 0, ""}, - {"InterfaceMulticastAddrMessage.Header", Field, 0, ""}, - {"InvalidHandle", Const, 0, ""}, - {"Ioperm", Func, 0, "func(from int, num int, on int) (err error)"}, - {"Iopl", Func, 0, "func(level int) (err error)"}, - {"Iovec", Type, 0, ""}, - {"Iovec.Base", Field, 0, ""}, - {"Iovec.Len", Field, 0, ""}, - {"IpAdapterInfo", Type, 0, ""}, - {"IpAdapterInfo.AdapterName", Field, 0, ""}, - {"IpAdapterInfo.Address", Field, 0, ""}, - {"IpAdapterInfo.AddressLength", Field, 0, ""}, - {"IpAdapterInfo.ComboIndex", Field, 0, ""}, - {"IpAdapterInfo.CurrentIpAddress", Field, 0, ""}, - {"IpAdapterInfo.Description", Field, 0, ""}, - {"IpAdapterInfo.DhcpEnabled", Field, 0, ""}, - {"IpAdapterInfo.DhcpServer", Field, 0, ""}, - {"IpAdapterInfo.GatewayList", Field, 0, ""}, - {"IpAdapterInfo.HaveWins", Field, 0, ""}, - {"IpAdapterInfo.Index", Field, 0, ""}, - {"IpAdapterInfo.IpAddressList", Field, 0, ""}, - {"IpAdapterInfo.LeaseExpires", Field, 0, ""}, - {"IpAdapterInfo.LeaseObtained", Field, 0, ""}, - {"IpAdapterInfo.Next", Field, 0, ""}, - {"IpAdapterInfo.PrimaryWinsServer", Field, 0, ""}, - {"IpAdapterInfo.SecondaryWinsServer", Field, 0, ""}, - {"IpAdapterInfo.Type", Field, 0, ""}, - {"IpAddrString", Type, 0, ""}, - {"IpAddrString.Context", Field, 0, ""}, - {"IpAddrString.IpAddress", Field, 0, ""}, - {"IpAddrString.IpMask", Field, 0, ""}, - {"IpAddrString.Next", Field, 0, ""}, - {"IpAddressString", Type, 0, ""}, - {"IpAddressString.String", Field, 0, ""}, - {"IpMaskString", Type, 0, ""}, - {"IpMaskString.String", Field, 2, ""}, - {"Issetugid", Func, 0, ""}, - {"KEY_ALL_ACCESS", Const, 0, ""}, - {"KEY_CREATE_LINK", Const, 0, ""}, - {"KEY_CREATE_SUB_KEY", Const, 0, ""}, - {"KEY_ENUMERATE_SUB_KEYS", Const, 0, ""}, - {"KEY_EXECUTE", Const, 0, ""}, - {"KEY_NOTIFY", Const, 0, ""}, - {"KEY_QUERY_VALUE", Const, 0, ""}, - {"KEY_READ", Const, 0, ""}, - {"KEY_SET_VALUE", Const, 0, ""}, - {"KEY_WOW64_32KEY", Const, 0, ""}, - {"KEY_WOW64_64KEY", Const, 0, ""}, - {"KEY_WRITE", Const, 0, ""}, - {"Kevent", Func, 0, ""}, - {"Kevent_t", Type, 0, ""}, - {"Kevent_t.Data", Field, 0, ""}, - {"Kevent_t.Fflags", Field, 0, ""}, - {"Kevent_t.Filter", Field, 0, ""}, - {"Kevent_t.Flags", Field, 0, ""}, - {"Kevent_t.Ident", Field, 0, ""}, - {"Kevent_t.Pad_cgo_0", Field, 2, ""}, - {"Kevent_t.Udata", Field, 0, ""}, - {"Kill", Func, 0, "func(pid int, sig Signal) (err error)"}, - {"Klogctl", Func, 0, "func(typ int, buf []byte) (n int, err error)"}, - {"Kqueue", Func, 0, ""}, - {"LANG_ENGLISH", Const, 0, ""}, - {"LAYERED_PROTOCOL", Const, 2, ""}, - {"LCNT_OVERLOAD_FLUSH", Const, 1, ""}, - {"LINUX_REBOOT_CMD_CAD_OFF", Const, 0, ""}, - {"LINUX_REBOOT_CMD_CAD_ON", Const, 0, ""}, - {"LINUX_REBOOT_CMD_HALT", Const, 0, ""}, - {"LINUX_REBOOT_CMD_KEXEC", Const, 0, ""}, - {"LINUX_REBOOT_CMD_POWER_OFF", Const, 0, ""}, - {"LINUX_REBOOT_CMD_RESTART", Const, 0, ""}, - {"LINUX_REBOOT_CMD_RESTART2", Const, 0, ""}, - {"LINUX_REBOOT_CMD_SW_SUSPEND", Const, 0, ""}, - {"LINUX_REBOOT_MAGIC1", Const, 0, ""}, - {"LINUX_REBOOT_MAGIC2", Const, 0, ""}, - {"LOCK_EX", Const, 0, ""}, - {"LOCK_NB", Const, 0, ""}, - {"LOCK_SH", Const, 0, ""}, - {"LOCK_UN", Const, 0, ""}, - {"LazyDLL", Type, 0, ""}, - {"LazyDLL.Name", Field, 0, ""}, - {"LazyProc", Type, 0, ""}, - {"LazyProc.Name", Field, 0, ""}, - {"Lchown", Func, 0, "func(path string, uid int, gid int) (err error)"}, - {"Linger", Type, 0, ""}, - {"Linger.Linger", Field, 0, ""}, - {"Linger.Onoff", Field, 0, ""}, - {"Link", Func, 0, "func(oldpath string, newpath string) (err error)"}, - {"Listen", Func, 0, "func(s int, n int) (err error)"}, - {"Listxattr", Func, 1, "func(path string, dest []byte) (sz int, err error)"}, - {"LoadCancelIoEx", Func, 1, ""}, - {"LoadConnectEx", Func, 1, ""}, - {"LoadCreateSymbolicLink", Func, 4, ""}, - {"LoadDLL", Func, 0, ""}, - {"LoadGetAddrInfo", Func, 1, ""}, - {"LoadLibrary", Func, 0, ""}, - {"LoadSetFileCompletionNotificationModes", Func, 2, ""}, - {"LocalFree", Func, 0, ""}, - {"Log2phys_t", Type, 0, ""}, - {"Log2phys_t.Contigbytes", Field, 0, ""}, - {"Log2phys_t.Devoffset", Field, 0, ""}, - {"Log2phys_t.Flags", Field, 0, ""}, - {"LookupAccountName", Func, 0, ""}, - {"LookupAccountSid", Func, 0, ""}, - {"LookupSID", Func, 0, ""}, - {"LsfJump", Func, 0, "func(code int, k int, jt int, jf int) *SockFilter"}, - {"LsfSocket", Func, 0, "func(ifindex int, proto int) (int, error)"}, - {"LsfStmt", Func, 0, "func(code int, k int) *SockFilter"}, - {"Lstat", Func, 0, "func(path string, stat *Stat_t) (err error)"}, - {"MADV_AUTOSYNC", Const, 1, ""}, - {"MADV_CAN_REUSE", Const, 0, ""}, - {"MADV_CORE", Const, 1, ""}, - {"MADV_DOFORK", Const, 0, ""}, - {"MADV_DONTFORK", Const, 0, ""}, - {"MADV_DONTNEED", Const, 0, ""}, - {"MADV_FREE", Const, 0, ""}, - {"MADV_FREE_REUSABLE", Const, 0, ""}, - {"MADV_FREE_REUSE", Const, 0, ""}, - {"MADV_HUGEPAGE", Const, 0, ""}, - {"MADV_HWPOISON", Const, 0, ""}, - {"MADV_MERGEABLE", Const, 0, ""}, - {"MADV_NOCORE", Const, 1, ""}, - {"MADV_NOHUGEPAGE", Const, 0, ""}, - {"MADV_NORMAL", Const, 0, ""}, - {"MADV_NOSYNC", Const, 1, ""}, - {"MADV_PROTECT", Const, 1, ""}, - {"MADV_RANDOM", Const, 0, ""}, - {"MADV_REMOVE", Const, 0, ""}, - {"MADV_SEQUENTIAL", Const, 0, ""}, - {"MADV_SPACEAVAIL", Const, 3, ""}, - {"MADV_UNMERGEABLE", Const, 0, ""}, - {"MADV_WILLNEED", Const, 0, ""}, - {"MADV_ZERO_WIRED_PAGES", Const, 0, ""}, - {"MAP_32BIT", Const, 0, ""}, - {"MAP_ALIGNED_SUPER", Const, 3, ""}, - {"MAP_ALIGNMENT_16MB", Const, 3, ""}, - {"MAP_ALIGNMENT_1TB", Const, 3, ""}, - {"MAP_ALIGNMENT_256TB", Const, 3, ""}, - {"MAP_ALIGNMENT_4GB", Const, 3, ""}, - {"MAP_ALIGNMENT_64KB", Const, 3, ""}, - {"MAP_ALIGNMENT_64PB", Const, 3, ""}, - {"MAP_ALIGNMENT_MASK", Const, 3, ""}, - {"MAP_ALIGNMENT_SHIFT", Const, 3, ""}, - {"MAP_ANON", Const, 0, ""}, - {"MAP_ANONYMOUS", Const, 0, ""}, - {"MAP_COPY", Const, 0, ""}, - {"MAP_DENYWRITE", Const, 0, ""}, - {"MAP_EXECUTABLE", Const, 0, ""}, - {"MAP_FILE", Const, 0, ""}, - {"MAP_FIXED", Const, 0, ""}, - {"MAP_FLAGMASK", Const, 3, ""}, - {"MAP_GROWSDOWN", Const, 0, ""}, - {"MAP_HASSEMAPHORE", Const, 0, ""}, - {"MAP_HUGETLB", Const, 0, ""}, - {"MAP_INHERIT", Const, 3, ""}, - {"MAP_INHERIT_COPY", Const, 3, ""}, - {"MAP_INHERIT_DEFAULT", Const, 3, ""}, - {"MAP_INHERIT_DONATE_COPY", Const, 3, ""}, - {"MAP_INHERIT_NONE", Const, 3, ""}, - {"MAP_INHERIT_SHARE", Const, 3, ""}, - {"MAP_JIT", Const, 0, ""}, - {"MAP_LOCKED", Const, 0, ""}, - {"MAP_NOCACHE", Const, 0, ""}, - {"MAP_NOCORE", Const, 1, ""}, - {"MAP_NOEXTEND", Const, 0, ""}, - {"MAP_NONBLOCK", Const, 0, ""}, - {"MAP_NORESERVE", Const, 0, ""}, - {"MAP_NOSYNC", Const, 1, ""}, - {"MAP_POPULATE", Const, 0, ""}, - {"MAP_PREFAULT_READ", Const, 1, ""}, - {"MAP_PRIVATE", Const, 0, ""}, - {"MAP_RENAME", Const, 0, ""}, - {"MAP_RESERVED0080", Const, 0, ""}, - {"MAP_RESERVED0100", Const, 1, ""}, - {"MAP_SHARED", Const, 0, ""}, - {"MAP_STACK", Const, 0, ""}, - {"MAP_TRYFIXED", Const, 3, ""}, - {"MAP_TYPE", Const, 0, ""}, - {"MAP_WIRED", Const, 3, ""}, - {"MAXIMUM_REPARSE_DATA_BUFFER_SIZE", Const, 4, ""}, - {"MAXLEN_IFDESCR", Const, 0, ""}, - {"MAXLEN_PHYSADDR", Const, 0, ""}, - {"MAX_ADAPTER_ADDRESS_LENGTH", Const, 0, ""}, - {"MAX_ADAPTER_DESCRIPTION_LENGTH", Const, 0, ""}, - {"MAX_ADAPTER_NAME_LENGTH", Const, 0, ""}, - {"MAX_COMPUTERNAME_LENGTH", Const, 0, ""}, - {"MAX_INTERFACE_NAME_LEN", Const, 0, ""}, - {"MAX_LONG_PATH", Const, 0, ""}, - {"MAX_PATH", Const, 0, ""}, - {"MAX_PROTOCOL_CHAIN", Const, 2, ""}, - {"MCL_CURRENT", Const, 0, ""}, - {"MCL_FUTURE", Const, 0, ""}, - {"MNT_DETACH", Const, 0, ""}, - {"MNT_EXPIRE", Const, 0, ""}, - {"MNT_FORCE", Const, 0, ""}, - {"MSG_BCAST", Const, 1, ""}, - {"MSG_CMSG_CLOEXEC", Const, 0, ""}, - {"MSG_COMPAT", Const, 0, ""}, - {"MSG_CONFIRM", Const, 0, ""}, - {"MSG_CONTROLMBUF", Const, 1, ""}, - {"MSG_CTRUNC", Const, 0, ""}, - {"MSG_DONTROUTE", Const, 0, ""}, - {"MSG_DONTWAIT", Const, 0, ""}, - {"MSG_EOF", Const, 0, ""}, - {"MSG_EOR", Const, 0, ""}, - {"MSG_ERRQUEUE", Const, 0, ""}, - {"MSG_FASTOPEN", Const, 1, ""}, - {"MSG_FIN", Const, 0, ""}, - {"MSG_FLUSH", Const, 0, ""}, - {"MSG_HAVEMORE", Const, 0, ""}, - {"MSG_HOLD", Const, 0, ""}, - {"MSG_IOVUSRSPACE", Const, 1, ""}, - {"MSG_LENUSRSPACE", Const, 1, ""}, - {"MSG_MCAST", Const, 1, ""}, - {"MSG_MORE", Const, 0, ""}, - {"MSG_NAMEMBUF", Const, 1, ""}, - {"MSG_NBIO", Const, 0, ""}, - {"MSG_NEEDSA", Const, 0, ""}, - {"MSG_NOSIGNAL", Const, 0, ""}, - {"MSG_NOTIFICATION", Const, 0, ""}, - {"MSG_OOB", Const, 0, ""}, - {"MSG_PEEK", Const, 0, ""}, - {"MSG_PROXY", Const, 0, ""}, - {"MSG_RCVMORE", Const, 0, ""}, - {"MSG_RST", Const, 0, ""}, - {"MSG_SEND", Const, 0, ""}, - {"MSG_SYN", Const, 0, ""}, - {"MSG_TRUNC", Const, 0, ""}, - {"MSG_TRYHARD", Const, 0, ""}, - {"MSG_USERFLAGS", Const, 1, ""}, - {"MSG_WAITALL", Const, 0, ""}, - {"MSG_WAITFORONE", Const, 0, ""}, - {"MSG_WAITSTREAM", Const, 0, ""}, - {"MS_ACTIVE", Const, 0, ""}, - {"MS_ASYNC", Const, 0, ""}, - {"MS_BIND", Const, 0, ""}, - {"MS_DEACTIVATE", Const, 0, ""}, - {"MS_DIRSYNC", Const, 0, ""}, - {"MS_INVALIDATE", Const, 0, ""}, - {"MS_I_VERSION", Const, 0, ""}, - {"MS_KERNMOUNT", Const, 0, ""}, - {"MS_KILLPAGES", Const, 0, ""}, - {"MS_MANDLOCK", Const, 0, ""}, - {"MS_MGC_MSK", Const, 0, ""}, - {"MS_MGC_VAL", Const, 0, ""}, - {"MS_MOVE", Const, 0, ""}, - {"MS_NOATIME", Const, 0, ""}, - {"MS_NODEV", Const, 0, ""}, - {"MS_NODIRATIME", Const, 0, ""}, - {"MS_NOEXEC", Const, 0, ""}, - {"MS_NOSUID", Const, 0, ""}, - {"MS_NOUSER", Const, 0, ""}, - {"MS_POSIXACL", Const, 0, ""}, - {"MS_PRIVATE", Const, 0, ""}, - {"MS_RDONLY", Const, 0, ""}, - {"MS_REC", Const, 0, ""}, - {"MS_RELATIME", Const, 0, ""}, - {"MS_REMOUNT", Const, 0, ""}, - {"MS_RMT_MASK", Const, 0, ""}, - {"MS_SHARED", Const, 0, ""}, - {"MS_SILENT", Const, 0, ""}, - {"MS_SLAVE", Const, 0, ""}, - {"MS_STRICTATIME", Const, 0, ""}, - {"MS_SYNC", Const, 0, ""}, - {"MS_SYNCHRONOUS", Const, 0, ""}, - {"MS_UNBINDABLE", Const, 0, ""}, - {"Madvise", Func, 0, "func(b []byte, advice int) (err error)"}, - {"MapViewOfFile", Func, 0, ""}, - {"MaxTokenInfoClass", Const, 0, ""}, - {"Mclpool", Type, 2, ""}, - {"Mclpool.Alive", Field, 2, ""}, - {"Mclpool.Cwm", Field, 2, ""}, - {"Mclpool.Grown", Field, 2, ""}, - {"Mclpool.Hwm", Field, 2, ""}, - {"Mclpool.Lwm", Field, 2, ""}, - {"MibIfRow", Type, 0, ""}, - {"MibIfRow.AdminStatus", Field, 0, ""}, - {"MibIfRow.Descr", Field, 0, ""}, - {"MibIfRow.DescrLen", Field, 0, ""}, - {"MibIfRow.InDiscards", Field, 0, ""}, - {"MibIfRow.InErrors", Field, 0, ""}, - {"MibIfRow.InNUcastPkts", Field, 0, ""}, - {"MibIfRow.InOctets", Field, 0, ""}, - {"MibIfRow.InUcastPkts", Field, 0, ""}, - {"MibIfRow.InUnknownProtos", Field, 0, ""}, - {"MibIfRow.Index", Field, 0, ""}, - {"MibIfRow.LastChange", Field, 0, ""}, - {"MibIfRow.Mtu", Field, 0, ""}, - {"MibIfRow.Name", Field, 0, ""}, - {"MibIfRow.OperStatus", Field, 0, ""}, - {"MibIfRow.OutDiscards", Field, 0, ""}, - {"MibIfRow.OutErrors", Field, 0, ""}, - {"MibIfRow.OutNUcastPkts", Field, 0, ""}, - {"MibIfRow.OutOctets", Field, 0, ""}, - {"MibIfRow.OutQLen", Field, 0, ""}, - {"MibIfRow.OutUcastPkts", Field, 0, ""}, - {"MibIfRow.PhysAddr", Field, 0, ""}, - {"MibIfRow.PhysAddrLen", Field, 0, ""}, - {"MibIfRow.Speed", Field, 0, ""}, - {"MibIfRow.Type", Field, 0, ""}, - {"Mkdir", Func, 0, "func(path string, mode uint32) (err error)"}, - {"Mkdirat", Func, 0, "func(dirfd int, path string, mode uint32) (err error)"}, - {"Mkfifo", Func, 0, "func(path string, mode uint32) (err error)"}, - {"Mknod", Func, 0, "func(path string, mode uint32, dev int) (err error)"}, - {"Mknodat", Func, 0, "func(dirfd int, path string, mode uint32, dev int) (err error)"}, - {"Mlock", Func, 0, "func(b []byte) (err error)"}, - {"Mlockall", Func, 0, "func(flags int) (err error)"}, - {"Mmap", Func, 0, "func(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)"}, - {"Mount", Func, 0, "func(source string, target string, fstype string, flags uintptr, data string) (err error)"}, - {"MoveFile", Func, 0, ""}, - {"Mprotect", Func, 0, "func(b []byte, prot int) (err error)"}, - {"Msghdr", Type, 0, ""}, - {"Msghdr.Control", Field, 0, ""}, - {"Msghdr.Controllen", Field, 0, ""}, - {"Msghdr.Flags", Field, 0, ""}, - {"Msghdr.Iov", Field, 0, ""}, - {"Msghdr.Iovlen", Field, 0, ""}, - {"Msghdr.Name", Field, 0, ""}, - {"Msghdr.Namelen", Field, 0, ""}, - {"Msghdr.Pad_cgo_0", Field, 0, ""}, - {"Msghdr.Pad_cgo_1", Field, 0, ""}, - {"Munlock", Func, 0, "func(b []byte) (err error)"}, - {"Munlockall", Func, 0, "func() (err error)"}, - {"Munmap", Func, 0, "func(b []byte) (err error)"}, - {"MustLoadDLL", Func, 0, ""}, - {"NAME_MAX", Const, 0, ""}, - {"NETLINK_ADD_MEMBERSHIP", Const, 0, ""}, - {"NETLINK_AUDIT", Const, 0, ""}, - {"NETLINK_BROADCAST_ERROR", Const, 0, ""}, - {"NETLINK_CONNECTOR", Const, 0, ""}, - {"NETLINK_DNRTMSG", Const, 0, ""}, - {"NETLINK_DROP_MEMBERSHIP", Const, 0, ""}, - {"NETLINK_ECRYPTFS", Const, 0, ""}, - {"NETLINK_FIB_LOOKUP", Const, 0, ""}, - {"NETLINK_FIREWALL", Const, 0, ""}, - {"NETLINK_GENERIC", Const, 0, ""}, - {"NETLINK_INET_DIAG", Const, 0, ""}, - {"NETLINK_IP6_FW", Const, 0, ""}, - {"NETLINK_ISCSI", Const, 0, ""}, - {"NETLINK_KOBJECT_UEVENT", Const, 0, ""}, - {"NETLINK_NETFILTER", Const, 0, ""}, - {"NETLINK_NFLOG", Const, 0, ""}, - {"NETLINK_NO_ENOBUFS", Const, 0, ""}, - {"NETLINK_PKTINFO", Const, 0, ""}, - {"NETLINK_RDMA", Const, 0, ""}, - {"NETLINK_ROUTE", Const, 0, ""}, - {"NETLINK_SCSITRANSPORT", Const, 0, ""}, - {"NETLINK_SELINUX", Const, 0, ""}, - {"NETLINK_UNUSED", Const, 0, ""}, - {"NETLINK_USERSOCK", Const, 0, ""}, - {"NETLINK_XFRM", Const, 0, ""}, - {"NET_RT_DUMP", Const, 0, ""}, - {"NET_RT_DUMP2", Const, 0, ""}, - {"NET_RT_FLAGS", Const, 0, ""}, - {"NET_RT_IFLIST", Const, 0, ""}, - {"NET_RT_IFLIST2", Const, 0, ""}, - {"NET_RT_IFLISTL", Const, 1, ""}, - {"NET_RT_IFMALIST", Const, 0, ""}, - {"NET_RT_MAXID", Const, 0, ""}, - {"NET_RT_OIFLIST", Const, 1, ""}, - {"NET_RT_OOIFLIST", Const, 1, ""}, - {"NET_RT_STAT", Const, 0, ""}, - {"NET_RT_STATS", Const, 1, ""}, - {"NET_RT_TABLE", Const, 1, ""}, - {"NET_RT_TRASH", Const, 0, ""}, - {"NLA_ALIGNTO", Const, 0, ""}, - {"NLA_F_NESTED", Const, 0, ""}, - {"NLA_F_NET_BYTEORDER", Const, 0, ""}, - {"NLA_HDRLEN", Const, 0, ""}, - {"NLMSG_ALIGNTO", Const, 0, ""}, - {"NLMSG_DONE", Const, 0, ""}, - {"NLMSG_ERROR", Const, 0, ""}, - {"NLMSG_HDRLEN", Const, 0, ""}, - {"NLMSG_MIN_TYPE", Const, 0, ""}, - {"NLMSG_NOOP", Const, 0, ""}, - {"NLMSG_OVERRUN", Const, 0, ""}, - {"NLM_F_ACK", Const, 0, ""}, - {"NLM_F_APPEND", Const, 0, ""}, - {"NLM_F_ATOMIC", Const, 0, ""}, - {"NLM_F_CREATE", Const, 0, ""}, - {"NLM_F_DUMP", Const, 0, ""}, - {"NLM_F_ECHO", Const, 0, ""}, - {"NLM_F_EXCL", Const, 0, ""}, - {"NLM_F_MATCH", Const, 0, ""}, - {"NLM_F_MULTI", Const, 0, ""}, - {"NLM_F_REPLACE", Const, 0, ""}, - {"NLM_F_REQUEST", Const, 0, ""}, - {"NLM_F_ROOT", Const, 0, ""}, - {"NOFLSH", Const, 0, ""}, - {"NOTE_ABSOLUTE", Const, 0, ""}, - {"NOTE_ATTRIB", Const, 0, ""}, - {"NOTE_BACKGROUND", Const, 16, ""}, - {"NOTE_CHILD", Const, 0, ""}, - {"NOTE_CRITICAL", Const, 16, ""}, - {"NOTE_DELETE", Const, 0, ""}, - {"NOTE_EOF", Const, 1, ""}, - {"NOTE_EXEC", Const, 0, ""}, - {"NOTE_EXIT", Const, 0, ""}, - {"NOTE_EXITSTATUS", Const, 0, ""}, - {"NOTE_EXIT_CSERROR", Const, 16, ""}, - {"NOTE_EXIT_DECRYPTFAIL", Const, 16, ""}, - {"NOTE_EXIT_DETAIL", Const, 16, ""}, - {"NOTE_EXIT_DETAIL_MASK", Const, 16, ""}, - {"NOTE_EXIT_MEMORY", Const, 16, ""}, - {"NOTE_EXIT_REPARENTED", Const, 16, ""}, - {"NOTE_EXTEND", Const, 0, ""}, - {"NOTE_FFAND", Const, 0, ""}, - {"NOTE_FFCOPY", Const, 0, ""}, - {"NOTE_FFCTRLMASK", Const, 0, ""}, - {"NOTE_FFLAGSMASK", Const, 0, ""}, - {"NOTE_FFNOP", Const, 0, ""}, - {"NOTE_FFOR", Const, 0, ""}, - {"NOTE_FORK", Const, 0, ""}, - {"NOTE_LEEWAY", Const, 16, ""}, - {"NOTE_LINK", Const, 0, ""}, - {"NOTE_LOWAT", Const, 0, ""}, - {"NOTE_NONE", Const, 0, ""}, - {"NOTE_NSECONDS", Const, 0, ""}, - {"NOTE_PCTRLMASK", Const, 0, ""}, - {"NOTE_PDATAMASK", Const, 0, ""}, - {"NOTE_REAP", Const, 0, ""}, - {"NOTE_RENAME", Const, 0, ""}, - {"NOTE_RESOURCEEND", Const, 0, ""}, - {"NOTE_REVOKE", Const, 0, ""}, - {"NOTE_SECONDS", Const, 0, ""}, - {"NOTE_SIGNAL", Const, 0, ""}, - {"NOTE_TRACK", Const, 0, ""}, - {"NOTE_TRACKERR", Const, 0, ""}, - {"NOTE_TRIGGER", Const, 0, ""}, - {"NOTE_TRUNCATE", Const, 1, ""}, - {"NOTE_USECONDS", Const, 0, ""}, - {"NOTE_VM_ERROR", Const, 0, ""}, - {"NOTE_VM_PRESSURE", Const, 0, ""}, - {"NOTE_VM_PRESSURE_SUDDEN_TERMINATE", Const, 0, ""}, - {"NOTE_VM_PRESSURE_TERMINATE", Const, 0, ""}, - {"NOTE_WRITE", Const, 0, ""}, - {"NameCanonical", Const, 0, ""}, - {"NameCanonicalEx", Const, 0, ""}, - {"NameDisplay", Const, 0, ""}, - {"NameDnsDomain", Const, 0, ""}, - {"NameFullyQualifiedDN", Const, 0, ""}, - {"NameSamCompatible", Const, 0, ""}, - {"NameServicePrincipal", Const, 0, ""}, - {"NameUniqueId", Const, 0, ""}, - {"NameUnknown", Const, 0, ""}, - {"NameUserPrincipal", Const, 0, ""}, - {"Nanosleep", Func, 0, "func(time *Timespec, leftover *Timespec) (err error)"}, - {"NetApiBufferFree", Func, 0, ""}, - {"NetGetJoinInformation", Func, 2, ""}, - {"NetSetupDomainName", Const, 2, ""}, - {"NetSetupUnjoined", Const, 2, ""}, - {"NetSetupUnknownStatus", Const, 2, ""}, - {"NetSetupWorkgroupName", Const, 2, ""}, - {"NetUserGetInfo", Func, 0, ""}, - {"NetlinkMessage", Type, 0, ""}, - {"NetlinkMessage.Data", Field, 0, ""}, - {"NetlinkMessage.Header", Field, 0, ""}, - {"NetlinkRIB", Func, 0, "func(proto int, family int) ([]byte, error)"}, - {"NetlinkRouteAttr", Type, 0, ""}, - {"NetlinkRouteAttr.Attr", Field, 0, ""}, - {"NetlinkRouteAttr.Value", Field, 0, ""}, - {"NetlinkRouteRequest", Type, 0, ""}, - {"NetlinkRouteRequest.Data", Field, 0, ""}, - {"NetlinkRouteRequest.Header", Field, 0, ""}, - {"NewCallback", Func, 0, ""}, - {"NewCallbackCDecl", Func, 3, ""}, - {"NewLazyDLL", Func, 0, ""}, - {"NlAttr", Type, 0, ""}, - {"NlAttr.Len", Field, 0, ""}, - {"NlAttr.Type", Field, 0, ""}, - {"NlMsgerr", Type, 0, ""}, - {"NlMsgerr.Error", Field, 0, ""}, - {"NlMsgerr.Msg", Field, 0, ""}, - {"NlMsghdr", Type, 0, ""}, - {"NlMsghdr.Flags", Field, 0, ""}, - {"NlMsghdr.Len", Field, 0, ""}, - {"NlMsghdr.Pid", Field, 0, ""}, - {"NlMsghdr.Seq", Field, 0, ""}, - {"NlMsghdr.Type", Field, 0, ""}, - {"NsecToFiletime", Func, 0, ""}, - {"NsecToTimespec", Func, 0, "func(nsec int64) Timespec"}, - {"NsecToTimeval", Func, 0, "func(nsec int64) Timeval"}, - {"Ntohs", Func, 0, ""}, - {"OCRNL", Const, 0, ""}, - {"OFDEL", Const, 0, ""}, - {"OFILL", Const, 0, ""}, - {"OFIOGETBMAP", Const, 1, ""}, - {"OID_PKIX_KP_SERVER_AUTH", Var, 0, ""}, - {"OID_SERVER_GATED_CRYPTO", Var, 0, ""}, - {"OID_SGC_NETSCAPE", Var, 0, ""}, - {"OLCUC", Const, 0, ""}, - {"ONLCR", Const, 0, ""}, - {"ONLRET", Const, 0, ""}, - {"ONOCR", Const, 0, ""}, - {"ONOEOT", Const, 1, ""}, - {"OPEN_ALWAYS", Const, 0, ""}, - {"OPEN_EXISTING", Const, 0, ""}, - {"OPOST", Const, 0, ""}, - {"O_ACCMODE", Const, 0, ""}, - {"O_ALERT", Const, 0, ""}, - {"O_ALT_IO", Const, 1, ""}, - {"O_APPEND", Const, 0, ""}, - {"O_ASYNC", Const, 0, ""}, - {"O_CLOEXEC", Const, 0, ""}, - {"O_CREAT", Const, 0, ""}, - {"O_DIRECT", Const, 0, ""}, - {"O_DIRECTORY", Const, 0, ""}, - {"O_DP_GETRAWENCRYPTED", Const, 16, ""}, - {"O_DSYNC", Const, 0, ""}, - {"O_EVTONLY", Const, 0, ""}, - {"O_EXCL", Const, 0, ""}, - {"O_EXEC", Const, 0, ""}, - {"O_EXLOCK", Const, 0, ""}, - {"O_FSYNC", Const, 0, ""}, - {"O_LARGEFILE", Const, 0, ""}, - {"O_NDELAY", Const, 0, ""}, - {"O_NOATIME", Const, 0, ""}, - {"O_NOCTTY", Const, 0, ""}, - {"O_NOFOLLOW", Const, 0, ""}, - {"O_NONBLOCK", Const, 0, ""}, - {"O_NOSIGPIPE", Const, 1, ""}, - {"O_POPUP", Const, 0, ""}, - {"O_RDONLY", Const, 0, ""}, - {"O_RDWR", Const, 0, ""}, - {"O_RSYNC", Const, 0, ""}, - {"O_SHLOCK", Const, 0, ""}, - {"O_SYMLINK", Const, 0, ""}, - {"O_SYNC", Const, 0, ""}, - {"O_TRUNC", Const, 0, ""}, - {"O_TTY_INIT", Const, 0, ""}, - {"O_WRONLY", Const, 0, ""}, - {"Open", Func, 0, "func(path string, mode int, perm uint32) (fd int, err error)"}, - {"OpenCurrentProcessToken", Func, 0, ""}, - {"OpenProcess", Func, 0, ""}, - {"OpenProcessToken", Func, 0, ""}, - {"Openat", Func, 0, "func(dirfd int, path string, flags int, mode uint32) (fd int, err error)"}, - {"Overlapped", Type, 0, ""}, - {"Overlapped.HEvent", Field, 0, ""}, - {"Overlapped.Internal", Field, 0, ""}, - {"Overlapped.InternalHigh", Field, 0, ""}, - {"Overlapped.Offset", Field, 0, ""}, - {"Overlapped.OffsetHigh", Field, 0, ""}, - {"PACKET_ADD_MEMBERSHIP", Const, 0, ""}, - {"PACKET_BROADCAST", Const, 0, ""}, - {"PACKET_DROP_MEMBERSHIP", Const, 0, ""}, - {"PACKET_FASTROUTE", Const, 0, ""}, - {"PACKET_HOST", Const, 0, ""}, - {"PACKET_LOOPBACK", Const, 0, ""}, - {"PACKET_MR_ALLMULTI", Const, 0, ""}, - {"PACKET_MR_MULTICAST", Const, 0, ""}, - {"PACKET_MR_PROMISC", Const, 0, ""}, - {"PACKET_MULTICAST", Const, 0, ""}, - {"PACKET_OTHERHOST", Const, 0, ""}, - {"PACKET_OUTGOING", Const, 0, ""}, - {"PACKET_RECV_OUTPUT", Const, 0, ""}, - {"PACKET_RX_RING", Const, 0, ""}, - {"PACKET_STATISTICS", Const, 0, ""}, - {"PAGE_EXECUTE_READ", Const, 0, ""}, - {"PAGE_EXECUTE_READWRITE", Const, 0, ""}, - {"PAGE_EXECUTE_WRITECOPY", Const, 0, ""}, - {"PAGE_READONLY", Const, 0, ""}, - {"PAGE_READWRITE", Const, 0, ""}, - {"PAGE_WRITECOPY", Const, 0, ""}, - {"PARENB", Const, 0, ""}, - {"PARMRK", Const, 0, ""}, - {"PARODD", Const, 0, ""}, - {"PENDIN", Const, 0, ""}, - {"PFL_HIDDEN", Const, 2, ""}, - {"PFL_MATCHES_PROTOCOL_ZERO", Const, 2, ""}, - {"PFL_MULTIPLE_PROTO_ENTRIES", Const, 2, ""}, - {"PFL_NETWORKDIRECT_PROVIDER", Const, 2, ""}, - {"PFL_RECOMMENDED_PROTO_ENTRY", Const, 2, ""}, - {"PF_FLUSH", Const, 1, ""}, - {"PKCS_7_ASN_ENCODING", Const, 0, ""}, - {"PMC5_PIPELINE_FLUSH", Const, 1, ""}, - {"PRIO_PGRP", Const, 2, ""}, - {"PRIO_PROCESS", Const, 2, ""}, - {"PRIO_USER", Const, 2, ""}, - {"PRI_IOFLUSH", Const, 1, ""}, - {"PROCESS_QUERY_INFORMATION", Const, 0, ""}, - {"PROCESS_TERMINATE", Const, 2, ""}, - {"PROT_EXEC", Const, 0, ""}, - {"PROT_GROWSDOWN", Const, 0, ""}, - {"PROT_GROWSUP", Const, 0, ""}, - {"PROT_NONE", Const, 0, ""}, - {"PROT_READ", Const, 0, ""}, - {"PROT_WRITE", Const, 0, ""}, - {"PROV_DH_SCHANNEL", Const, 0, ""}, - {"PROV_DSS", Const, 0, ""}, - {"PROV_DSS_DH", Const, 0, ""}, - {"PROV_EC_ECDSA_FULL", Const, 0, ""}, - {"PROV_EC_ECDSA_SIG", Const, 0, ""}, - {"PROV_EC_ECNRA_FULL", Const, 0, ""}, - {"PROV_EC_ECNRA_SIG", Const, 0, ""}, - {"PROV_FORTEZZA", Const, 0, ""}, - {"PROV_INTEL_SEC", Const, 0, ""}, - {"PROV_MS_EXCHANGE", Const, 0, ""}, - {"PROV_REPLACE_OWF", Const, 0, ""}, - {"PROV_RNG", Const, 0, ""}, - {"PROV_RSA_AES", Const, 0, ""}, - {"PROV_RSA_FULL", Const, 0, ""}, - {"PROV_RSA_SCHANNEL", Const, 0, ""}, - {"PROV_RSA_SIG", Const, 0, ""}, - {"PROV_SPYRUS_LYNKS", Const, 0, ""}, - {"PROV_SSL", Const, 0, ""}, - {"PR_CAPBSET_DROP", Const, 0, ""}, - {"PR_CAPBSET_READ", Const, 0, ""}, - {"PR_CLEAR_SECCOMP_FILTER", Const, 0, ""}, - {"PR_ENDIAN_BIG", Const, 0, ""}, - {"PR_ENDIAN_LITTLE", Const, 0, ""}, - {"PR_ENDIAN_PPC_LITTLE", Const, 0, ""}, - {"PR_FPEMU_NOPRINT", Const, 0, ""}, - {"PR_FPEMU_SIGFPE", Const, 0, ""}, - {"PR_FP_EXC_ASYNC", Const, 0, ""}, - {"PR_FP_EXC_DISABLED", Const, 0, ""}, - {"PR_FP_EXC_DIV", Const, 0, ""}, - {"PR_FP_EXC_INV", Const, 0, ""}, - {"PR_FP_EXC_NONRECOV", Const, 0, ""}, - {"PR_FP_EXC_OVF", Const, 0, ""}, - {"PR_FP_EXC_PRECISE", Const, 0, ""}, - {"PR_FP_EXC_RES", Const, 0, ""}, - {"PR_FP_EXC_SW_ENABLE", Const, 0, ""}, - {"PR_FP_EXC_UND", Const, 0, ""}, - {"PR_GET_DUMPABLE", Const, 0, ""}, - {"PR_GET_ENDIAN", Const, 0, ""}, - {"PR_GET_FPEMU", Const, 0, ""}, - {"PR_GET_FPEXC", Const, 0, ""}, - {"PR_GET_KEEPCAPS", Const, 0, ""}, - {"PR_GET_NAME", Const, 0, ""}, - {"PR_GET_PDEATHSIG", Const, 0, ""}, - {"PR_GET_SECCOMP", Const, 0, ""}, - {"PR_GET_SECCOMP_FILTER", Const, 0, ""}, - {"PR_GET_SECUREBITS", Const, 0, ""}, - {"PR_GET_TIMERSLACK", Const, 0, ""}, - {"PR_GET_TIMING", Const, 0, ""}, - {"PR_GET_TSC", Const, 0, ""}, - {"PR_GET_UNALIGN", Const, 0, ""}, - {"PR_MCE_KILL", Const, 0, ""}, - {"PR_MCE_KILL_CLEAR", Const, 0, ""}, - {"PR_MCE_KILL_DEFAULT", Const, 0, ""}, - {"PR_MCE_KILL_EARLY", Const, 0, ""}, - {"PR_MCE_KILL_GET", Const, 0, ""}, - {"PR_MCE_KILL_LATE", Const, 0, ""}, - {"PR_MCE_KILL_SET", Const, 0, ""}, - {"PR_SECCOMP_FILTER_EVENT", Const, 0, ""}, - {"PR_SECCOMP_FILTER_SYSCALL", Const, 0, ""}, - {"PR_SET_DUMPABLE", Const, 0, ""}, - {"PR_SET_ENDIAN", Const, 0, ""}, - {"PR_SET_FPEMU", Const, 0, ""}, - {"PR_SET_FPEXC", Const, 0, ""}, - {"PR_SET_KEEPCAPS", Const, 0, ""}, - {"PR_SET_NAME", Const, 0, ""}, - {"PR_SET_PDEATHSIG", Const, 0, ""}, - {"PR_SET_PTRACER", Const, 0, ""}, - {"PR_SET_SECCOMP", Const, 0, ""}, - {"PR_SET_SECCOMP_FILTER", Const, 0, ""}, - {"PR_SET_SECUREBITS", Const, 0, ""}, - {"PR_SET_TIMERSLACK", Const, 0, ""}, - {"PR_SET_TIMING", Const, 0, ""}, - {"PR_SET_TSC", Const, 0, ""}, - {"PR_SET_UNALIGN", Const, 0, ""}, - {"PR_TASK_PERF_EVENTS_DISABLE", Const, 0, ""}, - {"PR_TASK_PERF_EVENTS_ENABLE", Const, 0, ""}, - {"PR_TIMING_STATISTICAL", Const, 0, ""}, - {"PR_TIMING_TIMESTAMP", Const, 0, ""}, - {"PR_TSC_ENABLE", Const, 0, ""}, - {"PR_TSC_SIGSEGV", Const, 0, ""}, - {"PR_UNALIGN_NOPRINT", Const, 0, ""}, - {"PR_UNALIGN_SIGBUS", Const, 0, ""}, - {"PTRACE_ARCH_PRCTL", Const, 0, ""}, - {"PTRACE_ATTACH", Const, 0, ""}, - {"PTRACE_CONT", Const, 0, ""}, - {"PTRACE_DETACH", Const, 0, ""}, - {"PTRACE_EVENT_CLONE", Const, 0, ""}, - {"PTRACE_EVENT_EXEC", Const, 0, ""}, - {"PTRACE_EVENT_EXIT", Const, 0, ""}, - {"PTRACE_EVENT_FORK", Const, 0, ""}, - {"PTRACE_EVENT_VFORK", Const, 0, ""}, - {"PTRACE_EVENT_VFORK_DONE", Const, 0, ""}, - {"PTRACE_GETCRUNCHREGS", Const, 0, ""}, - {"PTRACE_GETEVENTMSG", Const, 0, ""}, - {"PTRACE_GETFPREGS", Const, 0, ""}, - {"PTRACE_GETFPXREGS", Const, 0, ""}, - {"PTRACE_GETHBPREGS", Const, 0, ""}, - {"PTRACE_GETREGS", Const, 0, ""}, - {"PTRACE_GETREGSET", Const, 0, ""}, - {"PTRACE_GETSIGINFO", Const, 0, ""}, - {"PTRACE_GETVFPREGS", Const, 0, ""}, - {"PTRACE_GETWMMXREGS", Const, 0, ""}, - {"PTRACE_GET_THREAD_AREA", Const, 0, ""}, - {"PTRACE_KILL", Const, 0, ""}, - {"PTRACE_OLDSETOPTIONS", Const, 0, ""}, - {"PTRACE_O_MASK", Const, 0, ""}, - {"PTRACE_O_TRACECLONE", Const, 0, ""}, - {"PTRACE_O_TRACEEXEC", Const, 0, ""}, - {"PTRACE_O_TRACEEXIT", Const, 0, ""}, - {"PTRACE_O_TRACEFORK", Const, 0, ""}, - {"PTRACE_O_TRACESYSGOOD", Const, 0, ""}, - {"PTRACE_O_TRACEVFORK", Const, 0, ""}, - {"PTRACE_O_TRACEVFORKDONE", Const, 0, ""}, - {"PTRACE_PEEKDATA", Const, 0, ""}, - {"PTRACE_PEEKTEXT", Const, 0, ""}, - {"PTRACE_PEEKUSR", Const, 0, ""}, - {"PTRACE_POKEDATA", Const, 0, ""}, - {"PTRACE_POKETEXT", Const, 0, ""}, - {"PTRACE_POKEUSR", Const, 0, ""}, - {"PTRACE_SETCRUNCHREGS", Const, 0, ""}, - {"PTRACE_SETFPREGS", Const, 0, ""}, - {"PTRACE_SETFPXREGS", Const, 0, ""}, - {"PTRACE_SETHBPREGS", Const, 0, ""}, - {"PTRACE_SETOPTIONS", Const, 0, ""}, - {"PTRACE_SETREGS", Const, 0, ""}, - {"PTRACE_SETREGSET", Const, 0, ""}, - {"PTRACE_SETSIGINFO", Const, 0, ""}, - {"PTRACE_SETVFPREGS", Const, 0, ""}, - {"PTRACE_SETWMMXREGS", Const, 0, ""}, - {"PTRACE_SET_SYSCALL", Const, 0, ""}, - {"PTRACE_SET_THREAD_AREA", Const, 0, ""}, - {"PTRACE_SINGLEBLOCK", Const, 0, ""}, - {"PTRACE_SINGLESTEP", Const, 0, ""}, - {"PTRACE_SYSCALL", Const, 0, ""}, - {"PTRACE_SYSEMU", Const, 0, ""}, - {"PTRACE_SYSEMU_SINGLESTEP", Const, 0, ""}, - {"PTRACE_TRACEME", Const, 0, ""}, - {"PT_ATTACH", Const, 0, ""}, - {"PT_ATTACHEXC", Const, 0, ""}, - {"PT_CONTINUE", Const, 0, ""}, - {"PT_DATA_ADDR", Const, 0, ""}, - {"PT_DENY_ATTACH", Const, 0, ""}, - {"PT_DETACH", Const, 0, ""}, - {"PT_FIRSTMACH", Const, 0, ""}, - {"PT_FORCEQUOTA", Const, 0, ""}, - {"PT_KILL", Const, 0, ""}, - {"PT_MASK", Const, 1, ""}, - {"PT_READ_D", Const, 0, ""}, - {"PT_READ_I", Const, 0, ""}, - {"PT_READ_U", Const, 0, ""}, - {"PT_SIGEXC", Const, 0, ""}, - {"PT_STEP", Const, 0, ""}, - {"PT_TEXT_ADDR", Const, 0, ""}, - {"PT_TEXT_END_ADDR", Const, 0, ""}, - {"PT_THUPDATE", Const, 0, ""}, - {"PT_TRACE_ME", Const, 0, ""}, - {"PT_WRITE_D", Const, 0, ""}, - {"PT_WRITE_I", Const, 0, ""}, - {"PT_WRITE_U", Const, 0, ""}, - {"ParseDirent", Func, 0, "func(buf []byte, max int, names []string) (consumed int, count int, newnames []string)"}, - {"ParseNetlinkMessage", Func, 0, "func(b []byte) ([]NetlinkMessage, error)"}, - {"ParseNetlinkRouteAttr", Func, 0, "func(m *NetlinkMessage) ([]NetlinkRouteAttr, error)"}, - {"ParseRoutingMessage", Func, 0, ""}, - {"ParseRoutingSockaddr", Func, 0, ""}, - {"ParseSocketControlMessage", Func, 0, "func(b []byte) ([]SocketControlMessage, error)"}, - {"ParseUnixCredentials", Func, 0, "func(m *SocketControlMessage) (*Ucred, error)"}, - {"ParseUnixRights", Func, 0, "func(m *SocketControlMessage) ([]int, error)"}, - {"PathMax", Const, 0, ""}, - {"Pathconf", Func, 0, ""}, - {"Pause", Func, 0, "func() (err error)"}, - {"Pipe", Func, 0, "func(p []int) error"}, - {"Pipe2", Func, 1, "func(p []int, flags int) error"}, - {"PivotRoot", Func, 0, "func(newroot string, putold string) (err error)"}, - {"Pointer", Type, 11, ""}, - {"PostQueuedCompletionStatus", Func, 0, ""}, - {"Pread", Func, 0, "func(fd int, p []byte, offset int64) (n int, err error)"}, - {"Proc", Type, 0, ""}, - {"Proc.Dll", Field, 0, ""}, - {"Proc.Name", Field, 0, ""}, - {"ProcAttr", Type, 0, ""}, - {"ProcAttr.Dir", Field, 0, ""}, - {"ProcAttr.Env", Field, 0, ""}, - {"ProcAttr.Files", Field, 0, ""}, - {"ProcAttr.Sys", Field, 0, ""}, - {"Process32First", Func, 4, ""}, - {"Process32Next", Func, 4, ""}, - {"ProcessEntry32", Type, 4, ""}, - {"ProcessEntry32.DefaultHeapID", Field, 4, ""}, - {"ProcessEntry32.ExeFile", Field, 4, ""}, - {"ProcessEntry32.Flags", Field, 4, ""}, - {"ProcessEntry32.ModuleID", Field, 4, ""}, - {"ProcessEntry32.ParentProcessID", Field, 4, ""}, - {"ProcessEntry32.PriClassBase", Field, 4, ""}, - {"ProcessEntry32.ProcessID", Field, 4, ""}, - {"ProcessEntry32.Size", Field, 4, ""}, - {"ProcessEntry32.Threads", Field, 4, ""}, - {"ProcessEntry32.Usage", Field, 4, ""}, - {"ProcessInformation", Type, 0, ""}, - {"ProcessInformation.Process", Field, 0, ""}, - {"ProcessInformation.ProcessId", Field, 0, ""}, - {"ProcessInformation.Thread", Field, 0, ""}, - {"ProcessInformation.ThreadId", Field, 0, ""}, - {"Protoent", Type, 0, ""}, - {"Protoent.Aliases", Field, 0, ""}, - {"Protoent.Name", Field, 0, ""}, - {"Protoent.Proto", Field, 0, ""}, - {"PtraceAttach", Func, 0, "func(pid int) (err error)"}, - {"PtraceCont", Func, 0, "func(pid int, signal int) (err error)"}, - {"PtraceDetach", Func, 0, "func(pid int) (err error)"}, - {"PtraceGetEventMsg", Func, 0, "func(pid int) (msg uint, err error)"}, - {"PtraceGetRegs", Func, 0, "func(pid int, regsout *PtraceRegs) (err error)"}, - {"PtracePeekData", Func, 0, "func(pid int, addr uintptr, out []byte) (count int, err error)"}, - {"PtracePeekText", Func, 0, "func(pid int, addr uintptr, out []byte) (count int, err error)"}, - {"PtracePokeData", Func, 0, "func(pid int, addr uintptr, data []byte) (count int, err error)"}, - {"PtracePokeText", Func, 0, "func(pid int, addr uintptr, data []byte) (count int, err error)"}, - {"PtraceRegs", Type, 0, ""}, - {"PtraceRegs.Cs", Field, 0, ""}, - {"PtraceRegs.Ds", Field, 0, ""}, - {"PtraceRegs.Eax", Field, 0, ""}, - {"PtraceRegs.Ebp", Field, 0, ""}, - {"PtraceRegs.Ebx", Field, 0, ""}, - {"PtraceRegs.Ecx", Field, 0, ""}, - {"PtraceRegs.Edi", Field, 0, ""}, - {"PtraceRegs.Edx", Field, 0, ""}, - {"PtraceRegs.Eflags", Field, 0, ""}, - {"PtraceRegs.Eip", Field, 0, ""}, - {"PtraceRegs.Es", Field, 0, ""}, - {"PtraceRegs.Esi", Field, 0, ""}, - {"PtraceRegs.Esp", Field, 0, ""}, - {"PtraceRegs.Fs", Field, 0, ""}, - {"PtraceRegs.Fs_base", Field, 0, ""}, - {"PtraceRegs.Gs", Field, 0, ""}, - {"PtraceRegs.Gs_base", Field, 0, ""}, - {"PtraceRegs.Orig_eax", Field, 0, ""}, - {"PtraceRegs.Orig_rax", Field, 0, ""}, - {"PtraceRegs.R10", Field, 0, ""}, - {"PtraceRegs.R11", Field, 0, ""}, - {"PtraceRegs.R12", Field, 0, ""}, - {"PtraceRegs.R13", Field, 0, ""}, - {"PtraceRegs.R14", Field, 0, ""}, - {"PtraceRegs.R15", Field, 0, ""}, - {"PtraceRegs.R8", Field, 0, ""}, - {"PtraceRegs.R9", Field, 0, ""}, - {"PtraceRegs.Rax", Field, 0, ""}, - {"PtraceRegs.Rbp", Field, 0, ""}, - {"PtraceRegs.Rbx", Field, 0, ""}, - {"PtraceRegs.Rcx", Field, 0, ""}, - {"PtraceRegs.Rdi", Field, 0, ""}, - {"PtraceRegs.Rdx", Field, 0, ""}, - {"PtraceRegs.Rip", Field, 0, ""}, - {"PtraceRegs.Rsi", Field, 0, ""}, - {"PtraceRegs.Rsp", Field, 0, ""}, - {"PtraceRegs.Ss", Field, 0, ""}, - {"PtraceRegs.Uregs", Field, 0, ""}, - {"PtraceRegs.Xcs", Field, 0, ""}, - {"PtraceRegs.Xds", Field, 0, ""}, - {"PtraceRegs.Xes", Field, 0, ""}, - {"PtraceRegs.Xfs", Field, 0, ""}, - {"PtraceRegs.Xgs", Field, 0, ""}, - {"PtraceRegs.Xss", Field, 0, ""}, - {"PtraceSetOptions", Func, 0, "func(pid int, options int) (err error)"}, - {"PtraceSetRegs", Func, 0, "func(pid int, regs *PtraceRegs) (err error)"}, - {"PtraceSingleStep", Func, 0, "func(pid int) (err error)"}, - {"PtraceSyscall", Func, 1, "func(pid int, signal int) (err error)"}, - {"Pwrite", Func, 0, "func(fd int, p []byte, offset int64) (n int, err error)"}, - {"REG_BINARY", Const, 0, ""}, - {"REG_DWORD", Const, 0, ""}, - {"REG_DWORD_BIG_ENDIAN", Const, 0, ""}, - {"REG_DWORD_LITTLE_ENDIAN", Const, 0, ""}, - {"REG_EXPAND_SZ", Const, 0, ""}, - {"REG_FULL_RESOURCE_DESCRIPTOR", Const, 0, ""}, - {"REG_LINK", Const, 0, ""}, - {"REG_MULTI_SZ", Const, 0, ""}, - {"REG_NONE", Const, 0, ""}, - {"REG_QWORD", Const, 0, ""}, - {"REG_QWORD_LITTLE_ENDIAN", Const, 0, ""}, - {"REG_RESOURCE_LIST", Const, 0, ""}, - {"REG_RESOURCE_REQUIREMENTS_LIST", Const, 0, ""}, - {"REG_SZ", Const, 0, ""}, - {"RLIMIT_AS", Const, 0, ""}, - {"RLIMIT_CORE", Const, 0, ""}, - {"RLIMIT_CPU", Const, 0, ""}, - {"RLIMIT_CPU_USAGE_MONITOR", Const, 16, ""}, - {"RLIMIT_DATA", Const, 0, ""}, - {"RLIMIT_FSIZE", Const, 0, ""}, - {"RLIMIT_NOFILE", Const, 0, ""}, - {"RLIMIT_STACK", Const, 0, ""}, - {"RLIM_INFINITY", Const, 0, ""}, - {"RTAX_ADVMSS", Const, 0, ""}, - {"RTAX_AUTHOR", Const, 0, ""}, - {"RTAX_BRD", Const, 0, ""}, - {"RTAX_CWND", Const, 0, ""}, - {"RTAX_DST", Const, 0, ""}, - {"RTAX_FEATURES", Const, 0, ""}, - {"RTAX_FEATURE_ALLFRAG", Const, 0, ""}, - {"RTAX_FEATURE_ECN", Const, 0, ""}, - {"RTAX_FEATURE_SACK", Const, 0, ""}, - {"RTAX_FEATURE_TIMESTAMP", Const, 0, ""}, - {"RTAX_GATEWAY", Const, 0, ""}, - {"RTAX_GENMASK", Const, 0, ""}, - {"RTAX_HOPLIMIT", Const, 0, ""}, - {"RTAX_IFA", Const, 0, ""}, - {"RTAX_IFP", Const, 0, ""}, - {"RTAX_INITCWND", Const, 0, ""}, - {"RTAX_INITRWND", Const, 0, ""}, - {"RTAX_LABEL", Const, 1, ""}, - {"RTAX_LOCK", Const, 0, ""}, - {"RTAX_MAX", Const, 0, ""}, - {"RTAX_MTU", Const, 0, ""}, - {"RTAX_NETMASK", Const, 0, ""}, - {"RTAX_REORDERING", Const, 0, ""}, - {"RTAX_RTO_MIN", Const, 0, ""}, - {"RTAX_RTT", Const, 0, ""}, - {"RTAX_RTTVAR", Const, 0, ""}, - {"RTAX_SRC", Const, 1, ""}, - {"RTAX_SRCMASK", Const, 1, ""}, - {"RTAX_SSTHRESH", Const, 0, ""}, - {"RTAX_TAG", Const, 1, ""}, - {"RTAX_UNSPEC", Const, 0, ""}, - {"RTAX_WINDOW", Const, 0, ""}, - {"RTA_ALIGNTO", Const, 0, ""}, - {"RTA_AUTHOR", Const, 0, ""}, - {"RTA_BRD", Const, 0, ""}, - {"RTA_CACHEINFO", Const, 0, ""}, - {"RTA_DST", Const, 0, ""}, - {"RTA_FLOW", Const, 0, ""}, - {"RTA_GATEWAY", Const, 0, ""}, - {"RTA_GENMASK", Const, 0, ""}, - {"RTA_IFA", Const, 0, ""}, - {"RTA_IFP", Const, 0, ""}, - {"RTA_IIF", Const, 0, ""}, - {"RTA_LABEL", Const, 1, ""}, - {"RTA_MAX", Const, 0, ""}, - {"RTA_METRICS", Const, 0, ""}, - {"RTA_MULTIPATH", Const, 0, ""}, - {"RTA_NETMASK", Const, 0, ""}, - {"RTA_OIF", Const, 0, ""}, - {"RTA_PREFSRC", Const, 0, ""}, - {"RTA_PRIORITY", Const, 0, ""}, - {"RTA_SRC", Const, 0, ""}, - {"RTA_SRCMASK", Const, 1, ""}, - {"RTA_TABLE", Const, 0, ""}, - {"RTA_TAG", Const, 1, ""}, - {"RTA_UNSPEC", Const, 0, ""}, - {"RTCF_DIRECTSRC", Const, 0, ""}, - {"RTCF_DOREDIRECT", Const, 0, ""}, - {"RTCF_LOG", Const, 0, ""}, - {"RTCF_MASQ", Const, 0, ""}, - {"RTCF_NAT", Const, 0, ""}, - {"RTCF_VALVE", Const, 0, ""}, - {"RTF_ADDRCLASSMASK", Const, 0, ""}, - {"RTF_ADDRCONF", Const, 0, ""}, - {"RTF_ALLONLINK", Const, 0, ""}, - {"RTF_ANNOUNCE", Const, 1, ""}, - {"RTF_BLACKHOLE", Const, 0, ""}, - {"RTF_BROADCAST", Const, 0, ""}, - {"RTF_CACHE", Const, 0, ""}, - {"RTF_CLONED", Const, 1, ""}, - {"RTF_CLONING", Const, 0, ""}, - {"RTF_CONDEMNED", Const, 0, ""}, - {"RTF_DEFAULT", Const, 0, ""}, - {"RTF_DELCLONE", Const, 0, ""}, - {"RTF_DONE", Const, 0, ""}, - {"RTF_DYNAMIC", Const, 0, ""}, - {"RTF_FLOW", Const, 0, ""}, - {"RTF_FMASK", Const, 0, ""}, - {"RTF_GATEWAY", Const, 0, ""}, - {"RTF_GWFLAG_COMPAT", Const, 3, ""}, - {"RTF_HOST", Const, 0, ""}, - {"RTF_IFREF", Const, 0, ""}, - {"RTF_IFSCOPE", Const, 0, ""}, - {"RTF_INTERFACE", Const, 0, ""}, - {"RTF_IRTT", Const, 0, ""}, - {"RTF_LINKRT", Const, 0, ""}, - {"RTF_LLDATA", Const, 0, ""}, - {"RTF_LLINFO", Const, 0, ""}, - {"RTF_LOCAL", Const, 0, ""}, - {"RTF_MASK", Const, 1, ""}, - {"RTF_MODIFIED", Const, 0, ""}, - {"RTF_MPATH", Const, 1, ""}, - {"RTF_MPLS", Const, 1, ""}, - {"RTF_MSS", Const, 0, ""}, - {"RTF_MTU", Const, 0, ""}, - {"RTF_MULTICAST", Const, 0, ""}, - {"RTF_NAT", Const, 0, ""}, - {"RTF_NOFORWARD", Const, 0, ""}, - {"RTF_NONEXTHOP", Const, 0, ""}, - {"RTF_NOPMTUDISC", Const, 0, ""}, - {"RTF_PERMANENT_ARP", Const, 1, ""}, - {"RTF_PINNED", Const, 0, ""}, - {"RTF_POLICY", Const, 0, ""}, - {"RTF_PRCLONING", Const, 0, ""}, - {"RTF_PROTO1", Const, 0, ""}, - {"RTF_PROTO2", Const, 0, ""}, - {"RTF_PROTO3", Const, 0, ""}, - {"RTF_PROXY", Const, 16, ""}, - {"RTF_REINSTATE", Const, 0, ""}, - {"RTF_REJECT", Const, 0, ""}, - {"RTF_RNH_LOCKED", Const, 0, ""}, - {"RTF_ROUTER", Const, 16, ""}, - {"RTF_SOURCE", Const, 1, ""}, - {"RTF_SRC", Const, 1, ""}, - {"RTF_STATIC", Const, 0, ""}, - {"RTF_STICKY", Const, 0, ""}, - {"RTF_THROW", Const, 0, ""}, - {"RTF_TUNNEL", Const, 1, ""}, - {"RTF_UP", Const, 0, ""}, - {"RTF_USETRAILERS", Const, 1, ""}, - {"RTF_WASCLONED", Const, 0, ""}, - {"RTF_WINDOW", Const, 0, ""}, - {"RTF_XRESOLVE", Const, 0, ""}, - {"RTM_ADD", Const, 0, ""}, - {"RTM_BASE", Const, 0, ""}, - {"RTM_CHANGE", Const, 0, ""}, - {"RTM_CHGADDR", Const, 1, ""}, - {"RTM_DELACTION", Const, 0, ""}, - {"RTM_DELADDR", Const, 0, ""}, - {"RTM_DELADDRLABEL", Const, 0, ""}, - {"RTM_DELETE", Const, 0, ""}, - {"RTM_DELLINK", Const, 0, ""}, - {"RTM_DELMADDR", Const, 0, ""}, - {"RTM_DELNEIGH", Const, 0, ""}, - {"RTM_DELQDISC", Const, 0, ""}, - {"RTM_DELROUTE", Const, 0, ""}, - {"RTM_DELRULE", Const, 0, ""}, - {"RTM_DELTCLASS", Const, 0, ""}, - {"RTM_DELTFILTER", Const, 0, ""}, - {"RTM_DESYNC", Const, 1, ""}, - {"RTM_F_CLONED", Const, 0, ""}, - {"RTM_F_EQUALIZE", Const, 0, ""}, - {"RTM_F_NOTIFY", Const, 0, ""}, - {"RTM_F_PREFIX", Const, 0, ""}, - {"RTM_GET", Const, 0, ""}, - {"RTM_GET2", Const, 0, ""}, - {"RTM_GETACTION", Const, 0, ""}, - {"RTM_GETADDR", Const, 0, ""}, - {"RTM_GETADDRLABEL", Const, 0, ""}, - {"RTM_GETANYCAST", Const, 0, ""}, - {"RTM_GETDCB", Const, 0, ""}, - {"RTM_GETLINK", Const, 0, ""}, - {"RTM_GETMULTICAST", Const, 0, ""}, - {"RTM_GETNEIGH", Const, 0, ""}, - {"RTM_GETNEIGHTBL", Const, 0, ""}, - {"RTM_GETQDISC", Const, 0, ""}, - {"RTM_GETROUTE", Const, 0, ""}, - {"RTM_GETRULE", Const, 0, ""}, - {"RTM_GETTCLASS", Const, 0, ""}, - {"RTM_GETTFILTER", Const, 0, ""}, - {"RTM_IEEE80211", Const, 0, ""}, - {"RTM_IFANNOUNCE", Const, 0, ""}, - {"RTM_IFINFO", Const, 0, ""}, - {"RTM_IFINFO2", Const, 0, ""}, - {"RTM_LLINFO_UPD", Const, 1, ""}, - {"RTM_LOCK", Const, 0, ""}, - {"RTM_LOSING", Const, 0, ""}, - {"RTM_MAX", Const, 0, ""}, - {"RTM_MAXSIZE", Const, 1, ""}, - {"RTM_MISS", Const, 0, ""}, - {"RTM_NEWACTION", Const, 0, ""}, - {"RTM_NEWADDR", Const, 0, ""}, - {"RTM_NEWADDRLABEL", Const, 0, ""}, - {"RTM_NEWLINK", Const, 0, ""}, - {"RTM_NEWMADDR", Const, 0, ""}, - {"RTM_NEWMADDR2", Const, 0, ""}, - {"RTM_NEWNDUSEROPT", Const, 0, ""}, - {"RTM_NEWNEIGH", Const, 0, ""}, - {"RTM_NEWNEIGHTBL", Const, 0, ""}, - {"RTM_NEWPREFIX", Const, 0, ""}, - {"RTM_NEWQDISC", Const, 0, ""}, - {"RTM_NEWROUTE", Const, 0, ""}, - {"RTM_NEWRULE", Const, 0, ""}, - {"RTM_NEWTCLASS", Const, 0, ""}, - {"RTM_NEWTFILTER", Const, 0, ""}, - {"RTM_NR_FAMILIES", Const, 0, ""}, - {"RTM_NR_MSGTYPES", Const, 0, ""}, - {"RTM_OIFINFO", Const, 1, ""}, - {"RTM_OLDADD", Const, 0, ""}, - {"RTM_OLDDEL", Const, 0, ""}, - {"RTM_OOIFINFO", Const, 1, ""}, - {"RTM_REDIRECT", Const, 0, ""}, - {"RTM_RESOLVE", Const, 0, ""}, - {"RTM_RTTUNIT", Const, 0, ""}, - {"RTM_SETDCB", Const, 0, ""}, - {"RTM_SETGATE", Const, 1, ""}, - {"RTM_SETLINK", Const, 0, ""}, - {"RTM_SETNEIGHTBL", Const, 0, ""}, - {"RTM_VERSION", Const, 0, ""}, - {"RTNH_ALIGNTO", Const, 0, ""}, - {"RTNH_F_DEAD", Const, 0, ""}, - {"RTNH_F_ONLINK", Const, 0, ""}, - {"RTNH_F_PERVASIVE", Const, 0, ""}, - {"RTNLGRP_IPV4_IFADDR", Const, 1, ""}, - {"RTNLGRP_IPV4_MROUTE", Const, 1, ""}, - {"RTNLGRP_IPV4_ROUTE", Const, 1, ""}, - {"RTNLGRP_IPV4_RULE", Const, 1, ""}, - {"RTNLGRP_IPV6_IFADDR", Const, 1, ""}, - {"RTNLGRP_IPV6_IFINFO", Const, 1, ""}, - {"RTNLGRP_IPV6_MROUTE", Const, 1, ""}, - {"RTNLGRP_IPV6_PREFIX", Const, 1, ""}, - {"RTNLGRP_IPV6_ROUTE", Const, 1, ""}, - {"RTNLGRP_IPV6_RULE", Const, 1, ""}, - {"RTNLGRP_LINK", Const, 1, ""}, - {"RTNLGRP_ND_USEROPT", Const, 1, ""}, - {"RTNLGRP_NEIGH", Const, 1, ""}, - {"RTNLGRP_NONE", Const, 1, ""}, - {"RTNLGRP_NOTIFY", Const, 1, ""}, - {"RTNLGRP_TC", Const, 1, ""}, - {"RTN_ANYCAST", Const, 0, ""}, - {"RTN_BLACKHOLE", Const, 0, ""}, - {"RTN_BROADCAST", Const, 0, ""}, - {"RTN_LOCAL", Const, 0, ""}, - {"RTN_MAX", Const, 0, ""}, - {"RTN_MULTICAST", Const, 0, ""}, - {"RTN_NAT", Const, 0, ""}, - {"RTN_PROHIBIT", Const, 0, ""}, - {"RTN_THROW", Const, 0, ""}, - {"RTN_UNICAST", Const, 0, ""}, - {"RTN_UNREACHABLE", Const, 0, ""}, - {"RTN_UNSPEC", Const, 0, ""}, - {"RTN_XRESOLVE", Const, 0, ""}, - {"RTPROT_BIRD", Const, 0, ""}, - {"RTPROT_BOOT", Const, 0, ""}, - {"RTPROT_DHCP", Const, 0, ""}, - {"RTPROT_DNROUTED", Const, 0, ""}, - {"RTPROT_GATED", Const, 0, ""}, - {"RTPROT_KERNEL", Const, 0, ""}, - {"RTPROT_MRT", Const, 0, ""}, - {"RTPROT_NTK", Const, 0, ""}, - {"RTPROT_RA", Const, 0, ""}, - {"RTPROT_REDIRECT", Const, 0, ""}, - {"RTPROT_STATIC", Const, 0, ""}, - {"RTPROT_UNSPEC", Const, 0, ""}, - {"RTPROT_XORP", Const, 0, ""}, - {"RTPROT_ZEBRA", Const, 0, ""}, - {"RTV_EXPIRE", Const, 0, ""}, - {"RTV_HOPCOUNT", Const, 0, ""}, - {"RTV_MTU", Const, 0, ""}, - {"RTV_RPIPE", Const, 0, ""}, - {"RTV_RTT", Const, 0, ""}, - {"RTV_RTTVAR", Const, 0, ""}, - {"RTV_SPIPE", Const, 0, ""}, - {"RTV_SSTHRESH", Const, 0, ""}, - {"RTV_WEIGHT", Const, 0, ""}, - {"RT_CACHING_CONTEXT", Const, 1, ""}, - {"RT_CLASS_DEFAULT", Const, 0, ""}, - {"RT_CLASS_LOCAL", Const, 0, ""}, - {"RT_CLASS_MAIN", Const, 0, ""}, - {"RT_CLASS_MAX", Const, 0, ""}, - {"RT_CLASS_UNSPEC", Const, 0, ""}, - {"RT_DEFAULT_FIB", Const, 1, ""}, - {"RT_NORTREF", Const, 1, ""}, - {"RT_SCOPE_HOST", Const, 0, ""}, - {"RT_SCOPE_LINK", Const, 0, ""}, - {"RT_SCOPE_NOWHERE", Const, 0, ""}, - {"RT_SCOPE_SITE", Const, 0, ""}, - {"RT_SCOPE_UNIVERSE", Const, 0, ""}, - {"RT_TABLEID_MAX", Const, 1, ""}, - {"RT_TABLE_COMPAT", Const, 0, ""}, - {"RT_TABLE_DEFAULT", Const, 0, ""}, - {"RT_TABLE_LOCAL", Const, 0, ""}, - {"RT_TABLE_MAIN", Const, 0, ""}, - {"RT_TABLE_MAX", Const, 0, ""}, - {"RT_TABLE_UNSPEC", Const, 0, ""}, - {"RUSAGE_CHILDREN", Const, 0, ""}, - {"RUSAGE_SELF", Const, 0, ""}, - {"RUSAGE_THREAD", Const, 0, ""}, - {"Radvisory_t", Type, 0, ""}, - {"Radvisory_t.Count", Field, 0, ""}, - {"Radvisory_t.Offset", Field, 0, ""}, - {"Radvisory_t.Pad_cgo_0", Field, 0, ""}, - {"RawConn", Type, 9, ""}, - {"RawSockaddr", Type, 0, ""}, - {"RawSockaddr.Data", Field, 0, ""}, - {"RawSockaddr.Family", Field, 0, ""}, - {"RawSockaddr.Len", Field, 0, ""}, - {"RawSockaddrAny", Type, 0, ""}, - {"RawSockaddrAny.Addr", Field, 0, ""}, - {"RawSockaddrAny.Pad", Field, 0, ""}, - {"RawSockaddrDatalink", Type, 0, ""}, - {"RawSockaddrDatalink.Alen", Field, 0, ""}, - {"RawSockaddrDatalink.Data", Field, 0, ""}, - {"RawSockaddrDatalink.Family", Field, 0, ""}, - {"RawSockaddrDatalink.Index", Field, 0, ""}, - {"RawSockaddrDatalink.Len", Field, 0, ""}, - {"RawSockaddrDatalink.Nlen", Field, 0, ""}, - {"RawSockaddrDatalink.Pad_cgo_0", Field, 2, ""}, - {"RawSockaddrDatalink.Slen", Field, 0, ""}, - {"RawSockaddrDatalink.Type", Field, 0, ""}, - {"RawSockaddrInet4", Type, 0, ""}, - {"RawSockaddrInet4.Addr", Field, 0, ""}, - {"RawSockaddrInet4.Family", Field, 0, ""}, - {"RawSockaddrInet4.Len", Field, 0, ""}, - {"RawSockaddrInet4.Port", Field, 0, ""}, - {"RawSockaddrInet4.Zero", Field, 0, ""}, - {"RawSockaddrInet6", Type, 0, ""}, - {"RawSockaddrInet6.Addr", Field, 0, ""}, - {"RawSockaddrInet6.Family", Field, 0, ""}, - {"RawSockaddrInet6.Flowinfo", Field, 0, ""}, - {"RawSockaddrInet6.Len", Field, 0, ""}, - {"RawSockaddrInet6.Port", Field, 0, ""}, - {"RawSockaddrInet6.Scope_id", Field, 0, ""}, - {"RawSockaddrLinklayer", Type, 0, ""}, - {"RawSockaddrLinklayer.Addr", Field, 0, ""}, - {"RawSockaddrLinklayer.Family", Field, 0, ""}, - {"RawSockaddrLinklayer.Halen", Field, 0, ""}, - {"RawSockaddrLinklayer.Hatype", Field, 0, ""}, - {"RawSockaddrLinklayer.Ifindex", Field, 0, ""}, - {"RawSockaddrLinklayer.Pkttype", Field, 0, ""}, - {"RawSockaddrLinklayer.Protocol", Field, 0, ""}, - {"RawSockaddrNetlink", Type, 0, ""}, - {"RawSockaddrNetlink.Family", Field, 0, ""}, - {"RawSockaddrNetlink.Groups", Field, 0, ""}, - {"RawSockaddrNetlink.Pad", Field, 0, ""}, - {"RawSockaddrNetlink.Pid", Field, 0, ""}, - {"RawSockaddrUnix", Type, 0, ""}, - {"RawSockaddrUnix.Family", Field, 0, ""}, - {"RawSockaddrUnix.Len", Field, 0, ""}, - {"RawSockaddrUnix.Pad_cgo_0", Field, 2, ""}, - {"RawSockaddrUnix.Path", Field, 0, ""}, - {"RawSyscall", Func, 0, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"RawSyscall6", Func, 0, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"Read", Func, 0, "func(fd int, p []byte) (n int, err error)"}, - {"ReadConsole", Func, 1, ""}, - {"ReadDirectoryChanges", Func, 0, ""}, - {"ReadDirent", Func, 0, "func(fd int, buf []byte) (n int, err error)"}, - {"ReadFile", Func, 0, ""}, - {"Readlink", Func, 0, "func(path string, buf []byte) (n int, err error)"}, - {"Reboot", Func, 0, "func(cmd int) (err error)"}, - {"Recvfrom", Func, 0, "func(fd int, p []byte, flags int) (n int, from Sockaddr, err error)"}, - {"Recvmsg", Func, 0, "func(fd int, p []byte, oob []byte, flags int) (n int, oobn int, recvflags int, from Sockaddr, err error)"}, - {"RegCloseKey", Func, 0, ""}, - {"RegEnumKeyEx", Func, 0, ""}, - {"RegOpenKeyEx", Func, 0, ""}, - {"RegQueryInfoKey", Func, 0, ""}, - {"RegQueryValueEx", Func, 0, ""}, - {"RemoveDirectory", Func, 0, ""}, - {"Removexattr", Func, 1, "func(path string, attr string) (err error)"}, - {"Rename", Func, 0, "func(oldpath string, newpath string) (err error)"}, - {"Renameat", Func, 0, "func(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)"}, - {"Revoke", Func, 0, ""}, - {"Rlimit", Type, 0, ""}, - {"Rlimit.Cur", Field, 0, ""}, - {"Rlimit.Max", Field, 0, ""}, - {"Rmdir", Func, 0, "func(path string) error"}, - {"RouteMessage", Type, 0, ""}, - {"RouteMessage.Data", Field, 0, ""}, - {"RouteMessage.Header", Field, 0, ""}, - {"RouteRIB", Func, 0, ""}, - {"RoutingMessage", Type, 14, ""}, - {"RtAttr", Type, 0, ""}, - {"RtAttr.Len", Field, 0, ""}, - {"RtAttr.Type", Field, 0, ""}, - {"RtGenmsg", Type, 0, ""}, - {"RtGenmsg.Family", Field, 0, ""}, - {"RtMetrics", Type, 0, ""}, - {"RtMetrics.Expire", Field, 0, ""}, - {"RtMetrics.Filler", Field, 0, ""}, - {"RtMetrics.Hopcount", Field, 0, ""}, - {"RtMetrics.Locks", Field, 0, ""}, - {"RtMetrics.Mtu", Field, 0, ""}, - {"RtMetrics.Pad", Field, 3, ""}, - {"RtMetrics.Pksent", Field, 0, ""}, - {"RtMetrics.Recvpipe", Field, 0, ""}, - {"RtMetrics.Refcnt", Field, 2, ""}, - {"RtMetrics.Rtt", Field, 0, ""}, - {"RtMetrics.Rttvar", Field, 0, ""}, - {"RtMetrics.Sendpipe", Field, 0, ""}, - {"RtMetrics.Ssthresh", Field, 0, ""}, - {"RtMetrics.Weight", Field, 0, ""}, - {"RtMsg", Type, 0, ""}, - {"RtMsg.Dst_len", Field, 0, ""}, - {"RtMsg.Family", Field, 0, ""}, - {"RtMsg.Flags", Field, 0, ""}, - {"RtMsg.Protocol", Field, 0, ""}, - {"RtMsg.Scope", Field, 0, ""}, - {"RtMsg.Src_len", Field, 0, ""}, - {"RtMsg.Table", Field, 0, ""}, - {"RtMsg.Tos", Field, 0, ""}, - {"RtMsg.Type", Field, 0, ""}, - {"RtMsghdr", Type, 0, ""}, - {"RtMsghdr.Addrs", Field, 0, ""}, - {"RtMsghdr.Errno", Field, 0, ""}, - {"RtMsghdr.Flags", Field, 0, ""}, - {"RtMsghdr.Fmask", Field, 0, ""}, - {"RtMsghdr.Hdrlen", Field, 2, ""}, - {"RtMsghdr.Index", Field, 0, ""}, - {"RtMsghdr.Inits", Field, 0, ""}, - {"RtMsghdr.Mpls", Field, 2, ""}, - {"RtMsghdr.Msglen", Field, 0, ""}, - {"RtMsghdr.Pad_cgo_0", Field, 0, ""}, - {"RtMsghdr.Pad_cgo_1", Field, 2, ""}, - {"RtMsghdr.Pid", Field, 0, ""}, - {"RtMsghdr.Priority", Field, 2, ""}, - {"RtMsghdr.Rmx", Field, 0, ""}, - {"RtMsghdr.Seq", Field, 0, ""}, - {"RtMsghdr.Tableid", Field, 2, ""}, - {"RtMsghdr.Type", Field, 0, ""}, - {"RtMsghdr.Use", Field, 0, ""}, - {"RtMsghdr.Version", Field, 0, ""}, - {"RtNexthop", Type, 0, ""}, - {"RtNexthop.Flags", Field, 0, ""}, - {"RtNexthop.Hops", Field, 0, ""}, - {"RtNexthop.Ifindex", Field, 0, ""}, - {"RtNexthop.Len", Field, 0, ""}, - {"Rusage", Type, 0, ""}, - {"Rusage.CreationTime", Field, 0, ""}, - {"Rusage.ExitTime", Field, 0, ""}, - {"Rusage.Idrss", Field, 0, ""}, - {"Rusage.Inblock", Field, 0, ""}, - {"Rusage.Isrss", Field, 0, ""}, - {"Rusage.Ixrss", Field, 0, ""}, - {"Rusage.KernelTime", Field, 0, ""}, - {"Rusage.Majflt", Field, 0, ""}, - {"Rusage.Maxrss", Field, 0, ""}, - {"Rusage.Minflt", Field, 0, ""}, - {"Rusage.Msgrcv", Field, 0, ""}, - {"Rusage.Msgsnd", Field, 0, ""}, - {"Rusage.Nivcsw", Field, 0, ""}, - {"Rusage.Nsignals", Field, 0, ""}, - {"Rusage.Nswap", Field, 0, ""}, - {"Rusage.Nvcsw", Field, 0, ""}, - {"Rusage.Oublock", Field, 0, ""}, - {"Rusage.Stime", Field, 0, ""}, - {"Rusage.UserTime", Field, 0, ""}, - {"Rusage.Utime", Field, 0, ""}, - {"SCM_BINTIME", Const, 0, ""}, - {"SCM_CREDENTIALS", Const, 0, ""}, - {"SCM_CREDS", Const, 0, ""}, - {"SCM_RIGHTS", Const, 0, ""}, - {"SCM_TIMESTAMP", Const, 0, ""}, - {"SCM_TIMESTAMPING", Const, 0, ""}, - {"SCM_TIMESTAMPNS", Const, 0, ""}, - {"SCM_TIMESTAMP_MONOTONIC", Const, 0, ""}, - {"SHUT_RD", Const, 0, ""}, - {"SHUT_RDWR", Const, 0, ""}, - {"SHUT_WR", Const, 0, ""}, - {"SID", Type, 0, ""}, - {"SIDAndAttributes", Type, 0, ""}, - {"SIDAndAttributes.Attributes", Field, 0, ""}, - {"SIDAndAttributes.Sid", Field, 0, ""}, - {"SIGABRT", Const, 0, ""}, - {"SIGALRM", Const, 0, ""}, - {"SIGBUS", Const, 0, ""}, - {"SIGCHLD", Const, 0, ""}, - {"SIGCLD", Const, 0, ""}, - {"SIGCONT", Const, 0, ""}, - {"SIGEMT", Const, 0, ""}, - {"SIGFPE", Const, 0, ""}, - {"SIGHUP", Const, 0, ""}, - {"SIGILL", Const, 0, ""}, - {"SIGINFO", Const, 0, ""}, - {"SIGINT", Const, 0, ""}, - {"SIGIO", Const, 0, ""}, - {"SIGIOT", Const, 0, ""}, - {"SIGKILL", Const, 0, ""}, - {"SIGLIBRT", Const, 1, ""}, - {"SIGLWP", Const, 0, ""}, - {"SIGPIPE", Const, 0, ""}, - {"SIGPOLL", Const, 0, ""}, - {"SIGPROF", Const, 0, ""}, - {"SIGPWR", Const, 0, ""}, - {"SIGQUIT", Const, 0, ""}, - {"SIGSEGV", Const, 0, ""}, - {"SIGSTKFLT", Const, 0, ""}, - {"SIGSTOP", Const, 0, ""}, - {"SIGSYS", Const, 0, ""}, - {"SIGTERM", Const, 0, ""}, - {"SIGTHR", Const, 0, ""}, - {"SIGTRAP", Const, 0, ""}, - {"SIGTSTP", Const, 0, ""}, - {"SIGTTIN", Const, 0, ""}, - {"SIGTTOU", Const, 0, ""}, - {"SIGUNUSED", Const, 0, ""}, - {"SIGURG", Const, 0, ""}, - {"SIGUSR1", Const, 0, ""}, - {"SIGUSR2", Const, 0, ""}, - {"SIGVTALRM", Const, 0, ""}, - {"SIGWINCH", Const, 0, ""}, - {"SIGXCPU", Const, 0, ""}, - {"SIGXFSZ", Const, 0, ""}, - {"SIOCADDDLCI", Const, 0, ""}, - {"SIOCADDMULTI", Const, 0, ""}, - {"SIOCADDRT", Const, 0, ""}, - {"SIOCAIFADDR", Const, 0, ""}, - {"SIOCAIFGROUP", Const, 0, ""}, - {"SIOCALIFADDR", Const, 0, ""}, - {"SIOCARPIPLL", Const, 0, ""}, - {"SIOCATMARK", Const, 0, ""}, - {"SIOCAUTOADDR", Const, 0, ""}, - {"SIOCAUTONETMASK", Const, 0, ""}, - {"SIOCBRDGADD", Const, 1, ""}, - {"SIOCBRDGADDS", Const, 1, ""}, - {"SIOCBRDGARL", Const, 1, ""}, - {"SIOCBRDGDADDR", Const, 1, ""}, - {"SIOCBRDGDEL", Const, 1, ""}, - {"SIOCBRDGDELS", Const, 1, ""}, - {"SIOCBRDGFLUSH", Const, 1, ""}, - {"SIOCBRDGFRL", Const, 1, ""}, - {"SIOCBRDGGCACHE", Const, 1, ""}, - {"SIOCBRDGGFD", Const, 1, ""}, - {"SIOCBRDGGHT", Const, 1, ""}, - {"SIOCBRDGGIFFLGS", Const, 1, ""}, - {"SIOCBRDGGMA", Const, 1, ""}, - {"SIOCBRDGGPARAM", Const, 1, ""}, - {"SIOCBRDGGPRI", Const, 1, ""}, - {"SIOCBRDGGRL", Const, 1, ""}, - {"SIOCBRDGGSIFS", Const, 1, ""}, - {"SIOCBRDGGTO", Const, 1, ""}, - {"SIOCBRDGIFS", Const, 1, ""}, - {"SIOCBRDGRTS", Const, 1, ""}, - {"SIOCBRDGSADDR", Const, 1, ""}, - {"SIOCBRDGSCACHE", Const, 1, ""}, - {"SIOCBRDGSFD", Const, 1, ""}, - {"SIOCBRDGSHT", Const, 1, ""}, - {"SIOCBRDGSIFCOST", Const, 1, ""}, - {"SIOCBRDGSIFFLGS", Const, 1, ""}, - {"SIOCBRDGSIFPRIO", Const, 1, ""}, - {"SIOCBRDGSMA", Const, 1, ""}, - {"SIOCBRDGSPRI", Const, 1, ""}, - {"SIOCBRDGSPROTO", Const, 1, ""}, - {"SIOCBRDGSTO", Const, 1, ""}, - {"SIOCBRDGSTXHC", Const, 1, ""}, - {"SIOCDARP", Const, 0, ""}, - {"SIOCDELDLCI", Const, 0, ""}, - {"SIOCDELMULTI", Const, 0, ""}, - {"SIOCDELRT", Const, 0, ""}, - {"SIOCDEVPRIVATE", Const, 0, ""}, - {"SIOCDIFADDR", Const, 0, ""}, - {"SIOCDIFGROUP", Const, 0, ""}, - {"SIOCDIFPHYADDR", Const, 0, ""}, - {"SIOCDLIFADDR", Const, 0, ""}, - {"SIOCDRARP", Const, 0, ""}, - {"SIOCGARP", Const, 0, ""}, - {"SIOCGDRVSPEC", Const, 0, ""}, - {"SIOCGETKALIVE", Const, 1, ""}, - {"SIOCGETLABEL", Const, 1, ""}, - {"SIOCGETPFLOW", Const, 1, ""}, - {"SIOCGETPFSYNC", Const, 1, ""}, - {"SIOCGETSGCNT", Const, 0, ""}, - {"SIOCGETVIFCNT", Const, 0, ""}, - {"SIOCGETVLAN", Const, 0, ""}, - {"SIOCGHIWAT", Const, 0, ""}, - {"SIOCGIFADDR", Const, 0, ""}, - {"SIOCGIFADDRPREF", Const, 1, ""}, - {"SIOCGIFALIAS", Const, 1, ""}, - {"SIOCGIFALTMTU", Const, 0, ""}, - {"SIOCGIFASYNCMAP", Const, 0, ""}, - {"SIOCGIFBOND", Const, 0, ""}, - {"SIOCGIFBR", Const, 0, ""}, - {"SIOCGIFBRDADDR", Const, 0, ""}, - {"SIOCGIFCAP", Const, 0, ""}, - {"SIOCGIFCONF", Const, 0, ""}, - {"SIOCGIFCOUNT", Const, 0, ""}, - {"SIOCGIFDATA", Const, 1, ""}, - {"SIOCGIFDESCR", Const, 0, ""}, - {"SIOCGIFDEVMTU", Const, 0, ""}, - {"SIOCGIFDLT", Const, 1, ""}, - {"SIOCGIFDSTADDR", Const, 0, ""}, - {"SIOCGIFENCAP", Const, 0, ""}, - {"SIOCGIFFIB", Const, 1, ""}, - {"SIOCGIFFLAGS", Const, 0, ""}, - {"SIOCGIFGATTR", Const, 1, ""}, - {"SIOCGIFGENERIC", Const, 0, ""}, - {"SIOCGIFGMEMB", Const, 0, ""}, - {"SIOCGIFGROUP", Const, 0, ""}, - {"SIOCGIFHARDMTU", Const, 3, ""}, - {"SIOCGIFHWADDR", Const, 0, ""}, - {"SIOCGIFINDEX", Const, 0, ""}, - {"SIOCGIFKPI", Const, 0, ""}, - {"SIOCGIFMAC", Const, 0, ""}, - {"SIOCGIFMAP", Const, 0, ""}, - {"SIOCGIFMEDIA", Const, 0, ""}, - {"SIOCGIFMEM", Const, 0, ""}, - {"SIOCGIFMETRIC", Const, 0, ""}, - {"SIOCGIFMTU", Const, 0, ""}, - {"SIOCGIFNAME", Const, 0, ""}, - {"SIOCGIFNETMASK", Const, 0, ""}, - {"SIOCGIFPDSTADDR", Const, 0, ""}, - {"SIOCGIFPFLAGS", Const, 0, ""}, - {"SIOCGIFPHYS", Const, 0, ""}, - {"SIOCGIFPRIORITY", Const, 1, ""}, - {"SIOCGIFPSRCADDR", Const, 0, ""}, - {"SIOCGIFRDOMAIN", Const, 1, ""}, - {"SIOCGIFRTLABEL", Const, 1, ""}, - {"SIOCGIFSLAVE", Const, 0, ""}, - {"SIOCGIFSTATUS", Const, 0, ""}, - {"SIOCGIFTIMESLOT", Const, 1, ""}, - {"SIOCGIFTXQLEN", Const, 0, ""}, - {"SIOCGIFVLAN", Const, 0, ""}, - {"SIOCGIFWAKEFLAGS", Const, 0, ""}, - {"SIOCGIFXFLAGS", Const, 1, ""}, - {"SIOCGLIFADDR", Const, 0, ""}, - {"SIOCGLIFPHYADDR", Const, 0, ""}, - {"SIOCGLIFPHYRTABLE", Const, 1, ""}, - {"SIOCGLIFPHYTTL", Const, 3, ""}, - {"SIOCGLINKSTR", Const, 1, ""}, - {"SIOCGLOWAT", Const, 0, ""}, - {"SIOCGPGRP", Const, 0, ""}, - {"SIOCGPRIVATE_0", Const, 0, ""}, - {"SIOCGPRIVATE_1", Const, 0, ""}, - {"SIOCGRARP", Const, 0, ""}, - {"SIOCGSPPPPARAMS", Const, 3, ""}, - {"SIOCGSTAMP", Const, 0, ""}, - {"SIOCGSTAMPNS", Const, 0, ""}, - {"SIOCGVH", Const, 1, ""}, - {"SIOCGVNETID", Const, 3, ""}, - {"SIOCIFCREATE", Const, 0, ""}, - {"SIOCIFCREATE2", Const, 0, ""}, - {"SIOCIFDESTROY", Const, 0, ""}, - {"SIOCIFGCLONERS", Const, 0, ""}, - {"SIOCINITIFADDR", Const, 1, ""}, - {"SIOCPROTOPRIVATE", Const, 0, ""}, - {"SIOCRSLVMULTI", Const, 0, ""}, - {"SIOCRTMSG", Const, 0, ""}, - {"SIOCSARP", Const, 0, ""}, - {"SIOCSDRVSPEC", Const, 0, ""}, - {"SIOCSETKALIVE", Const, 1, ""}, - {"SIOCSETLABEL", Const, 1, ""}, - {"SIOCSETPFLOW", Const, 1, ""}, - {"SIOCSETPFSYNC", Const, 1, ""}, - {"SIOCSETVLAN", Const, 0, ""}, - {"SIOCSHIWAT", Const, 0, ""}, - {"SIOCSIFADDR", Const, 0, ""}, - {"SIOCSIFADDRPREF", Const, 1, ""}, - {"SIOCSIFALTMTU", Const, 0, ""}, - {"SIOCSIFASYNCMAP", Const, 0, ""}, - {"SIOCSIFBOND", Const, 0, ""}, - {"SIOCSIFBR", Const, 0, ""}, - {"SIOCSIFBRDADDR", Const, 0, ""}, - {"SIOCSIFCAP", Const, 0, ""}, - {"SIOCSIFDESCR", Const, 0, ""}, - {"SIOCSIFDSTADDR", Const, 0, ""}, - {"SIOCSIFENCAP", Const, 0, ""}, - {"SIOCSIFFIB", Const, 1, ""}, - {"SIOCSIFFLAGS", Const, 0, ""}, - {"SIOCSIFGATTR", Const, 1, ""}, - {"SIOCSIFGENERIC", Const, 0, ""}, - {"SIOCSIFHWADDR", Const, 0, ""}, - {"SIOCSIFHWBROADCAST", Const, 0, ""}, - {"SIOCSIFKPI", Const, 0, ""}, - {"SIOCSIFLINK", Const, 0, ""}, - {"SIOCSIFLLADDR", Const, 0, ""}, - {"SIOCSIFMAC", Const, 0, ""}, - {"SIOCSIFMAP", Const, 0, ""}, - {"SIOCSIFMEDIA", Const, 0, ""}, - {"SIOCSIFMEM", Const, 0, ""}, - {"SIOCSIFMETRIC", Const, 0, ""}, - {"SIOCSIFMTU", Const, 0, ""}, - {"SIOCSIFNAME", Const, 0, ""}, - {"SIOCSIFNETMASK", Const, 0, ""}, - {"SIOCSIFPFLAGS", Const, 0, ""}, - {"SIOCSIFPHYADDR", Const, 0, ""}, - {"SIOCSIFPHYS", Const, 0, ""}, - {"SIOCSIFPRIORITY", Const, 1, ""}, - {"SIOCSIFRDOMAIN", Const, 1, ""}, - {"SIOCSIFRTLABEL", Const, 1, ""}, - {"SIOCSIFRVNET", Const, 0, ""}, - {"SIOCSIFSLAVE", Const, 0, ""}, - {"SIOCSIFTIMESLOT", Const, 1, ""}, - {"SIOCSIFTXQLEN", Const, 0, ""}, - {"SIOCSIFVLAN", Const, 0, ""}, - {"SIOCSIFVNET", Const, 0, ""}, - {"SIOCSIFXFLAGS", Const, 1, ""}, - {"SIOCSLIFPHYADDR", Const, 0, ""}, - {"SIOCSLIFPHYRTABLE", Const, 1, ""}, - {"SIOCSLIFPHYTTL", Const, 3, ""}, - {"SIOCSLINKSTR", Const, 1, ""}, - {"SIOCSLOWAT", Const, 0, ""}, - {"SIOCSPGRP", Const, 0, ""}, - {"SIOCSRARP", Const, 0, ""}, - {"SIOCSSPPPPARAMS", Const, 3, ""}, - {"SIOCSVH", Const, 1, ""}, - {"SIOCSVNETID", Const, 3, ""}, - {"SIOCZIFDATA", Const, 1, ""}, - {"SIO_GET_EXTENSION_FUNCTION_POINTER", Const, 1, ""}, - {"SIO_GET_INTERFACE_LIST", Const, 0, ""}, - {"SIO_KEEPALIVE_VALS", Const, 3, ""}, - {"SIO_UDP_CONNRESET", Const, 4, ""}, - {"SOCK_CLOEXEC", Const, 0, ""}, - {"SOCK_DCCP", Const, 0, ""}, - {"SOCK_DGRAM", Const, 0, ""}, - {"SOCK_FLAGS_MASK", Const, 1, ""}, - {"SOCK_MAXADDRLEN", Const, 0, ""}, - {"SOCK_NONBLOCK", Const, 0, ""}, - {"SOCK_NOSIGPIPE", Const, 1, ""}, - {"SOCK_PACKET", Const, 0, ""}, - {"SOCK_RAW", Const, 0, ""}, - {"SOCK_RDM", Const, 0, ""}, - {"SOCK_SEQPACKET", Const, 0, ""}, - {"SOCK_STREAM", Const, 0, ""}, - {"SOL_AAL", Const, 0, ""}, - {"SOL_ATM", Const, 0, ""}, - {"SOL_DECNET", Const, 0, ""}, - {"SOL_ICMPV6", Const, 0, ""}, - {"SOL_IP", Const, 0, ""}, - {"SOL_IPV6", Const, 0, ""}, - {"SOL_IRDA", Const, 0, ""}, - {"SOL_PACKET", Const, 0, ""}, - {"SOL_RAW", Const, 0, ""}, - {"SOL_SOCKET", Const, 0, ""}, - {"SOL_TCP", Const, 0, ""}, - {"SOL_X25", Const, 0, ""}, - {"SOMAXCONN", Const, 0, ""}, - {"SO_ACCEPTCONN", Const, 0, ""}, - {"SO_ACCEPTFILTER", Const, 0, ""}, - {"SO_ATTACH_FILTER", Const, 0, ""}, - {"SO_BINDANY", Const, 1, ""}, - {"SO_BINDTODEVICE", Const, 0, ""}, - {"SO_BINTIME", Const, 0, ""}, - {"SO_BROADCAST", Const, 0, ""}, - {"SO_BSDCOMPAT", Const, 0, ""}, - {"SO_DEBUG", Const, 0, ""}, - {"SO_DETACH_FILTER", Const, 0, ""}, - {"SO_DOMAIN", Const, 0, ""}, - {"SO_DONTROUTE", Const, 0, ""}, - {"SO_DONTTRUNC", Const, 0, ""}, - {"SO_ERROR", Const, 0, ""}, - {"SO_KEEPALIVE", Const, 0, ""}, - {"SO_LABEL", Const, 0, ""}, - {"SO_LINGER", Const, 0, ""}, - {"SO_LINGER_SEC", Const, 0, ""}, - {"SO_LISTENINCQLEN", Const, 0, ""}, - {"SO_LISTENQLEN", Const, 0, ""}, - {"SO_LISTENQLIMIT", Const, 0, ""}, - {"SO_MARK", Const, 0, ""}, - {"SO_NETPROC", Const, 1, ""}, - {"SO_NKE", Const, 0, ""}, - {"SO_NOADDRERR", Const, 0, ""}, - {"SO_NOHEADER", Const, 1, ""}, - {"SO_NOSIGPIPE", Const, 0, ""}, - {"SO_NOTIFYCONFLICT", Const, 0, ""}, - {"SO_NO_CHECK", Const, 0, ""}, - {"SO_NO_DDP", Const, 0, ""}, - {"SO_NO_OFFLOAD", Const, 0, ""}, - {"SO_NP_EXTENSIONS", Const, 0, ""}, - {"SO_NREAD", Const, 0, ""}, - {"SO_NUMRCVPKT", Const, 16, ""}, - {"SO_NWRITE", Const, 0, ""}, - {"SO_OOBINLINE", Const, 0, ""}, - {"SO_OVERFLOWED", Const, 1, ""}, - {"SO_PASSCRED", Const, 0, ""}, - {"SO_PASSSEC", Const, 0, ""}, - {"SO_PEERCRED", Const, 0, ""}, - {"SO_PEERLABEL", Const, 0, ""}, - {"SO_PEERNAME", Const, 0, ""}, - {"SO_PEERSEC", Const, 0, ""}, - {"SO_PRIORITY", Const, 0, ""}, - {"SO_PROTOCOL", Const, 0, ""}, - {"SO_PROTOTYPE", Const, 1, ""}, - {"SO_RANDOMPORT", Const, 0, ""}, - {"SO_RCVBUF", Const, 0, ""}, - {"SO_RCVBUFFORCE", Const, 0, ""}, - {"SO_RCVLOWAT", Const, 0, ""}, - {"SO_RCVTIMEO", Const, 0, ""}, - {"SO_RESTRICTIONS", Const, 0, ""}, - {"SO_RESTRICT_DENYIN", Const, 0, ""}, - {"SO_RESTRICT_DENYOUT", Const, 0, ""}, - {"SO_RESTRICT_DENYSET", Const, 0, ""}, - {"SO_REUSEADDR", Const, 0, ""}, - {"SO_REUSEPORT", Const, 0, ""}, - {"SO_REUSESHAREUID", Const, 0, ""}, - {"SO_RTABLE", Const, 1, ""}, - {"SO_RXQ_OVFL", Const, 0, ""}, - {"SO_SECURITY_AUTHENTICATION", Const, 0, ""}, - {"SO_SECURITY_ENCRYPTION_NETWORK", Const, 0, ""}, - {"SO_SECURITY_ENCRYPTION_TRANSPORT", Const, 0, ""}, - {"SO_SETFIB", Const, 0, ""}, - {"SO_SNDBUF", Const, 0, ""}, - {"SO_SNDBUFFORCE", Const, 0, ""}, - {"SO_SNDLOWAT", Const, 0, ""}, - {"SO_SNDTIMEO", Const, 0, ""}, - {"SO_SPLICE", Const, 1, ""}, - {"SO_TIMESTAMP", Const, 0, ""}, - {"SO_TIMESTAMPING", Const, 0, ""}, - {"SO_TIMESTAMPNS", Const, 0, ""}, - {"SO_TIMESTAMP_MONOTONIC", Const, 0, ""}, - {"SO_TYPE", Const, 0, ""}, - {"SO_UPCALLCLOSEWAIT", Const, 0, ""}, - {"SO_UPDATE_ACCEPT_CONTEXT", Const, 0, ""}, - {"SO_UPDATE_CONNECT_CONTEXT", Const, 1, ""}, - {"SO_USELOOPBACK", Const, 0, ""}, - {"SO_USER_COOKIE", Const, 1, ""}, - {"SO_VENDOR", Const, 3, ""}, - {"SO_WANTMORE", Const, 0, ""}, - {"SO_WANTOOBFLAG", Const, 0, ""}, - {"SSLExtraCertChainPolicyPara", Type, 0, ""}, - {"SSLExtraCertChainPolicyPara.AuthType", Field, 0, ""}, - {"SSLExtraCertChainPolicyPara.Checks", Field, 0, ""}, - {"SSLExtraCertChainPolicyPara.ServerName", Field, 0, ""}, - {"SSLExtraCertChainPolicyPara.Size", Field, 0, ""}, - {"STANDARD_RIGHTS_ALL", Const, 0, ""}, - {"STANDARD_RIGHTS_EXECUTE", Const, 0, ""}, - {"STANDARD_RIGHTS_READ", Const, 0, ""}, - {"STANDARD_RIGHTS_REQUIRED", Const, 0, ""}, - {"STANDARD_RIGHTS_WRITE", Const, 0, ""}, - {"STARTF_USESHOWWINDOW", Const, 0, ""}, - {"STARTF_USESTDHANDLES", Const, 0, ""}, - {"STD_ERROR_HANDLE", Const, 0, ""}, - {"STD_INPUT_HANDLE", Const, 0, ""}, - {"STD_OUTPUT_HANDLE", Const, 0, ""}, - {"SUBLANG_ENGLISH_US", Const, 0, ""}, - {"SW_FORCEMINIMIZE", Const, 0, ""}, - {"SW_HIDE", Const, 0, ""}, - {"SW_MAXIMIZE", Const, 0, ""}, - {"SW_MINIMIZE", Const, 0, ""}, - {"SW_NORMAL", Const, 0, ""}, - {"SW_RESTORE", Const, 0, ""}, - {"SW_SHOW", Const, 0, ""}, - {"SW_SHOWDEFAULT", Const, 0, ""}, - {"SW_SHOWMAXIMIZED", Const, 0, ""}, - {"SW_SHOWMINIMIZED", Const, 0, ""}, - {"SW_SHOWMINNOACTIVE", Const, 0, ""}, - {"SW_SHOWNA", Const, 0, ""}, - {"SW_SHOWNOACTIVATE", Const, 0, ""}, - {"SW_SHOWNORMAL", Const, 0, ""}, - {"SYMBOLIC_LINK_FLAG_DIRECTORY", Const, 4, ""}, - {"SYNCHRONIZE", Const, 0, ""}, - {"SYSCTL_VERSION", Const, 1, ""}, - {"SYSCTL_VERS_0", Const, 1, ""}, - {"SYSCTL_VERS_1", Const, 1, ""}, - {"SYSCTL_VERS_MASK", Const, 1, ""}, - {"SYS_ABORT2", Const, 0, ""}, - {"SYS_ACCEPT", Const, 0, ""}, - {"SYS_ACCEPT4", Const, 0, ""}, - {"SYS_ACCEPT_NOCANCEL", Const, 0, ""}, - {"SYS_ACCESS", Const, 0, ""}, - {"SYS_ACCESS_EXTENDED", Const, 0, ""}, - {"SYS_ACCT", Const, 0, ""}, - {"SYS_ADD_KEY", Const, 0, ""}, - {"SYS_ADD_PROFIL", Const, 0, ""}, - {"SYS_ADJFREQ", Const, 1, ""}, - {"SYS_ADJTIME", Const, 0, ""}, - {"SYS_ADJTIMEX", Const, 0, ""}, - {"SYS_AFS_SYSCALL", Const, 0, ""}, - {"SYS_AIO_CANCEL", Const, 0, ""}, - {"SYS_AIO_ERROR", Const, 0, ""}, - {"SYS_AIO_FSYNC", Const, 0, ""}, - {"SYS_AIO_MLOCK", Const, 14, ""}, - {"SYS_AIO_READ", Const, 0, ""}, - {"SYS_AIO_RETURN", Const, 0, ""}, - {"SYS_AIO_SUSPEND", Const, 0, ""}, - {"SYS_AIO_SUSPEND_NOCANCEL", Const, 0, ""}, - {"SYS_AIO_WAITCOMPLETE", Const, 14, ""}, - {"SYS_AIO_WRITE", Const, 0, ""}, - {"SYS_ALARM", Const, 0, ""}, - {"SYS_ARCH_PRCTL", Const, 0, ""}, - {"SYS_ARM_FADVISE64_64", Const, 0, ""}, - {"SYS_ARM_SYNC_FILE_RANGE", Const, 0, ""}, - {"SYS_ATGETMSG", Const, 0, ""}, - {"SYS_ATPGETREQ", Const, 0, ""}, - {"SYS_ATPGETRSP", Const, 0, ""}, - {"SYS_ATPSNDREQ", Const, 0, ""}, - {"SYS_ATPSNDRSP", Const, 0, ""}, - {"SYS_ATPUTMSG", Const, 0, ""}, - {"SYS_ATSOCKET", Const, 0, ""}, - {"SYS_AUDIT", Const, 0, ""}, - {"SYS_AUDITCTL", Const, 0, ""}, - {"SYS_AUDITON", Const, 0, ""}, - {"SYS_AUDIT_SESSION_JOIN", Const, 0, ""}, - {"SYS_AUDIT_SESSION_PORT", Const, 0, ""}, - {"SYS_AUDIT_SESSION_SELF", Const, 0, ""}, - {"SYS_BDFLUSH", Const, 0, ""}, - {"SYS_BIND", Const, 0, ""}, - {"SYS_BINDAT", Const, 3, ""}, - {"SYS_BREAK", Const, 0, ""}, - {"SYS_BRK", Const, 0, ""}, - {"SYS_BSDTHREAD_CREATE", Const, 0, ""}, - {"SYS_BSDTHREAD_REGISTER", Const, 0, ""}, - {"SYS_BSDTHREAD_TERMINATE", Const, 0, ""}, - {"SYS_CAPGET", Const, 0, ""}, - {"SYS_CAPSET", Const, 0, ""}, - {"SYS_CAP_ENTER", Const, 0, ""}, - {"SYS_CAP_FCNTLS_GET", Const, 1, ""}, - {"SYS_CAP_FCNTLS_LIMIT", Const, 1, ""}, - {"SYS_CAP_GETMODE", Const, 0, ""}, - {"SYS_CAP_GETRIGHTS", Const, 0, ""}, - {"SYS_CAP_IOCTLS_GET", Const, 1, ""}, - {"SYS_CAP_IOCTLS_LIMIT", Const, 1, ""}, - {"SYS_CAP_NEW", Const, 0, ""}, - {"SYS_CAP_RIGHTS_GET", Const, 1, ""}, - {"SYS_CAP_RIGHTS_LIMIT", Const, 1, ""}, - {"SYS_CHDIR", Const, 0, ""}, - {"SYS_CHFLAGS", Const, 0, ""}, - {"SYS_CHFLAGSAT", Const, 3, ""}, - {"SYS_CHMOD", Const, 0, ""}, - {"SYS_CHMOD_EXTENDED", Const, 0, ""}, - {"SYS_CHOWN", Const, 0, ""}, - {"SYS_CHOWN32", Const, 0, ""}, - {"SYS_CHROOT", Const, 0, ""}, - {"SYS_CHUD", Const, 0, ""}, - {"SYS_CLOCK_ADJTIME", Const, 0, ""}, - {"SYS_CLOCK_GETCPUCLOCKID2", Const, 1, ""}, - {"SYS_CLOCK_GETRES", Const, 0, ""}, - {"SYS_CLOCK_GETTIME", Const, 0, ""}, - {"SYS_CLOCK_NANOSLEEP", Const, 0, ""}, - {"SYS_CLOCK_SETTIME", Const, 0, ""}, - {"SYS_CLONE", Const, 0, ""}, - {"SYS_CLOSE", Const, 0, ""}, - {"SYS_CLOSEFROM", Const, 0, ""}, - {"SYS_CLOSE_NOCANCEL", Const, 0, ""}, - {"SYS_CONNECT", Const, 0, ""}, - {"SYS_CONNECTAT", Const, 3, ""}, - {"SYS_CONNECT_NOCANCEL", Const, 0, ""}, - {"SYS_COPYFILE", Const, 0, ""}, - {"SYS_CPUSET", Const, 0, ""}, - {"SYS_CPUSET_GETAFFINITY", Const, 0, ""}, - {"SYS_CPUSET_GETID", Const, 0, ""}, - {"SYS_CPUSET_SETAFFINITY", Const, 0, ""}, - {"SYS_CPUSET_SETID", Const, 0, ""}, - {"SYS_CREAT", Const, 0, ""}, - {"SYS_CREATE_MODULE", Const, 0, ""}, - {"SYS_CSOPS", Const, 0, ""}, - {"SYS_CSOPS_AUDITTOKEN", Const, 16, ""}, - {"SYS_DELETE", Const, 0, ""}, - {"SYS_DELETE_MODULE", Const, 0, ""}, - {"SYS_DUP", Const, 0, ""}, - {"SYS_DUP2", Const, 0, ""}, - {"SYS_DUP3", Const, 0, ""}, - {"SYS_EACCESS", Const, 0, ""}, - {"SYS_EPOLL_CREATE", Const, 0, ""}, - {"SYS_EPOLL_CREATE1", Const, 0, ""}, - {"SYS_EPOLL_CTL", Const, 0, ""}, - {"SYS_EPOLL_CTL_OLD", Const, 0, ""}, - {"SYS_EPOLL_PWAIT", Const, 0, ""}, - {"SYS_EPOLL_WAIT", Const, 0, ""}, - {"SYS_EPOLL_WAIT_OLD", Const, 0, ""}, - {"SYS_EVENTFD", Const, 0, ""}, - {"SYS_EVENTFD2", Const, 0, ""}, - {"SYS_EXCHANGEDATA", Const, 0, ""}, - {"SYS_EXECVE", Const, 0, ""}, - {"SYS_EXIT", Const, 0, ""}, - {"SYS_EXIT_GROUP", Const, 0, ""}, - {"SYS_EXTATTRCTL", Const, 0, ""}, - {"SYS_EXTATTR_DELETE_FD", Const, 0, ""}, - {"SYS_EXTATTR_DELETE_FILE", Const, 0, ""}, - {"SYS_EXTATTR_DELETE_LINK", Const, 0, ""}, - {"SYS_EXTATTR_GET_FD", Const, 0, ""}, - {"SYS_EXTATTR_GET_FILE", Const, 0, ""}, - {"SYS_EXTATTR_GET_LINK", Const, 0, ""}, - {"SYS_EXTATTR_LIST_FD", Const, 0, ""}, - {"SYS_EXTATTR_LIST_FILE", Const, 0, ""}, - {"SYS_EXTATTR_LIST_LINK", Const, 0, ""}, - {"SYS_EXTATTR_SET_FD", Const, 0, ""}, - {"SYS_EXTATTR_SET_FILE", Const, 0, ""}, - {"SYS_EXTATTR_SET_LINK", Const, 0, ""}, - {"SYS_FACCESSAT", Const, 0, ""}, - {"SYS_FADVISE64", Const, 0, ""}, - {"SYS_FADVISE64_64", Const, 0, ""}, - {"SYS_FALLOCATE", Const, 0, ""}, - {"SYS_FANOTIFY_INIT", Const, 0, ""}, - {"SYS_FANOTIFY_MARK", Const, 0, ""}, - {"SYS_FCHDIR", Const, 0, ""}, - {"SYS_FCHFLAGS", Const, 0, ""}, - {"SYS_FCHMOD", Const, 0, ""}, - {"SYS_FCHMODAT", Const, 0, ""}, - {"SYS_FCHMOD_EXTENDED", Const, 0, ""}, - {"SYS_FCHOWN", Const, 0, ""}, - {"SYS_FCHOWN32", Const, 0, ""}, - {"SYS_FCHOWNAT", Const, 0, ""}, - {"SYS_FCHROOT", Const, 1, ""}, - {"SYS_FCNTL", Const, 0, ""}, - {"SYS_FCNTL64", Const, 0, ""}, - {"SYS_FCNTL_NOCANCEL", Const, 0, ""}, - {"SYS_FDATASYNC", Const, 0, ""}, - {"SYS_FEXECVE", Const, 0, ""}, - {"SYS_FFCLOCK_GETCOUNTER", Const, 0, ""}, - {"SYS_FFCLOCK_GETESTIMATE", Const, 0, ""}, - {"SYS_FFCLOCK_SETESTIMATE", Const, 0, ""}, - {"SYS_FFSCTL", Const, 0, ""}, - {"SYS_FGETATTRLIST", Const, 0, ""}, - {"SYS_FGETXATTR", Const, 0, ""}, - {"SYS_FHOPEN", Const, 0, ""}, - {"SYS_FHSTAT", Const, 0, ""}, - {"SYS_FHSTATFS", Const, 0, ""}, - {"SYS_FILEPORT_MAKEFD", Const, 0, ""}, - {"SYS_FILEPORT_MAKEPORT", Const, 0, ""}, - {"SYS_FKTRACE", Const, 1, ""}, - {"SYS_FLISTXATTR", Const, 0, ""}, - {"SYS_FLOCK", Const, 0, ""}, - {"SYS_FORK", Const, 0, ""}, - {"SYS_FPATHCONF", Const, 0, ""}, - {"SYS_FREEBSD6_FTRUNCATE", Const, 0, ""}, - {"SYS_FREEBSD6_LSEEK", Const, 0, ""}, - {"SYS_FREEBSD6_MMAP", Const, 0, ""}, - {"SYS_FREEBSD6_PREAD", Const, 0, ""}, - {"SYS_FREEBSD6_PWRITE", Const, 0, ""}, - {"SYS_FREEBSD6_TRUNCATE", Const, 0, ""}, - {"SYS_FREMOVEXATTR", Const, 0, ""}, - {"SYS_FSCTL", Const, 0, ""}, - {"SYS_FSETATTRLIST", Const, 0, ""}, - {"SYS_FSETXATTR", Const, 0, ""}, - {"SYS_FSGETPATH", Const, 0, ""}, - {"SYS_FSTAT", Const, 0, ""}, - {"SYS_FSTAT64", Const, 0, ""}, - {"SYS_FSTAT64_EXTENDED", Const, 0, ""}, - {"SYS_FSTATAT", Const, 0, ""}, - {"SYS_FSTATAT64", Const, 0, ""}, - {"SYS_FSTATFS", Const, 0, ""}, - {"SYS_FSTATFS64", Const, 0, ""}, - {"SYS_FSTATV", Const, 0, ""}, - {"SYS_FSTATVFS1", Const, 1, ""}, - {"SYS_FSTAT_EXTENDED", Const, 0, ""}, - {"SYS_FSYNC", Const, 0, ""}, - {"SYS_FSYNC_NOCANCEL", Const, 0, ""}, - {"SYS_FSYNC_RANGE", Const, 1, ""}, - {"SYS_FTIME", Const, 0, ""}, - {"SYS_FTRUNCATE", Const, 0, ""}, - {"SYS_FTRUNCATE64", Const, 0, ""}, - {"SYS_FUTEX", Const, 0, ""}, - {"SYS_FUTIMENS", Const, 1, ""}, - {"SYS_FUTIMES", Const, 0, ""}, - {"SYS_FUTIMESAT", Const, 0, ""}, - {"SYS_GETATTRLIST", Const, 0, ""}, - {"SYS_GETAUDIT", Const, 0, ""}, - {"SYS_GETAUDIT_ADDR", Const, 0, ""}, - {"SYS_GETAUID", Const, 0, ""}, - {"SYS_GETCONTEXT", Const, 0, ""}, - {"SYS_GETCPU", Const, 0, ""}, - {"SYS_GETCWD", Const, 0, ""}, - {"SYS_GETDENTS", Const, 0, ""}, - {"SYS_GETDENTS64", Const, 0, ""}, - {"SYS_GETDIRENTRIES", Const, 0, ""}, - {"SYS_GETDIRENTRIES64", Const, 0, ""}, - {"SYS_GETDIRENTRIESATTR", Const, 0, ""}, - {"SYS_GETDTABLECOUNT", Const, 1, ""}, - {"SYS_GETDTABLESIZE", Const, 0, ""}, - {"SYS_GETEGID", Const, 0, ""}, - {"SYS_GETEGID32", Const, 0, ""}, - {"SYS_GETEUID", Const, 0, ""}, - {"SYS_GETEUID32", Const, 0, ""}, - {"SYS_GETFH", Const, 0, ""}, - {"SYS_GETFSSTAT", Const, 0, ""}, - {"SYS_GETFSSTAT64", Const, 0, ""}, - {"SYS_GETGID", Const, 0, ""}, - {"SYS_GETGID32", Const, 0, ""}, - {"SYS_GETGROUPS", Const, 0, ""}, - {"SYS_GETGROUPS32", Const, 0, ""}, - {"SYS_GETHOSTUUID", Const, 0, ""}, - {"SYS_GETITIMER", Const, 0, ""}, - {"SYS_GETLCID", Const, 0, ""}, - {"SYS_GETLOGIN", Const, 0, ""}, - {"SYS_GETLOGINCLASS", Const, 0, ""}, - {"SYS_GETPEERNAME", Const, 0, ""}, - {"SYS_GETPGID", Const, 0, ""}, - {"SYS_GETPGRP", Const, 0, ""}, - {"SYS_GETPID", Const, 0, ""}, - {"SYS_GETPMSG", Const, 0, ""}, - {"SYS_GETPPID", Const, 0, ""}, - {"SYS_GETPRIORITY", Const, 0, ""}, - {"SYS_GETRESGID", Const, 0, ""}, - {"SYS_GETRESGID32", Const, 0, ""}, - {"SYS_GETRESUID", Const, 0, ""}, - {"SYS_GETRESUID32", Const, 0, ""}, - {"SYS_GETRLIMIT", Const, 0, ""}, - {"SYS_GETRTABLE", Const, 1, ""}, - {"SYS_GETRUSAGE", Const, 0, ""}, - {"SYS_GETSGROUPS", Const, 0, ""}, - {"SYS_GETSID", Const, 0, ""}, - {"SYS_GETSOCKNAME", Const, 0, ""}, - {"SYS_GETSOCKOPT", Const, 0, ""}, - {"SYS_GETTHRID", Const, 1, ""}, - {"SYS_GETTID", Const, 0, ""}, - {"SYS_GETTIMEOFDAY", Const, 0, ""}, - {"SYS_GETUID", Const, 0, ""}, - {"SYS_GETUID32", Const, 0, ""}, - {"SYS_GETVFSSTAT", Const, 1, ""}, - {"SYS_GETWGROUPS", Const, 0, ""}, - {"SYS_GETXATTR", Const, 0, ""}, - {"SYS_GET_KERNEL_SYMS", Const, 0, ""}, - {"SYS_GET_MEMPOLICY", Const, 0, ""}, - {"SYS_GET_ROBUST_LIST", Const, 0, ""}, - {"SYS_GET_THREAD_AREA", Const, 0, ""}, - {"SYS_GSSD_SYSCALL", Const, 14, ""}, - {"SYS_GTTY", Const, 0, ""}, - {"SYS_IDENTITYSVC", Const, 0, ""}, - {"SYS_IDLE", Const, 0, ""}, - {"SYS_INITGROUPS", Const, 0, ""}, - {"SYS_INIT_MODULE", Const, 0, ""}, - {"SYS_INOTIFY_ADD_WATCH", Const, 0, ""}, - {"SYS_INOTIFY_INIT", Const, 0, ""}, - {"SYS_INOTIFY_INIT1", Const, 0, ""}, - {"SYS_INOTIFY_RM_WATCH", Const, 0, ""}, - {"SYS_IOCTL", Const, 0, ""}, - {"SYS_IOPERM", Const, 0, ""}, - {"SYS_IOPL", Const, 0, ""}, - {"SYS_IOPOLICYSYS", Const, 0, ""}, - {"SYS_IOPRIO_GET", Const, 0, ""}, - {"SYS_IOPRIO_SET", Const, 0, ""}, - {"SYS_IO_CANCEL", Const, 0, ""}, - {"SYS_IO_DESTROY", Const, 0, ""}, - {"SYS_IO_GETEVENTS", Const, 0, ""}, - {"SYS_IO_SETUP", Const, 0, ""}, - {"SYS_IO_SUBMIT", Const, 0, ""}, - {"SYS_IPC", Const, 0, ""}, - {"SYS_ISSETUGID", Const, 0, ""}, - {"SYS_JAIL", Const, 0, ""}, - {"SYS_JAIL_ATTACH", Const, 0, ""}, - {"SYS_JAIL_GET", Const, 0, ""}, - {"SYS_JAIL_REMOVE", Const, 0, ""}, - {"SYS_JAIL_SET", Const, 0, ""}, - {"SYS_KAS_INFO", Const, 16, ""}, - {"SYS_KDEBUG_TRACE", Const, 0, ""}, - {"SYS_KENV", Const, 0, ""}, - {"SYS_KEVENT", Const, 0, ""}, - {"SYS_KEVENT64", Const, 0, ""}, - {"SYS_KEXEC_LOAD", Const, 0, ""}, - {"SYS_KEYCTL", Const, 0, ""}, - {"SYS_KILL", Const, 0, ""}, - {"SYS_KLDFIND", Const, 0, ""}, - {"SYS_KLDFIRSTMOD", Const, 0, ""}, - {"SYS_KLDLOAD", Const, 0, ""}, - {"SYS_KLDNEXT", Const, 0, ""}, - {"SYS_KLDSTAT", Const, 0, ""}, - {"SYS_KLDSYM", Const, 0, ""}, - {"SYS_KLDUNLOAD", Const, 0, ""}, - {"SYS_KLDUNLOADF", Const, 0, ""}, - {"SYS_KMQ_NOTIFY", Const, 14, ""}, - {"SYS_KMQ_OPEN", Const, 14, ""}, - {"SYS_KMQ_SETATTR", Const, 14, ""}, - {"SYS_KMQ_TIMEDRECEIVE", Const, 14, ""}, - {"SYS_KMQ_TIMEDSEND", Const, 14, ""}, - {"SYS_KMQ_UNLINK", Const, 14, ""}, - {"SYS_KQUEUE", Const, 0, ""}, - {"SYS_KQUEUE1", Const, 1, ""}, - {"SYS_KSEM_CLOSE", Const, 14, ""}, - {"SYS_KSEM_DESTROY", Const, 14, ""}, - {"SYS_KSEM_GETVALUE", Const, 14, ""}, - {"SYS_KSEM_INIT", Const, 14, ""}, - {"SYS_KSEM_OPEN", Const, 14, ""}, - {"SYS_KSEM_POST", Const, 14, ""}, - {"SYS_KSEM_TIMEDWAIT", Const, 14, ""}, - {"SYS_KSEM_TRYWAIT", Const, 14, ""}, - {"SYS_KSEM_UNLINK", Const, 14, ""}, - {"SYS_KSEM_WAIT", Const, 14, ""}, - {"SYS_KTIMER_CREATE", Const, 0, ""}, - {"SYS_KTIMER_DELETE", Const, 0, ""}, - {"SYS_KTIMER_GETOVERRUN", Const, 0, ""}, - {"SYS_KTIMER_GETTIME", Const, 0, ""}, - {"SYS_KTIMER_SETTIME", Const, 0, ""}, - {"SYS_KTRACE", Const, 0, ""}, - {"SYS_LCHFLAGS", Const, 0, ""}, - {"SYS_LCHMOD", Const, 0, ""}, - {"SYS_LCHOWN", Const, 0, ""}, - {"SYS_LCHOWN32", Const, 0, ""}, - {"SYS_LEDGER", Const, 16, ""}, - {"SYS_LGETFH", Const, 0, ""}, - {"SYS_LGETXATTR", Const, 0, ""}, - {"SYS_LINK", Const, 0, ""}, - {"SYS_LINKAT", Const, 0, ""}, - {"SYS_LIO_LISTIO", Const, 0, ""}, - {"SYS_LISTEN", Const, 0, ""}, - {"SYS_LISTXATTR", Const, 0, ""}, - {"SYS_LLISTXATTR", Const, 0, ""}, - {"SYS_LOCK", Const, 0, ""}, - {"SYS_LOOKUP_DCOOKIE", Const, 0, ""}, - {"SYS_LPATHCONF", Const, 0, ""}, - {"SYS_LREMOVEXATTR", Const, 0, ""}, - {"SYS_LSEEK", Const, 0, ""}, - {"SYS_LSETXATTR", Const, 0, ""}, - {"SYS_LSTAT", Const, 0, ""}, - {"SYS_LSTAT64", Const, 0, ""}, - {"SYS_LSTAT64_EXTENDED", Const, 0, ""}, - {"SYS_LSTATV", Const, 0, ""}, - {"SYS_LSTAT_EXTENDED", Const, 0, ""}, - {"SYS_LUTIMES", Const, 0, ""}, - {"SYS_MAC_SYSCALL", Const, 0, ""}, - {"SYS_MADVISE", Const, 0, ""}, - {"SYS_MADVISE1", Const, 0, ""}, - {"SYS_MAXSYSCALL", Const, 0, ""}, - {"SYS_MBIND", Const, 0, ""}, - {"SYS_MIGRATE_PAGES", Const, 0, ""}, - {"SYS_MINCORE", Const, 0, ""}, - {"SYS_MINHERIT", Const, 0, ""}, - {"SYS_MKCOMPLEX", Const, 0, ""}, - {"SYS_MKDIR", Const, 0, ""}, - {"SYS_MKDIRAT", Const, 0, ""}, - {"SYS_MKDIR_EXTENDED", Const, 0, ""}, - {"SYS_MKFIFO", Const, 0, ""}, - {"SYS_MKFIFOAT", Const, 0, ""}, - {"SYS_MKFIFO_EXTENDED", Const, 0, ""}, - {"SYS_MKNOD", Const, 0, ""}, - {"SYS_MKNODAT", Const, 0, ""}, - {"SYS_MLOCK", Const, 0, ""}, - {"SYS_MLOCKALL", Const, 0, ""}, - {"SYS_MMAP", Const, 0, ""}, - {"SYS_MMAP2", Const, 0, ""}, - {"SYS_MODCTL", Const, 1, ""}, - {"SYS_MODFIND", Const, 0, ""}, - {"SYS_MODFNEXT", Const, 0, ""}, - {"SYS_MODIFY_LDT", Const, 0, ""}, - {"SYS_MODNEXT", Const, 0, ""}, - {"SYS_MODSTAT", Const, 0, ""}, - {"SYS_MODWATCH", Const, 0, ""}, - {"SYS_MOUNT", Const, 0, ""}, - {"SYS_MOVE_PAGES", Const, 0, ""}, - {"SYS_MPROTECT", Const, 0, ""}, - {"SYS_MPX", Const, 0, ""}, - {"SYS_MQUERY", Const, 1, ""}, - {"SYS_MQ_GETSETATTR", Const, 0, ""}, - {"SYS_MQ_NOTIFY", Const, 0, ""}, - {"SYS_MQ_OPEN", Const, 0, ""}, - {"SYS_MQ_TIMEDRECEIVE", Const, 0, ""}, - {"SYS_MQ_TIMEDSEND", Const, 0, ""}, - {"SYS_MQ_UNLINK", Const, 0, ""}, - {"SYS_MREMAP", Const, 0, ""}, - {"SYS_MSGCTL", Const, 0, ""}, - {"SYS_MSGGET", Const, 0, ""}, - {"SYS_MSGRCV", Const, 0, ""}, - {"SYS_MSGRCV_NOCANCEL", Const, 0, ""}, - {"SYS_MSGSND", Const, 0, ""}, - {"SYS_MSGSND_NOCANCEL", Const, 0, ""}, - {"SYS_MSGSYS", Const, 0, ""}, - {"SYS_MSYNC", Const, 0, ""}, - {"SYS_MSYNC_NOCANCEL", Const, 0, ""}, - {"SYS_MUNLOCK", Const, 0, ""}, - {"SYS_MUNLOCKALL", Const, 0, ""}, - {"SYS_MUNMAP", Const, 0, ""}, - {"SYS_NAME_TO_HANDLE_AT", Const, 0, ""}, - {"SYS_NANOSLEEP", Const, 0, ""}, - {"SYS_NEWFSTATAT", Const, 0, ""}, - {"SYS_NFSCLNT", Const, 0, ""}, - {"SYS_NFSSERVCTL", Const, 0, ""}, - {"SYS_NFSSVC", Const, 0, ""}, - {"SYS_NFSTAT", Const, 0, ""}, - {"SYS_NICE", Const, 0, ""}, - {"SYS_NLM_SYSCALL", Const, 14, ""}, - {"SYS_NLSTAT", Const, 0, ""}, - {"SYS_NMOUNT", Const, 0, ""}, - {"SYS_NSTAT", Const, 0, ""}, - {"SYS_NTP_ADJTIME", Const, 0, ""}, - {"SYS_NTP_GETTIME", Const, 0, ""}, - {"SYS_NUMA_GETAFFINITY", Const, 14, ""}, - {"SYS_NUMA_SETAFFINITY", Const, 14, ""}, - {"SYS_OABI_SYSCALL_BASE", Const, 0, ""}, - {"SYS_OBREAK", Const, 0, ""}, - {"SYS_OLDFSTAT", Const, 0, ""}, - {"SYS_OLDLSTAT", Const, 0, ""}, - {"SYS_OLDOLDUNAME", Const, 0, ""}, - {"SYS_OLDSTAT", Const, 0, ""}, - {"SYS_OLDUNAME", Const, 0, ""}, - {"SYS_OPEN", Const, 0, ""}, - {"SYS_OPENAT", Const, 0, ""}, - {"SYS_OPENBSD_POLL", Const, 0, ""}, - {"SYS_OPEN_BY_HANDLE_AT", Const, 0, ""}, - {"SYS_OPEN_DPROTECTED_NP", Const, 16, ""}, - {"SYS_OPEN_EXTENDED", Const, 0, ""}, - {"SYS_OPEN_NOCANCEL", Const, 0, ""}, - {"SYS_OVADVISE", Const, 0, ""}, - {"SYS_PACCEPT", Const, 1, ""}, - {"SYS_PATHCONF", Const, 0, ""}, - {"SYS_PAUSE", Const, 0, ""}, - {"SYS_PCICONFIG_IOBASE", Const, 0, ""}, - {"SYS_PCICONFIG_READ", Const, 0, ""}, - {"SYS_PCICONFIG_WRITE", Const, 0, ""}, - {"SYS_PDFORK", Const, 0, ""}, - {"SYS_PDGETPID", Const, 0, ""}, - {"SYS_PDKILL", Const, 0, ""}, - {"SYS_PERF_EVENT_OPEN", Const, 0, ""}, - {"SYS_PERSONALITY", Const, 0, ""}, - {"SYS_PID_HIBERNATE", Const, 0, ""}, - {"SYS_PID_RESUME", Const, 0, ""}, - {"SYS_PID_SHUTDOWN_SOCKETS", Const, 0, ""}, - {"SYS_PID_SUSPEND", Const, 0, ""}, - {"SYS_PIPE", Const, 0, ""}, - {"SYS_PIPE2", Const, 0, ""}, - {"SYS_PIVOT_ROOT", Const, 0, ""}, - {"SYS_PMC_CONTROL", Const, 1, ""}, - {"SYS_PMC_GET_INFO", Const, 1, ""}, - {"SYS_POLL", Const, 0, ""}, - {"SYS_POLLTS", Const, 1, ""}, - {"SYS_POLL_NOCANCEL", Const, 0, ""}, - {"SYS_POSIX_FADVISE", Const, 0, ""}, - {"SYS_POSIX_FALLOCATE", Const, 0, ""}, - {"SYS_POSIX_OPENPT", Const, 0, ""}, - {"SYS_POSIX_SPAWN", Const, 0, ""}, - {"SYS_PPOLL", Const, 0, ""}, - {"SYS_PRCTL", Const, 0, ""}, - {"SYS_PREAD", Const, 0, ""}, - {"SYS_PREAD64", Const, 0, ""}, - {"SYS_PREADV", Const, 0, ""}, - {"SYS_PREAD_NOCANCEL", Const, 0, ""}, - {"SYS_PRLIMIT64", Const, 0, ""}, - {"SYS_PROCCTL", Const, 3, ""}, - {"SYS_PROCESS_POLICY", Const, 0, ""}, - {"SYS_PROCESS_VM_READV", Const, 0, ""}, - {"SYS_PROCESS_VM_WRITEV", Const, 0, ""}, - {"SYS_PROC_INFO", Const, 0, ""}, - {"SYS_PROF", Const, 0, ""}, - {"SYS_PROFIL", Const, 0, ""}, - {"SYS_PSELECT", Const, 0, ""}, - {"SYS_PSELECT6", Const, 0, ""}, - {"SYS_PSET_ASSIGN", Const, 1, ""}, - {"SYS_PSET_CREATE", Const, 1, ""}, - {"SYS_PSET_DESTROY", Const, 1, ""}, - {"SYS_PSYNCH_CVBROAD", Const, 0, ""}, - {"SYS_PSYNCH_CVCLRPREPOST", Const, 0, ""}, - {"SYS_PSYNCH_CVSIGNAL", Const, 0, ""}, - {"SYS_PSYNCH_CVWAIT", Const, 0, ""}, - {"SYS_PSYNCH_MUTEXDROP", Const, 0, ""}, - {"SYS_PSYNCH_MUTEXWAIT", Const, 0, ""}, - {"SYS_PSYNCH_RW_DOWNGRADE", Const, 0, ""}, - {"SYS_PSYNCH_RW_LONGRDLOCK", Const, 0, ""}, - {"SYS_PSYNCH_RW_RDLOCK", Const, 0, ""}, - {"SYS_PSYNCH_RW_UNLOCK", Const, 0, ""}, - {"SYS_PSYNCH_RW_UNLOCK2", Const, 0, ""}, - {"SYS_PSYNCH_RW_UPGRADE", Const, 0, ""}, - {"SYS_PSYNCH_RW_WRLOCK", Const, 0, ""}, - {"SYS_PSYNCH_RW_YIELDWRLOCK", Const, 0, ""}, - {"SYS_PTRACE", Const, 0, ""}, - {"SYS_PUTPMSG", Const, 0, ""}, - {"SYS_PWRITE", Const, 0, ""}, - {"SYS_PWRITE64", Const, 0, ""}, - {"SYS_PWRITEV", Const, 0, ""}, - {"SYS_PWRITE_NOCANCEL", Const, 0, ""}, - {"SYS_QUERY_MODULE", Const, 0, ""}, - {"SYS_QUOTACTL", Const, 0, ""}, - {"SYS_RASCTL", Const, 1, ""}, - {"SYS_RCTL_ADD_RULE", Const, 0, ""}, - {"SYS_RCTL_GET_LIMITS", Const, 0, ""}, - {"SYS_RCTL_GET_RACCT", Const, 0, ""}, - {"SYS_RCTL_GET_RULES", Const, 0, ""}, - {"SYS_RCTL_REMOVE_RULE", Const, 0, ""}, - {"SYS_READ", Const, 0, ""}, - {"SYS_READAHEAD", Const, 0, ""}, - {"SYS_READDIR", Const, 0, ""}, - {"SYS_READLINK", Const, 0, ""}, - {"SYS_READLINKAT", Const, 0, ""}, - {"SYS_READV", Const, 0, ""}, - {"SYS_READV_NOCANCEL", Const, 0, ""}, - {"SYS_READ_NOCANCEL", Const, 0, ""}, - {"SYS_REBOOT", Const, 0, ""}, - {"SYS_RECV", Const, 0, ""}, - {"SYS_RECVFROM", Const, 0, ""}, - {"SYS_RECVFROM_NOCANCEL", Const, 0, ""}, - {"SYS_RECVMMSG", Const, 0, ""}, - {"SYS_RECVMSG", Const, 0, ""}, - {"SYS_RECVMSG_NOCANCEL", Const, 0, ""}, - {"SYS_REMAP_FILE_PAGES", Const, 0, ""}, - {"SYS_REMOVEXATTR", Const, 0, ""}, - {"SYS_RENAME", Const, 0, ""}, - {"SYS_RENAMEAT", Const, 0, ""}, - {"SYS_REQUEST_KEY", Const, 0, ""}, - {"SYS_RESTART_SYSCALL", Const, 0, ""}, - {"SYS_REVOKE", Const, 0, ""}, - {"SYS_RFORK", Const, 0, ""}, - {"SYS_RMDIR", Const, 0, ""}, - {"SYS_RTPRIO", Const, 0, ""}, - {"SYS_RTPRIO_THREAD", Const, 0, ""}, - {"SYS_RT_SIGACTION", Const, 0, ""}, - {"SYS_RT_SIGPENDING", Const, 0, ""}, - {"SYS_RT_SIGPROCMASK", Const, 0, ""}, - {"SYS_RT_SIGQUEUEINFO", Const, 0, ""}, - {"SYS_RT_SIGRETURN", Const, 0, ""}, - {"SYS_RT_SIGSUSPEND", Const, 0, ""}, - {"SYS_RT_SIGTIMEDWAIT", Const, 0, ""}, - {"SYS_RT_TGSIGQUEUEINFO", Const, 0, ""}, - {"SYS_SBRK", Const, 0, ""}, - {"SYS_SCHED_GETAFFINITY", Const, 0, ""}, - {"SYS_SCHED_GETPARAM", Const, 0, ""}, - {"SYS_SCHED_GETSCHEDULER", Const, 0, ""}, - {"SYS_SCHED_GET_PRIORITY_MAX", Const, 0, ""}, - {"SYS_SCHED_GET_PRIORITY_MIN", Const, 0, ""}, - {"SYS_SCHED_RR_GET_INTERVAL", Const, 0, ""}, - {"SYS_SCHED_SETAFFINITY", Const, 0, ""}, - {"SYS_SCHED_SETPARAM", Const, 0, ""}, - {"SYS_SCHED_SETSCHEDULER", Const, 0, ""}, - {"SYS_SCHED_YIELD", Const, 0, ""}, - {"SYS_SCTP_GENERIC_RECVMSG", Const, 0, ""}, - {"SYS_SCTP_GENERIC_SENDMSG", Const, 0, ""}, - {"SYS_SCTP_GENERIC_SENDMSG_IOV", Const, 0, ""}, - {"SYS_SCTP_PEELOFF", Const, 0, ""}, - {"SYS_SEARCHFS", Const, 0, ""}, - {"SYS_SECURITY", Const, 0, ""}, - {"SYS_SELECT", Const, 0, ""}, - {"SYS_SELECT_NOCANCEL", Const, 0, ""}, - {"SYS_SEMCONFIG", Const, 1, ""}, - {"SYS_SEMCTL", Const, 0, ""}, - {"SYS_SEMGET", Const, 0, ""}, - {"SYS_SEMOP", Const, 0, ""}, - {"SYS_SEMSYS", Const, 0, ""}, - {"SYS_SEMTIMEDOP", Const, 0, ""}, - {"SYS_SEM_CLOSE", Const, 0, ""}, - {"SYS_SEM_DESTROY", Const, 0, ""}, - {"SYS_SEM_GETVALUE", Const, 0, ""}, - {"SYS_SEM_INIT", Const, 0, ""}, - {"SYS_SEM_OPEN", Const, 0, ""}, - {"SYS_SEM_POST", Const, 0, ""}, - {"SYS_SEM_TRYWAIT", Const, 0, ""}, - {"SYS_SEM_UNLINK", Const, 0, ""}, - {"SYS_SEM_WAIT", Const, 0, ""}, - {"SYS_SEM_WAIT_NOCANCEL", Const, 0, ""}, - {"SYS_SEND", Const, 0, ""}, - {"SYS_SENDFILE", Const, 0, ""}, - {"SYS_SENDFILE64", Const, 0, ""}, - {"SYS_SENDMMSG", Const, 0, ""}, - {"SYS_SENDMSG", Const, 0, ""}, - {"SYS_SENDMSG_NOCANCEL", Const, 0, ""}, - {"SYS_SENDTO", Const, 0, ""}, - {"SYS_SENDTO_NOCANCEL", Const, 0, ""}, - {"SYS_SETATTRLIST", Const, 0, ""}, - {"SYS_SETAUDIT", Const, 0, ""}, - {"SYS_SETAUDIT_ADDR", Const, 0, ""}, - {"SYS_SETAUID", Const, 0, ""}, - {"SYS_SETCONTEXT", Const, 0, ""}, - {"SYS_SETDOMAINNAME", Const, 0, ""}, - {"SYS_SETEGID", Const, 0, ""}, - {"SYS_SETEUID", Const, 0, ""}, - {"SYS_SETFIB", Const, 0, ""}, - {"SYS_SETFSGID", Const, 0, ""}, - {"SYS_SETFSGID32", Const, 0, ""}, - {"SYS_SETFSUID", Const, 0, ""}, - {"SYS_SETFSUID32", Const, 0, ""}, - {"SYS_SETGID", Const, 0, ""}, - {"SYS_SETGID32", Const, 0, ""}, - {"SYS_SETGROUPS", Const, 0, ""}, - {"SYS_SETGROUPS32", Const, 0, ""}, - {"SYS_SETHOSTNAME", Const, 0, ""}, - {"SYS_SETITIMER", Const, 0, ""}, - {"SYS_SETLCID", Const, 0, ""}, - {"SYS_SETLOGIN", Const, 0, ""}, - {"SYS_SETLOGINCLASS", Const, 0, ""}, - {"SYS_SETNS", Const, 0, ""}, - {"SYS_SETPGID", Const, 0, ""}, - {"SYS_SETPRIORITY", Const, 0, ""}, - {"SYS_SETPRIVEXEC", Const, 0, ""}, - {"SYS_SETREGID", Const, 0, ""}, - {"SYS_SETREGID32", Const, 0, ""}, - {"SYS_SETRESGID", Const, 0, ""}, - {"SYS_SETRESGID32", Const, 0, ""}, - {"SYS_SETRESUID", Const, 0, ""}, - {"SYS_SETRESUID32", Const, 0, ""}, - {"SYS_SETREUID", Const, 0, ""}, - {"SYS_SETREUID32", Const, 0, ""}, - {"SYS_SETRLIMIT", Const, 0, ""}, - {"SYS_SETRTABLE", Const, 1, ""}, - {"SYS_SETSGROUPS", Const, 0, ""}, - {"SYS_SETSID", Const, 0, ""}, - {"SYS_SETSOCKOPT", Const, 0, ""}, - {"SYS_SETTID", Const, 0, ""}, - {"SYS_SETTID_WITH_PID", Const, 0, ""}, - {"SYS_SETTIMEOFDAY", Const, 0, ""}, - {"SYS_SETUID", Const, 0, ""}, - {"SYS_SETUID32", Const, 0, ""}, - {"SYS_SETWGROUPS", Const, 0, ""}, - {"SYS_SETXATTR", Const, 0, ""}, - {"SYS_SET_MEMPOLICY", Const, 0, ""}, - {"SYS_SET_ROBUST_LIST", Const, 0, ""}, - {"SYS_SET_THREAD_AREA", Const, 0, ""}, - {"SYS_SET_TID_ADDRESS", Const, 0, ""}, - {"SYS_SGETMASK", Const, 0, ""}, - {"SYS_SHARED_REGION_CHECK_NP", Const, 0, ""}, - {"SYS_SHARED_REGION_MAP_AND_SLIDE_NP", Const, 0, ""}, - {"SYS_SHMAT", Const, 0, ""}, - {"SYS_SHMCTL", Const, 0, ""}, - {"SYS_SHMDT", Const, 0, ""}, - {"SYS_SHMGET", Const, 0, ""}, - {"SYS_SHMSYS", Const, 0, ""}, - {"SYS_SHM_OPEN", Const, 0, ""}, - {"SYS_SHM_UNLINK", Const, 0, ""}, - {"SYS_SHUTDOWN", Const, 0, ""}, - {"SYS_SIGACTION", Const, 0, ""}, - {"SYS_SIGALTSTACK", Const, 0, ""}, - {"SYS_SIGNAL", Const, 0, ""}, - {"SYS_SIGNALFD", Const, 0, ""}, - {"SYS_SIGNALFD4", Const, 0, ""}, - {"SYS_SIGPENDING", Const, 0, ""}, - {"SYS_SIGPROCMASK", Const, 0, ""}, - {"SYS_SIGQUEUE", Const, 0, ""}, - {"SYS_SIGQUEUEINFO", Const, 1, ""}, - {"SYS_SIGRETURN", Const, 0, ""}, - {"SYS_SIGSUSPEND", Const, 0, ""}, - {"SYS_SIGSUSPEND_NOCANCEL", Const, 0, ""}, - {"SYS_SIGTIMEDWAIT", Const, 0, ""}, - {"SYS_SIGWAIT", Const, 0, ""}, - {"SYS_SIGWAITINFO", Const, 0, ""}, - {"SYS_SOCKET", Const, 0, ""}, - {"SYS_SOCKETCALL", Const, 0, ""}, - {"SYS_SOCKETPAIR", Const, 0, ""}, - {"SYS_SPLICE", Const, 0, ""}, - {"SYS_SSETMASK", Const, 0, ""}, - {"SYS_SSTK", Const, 0, ""}, - {"SYS_STACK_SNAPSHOT", Const, 0, ""}, - {"SYS_STAT", Const, 0, ""}, - {"SYS_STAT64", Const, 0, ""}, - {"SYS_STAT64_EXTENDED", Const, 0, ""}, - {"SYS_STATFS", Const, 0, ""}, - {"SYS_STATFS64", Const, 0, ""}, - {"SYS_STATV", Const, 0, ""}, - {"SYS_STATVFS1", Const, 1, ""}, - {"SYS_STAT_EXTENDED", Const, 0, ""}, - {"SYS_STIME", Const, 0, ""}, - {"SYS_STTY", Const, 0, ""}, - {"SYS_SWAPCONTEXT", Const, 0, ""}, - {"SYS_SWAPCTL", Const, 1, ""}, - {"SYS_SWAPOFF", Const, 0, ""}, - {"SYS_SWAPON", Const, 0, ""}, - {"SYS_SYMLINK", Const, 0, ""}, - {"SYS_SYMLINKAT", Const, 0, ""}, - {"SYS_SYNC", Const, 0, ""}, - {"SYS_SYNCFS", Const, 0, ""}, - {"SYS_SYNC_FILE_RANGE", Const, 0, ""}, - {"SYS_SYSARCH", Const, 0, ""}, - {"SYS_SYSCALL", Const, 0, ""}, - {"SYS_SYSCALL_BASE", Const, 0, ""}, - {"SYS_SYSFS", Const, 0, ""}, - {"SYS_SYSINFO", Const, 0, ""}, - {"SYS_SYSLOG", Const, 0, ""}, - {"SYS_TEE", Const, 0, ""}, - {"SYS_TGKILL", Const, 0, ""}, - {"SYS_THREAD_SELFID", Const, 0, ""}, - {"SYS_THR_CREATE", Const, 0, ""}, - {"SYS_THR_EXIT", Const, 0, ""}, - {"SYS_THR_KILL", Const, 0, ""}, - {"SYS_THR_KILL2", Const, 0, ""}, - {"SYS_THR_NEW", Const, 0, ""}, - {"SYS_THR_SELF", Const, 0, ""}, - {"SYS_THR_SET_NAME", Const, 0, ""}, - {"SYS_THR_SUSPEND", Const, 0, ""}, - {"SYS_THR_WAKE", Const, 0, ""}, - {"SYS_TIME", Const, 0, ""}, - {"SYS_TIMERFD_CREATE", Const, 0, ""}, - {"SYS_TIMERFD_GETTIME", Const, 0, ""}, - {"SYS_TIMERFD_SETTIME", Const, 0, ""}, - {"SYS_TIMER_CREATE", Const, 0, ""}, - {"SYS_TIMER_DELETE", Const, 0, ""}, - {"SYS_TIMER_GETOVERRUN", Const, 0, ""}, - {"SYS_TIMER_GETTIME", Const, 0, ""}, - {"SYS_TIMER_SETTIME", Const, 0, ""}, - {"SYS_TIMES", Const, 0, ""}, - {"SYS_TKILL", Const, 0, ""}, - {"SYS_TRUNCATE", Const, 0, ""}, - {"SYS_TRUNCATE64", Const, 0, ""}, - {"SYS_TUXCALL", Const, 0, ""}, - {"SYS_UGETRLIMIT", Const, 0, ""}, - {"SYS_ULIMIT", Const, 0, ""}, - {"SYS_UMASK", Const, 0, ""}, - {"SYS_UMASK_EXTENDED", Const, 0, ""}, - {"SYS_UMOUNT", Const, 0, ""}, - {"SYS_UMOUNT2", Const, 0, ""}, - {"SYS_UNAME", Const, 0, ""}, - {"SYS_UNDELETE", Const, 0, ""}, - {"SYS_UNLINK", Const, 0, ""}, - {"SYS_UNLINKAT", Const, 0, ""}, - {"SYS_UNMOUNT", Const, 0, ""}, - {"SYS_UNSHARE", Const, 0, ""}, - {"SYS_USELIB", Const, 0, ""}, - {"SYS_USTAT", Const, 0, ""}, - {"SYS_UTIME", Const, 0, ""}, - {"SYS_UTIMENSAT", Const, 0, ""}, - {"SYS_UTIMES", Const, 0, ""}, - {"SYS_UTRACE", Const, 0, ""}, - {"SYS_UUIDGEN", Const, 0, ""}, - {"SYS_VADVISE", Const, 1, ""}, - {"SYS_VFORK", Const, 0, ""}, - {"SYS_VHANGUP", Const, 0, ""}, - {"SYS_VM86", Const, 0, ""}, - {"SYS_VM86OLD", Const, 0, ""}, - {"SYS_VMSPLICE", Const, 0, ""}, - {"SYS_VM_PRESSURE_MONITOR", Const, 0, ""}, - {"SYS_VSERVER", Const, 0, ""}, - {"SYS_WAIT4", Const, 0, ""}, - {"SYS_WAIT4_NOCANCEL", Const, 0, ""}, - {"SYS_WAIT6", Const, 1, ""}, - {"SYS_WAITEVENT", Const, 0, ""}, - {"SYS_WAITID", Const, 0, ""}, - {"SYS_WAITID_NOCANCEL", Const, 0, ""}, - {"SYS_WAITPID", Const, 0, ""}, - {"SYS_WATCHEVENT", Const, 0, ""}, - {"SYS_WORKQ_KERNRETURN", Const, 0, ""}, - {"SYS_WORKQ_OPEN", Const, 0, ""}, - {"SYS_WRITE", Const, 0, ""}, - {"SYS_WRITEV", Const, 0, ""}, - {"SYS_WRITEV_NOCANCEL", Const, 0, ""}, - {"SYS_WRITE_NOCANCEL", Const, 0, ""}, - {"SYS_YIELD", Const, 0, ""}, - {"SYS__LLSEEK", Const, 0, ""}, - {"SYS__LWP_CONTINUE", Const, 1, ""}, - {"SYS__LWP_CREATE", Const, 1, ""}, - {"SYS__LWP_CTL", Const, 1, ""}, - {"SYS__LWP_DETACH", Const, 1, ""}, - {"SYS__LWP_EXIT", Const, 1, ""}, - {"SYS__LWP_GETNAME", Const, 1, ""}, - {"SYS__LWP_GETPRIVATE", Const, 1, ""}, - {"SYS__LWP_KILL", Const, 1, ""}, - {"SYS__LWP_PARK", Const, 1, ""}, - {"SYS__LWP_SELF", Const, 1, ""}, - {"SYS__LWP_SETNAME", Const, 1, ""}, - {"SYS__LWP_SETPRIVATE", Const, 1, ""}, - {"SYS__LWP_SUSPEND", Const, 1, ""}, - {"SYS__LWP_UNPARK", Const, 1, ""}, - {"SYS__LWP_UNPARK_ALL", Const, 1, ""}, - {"SYS__LWP_WAIT", Const, 1, ""}, - {"SYS__LWP_WAKEUP", Const, 1, ""}, - {"SYS__NEWSELECT", Const, 0, ""}, - {"SYS__PSET_BIND", Const, 1, ""}, - {"SYS__SCHED_GETAFFINITY", Const, 1, ""}, - {"SYS__SCHED_GETPARAM", Const, 1, ""}, - {"SYS__SCHED_SETAFFINITY", Const, 1, ""}, - {"SYS__SCHED_SETPARAM", Const, 1, ""}, - {"SYS__SYSCTL", Const, 0, ""}, - {"SYS__UMTX_LOCK", Const, 0, ""}, - {"SYS__UMTX_OP", Const, 0, ""}, - {"SYS__UMTX_UNLOCK", Const, 0, ""}, - {"SYS___ACL_ACLCHECK_FD", Const, 0, ""}, - {"SYS___ACL_ACLCHECK_FILE", Const, 0, ""}, - {"SYS___ACL_ACLCHECK_LINK", Const, 0, ""}, - {"SYS___ACL_DELETE_FD", Const, 0, ""}, - {"SYS___ACL_DELETE_FILE", Const, 0, ""}, - {"SYS___ACL_DELETE_LINK", Const, 0, ""}, - {"SYS___ACL_GET_FD", Const, 0, ""}, - {"SYS___ACL_GET_FILE", Const, 0, ""}, - {"SYS___ACL_GET_LINK", Const, 0, ""}, - {"SYS___ACL_SET_FD", Const, 0, ""}, - {"SYS___ACL_SET_FILE", Const, 0, ""}, - {"SYS___ACL_SET_LINK", Const, 0, ""}, - {"SYS___CAP_RIGHTS_GET", Const, 14, ""}, - {"SYS___CLONE", Const, 1, ""}, - {"SYS___DISABLE_THREADSIGNAL", Const, 0, ""}, - {"SYS___GETCWD", Const, 0, ""}, - {"SYS___GETLOGIN", Const, 1, ""}, - {"SYS___GET_TCB", Const, 1, ""}, - {"SYS___MAC_EXECVE", Const, 0, ""}, - {"SYS___MAC_GETFSSTAT", Const, 0, ""}, - {"SYS___MAC_GET_FD", Const, 0, ""}, - {"SYS___MAC_GET_FILE", Const, 0, ""}, - {"SYS___MAC_GET_LCID", Const, 0, ""}, - {"SYS___MAC_GET_LCTX", Const, 0, ""}, - {"SYS___MAC_GET_LINK", Const, 0, ""}, - {"SYS___MAC_GET_MOUNT", Const, 0, ""}, - {"SYS___MAC_GET_PID", Const, 0, ""}, - {"SYS___MAC_GET_PROC", Const, 0, ""}, - {"SYS___MAC_MOUNT", Const, 0, ""}, - {"SYS___MAC_SET_FD", Const, 0, ""}, - {"SYS___MAC_SET_FILE", Const, 0, ""}, - {"SYS___MAC_SET_LCTX", Const, 0, ""}, - {"SYS___MAC_SET_LINK", Const, 0, ""}, - {"SYS___MAC_SET_PROC", Const, 0, ""}, - {"SYS___MAC_SYSCALL", Const, 0, ""}, - {"SYS___OLD_SEMWAIT_SIGNAL", Const, 0, ""}, - {"SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", Const, 0, ""}, - {"SYS___POSIX_CHOWN", Const, 1, ""}, - {"SYS___POSIX_FCHOWN", Const, 1, ""}, - {"SYS___POSIX_LCHOWN", Const, 1, ""}, - {"SYS___POSIX_RENAME", Const, 1, ""}, - {"SYS___PTHREAD_CANCELED", Const, 0, ""}, - {"SYS___PTHREAD_CHDIR", Const, 0, ""}, - {"SYS___PTHREAD_FCHDIR", Const, 0, ""}, - {"SYS___PTHREAD_KILL", Const, 0, ""}, - {"SYS___PTHREAD_MARKCANCEL", Const, 0, ""}, - {"SYS___PTHREAD_SIGMASK", Const, 0, ""}, - {"SYS___QUOTACTL", Const, 1, ""}, - {"SYS___SEMCTL", Const, 1, ""}, - {"SYS___SEMWAIT_SIGNAL", Const, 0, ""}, - {"SYS___SEMWAIT_SIGNAL_NOCANCEL", Const, 0, ""}, - {"SYS___SETLOGIN", Const, 1, ""}, - {"SYS___SETUGID", Const, 0, ""}, - {"SYS___SET_TCB", Const, 1, ""}, - {"SYS___SIGACTION_SIGTRAMP", Const, 1, ""}, - {"SYS___SIGTIMEDWAIT", Const, 1, ""}, - {"SYS___SIGWAIT", Const, 0, ""}, - {"SYS___SIGWAIT_NOCANCEL", Const, 0, ""}, - {"SYS___SYSCTL", Const, 0, ""}, - {"SYS___TFORK", Const, 1, ""}, - {"SYS___THREXIT", Const, 1, ""}, - {"SYS___THRSIGDIVERT", Const, 1, ""}, - {"SYS___THRSLEEP", Const, 1, ""}, - {"SYS___THRWAKEUP", Const, 1, ""}, - {"S_ARCH1", Const, 1, ""}, - {"S_ARCH2", Const, 1, ""}, - {"S_BLKSIZE", Const, 0, ""}, - {"S_IEXEC", Const, 0, ""}, - {"S_IFBLK", Const, 0, ""}, - {"S_IFCHR", Const, 0, ""}, - {"S_IFDIR", Const, 0, ""}, - {"S_IFIFO", Const, 0, ""}, - {"S_IFLNK", Const, 0, ""}, - {"S_IFMT", Const, 0, ""}, - {"S_IFREG", Const, 0, ""}, - {"S_IFSOCK", Const, 0, ""}, - {"S_IFWHT", Const, 0, ""}, - {"S_IREAD", Const, 0, ""}, - {"S_IRGRP", Const, 0, ""}, - {"S_IROTH", Const, 0, ""}, - {"S_IRUSR", Const, 0, ""}, - {"S_IRWXG", Const, 0, ""}, - {"S_IRWXO", Const, 0, ""}, - {"S_IRWXU", Const, 0, ""}, - {"S_ISGID", Const, 0, ""}, - {"S_ISTXT", Const, 0, ""}, - {"S_ISUID", Const, 0, ""}, - {"S_ISVTX", Const, 0, ""}, - {"S_IWGRP", Const, 0, ""}, - {"S_IWOTH", Const, 0, ""}, - {"S_IWRITE", Const, 0, ""}, - {"S_IWUSR", Const, 0, ""}, - {"S_IXGRP", Const, 0, ""}, - {"S_IXOTH", Const, 0, ""}, - {"S_IXUSR", Const, 0, ""}, - {"S_LOGIN_SET", Const, 1, ""}, - {"SecurityAttributes", Type, 0, ""}, - {"SecurityAttributes.InheritHandle", Field, 0, ""}, - {"SecurityAttributes.Length", Field, 0, ""}, - {"SecurityAttributes.SecurityDescriptor", Field, 0, ""}, - {"Seek", Func, 0, "func(fd int, offset int64, whence int) (off int64, err error)"}, - {"Select", Func, 0, "func(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)"}, - {"Sendfile", Func, 0, "func(outfd int, infd int, offset *int64, count int) (written int, err error)"}, - {"Sendmsg", Func, 0, "func(fd int, p []byte, oob []byte, to Sockaddr, flags int) (err error)"}, - {"SendmsgN", Func, 3, "func(fd int, p []byte, oob []byte, to Sockaddr, flags int) (n int, err error)"}, - {"Sendto", Func, 0, "func(fd int, p []byte, flags int, to Sockaddr) (err error)"}, - {"Servent", Type, 0, ""}, - {"Servent.Aliases", Field, 0, ""}, - {"Servent.Name", Field, 0, ""}, - {"Servent.Port", Field, 0, ""}, - {"Servent.Proto", Field, 0, ""}, - {"SetBpf", Func, 0, ""}, - {"SetBpfBuflen", Func, 0, ""}, - {"SetBpfDatalink", Func, 0, ""}, - {"SetBpfHeadercmpl", Func, 0, ""}, - {"SetBpfImmediate", Func, 0, ""}, - {"SetBpfInterface", Func, 0, ""}, - {"SetBpfPromisc", Func, 0, ""}, - {"SetBpfTimeout", Func, 0, ""}, - {"SetCurrentDirectory", Func, 0, ""}, - {"SetEndOfFile", Func, 0, ""}, - {"SetEnvironmentVariable", Func, 0, ""}, - {"SetFileAttributes", Func, 0, ""}, - {"SetFileCompletionNotificationModes", Func, 2, ""}, - {"SetFilePointer", Func, 0, ""}, - {"SetFileTime", Func, 0, ""}, - {"SetHandleInformation", Func, 0, ""}, - {"SetKevent", Func, 0, ""}, - {"SetLsfPromisc", Func, 0, "func(name string, m bool) error"}, - {"SetNonblock", Func, 0, "func(fd int, nonblocking bool) (err error)"}, - {"Setdomainname", Func, 0, "func(p []byte) (err error)"}, - {"Setegid", Func, 0, "func(egid int) (err error)"}, - {"Setenv", Func, 0, "func(key string, value string) error"}, - {"Seteuid", Func, 0, "func(euid int) (err error)"}, - {"Setfsgid", Func, 0, "func(gid int) (err error)"}, - {"Setfsuid", Func, 0, "func(uid int) (err error)"}, - {"Setgid", Func, 0, "func(gid int) (err error)"}, - {"Setgroups", Func, 0, "func(gids []int) (err error)"}, - {"Sethostname", Func, 0, "func(p []byte) (err error)"}, - {"Setlogin", Func, 0, ""}, - {"Setpgid", Func, 0, "func(pid int, pgid int) (err error)"}, - {"Setpriority", Func, 0, "func(which int, who int, prio int) (err error)"}, - {"Setprivexec", Func, 0, ""}, - {"Setregid", Func, 0, "func(rgid int, egid int) (err error)"}, - {"Setresgid", Func, 0, "func(rgid int, egid int, sgid int) (err error)"}, - {"Setresuid", Func, 0, "func(ruid int, euid int, suid int) (err error)"}, - {"Setreuid", Func, 0, "func(ruid int, euid int) (err error)"}, - {"Setrlimit", Func, 0, "func(resource int, rlim *Rlimit) error"}, - {"Setsid", Func, 0, "func() (pid int, err error)"}, - {"Setsockopt", Func, 0, ""}, - {"SetsockoptByte", Func, 0, "func(fd int, level int, opt int, value byte) (err error)"}, - {"SetsockoptICMPv6Filter", Func, 2, "func(fd int, level int, opt int, filter *ICMPv6Filter) error"}, - {"SetsockoptIPMreq", Func, 0, "func(fd int, level int, opt int, mreq *IPMreq) (err error)"}, - {"SetsockoptIPMreqn", Func, 0, "func(fd int, level int, opt int, mreq *IPMreqn) (err error)"}, - {"SetsockoptIPv6Mreq", Func, 0, "func(fd int, level int, opt int, mreq *IPv6Mreq) (err error)"}, - {"SetsockoptInet4Addr", Func, 0, "func(fd int, level int, opt int, value [4]byte) (err error)"}, - {"SetsockoptInt", Func, 0, "func(fd int, level int, opt int, value int) (err error)"}, - {"SetsockoptLinger", Func, 0, "func(fd int, level int, opt int, l *Linger) (err error)"}, - {"SetsockoptString", Func, 0, "func(fd int, level int, opt int, s string) (err error)"}, - {"SetsockoptTimeval", Func, 0, "func(fd int, level int, opt int, tv *Timeval) (err error)"}, - {"Settimeofday", Func, 0, "func(tv *Timeval) (err error)"}, - {"Setuid", Func, 0, "func(uid int) (err error)"}, - {"Setxattr", Func, 1, "func(path string, attr string, data []byte, flags int) (err error)"}, - {"Shutdown", Func, 0, "func(fd int, how int) (err error)"}, - {"SidTypeAlias", Const, 0, ""}, - {"SidTypeComputer", Const, 0, ""}, - {"SidTypeDeletedAccount", Const, 0, ""}, - {"SidTypeDomain", Const, 0, ""}, - {"SidTypeGroup", Const, 0, ""}, - {"SidTypeInvalid", Const, 0, ""}, - {"SidTypeLabel", Const, 0, ""}, - {"SidTypeUnknown", Const, 0, ""}, - {"SidTypeUser", Const, 0, ""}, - {"SidTypeWellKnownGroup", Const, 0, ""}, - {"Signal", Type, 0, ""}, - {"SizeofBpfHdr", Const, 0, ""}, - {"SizeofBpfInsn", Const, 0, ""}, - {"SizeofBpfProgram", Const, 0, ""}, - {"SizeofBpfStat", Const, 0, ""}, - {"SizeofBpfVersion", Const, 0, ""}, - {"SizeofBpfZbuf", Const, 0, ""}, - {"SizeofBpfZbufHeader", Const, 0, ""}, - {"SizeofCmsghdr", Const, 0, ""}, - {"SizeofICMPv6Filter", Const, 2, ""}, - {"SizeofIPMreq", Const, 0, ""}, - {"SizeofIPMreqn", Const, 0, ""}, - {"SizeofIPv6MTUInfo", Const, 2, ""}, - {"SizeofIPv6Mreq", Const, 0, ""}, - {"SizeofIfAddrmsg", Const, 0, ""}, - {"SizeofIfAnnounceMsghdr", Const, 1, ""}, - {"SizeofIfData", Const, 0, ""}, - {"SizeofIfInfomsg", Const, 0, ""}, - {"SizeofIfMsghdr", Const, 0, ""}, - {"SizeofIfaMsghdr", Const, 0, ""}, - {"SizeofIfmaMsghdr", Const, 0, ""}, - {"SizeofIfmaMsghdr2", Const, 0, ""}, - {"SizeofInet4Pktinfo", Const, 0, ""}, - {"SizeofInet6Pktinfo", Const, 0, ""}, - {"SizeofInotifyEvent", Const, 0, ""}, - {"SizeofLinger", Const, 0, ""}, - {"SizeofMsghdr", Const, 0, ""}, - {"SizeofNlAttr", Const, 0, ""}, - {"SizeofNlMsgerr", Const, 0, ""}, - {"SizeofNlMsghdr", Const, 0, ""}, - {"SizeofRtAttr", Const, 0, ""}, - {"SizeofRtGenmsg", Const, 0, ""}, - {"SizeofRtMetrics", Const, 0, ""}, - {"SizeofRtMsg", Const, 0, ""}, - {"SizeofRtMsghdr", Const, 0, ""}, - {"SizeofRtNexthop", Const, 0, ""}, - {"SizeofSockFilter", Const, 0, ""}, - {"SizeofSockFprog", Const, 0, ""}, - {"SizeofSockaddrAny", Const, 0, ""}, - {"SizeofSockaddrDatalink", Const, 0, ""}, - {"SizeofSockaddrInet4", Const, 0, ""}, - {"SizeofSockaddrInet6", Const, 0, ""}, - {"SizeofSockaddrLinklayer", Const, 0, ""}, - {"SizeofSockaddrNetlink", Const, 0, ""}, - {"SizeofSockaddrUnix", Const, 0, ""}, - {"SizeofTCPInfo", Const, 1, ""}, - {"SizeofUcred", Const, 0, ""}, - {"SlicePtrFromStrings", Func, 1, "func(ss []string) ([]*byte, error)"}, - {"SockFilter", Type, 0, ""}, - {"SockFilter.Code", Field, 0, ""}, - {"SockFilter.Jf", Field, 0, ""}, - {"SockFilter.Jt", Field, 0, ""}, - {"SockFilter.K", Field, 0, ""}, - {"SockFprog", Type, 0, ""}, - {"SockFprog.Filter", Field, 0, ""}, - {"SockFprog.Len", Field, 0, ""}, - {"SockFprog.Pad_cgo_0", Field, 0, ""}, - {"SockaddrDatalink", Type, 0, ""}, - {"SockaddrDatalink.Alen", Field, 0, ""}, - {"SockaddrDatalink.Data", Field, 0, ""}, - {"SockaddrDatalink.Family", Field, 0, ""}, - {"SockaddrDatalink.Index", Field, 0, ""}, - {"SockaddrDatalink.Len", Field, 0, ""}, - {"SockaddrDatalink.Nlen", Field, 0, ""}, - {"SockaddrDatalink.Slen", Field, 0, ""}, - {"SockaddrDatalink.Type", Field, 0, ""}, - {"SockaddrGen", Type, 0, ""}, - {"SockaddrInet4", Type, 0, ""}, - {"SockaddrInet4.Addr", Field, 0, ""}, - {"SockaddrInet4.Port", Field, 0, ""}, - {"SockaddrInet6", Type, 0, ""}, - {"SockaddrInet6.Addr", Field, 0, ""}, - {"SockaddrInet6.Port", Field, 0, ""}, - {"SockaddrInet6.ZoneId", Field, 0, ""}, - {"SockaddrLinklayer", Type, 0, ""}, - {"SockaddrLinklayer.Addr", Field, 0, ""}, - {"SockaddrLinklayer.Halen", Field, 0, ""}, - {"SockaddrLinklayer.Hatype", Field, 0, ""}, - {"SockaddrLinklayer.Ifindex", Field, 0, ""}, - {"SockaddrLinklayer.Pkttype", Field, 0, ""}, - {"SockaddrLinklayer.Protocol", Field, 0, ""}, - {"SockaddrNetlink", Type, 0, ""}, - {"SockaddrNetlink.Family", Field, 0, ""}, - {"SockaddrNetlink.Groups", Field, 0, ""}, - {"SockaddrNetlink.Pad", Field, 0, ""}, - {"SockaddrNetlink.Pid", Field, 0, ""}, - {"SockaddrUnix", Type, 0, ""}, - {"SockaddrUnix.Name", Field, 0, ""}, - {"Socket", Func, 0, "func(domain int, typ int, proto int) (fd int, err error)"}, - {"SocketControlMessage", Type, 0, ""}, - {"SocketControlMessage.Data", Field, 0, ""}, - {"SocketControlMessage.Header", Field, 0, ""}, - {"SocketDisableIPv6", Var, 0, ""}, - {"Socketpair", Func, 0, "func(domain int, typ int, proto int) (fd [2]int, err error)"}, - {"Splice", Func, 0, "func(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)"}, - {"StartProcess", Func, 0, "func(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error)"}, - {"StartupInfo", Type, 0, ""}, - {"StartupInfo.Cb", Field, 0, ""}, - {"StartupInfo.Desktop", Field, 0, ""}, - {"StartupInfo.FillAttribute", Field, 0, ""}, - {"StartupInfo.Flags", Field, 0, ""}, - {"StartupInfo.ShowWindow", Field, 0, ""}, - {"StartupInfo.StdErr", Field, 0, ""}, - {"StartupInfo.StdInput", Field, 0, ""}, - {"StartupInfo.StdOutput", Field, 0, ""}, - {"StartupInfo.Title", Field, 0, ""}, - {"StartupInfo.X", Field, 0, ""}, - {"StartupInfo.XCountChars", Field, 0, ""}, - {"StartupInfo.XSize", Field, 0, ""}, - {"StartupInfo.Y", Field, 0, ""}, - {"StartupInfo.YCountChars", Field, 0, ""}, - {"StartupInfo.YSize", Field, 0, ""}, - {"Stat", Func, 0, "func(path string, stat *Stat_t) (err error)"}, - {"Stat_t", Type, 0, ""}, - {"Stat_t.Atim", Field, 0, ""}, - {"Stat_t.Atim_ext", Field, 12, ""}, - {"Stat_t.Atimespec", Field, 0, ""}, - {"Stat_t.Birthtimespec", Field, 0, ""}, - {"Stat_t.Blksize", Field, 0, ""}, - {"Stat_t.Blocks", Field, 0, ""}, - {"Stat_t.Btim_ext", Field, 12, ""}, - {"Stat_t.Ctim", Field, 0, ""}, - {"Stat_t.Ctim_ext", Field, 12, ""}, - {"Stat_t.Ctimespec", Field, 0, ""}, - {"Stat_t.Dev", Field, 0, ""}, - {"Stat_t.Flags", Field, 0, ""}, - {"Stat_t.Gen", Field, 0, ""}, - {"Stat_t.Gid", Field, 0, ""}, - {"Stat_t.Ino", Field, 0, ""}, - {"Stat_t.Lspare", Field, 0, ""}, - {"Stat_t.Lspare0", Field, 2, ""}, - {"Stat_t.Lspare1", Field, 2, ""}, - {"Stat_t.Mode", Field, 0, ""}, - {"Stat_t.Mtim", Field, 0, ""}, - {"Stat_t.Mtim_ext", Field, 12, ""}, - {"Stat_t.Mtimespec", Field, 0, ""}, - {"Stat_t.Nlink", Field, 0, ""}, - {"Stat_t.Pad_cgo_0", Field, 0, ""}, - {"Stat_t.Pad_cgo_1", Field, 0, ""}, - {"Stat_t.Pad_cgo_2", Field, 0, ""}, - {"Stat_t.Padding0", Field, 12, ""}, - {"Stat_t.Padding1", Field, 12, ""}, - {"Stat_t.Qspare", Field, 0, ""}, - {"Stat_t.Rdev", Field, 0, ""}, - {"Stat_t.Size", Field, 0, ""}, - {"Stat_t.Spare", Field, 2, ""}, - {"Stat_t.Uid", Field, 0, ""}, - {"Stat_t.X__pad0", Field, 0, ""}, - {"Stat_t.X__pad1", Field, 0, ""}, - {"Stat_t.X__pad2", Field, 0, ""}, - {"Stat_t.X__st_birthtim", Field, 2, ""}, - {"Stat_t.X__st_ino", Field, 0, ""}, - {"Stat_t.X__unused", Field, 0, ""}, - {"Statfs", Func, 0, "func(path string, buf *Statfs_t) (err error)"}, - {"Statfs_t", Type, 0, ""}, - {"Statfs_t.Asyncreads", Field, 0, ""}, - {"Statfs_t.Asyncwrites", Field, 0, ""}, - {"Statfs_t.Bavail", Field, 0, ""}, - {"Statfs_t.Bfree", Field, 0, ""}, - {"Statfs_t.Blocks", Field, 0, ""}, - {"Statfs_t.Bsize", Field, 0, ""}, - {"Statfs_t.Charspare", Field, 0, ""}, - {"Statfs_t.F_asyncreads", Field, 2, ""}, - {"Statfs_t.F_asyncwrites", Field, 2, ""}, - {"Statfs_t.F_bavail", Field, 2, ""}, - {"Statfs_t.F_bfree", Field, 2, ""}, - {"Statfs_t.F_blocks", Field, 2, ""}, - {"Statfs_t.F_bsize", Field, 2, ""}, - {"Statfs_t.F_ctime", Field, 2, ""}, - {"Statfs_t.F_favail", Field, 2, ""}, - {"Statfs_t.F_ffree", Field, 2, ""}, - {"Statfs_t.F_files", Field, 2, ""}, - {"Statfs_t.F_flags", Field, 2, ""}, - {"Statfs_t.F_fsid", Field, 2, ""}, - {"Statfs_t.F_fstypename", Field, 2, ""}, - {"Statfs_t.F_iosize", Field, 2, ""}, - {"Statfs_t.F_mntfromname", Field, 2, ""}, - {"Statfs_t.F_mntfromspec", Field, 3, ""}, - {"Statfs_t.F_mntonname", Field, 2, ""}, - {"Statfs_t.F_namemax", Field, 2, ""}, - {"Statfs_t.F_owner", Field, 2, ""}, - {"Statfs_t.F_spare", Field, 2, ""}, - {"Statfs_t.F_syncreads", Field, 2, ""}, - {"Statfs_t.F_syncwrites", Field, 2, ""}, - {"Statfs_t.Ffree", Field, 0, ""}, - {"Statfs_t.Files", Field, 0, ""}, - {"Statfs_t.Flags", Field, 0, ""}, - {"Statfs_t.Frsize", Field, 0, ""}, - {"Statfs_t.Fsid", Field, 0, ""}, - {"Statfs_t.Fssubtype", Field, 0, ""}, - {"Statfs_t.Fstypename", Field, 0, ""}, - {"Statfs_t.Iosize", Field, 0, ""}, - {"Statfs_t.Mntfromname", Field, 0, ""}, - {"Statfs_t.Mntonname", Field, 0, ""}, - {"Statfs_t.Mount_info", Field, 2, ""}, - {"Statfs_t.Namelen", Field, 0, ""}, - {"Statfs_t.Namemax", Field, 0, ""}, - {"Statfs_t.Owner", Field, 0, ""}, - {"Statfs_t.Pad_cgo_0", Field, 0, ""}, - {"Statfs_t.Pad_cgo_1", Field, 2, ""}, - {"Statfs_t.Reserved", Field, 0, ""}, - {"Statfs_t.Spare", Field, 0, ""}, - {"Statfs_t.Syncreads", Field, 0, ""}, - {"Statfs_t.Syncwrites", Field, 0, ""}, - {"Statfs_t.Type", Field, 0, ""}, - {"Statfs_t.Version", Field, 0, ""}, - {"Stderr", Var, 0, ""}, - {"Stdin", Var, 0, ""}, - {"Stdout", Var, 0, ""}, - {"StringBytePtr", Func, 0, "func(s string) *byte"}, - {"StringByteSlice", Func, 0, "func(s string) []byte"}, - {"StringSlicePtr", Func, 0, "func(ss []string) []*byte"}, - {"StringToSid", Func, 0, ""}, - {"StringToUTF16", Func, 0, ""}, - {"StringToUTF16Ptr", Func, 0, ""}, - {"Symlink", Func, 0, "func(oldpath string, newpath string) (err error)"}, - {"Sync", Func, 0, "func()"}, - {"SyncFileRange", Func, 0, "func(fd int, off int64, n int64, flags int) (err error)"}, - {"SysProcAttr", Type, 0, ""}, - {"SysProcAttr.AdditionalInheritedHandles", Field, 17, ""}, - {"SysProcAttr.AmbientCaps", Field, 9, ""}, - {"SysProcAttr.CgroupFD", Field, 20, ""}, - {"SysProcAttr.Chroot", Field, 0, ""}, - {"SysProcAttr.Cloneflags", Field, 2, ""}, - {"SysProcAttr.CmdLine", Field, 0, ""}, - {"SysProcAttr.CreationFlags", Field, 1, ""}, - {"SysProcAttr.Credential", Field, 0, ""}, - {"SysProcAttr.Ctty", Field, 1, ""}, - {"SysProcAttr.Foreground", Field, 5, ""}, - {"SysProcAttr.GidMappings", Field, 4, ""}, - {"SysProcAttr.GidMappingsEnableSetgroups", Field, 5, ""}, - {"SysProcAttr.HideWindow", Field, 0, ""}, - {"SysProcAttr.Jail", Field, 21, ""}, - {"SysProcAttr.NoInheritHandles", Field, 16, ""}, - {"SysProcAttr.Noctty", Field, 0, ""}, - {"SysProcAttr.ParentProcess", Field, 17, ""}, - {"SysProcAttr.Pdeathsig", Field, 0, ""}, - {"SysProcAttr.Pgid", Field, 5, ""}, - {"SysProcAttr.PidFD", Field, 22, ""}, - {"SysProcAttr.ProcessAttributes", Field, 13, ""}, - {"SysProcAttr.Ptrace", Field, 0, ""}, - {"SysProcAttr.Setctty", Field, 0, ""}, - {"SysProcAttr.Setpgid", Field, 0, ""}, - {"SysProcAttr.Setsid", Field, 0, ""}, - {"SysProcAttr.ThreadAttributes", Field, 13, ""}, - {"SysProcAttr.Token", Field, 10, ""}, - {"SysProcAttr.UidMappings", Field, 4, ""}, - {"SysProcAttr.Unshareflags", Field, 7, ""}, - {"SysProcAttr.UseCgroupFD", Field, 20, ""}, - {"SysProcIDMap", Type, 4, ""}, - {"SysProcIDMap.ContainerID", Field, 4, ""}, - {"SysProcIDMap.HostID", Field, 4, ""}, - {"SysProcIDMap.Size", Field, 4, ""}, - {"Syscall", Func, 0, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"Syscall12", Func, 0, ""}, - {"Syscall15", Func, 0, ""}, - {"Syscall18", Func, 12, ""}, - {"Syscall6", Func, 0, "func(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr) (r1 uintptr, r2 uintptr, err Errno)"}, - {"Syscall9", Func, 0, ""}, - {"SyscallN", Func, 18, ""}, - {"Sysctl", Func, 0, ""}, - {"SysctlUint32", Func, 0, ""}, - {"Sysctlnode", Type, 2, ""}, - {"Sysctlnode.Flags", Field, 2, ""}, - {"Sysctlnode.Name", Field, 2, ""}, - {"Sysctlnode.Num", Field, 2, ""}, - {"Sysctlnode.Un", Field, 2, ""}, - {"Sysctlnode.Ver", Field, 2, ""}, - {"Sysctlnode.X__rsvd", Field, 2, ""}, - {"Sysctlnode.X_sysctl_desc", Field, 2, ""}, - {"Sysctlnode.X_sysctl_func", Field, 2, ""}, - {"Sysctlnode.X_sysctl_parent", Field, 2, ""}, - {"Sysctlnode.X_sysctl_size", Field, 2, ""}, - {"Sysinfo", Func, 0, "func(info *Sysinfo_t) (err error)"}, - {"Sysinfo_t", Type, 0, ""}, - {"Sysinfo_t.Bufferram", Field, 0, ""}, - {"Sysinfo_t.Freehigh", Field, 0, ""}, - {"Sysinfo_t.Freeram", Field, 0, ""}, - {"Sysinfo_t.Freeswap", Field, 0, ""}, - {"Sysinfo_t.Loads", Field, 0, ""}, - {"Sysinfo_t.Pad", Field, 0, ""}, - {"Sysinfo_t.Pad_cgo_0", Field, 0, ""}, - {"Sysinfo_t.Pad_cgo_1", Field, 0, ""}, - {"Sysinfo_t.Procs", Field, 0, ""}, - {"Sysinfo_t.Sharedram", Field, 0, ""}, - {"Sysinfo_t.Totalhigh", Field, 0, ""}, - {"Sysinfo_t.Totalram", Field, 0, ""}, - {"Sysinfo_t.Totalswap", Field, 0, ""}, - {"Sysinfo_t.Unit", Field, 0, ""}, - {"Sysinfo_t.Uptime", Field, 0, ""}, - {"Sysinfo_t.X_f", Field, 0, ""}, - {"Systemtime", Type, 0, ""}, - {"Systemtime.Day", Field, 0, ""}, - {"Systemtime.DayOfWeek", Field, 0, ""}, - {"Systemtime.Hour", Field, 0, ""}, - {"Systemtime.Milliseconds", Field, 0, ""}, - {"Systemtime.Minute", Field, 0, ""}, - {"Systemtime.Month", Field, 0, ""}, - {"Systemtime.Second", Field, 0, ""}, - {"Systemtime.Year", Field, 0, ""}, - {"TCGETS", Const, 0, ""}, - {"TCIFLUSH", Const, 1, ""}, - {"TCIOFLUSH", Const, 1, ""}, - {"TCOFLUSH", Const, 1, ""}, - {"TCPInfo", Type, 1, ""}, - {"TCPInfo.Advmss", Field, 1, ""}, - {"TCPInfo.Ato", Field, 1, ""}, - {"TCPInfo.Backoff", Field, 1, ""}, - {"TCPInfo.Ca_state", Field, 1, ""}, - {"TCPInfo.Fackets", Field, 1, ""}, - {"TCPInfo.Last_ack_recv", Field, 1, ""}, - {"TCPInfo.Last_ack_sent", Field, 1, ""}, - {"TCPInfo.Last_data_recv", Field, 1, ""}, - {"TCPInfo.Last_data_sent", Field, 1, ""}, - {"TCPInfo.Lost", Field, 1, ""}, - {"TCPInfo.Options", Field, 1, ""}, - {"TCPInfo.Pad_cgo_0", Field, 1, ""}, - {"TCPInfo.Pmtu", Field, 1, ""}, - {"TCPInfo.Probes", Field, 1, ""}, - {"TCPInfo.Rcv_mss", Field, 1, ""}, - {"TCPInfo.Rcv_rtt", Field, 1, ""}, - {"TCPInfo.Rcv_space", Field, 1, ""}, - {"TCPInfo.Rcv_ssthresh", Field, 1, ""}, - {"TCPInfo.Reordering", Field, 1, ""}, - {"TCPInfo.Retrans", Field, 1, ""}, - {"TCPInfo.Retransmits", Field, 1, ""}, - {"TCPInfo.Rto", Field, 1, ""}, - {"TCPInfo.Rtt", Field, 1, ""}, - {"TCPInfo.Rttvar", Field, 1, ""}, - {"TCPInfo.Sacked", Field, 1, ""}, - {"TCPInfo.Snd_cwnd", Field, 1, ""}, - {"TCPInfo.Snd_mss", Field, 1, ""}, - {"TCPInfo.Snd_ssthresh", Field, 1, ""}, - {"TCPInfo.State", Field, 1, ""}, - {"TCPInfo.Total_retrans", Field, 1, ""}, - {"TCPInfo.Unacked", Field, 1, ""}, - {"TCPKeepalive", Type, 3, ""}, - {"TCPKeepalive.Interval", Field, 3, ""}, - {"TCPKeepalive.OnOff", Field, 3, ""}, - {"TCPKeepalive.Time", Field, 3, ""}, - {"TCP_CA_NAME_MAX", Const, 0, ""}, - {"TCP_CONGCTL", Const, 1, ""}, - {"TCP_CONGESTION", Const, 0, ""}, - {"TCP_CONNECTIONTIMEOUT", Const, 0, ""}, - {"TCP_CORK", Const, 0, ""}, - {"TCP_DEFER_ACCEPT", Const, 0, ""}, - {"TCP_ENABLE_ECN", Const, 16, ""}, - {"TCP_INFO", Const, 0, ""}, - {"TCP_KEEPALIVE", Const, 0, ""}, - {"TCP_KEEPCNT", Const, 0, ""}, - {"TCP_KEEPIDLE", Const, 0, ""}, - {"TCP_KEEPINIT", Const, 1, ""}, - {"TCP_KEEPINTVL", Const, 0, ""}, - {"TCP_LINGER2", Const, 0, ""}, - {"TCP_MAXBURST", Const, 0, ""}, - {"TCP_MAXHLEN", Const, 0, ""}, - {"TCP_MAXOLEN", Const, 0, ""}, - {"TCP_MAXSEG", Const, 0, ""}, - {"TCP_MAXWIN", Const, 0, ""}, - {"TCP_MAX_SACK", Const, 0, ""}, - {"TCP_MAX_WINSHIFT", Const, 0, ""}, - {"TCP_MD5SIG", Const, 0, ""}, - {"TCP_MD5SIG_MAXKEYLEN", Const, 0, ""}, - {"TCP_MINMSS", Const, 0, ""}, - {"TCP_MINMSSOVERLOAD", Const, 0, ""}, - {"TCP_MSS", Const, 0, ""}, - {"TCP_NODELAY", Const, 0, ""}, - {"TCP_NOOPT", Const, 0, ""}, - {"TCP_NOPUSH", Const, 0, ""}, - {"TCP_NOTSENT_LOWAT", Const, 16, ""}, - {"TCP_NSTATES", Const, 1, ""}, - {"TCP_QUICKACK", Const, 0, ""}, - {"TCP_RXT_CONNDROPTIME", Const, 0, ""}, - {"TCP_RXT_FINDROP", Const, 0, ""}, - {"TCP_SACK_ENABLE", Const, 1, ""}, - {"TCP_SENDMOREACKS", Const, 16, ""}, - {"TCP_SYNCNT", Const, 0, ""}, - {"TCP_VENDOR", Const, 3, ""}, - {"TCP_WINDOW_CLAMP", Const, 0, ""}, - {"TCSAFLUSH", Const, 1, ""}, - {"TCSETS", Const, 0, ""}, - {"TF_DISCONNECT", Const, 0, ""}, - {"TF_REUSE_SOCKET", Const, 0, ""}, - {"TF_USE_DEFAULT_WORKER", Const, 0, ""}, - {"TF_USE_KERNEL_APC", Const, 0, ""}, - {"TF_USE_SYSTEM_THREAD", Const, 0, ""}, - {"TF_WRITE_BEHIND", Const, 0, ""}, - {"TH32CS_INHERIT", Const, 4, ""}, - {"TH32CS_SNAPALL", Const, 4, ""}, - {"TH32CS_SNAPHEAPLIST", Const, 4, ""}, - {"TH32CS_SNAPMODULE", Const, 4, ""}, - {"TH32CS_SNAPMODULE32", Const, 4, ""}, - {"TH32CS_SNAPPROCESS", Const, 4, ""}, - {"TH32CS_SNAPTHREAD", Const, 4, ""}, - {"TIME_ZONE_ID_DAYLIGHT", Const, 0, ""}, - {"TIME_ZONE_ID_STANDARD", Const, 0, ""}, - {"TIME_ZONE_ID_UNKNOWN", Const, 0, ""}, - {"TIOCCBRK", Const, 0, ""}, - {"TIOCCDTR", Const, 0, ""}, - {"TIOCCONS", Const, 0, ""}, - {"TIOCDCDTIMESTAMP", Const, 0, ""}, - {"TIOCDRAIN", Const, 0, ""}, - {"TIOCDSIMICROCODE", Const, 0, ""}, - {"TIOCEXCL", Const, 0, ""}, - {"TIOCEXT", Const, 0, ""}, - {"TIOCFLAG_CDTRCTS", Const, 1, ""}, - {"TIOCFLAG_CLOCAL", Const, 1, ""}, - {"TIOCFLAG_CRTSCTS", Const, 1, ""}, - {"TIOCFLAG_MDMBUF", Const, 1, ""}, - {"TIOCFLAG_PPS", Const, 1, ""}, - {"TIOCFLAG_SOFTCAR", Const, 1, ""}, - {"TIOCFLUSH", Const, 0, ""}, - {"TIOCGDEV", Const, 0, ""}, - {"TIOCGDRAINWAIT", Const, 0, ""}, - {"TIOCGETA", Const, 0, ""}, - {"TIOCGETD", Const, 0, ""}, - {"TIOCGFLAGS", Const, 1, ""}, - {"TIOCGICOUNT", Const, 0, ""}, - {"TIOCGLCKTRMIOS", Const, 0, ""}, - {"TIOCGLINED", Const, 1, ""}, - {"TIOCGPGRP", Const, 0, ""}, - {"TIOCGPTN", Const, 0, ""}, - {"TIOCGQSIZE", Const, 1, ""}, - {"TIOCGRANTPT", Const, 1, ""}, - {"TIOCGRS485", Const, 0, ""}, - {"TIOCGSERIAL", Const, 0, ""}, - {"TIOCGSID", Const, 0, ""}, - {"TIOCGSIZE", Const, 1, ""}, - {"TIOCGSOFTCAR", Const, 0, ""}, - {"TIOCGTSTAMP", Const, 1, ""}, - {"TIOCGWINSZ", Const, 0, ""}, - {"TIOCINQ", Const, 0, ""}, - {"TIOCIXOFF", Const, 0, ""}, - {"TIOCIXON", Const, 0, ""}, - {"TIOCLINUX", Const, 0, ""}, - {"TIOCMBIC", Const, 0, ""}, - {"TIOCMBIS", Const, 0, ""}, - {"TIOCMGDTRWAIT", Const, 0, ""}, - {"TIOCMGET", Const, 0, ""}, - {"TIOCMIWAIT", Const, 0, ""}, - {"TIOCMODG", Const, 0, ""}, - {"TIOCMODS", Const, 0, ""}, - {"TIOCMSDTRWAIT", Const, 0, ""}, - {"TIOCMSET", Const, 0, ""}, - {"TIOCM_CAR", Const, 0, ""}, - {"TIOCM_CD", Const, 0, ""}, - {"TIOCM_CTS", Const, 0, ""}, - {"TIOCM_DCD", Const, 0, ""}, - {"TIOCM_DSR", Const, 0, ""}, - {"TIOCM_DTR", Const, 0, ""}, - {"TIOCM_LE", Const, 0, ""}, - {"TIOCM_RI", Const, 0, ""}, - {"TIOCM_RNG", Const, 0, ""}, - {"TIOCM_RTS", Const, 0, ""}, - {"TIOCM_SR", Const, 0, ""}, - {"TIOCM_ST", Const, 0, ""}, - {"TIOCNOTTY", Const, 0, ""}, - {"TIOCNXCL", Const, 0, ""}, - {"TIOCOUTQ", Const, 0, ""}, - {"TIOCPKT", Const, 0, ""}, - {"TIOCPKT_DATA", Const, 0, ""}, - {"TIOCPKT_DOSTOP", Const, 0, ""}, - {"TIOCPKT_FLUSHREAD", Const, 0, ""}, - {"TIOCPKT_FLUSHWRITE", Const, 0, ""}, - {"TIOCPKT_IOCTL", Const, 0, ""}, - {"TIOCPKT_NOSTOP", Const, 0, ""}, - {"TIOCPKT_START", Const, 0, ""}, - {"TIOCPKT_STOP", Const, 0, ""}, - {"TIOCPTMASTER", Const, 0, ""}, - {"TIOCPTMGET", Const, 1, ""}, - {"TIOCPTSNAME", Const, 1, ""}, - {"TIOCPTYGNAME", Const, 0, ""}, - {"TIOCPTYGRANT", Const, 0, ""}, - {"TIOCPTYUNLK", Const, 0, ""}, - {"TIOCRCVFRAME", Const, 1, ""}, - {"TIOCREMOTE", Const, 0, ""}, - {"TIOCSBRK", Const, 0, ""}, - {"TIOCSCONS", Const, 0, ""}, - {"TIOCSCTTY", Const, 0, ""}, - {"TIOCSDRAINWAIT", Const, 0, ""}, - {"TIOCSDTR", Const, 0, ""}, - {"TIOCSERCONFIG", Const, 0, ""}, - {"TIOCSERGETLSR", Const, 0, ""}, - {"TIOCSERGETMULTI", Const, 0, ""}, - {"TIOCSERGSTRUCT", Const, 0, ""}, - {"TIOCSERGWILD", Const, 0, ""}, - {"TIOCSERSETMULTI", Const, 0, ""}, - {"TIOCSERSWILD", Const, 0, ""}, - {"TIOCSER_TEMT", Const, 0, ""}, - {"TIOCSETA", Const, 0, ""}, - {"TIOCSETAF", Const, 0, ""}, - {"TIOCSETAW", Const, 0, ""}, - {"TIOCSETD", Const, 0, ""}, - {"TIOCSFLAGS", Const, 1, ""}, - {"TIOCSIG", Const, 0, ""}, - {"TIOCSLCKTRMIOS", Const, 0, ""}, - {"TIOCSLINED", Const, 1, ""}, - {"TIOCSPGRP", Const, 0, ""}, - {"TIOCSPTLCK", Const, 0, ""}, - {"TIOCSQSIZE", Const, 1, ""}, - {"TIOCSRS485", Const, 0, ""}, - {"TIOCSSERIAL", Const, 0, ""}, - {"TIOCSSIZE", Const, 1, ""}, - {"TIOCSSOFTCAR", Const, 0, ""}, - {"TIOCSTART", Const, 0, ""}, - {"TIOCSTAT", Const, 0, ""}, - {"TIOCSTI", Const, 0, ""}, - {"TIOCSTOP", Const, 0, ""}, - {"TIOCSTSTAMP", Const, 1, ""}, - {"TIOCSWINSZ", Const, 0, ""}, - {"TIOCTIMESTAMP", Const, 0, ""}, - {"TIOCUCNTL", Const, 0, ""}, - {"TIOCVHANGUP", Const, 0, ""}, - {"TIOCXMTFRAME", Const, 1, ""}, - {"TOKEN_ADJUST_DEFAULT", Const, 0, ""}, - {"TOKEN_ADJUST_GROUPS", Const, 0, ""}, - {"TOKEN_ADJUST_PRIVILEGES", Const, 0, ""}, - {"TOKEN_ADJUST_SESSIONID", Const, 11, ""}, - {"TOKEN_ALL_ACCESS", Const, 0, ""}, - {"TOKEN_ASSIGN_PRIMARY", Const, 0, ""}, - {"TOKEN_DUPLICATE", Const, 0, ""}, - {"TOKEN_EXECUTE", Const, 0, ""}, - {"TOKEN_IMPERSONATE", Const, 0, ""}, - {"TOKEN_QUERY", Const, 0, ""}, - {"TOKEN_QUERY_SOURCE", Const, 0, ""}, - {"TOKEN_READ", Const, 0, ""}, - {"TOKEN_WRITE", Const, 0, ""}, - {"TOSTOP", Const, 0, ""}, - {"TRUNCATE_EXISTING", Const, 0, ""}, - {"TUNATTACHFILTER", Const, 0, ""}, - {"TUNDETACHFILTER", Const, 0, ""}, - {"TUNGETFEATURES", Const, 0, ""}, - {"TUNGETIFF", Const, 0, ""}, - {"TUNGETSNDBUF", Const, 0, ""}, - {"TUNGETVNETHDRSZ", Const, 0, ""}, - {"TUNSETDEBUG", Const, 0, ""}, - {"TUNSETGROUP", Const, 0, ""}, - {"TUNSETIFF", Const, 0, ""}, - {"TUNSETLINK", Const, 0, ""}, - {"TUNSETNOCSUM", Const, 0, ""}, - {"TUNSETOFFLOAD", Const, 0, ""}, - {"TUNSETOWNER", Const, 0, ""}, - {"TUNSETPERSIST", Const, 0, ""}, - {"TUNSETSNDBUF", Const, 0, ""}, - {"TUNSETTXFILTER", Const, 0, ""}, - {"TUNSETVNETHDRSZ", Const, 0, ""}, - {"Tee", Func, 0, "func(rfd int, wfd int, len int, flags int) (n int64, err error)"}, - {"TerminateProcess", Func, 0, ""}, - {"Termios", Type, 0, ""}, - {"Termios.Cc", Field, 0, ""}, - {"Termios.Cflag", Field, 0, ""}, - {"Termios.Iflag", Field, 0, ""}, - {"Termios.Ispeed", Field, 0, ""}, - {"Termios.Lflag", Field, 0, ""}, - {"Termios.Line", Field, 0, ""}, - {"Termios.Oflag", Field, 0, ""}, - {"Termios.Ospeed", Field, 0, ""}, - {"Termios.Pad_cgo_0", Field, 0, ""}, - {"Tgkill", Func, 0, "func(tgid int, tid int, sig Signal) (err error)"}, - {"Time", Func, 0, "func(t *Time_t) (tt Time_t, err error)"}, - {"Time_t", Type, 0, ""}, - {"Times", Func, 0, "func(tms *Tms) (ticks uintptr, err error)"}, - {"Timespec", Type, 0, ""}, - {"Timespec.Nsec", Field, 0, ""}, - {"Timespec.Pad_cgo_0", Field, 2, ""}, - {"Timespec.Sec", Field, 0, ""}, - {"TimespecToNsec", Func, 0, "func(ts Timespec) int64"}, - {"Timeval", Type, 0, ""}, - {"Timeval.Pad_cgo_0", Field, 0, ""}, - {"Timeval.Sec", Field, 0, ""}, - {"Timeval.Usec", Field, 0, ""}, - {"Timeval32", Type, 0, ""}, - {"Timeval32.Sec", Field, 0, ""}, - {"Timeval32.Usec", Field, 0, ""}, - {"TimevalToNsec", Func, 0, "func(tv Timeval) int64"}, - {"Timex", Type, 0, ""}, - {"Timex.Calcnt", Field, 0, ""}, - {"Timex.Constant", Field, 0, ""}, - {"Timex.Errcnt", Field, 0, ""}, - {"Timex.Esterror", Field, 0, ""}, - {"Timex.Freq", Field, 0, ""}, - {"Timex.Jitcnt", Field, 0, ""}, - {"Timex.Jitter", Field, 0, ""}, - {"Timex.Maxerror", Field, 0, ""}, - {"Timex.Modes", Field, 0, ""}, - {"Timex.Offset", Field, 0, ""}, - {"Timex.Pad_cgo_0", Field, 0, ""}, - {"Timex.Pad_cgo_1", Field, 0, ""}, - {"Timex.Pad_cgo_2", Field, 0, ""}, - {"Timex.Pad_cgo_3", Field, 0, ""}, - {"Timex.Ppsfreq", Field, 0, ""}, - {"Timex.Precision", Field, 0, ""}, - {"Timex.Shift", Field, 0, ""}, - {"Timex.Stabil", Field, 0, ""}, - {"Timex.Status", Field, 0, ""}, - {"Timex.Stbcnt", Field, 0, ""}, - {"Timex.Tai", Field, 0, ""}, - {"Timex.Tick", Field, 0, ""}, - {"Timex.Time", Field, 0, ""}, - {"Timex.Tolerance", Field, 0, ""}, - {"Timezoneinformation", Type, 0, ""}, - {"Timezoneinformation.Bias", Field, 0, ""}, - {"Timezoneinformation.DaylightBias", Field, 0, ""}, - {"Timezoneinformation.DaylightDate", Field, 0, ""}, - {"Timezoneinformation.DaylightName", Field, 0, ""}, - {"Timezoneinformation.StandardBias", Field, 0, ""}, - {"Timezoneinformation.StandardDate", Field, 0, ""}, - {"Timezoneinformation.StandardName", Field, 0, ""}, - {"Tms", Type, 0, ""}, - {"Tms.Cstime", Field, 0, ""}, - {"Tms.Cutime", Field, 0, ""}, - {"Tms.Stime", Field, 0, ""}, - {"Tms.Utime", Field, 0, ""}, - {"Token", Type, 0, ""}, - {"TokenAccessInformation", Const, 0, ""}, - {"TokenAuditPolicy", Const, 0, ""}, - {"TokenDefaultDacl", Const, 0, ""}, - {"TokenElevation", Const, 0, ""}, - {"TokenElevationType", Const, 0, ""}, - {"TokenGroups", Const, 0, ""}, - {"TokenGroupsAndPrivileges", Const, 0, ""}, - {"TokenHasRestrictions", Const, 0, ""}, - {"TokenImpersonationLevel", Const, 0, ""}, - {"TokenIntegrityLevel", Const, 0, ""}, - {"TokenLinkedToken", Const, 0, ""}, - {"TokenLogonSid", Const, 0, ""}, - {"TokenMandatoryPolicy", Const, 0, ""}, - {"TokenOrigin", Const, 0, ""}, - {"TokenOwner", Const, 0, ""}, - {"TokenPrimaryGroup", Const, 0, ""}, - {"TokenPrivileges", Const, 0, ""}, - {"TokenRestrictedSids", Const, 0, ""}, - {"TokenSandBoxInert", Const, 0, ""}, - {"TokenSessionId", Const, 0, ""}, - {"TokenSessionReference", Const, 0, ""}, - {"TokenSource", Const, 0, ""}, - {"TokenStatistics", Const, 0, ""}, - {"TokenType", Const, 0, ""}, - {"TokenUIAccess", Const, 0, ""}, - {"TokenUser", Const, 0, ""}, - {"TokenVirtualizationAllowed", Const, 0, ""}, - {"TokenVirtualizationEnabled", Const, 0, ""}, - {"Tokenprimarygroup", Type, 0, ""}, - {"Tokenprimarygroup.PrimaryGroup", Field, 0, ""}, - {"Tokenuser", Type, 0, ""}, - {"Tokenuser.User", Field, 0, ""}, - {"TranslateAccountName", Func, 0, ""}, - {"TranslateName", Func, 0, ""}, - {"TransmitFile", Func, 0, ""}, - {"TransmitFileBuffers", Type, 0, ""}, - {"TransmitFileBuffers.Head", Field, 0, ""}, - {"TransmitFileBuffers.HeadLength", Field, 0, ""}, - {"TransmitFileBuffers.Tail", Field, 0, ""}, - {"TransmitFileBuffers.TailLength", Field, 0, ""}, - {"Truncate", Func, 0, "func(path string, length int64) (err error)"}, - {"UNIX_PATH_MAX", Const, 12, ""}, - {"USAGE_MATCH_TYPE_AND", Const, 0, ""}, - {"USAGE_MATCH_TYPE_OR", Const, 0, ""}, - {"UTF16FromString", Func, 1, ""}, - {"UTF16PtrFromString", Func, 1, ""}, - {"UTF16ToString", Func, 0, ""}, - {"Ucred", Type, 0, ""}, - {"Ucred.Gid", Field, 0, ""}, - {"Ucred.Pid", Field, 0, ""}, - {"Ucred.Uid", Field, 0, ""}, - {"Umask", Func, 0, "func(mask int) (oldmask int)"}, - {"Uname", Func, 0, "func(buf *Utsname) (err error)"}, - {"Undelete", Func, 0, ""}, - {"UnixCredentials", Func, 0, "func(ucred *Ucred) []byte"}, - {"UnixRights", Func, 0, "func(fds ...int) []byte"}, - {"Unlink", Func, 0, "func(path string) error"}, - {"Unlinkat", Func, 0, "func(dirfd int, path string) error"}, - {"UnmapViewOfFile", Func, 0, ""}, - {"Unmount", Func, 0, "func(target string, flags int) (err error)"}, - {"Unsetenv", Func, 4, "func(key string) error"}, - {"Unshare", Func, 0, "func(flags int) (err error)"}, - {"UserInfo10", Type, 0, ""}, - {"UserInfo10.Comment", Field, 0, ""}, - {"UserInfo10.FullName", Field, 0, ""}, - {"UserInfo10.Name", Field, 0, ""}, - {"UserInfo10.UsrComment", Field, 0, ""}, - {"Ustat", Func, 0, "func(dev int, ubuf *Ustat_t) (err error)"}, - {"Ustat_t", Type, 0, ""}, - {"Ustat_t.Fname", Field, 0, ""}, - {"Ustat_t.Fpack", Field, 0, ""}, - {"Ustat_t.Pad_cgo_0", Field, 0, ""}, - {"Ustat_t.Pad_cgo_1", Field, 0, ""}, - {"Ustat_t.Tfree", Field, 0, ""}, - {"Ustat_t.Tinode", Field, 0, ""}, - {"Utimbuf", Type, 0, ""}, - {"Utimbuf.Actime", Field, 0, ""}, - {"Utimbuf.Modtime", Field, 0, ""}, - {"Utime", Func, 0, "func(path string, buf *Utimbuf) (err error)"}, - {"Utimes", Func, 0, "func(path string, tv []Timeval) (err error)"}, - {"UtimesNano", Func, 1, "func(path string, ts []Timespec) (err error)"}, - {"Utsname", Type, 0, ""}, - {"Utsname.Domainname", Field, 0, ""}, - {"Utsname.Machine", Field, 0, ""}, - {"Utsname.Nodename", Field, 0, ""}, - {"Utsname.Release", Field, 0, ""}, - {"Utsname.Sysname", Field, 0, ""}, - {"Utsname.Version", Field, 0, ""}, - {"VDISCARD", Const, 0, ""}, - {"VDSUSP", Const, 1, ""}, - {"VEOF", Const, 0, ""}, - {"VEOL", Const, 0, ""}, - {"VEOL2", Const, 0, ""}, - {"VERASE", Const, 0, ""}, - {"VERASE2", Const, 1, ""}, - {"VINTR", Const, 0, ""}, - {"VKILL", Const, 0, ""}, - {"VLNEXT", Const, 0, ""}, - {"VMIN", Const, 0, ""}, - {"VQUIT", Const, 0, ""}, - {"VREPRINT", Const, 0, ""}, - {"VSTART", Const, 0, ""}, - {"VSTATUS", Const, 1, ""}, - {"VSTOP", Const, 0, ""}, - {"VSUSP", Const, 0, ""}, - {"VSWTC", Const, 0, ""}, - {"VT0", Const, 1, ""}, - {"VT1", Const, 1, ""}, - {"VTDLY", Const, 1, ""}, - {"VTIME", Const, 0, ""}, - {"VWERASE", Const, 0, ""}, - {"VirtualLock", Func, 0, ""}, - {"VirtualUnlock", Func, 0, ""}, - {"WAIT_ABANDONED", Const, 0, ""}, - {"WAIT_FAILED", Const, 0, ""}, - {"WAIT_OBJECT_0", Const, 0, ""}, - {"WAIT_TIMEOUT", Const, 0, ""}, - {"WALL", Const, 0, ""}, - {"WALLSIG", Const, 1, ""}, - {"WALTSIG", Const, 1, ""}, - {"WCLONE", Const, 0, ""}, - {"WCONTINUED", Const, 0, ""}, - {"WCOREFLAG", Const, 0, ""}, - {"WEXITED", Const, 0, ""}, - {"WLINUXCLONE", Const, 0, ""}, - {"WNOHANG", Const, 0, ""}, - {"WNOTHREAD", Const, 0, ""}, - {"WNOWAIT", Const, 0, ""}, - {"WNOZOMBIE", Const, 1, ""}, - {"WOPTSCHECKED", Const, 1, ""}, - {"WORDSIZE", Const, 0, ""}, - {"WSABuf", Type, 0, ""}, - {"WSABuf.Buf", Field, 0, ""}, - {"WSABuf.Len", Field, 0, ""}, - {"WSACleanup", Func, 0, ""}, - {"WSADESCRIPTION_LEN", Const, 0, ""}, - {"WSAData", Type, 0, ""}, - {"WSAData.Description", Field, 0, ""}, - {"WSAData.HighVersion", Field, 0, ""}, - {"WSAData.MaxSockets", Field, 0, ""}, - {"WSAData.MaxUdpDg", Field, 0, ""}, - {"WSAData.SystemStatus", Field, 0, ""}, - {"WSAData.VendorInfo", Field, 0, ""}, - {"WSAData.Version", Field, 0, ""}, - {"WSAEACCES", Const, 2, ""}, - {"WSAECONNABORTED", Const, 9, ""}, - {"WSAECONNRESET", Const, 3, ""}, - {"WSAENOPROTOOPT", Const, 23, ""}, - {"WSAEnumProtocols", Func, 2, ""}, - {"WSAID_CONNECTEX", Var, 1, ""}, - {"WSAIoctl", Func, 0, ""}, - {"WSAPROTOCOL_LEN", Const, 2, ""}, - {"WSAProtocolChain", Type, 2, ""}, - {"WSAProtocolChain.ChainEntries", Field, 2, ""}, - {"WSAProtocolChain.ChainLen", Field, 2, ""}, - {"WSAProtocolInfo", Type, 2, ""}, - {"WSAProtocolInfo.AddressFamily", Field, 2, ""}, - {"WSAProtocolInfo.CatalogEntryId", Field, 2, ""}, - {"WSAProtocolInfo.MaxSockAddr", Field, 2, ""}, - {"WSAProtocolInfo.MessageSize", Field, 2, ""}, - {"WSAProtocolInfo.MinSockAddr", Field, 2, ""}, - {"WSAProtocolInfo.NetworkByteOrder", Field, 2, ""}, - {"WSAProtocolInfo.Protocol", Field, 2, ""}, - {"WSAProtocolInfo.ProtocolChain", Field, 2, ""}, - {"WSAProtocolInfo.ProtocolMaxOffset", Field, 2, ""}, - {"WSAProtocolInfo.ProtocolName", Field, 2, ""}, - {"WSAProtocolInfo.ProviderFlags", Field, 2, ""}, - {"WSAProtocolInfo.ProviderId", Field, 2, ""}, - {"WSAProtocolInfo.ProviderReserved", Field, 2, ""}, - {"WSAProtocolInfo.SecurityScheme", Field, 2, ""}, - {"WSAProtocolInfo.ServiceFlags1", Field, 2, ""}, - {"WSAProtocolInfo.ServiceFlags2", Field, 2, ""}, - {"WSAProtocolInfo.ServiceFlags3", Field, 2, ""}, - {"WSAProtocolInfo.ServiceFlags4", Field, 2, ""}, - {"WSAProtocolInfo.SocketType", Field, 2, ""}, - {"WSAProtocolInfo.Version", Field, 2, ""}, - {"WSARecv", Func, 0, ""}, - {"WSARecvFrom", Func, 0, ""}, - {"WSASYS_STATUS_LEN", Const, 0, ""}, - {"WSASend", Func, 0, ""}, - {"WSASendTo", Func, 0, ""}, - {"WSASendto", Func, 0, ""}, - {"WSAStartup", Func, 0, ""}, - {"WSTOPPED", Const, 0, ""}, - {"WTRAPPED", Const, 1, ""}, - {"WUNTRACED", Const, 0, ""}, - {"Wait4", Func, 0, "func(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error)"}, - {"WaitForSingleObject", Func, 0, ""}, - {"WaitStatus", Type, 0, ""}, - {"WaitStatus.ExitCode", Field, 0, ""}, - {"Win32FileAttributeData", Type, 0, ""}, - {"Win32FileAttributeData.CreationTime", Field, 0, ""}, - {"Win32FileAttributeData.FileAttributes", Field, 0, ""}, - {"Win32FileAttributeData.FileSizeHigh", Field, 0, ""}, - {"Win32FileAttributeData.FileSizeLow", Field, 0, ""}, - {"Win32FileAttributeData.LastAccessTime", Field, 0, ""}, - {"Win32FileAttributeData.LastWriteTime", Field, 0, ""}, - {"Win32finddata", Type, 0, ""}, - {"Win32finddata.AlternateFileName", Field, 0, ""}, - {"Win32finddata.CreationTime", Field, 0, ""}, - {"Win32finddata.FileAttributes", Field, 0, ""}, - {"Win32finddata.FileName", Field, 0, ""}, - {"Win32finddata.FileSizeHigh", Field, 0, ""}, - {"Win32finddata.FileSizeLow", Field, 0, ""}, - {"Win32finddata.LastAccessTime", Field, 0, ""}, - {"Win32finddata.LastWriteTime", Field, 0, ""}, - {"Win32finddata.Reserved0", Field, 0, ""}, - {"Win32finddata.Reserved1", Field, 0, ""}, - {"Write", Func, 0, "func(fd int, p []byte) (n int, err error)"}, - {"WriteConsole", Func, 1, ""}, - {"WriteFile", Func, 0, ""}, - {"X509_ASN_ENCODING", Const, 0, ""}, - {"XCASE", Const, 0, ""}, - {"XP1_CONNECTIONLESS", Const, 2, ""}, - {"XP1_CONNECT_DATA", Const, 2, ""}, - {"XP1_DISCONNECT_DATA", Const, 2, ""}, - {"XP1_EXPEDITED_DATA", Const, 2, ""}, - {"XP1_GRACEFUL_CLOSE", Const, 2, ""}, - {"XP1_GUARANTEED_DELIVERY", Const, 2, ""}, - {"XP1_GUARANTEED_ORDER", Const, 2, ""}, - {"XP1_IFS_HANDLES", Const, 2, ""}, - {"XP1_MESSAGE_ORIENTED", Const, 2, ""}, - {"XP1_MULTIPOINT_CONTROL_PLANE", Const, 2, ""}, - {"XP1_MULTIPOINT_DATA_PLANE", Const, 2, ""}, - {"XP1_PARTIAL_MESSAGE", Const, 2, ""}, - {"XP1_PSEUDO_STREAM", Const, 2, ""}, - {"XP1_QOS_SUPPORTED", Const, 2, ""}, - {"XP1_SAN_SUPPORT_SDP", Const, 2, ""}, - {"XP1_SUPPORT_BROADCAST", Const, 2, ""}, - {"XP1_SUPPORT_MULTIPOINT", Const, 2, ""}, - {"XP1_UNI_RECV", Const, 2, ""}, - {"XP1_UNI_SEND", Const, 2, ""}, - }, - "syscall/js": { - {"CopyBytesToGo", Func, 0, ""}, - {"CopyBytesToJS", Func, 0, ""}, - {"Error", Type, 0, ""}, - {"Func", Type, 0, ""}, - {"FuncOf", Func, 0, ""}, - {"Global", Func, 0, ""}, - {"Null", Func, 0, ""}, - {"Type", Type, 0, ""}, - {"TypeBoolean", Const, 0, ""}, - {"TypeFunction", Const, 0, ""}, - {"TypeNull", Const, 0, ""}, - {"TypeNumber", Const, 0, ""}, - {"TypeObject", Const, 0, ""}, - {"TypeString", Const, 0, ""}, - {"TypeSymbol", Const, 0, ""}, - {"TypeUndefined", Const, 0, ""}, - {"Undefined", Func, 0, ""}, - {"Value", Type, 0, ""}, - {"ValueError", Type, 0, ""}, - {"ValueOf", Func, 0, ""}, - }, - "testing": { - {"(*B).ArtifactDir", Method, 26, ""}, - {"(*B).Attr", Method, 25, ""}, - {"(*B).Chdir", Method, 24, ""}, - {"(*B).Cleanup", Method, 14, ""}, - {"(*B).Context", Method, 24, ""}, - {"(*B).Elapsed", Method, 20, ""}, - {"(*B).Error", Method, 0, ""}, - {"(*B).Errorf", Method, 0, ""}, - {"(*B).Fail", Method, 0, ""}, - {"(*B).FailNow", Method, 0, ""}, - {"(*B).Failed", Method, 0, ""}, - {"(*B).Fatal", Method, 0, ""}, - {"(*B).Fatalf", Method, 0, ""}, - {"(*B).Helper", Method, 9, ""}, - {"(*B).Log", Method, 0, ""}, - {"(*B).Logf", Method, 0, ""}, - {"(*B).Loop", Method, 24, ""}, - {"(*B).Name", Method, 8, ""}, - {"(*B).Output", Method, 25, ""}, - {"(*B).ReportAllocs", Method, 1, ""}, - {"(*B).ReportMetric", Method, 13, ""}, - {"(*B).ResetTimer", Method, 0, ""}, - {"(*B).Run", Method, 7, ""}, - {"(*B).RunParallel", Method, 3, ""}, - {"(*B).SetBytes", Method, 0, ""}, - {"(*B).SetParallelism", Method, 3, ""}, - {"(*B).Setenv", Method, 17, ""}, - {"(*B).Skip", Method, 1, ""}, - {"(*B).SkipNow", Method, 1, ""}, - {"(*B).Skipf", Method, 1, ""}, - {"(*B).Skipped", Method, 1, ""}, - {"(*B).StartTimer", Method, 0, ""}, - {"(*B).StopTimer", Method, 0, ""}, - {"(*B).TempDir", Method, 15, ""}, - {"(*F).Add", Method, 18, ""}, - {"(*F).ArtifactDir", Method, 26, ""}, - {"(*F).Attr", Method, 25, ""}, - {"(*F).Chdir", Method, 24, ""}, - {"(*F).Cleanup", Method, 18, ""}, - {"(*F).Context", Method, 24, ""}, - {"(*F).Error", Method, 18, ""}, - {"(*F).Errorf", Method, 18, ""}, - {"(*F).Fail", Method, 18, ""}, - {"(*F).FailNow", Method, 18, ""}, - {"(*F).Failed", Method, 18, ""}, - {"(*F).Fatal", Method, 18, ""}, - {"(*F).Fatalf", Method, 18, ""}, - {"(*F).Fuzz", Method, 18, ""}, - {"(*F).Helper", Method, 18, ""}, - {"(*F).Log", Method, 18, ""}, - {"(*F).Logf", Method, 18, ""}, - {"(*F).Name", Method, 18, ""}, - {"(*F).Output", Method, 25, ""}, - {"(*F).Setenv", Method, 18, ""}, - {"(*F).Skip", Method, 18, ""}, - {"(*F).SkipNow", Method, 18, ""}, - {"(*F).Skipf", Method, 18, ""}, - {"(*F).Skipped", Method, 18, ""}, - {"(*F).TempDir", Method, 18, ""}, - {"(*M).Run", Method, 4, ""}, - {"(*PB).Next", Method, 3, ""}, - {"(*T).ArtifactDir", Method, 26, ""}, - {"(*T).Attr", Method, 25, ""}, - {"(*T).Chdir", Method, 24, ""}, - {"(*T).Cleanup", Method, 14, ""}, - {"(*T).Context", Method, 24, ""}, - {"(*T).Deadline", Method, 15, ""}, - {"(*T).Error", Method, 0, ""}, - {"(*T).Errorf", Method, 0, ""}, - {"(*T).Fail", Method, 0, ""}, - {"(*T).FailNow", Method, 0, ""}, - {"(*T).Failed", Method, 0, ""}, - {"(*T).Fatal", Method, 0, ""}, - {"(*T).Fatalf", Method, 0, ""}, - {"(*T).Helper", Method, 9, ""}, - {"(*T).Log", Method, 0, ""}, - {"(*T).Logf", Method, 0, ""}, - {"(*T).Name", Method, 8, ""}, - {"(*T).Output", Method, 25, ""}, - {"(*T).Parallel", Method, 0, ""}, - {"(*T).Run", Method, 7, ""}, - {"(*T).Setenv", Method, 17, ""}, - {"(*T).Skip", Method, 1, ""}, - {"(*T).SkipNow", Method, 1, ""}, - {"(*T).Skipf", Method, 1, ""}, - {"(*T).Skipped", Method, 1, ""}, - {"(*T).TempDir", Method, 15, ""}, - {"(BenchmarkResult).AllocedBytesPerOp", Method, 1, ""}, - {"(BenchmarkResult).AllocsPerOp", Method, 1, ""}, - {"(BenchmarkResult).MemString", Method, 1, ""}, - {"(BenchmarkResult).NsPerOp", Method, 0, ""}, - {"(BenchmarkResult).String", Method, 0, ""}, - {"(TB).ArtifactDir", Method, 26, ""}, - {"(TB).Attr", Method, 25, ""}, - {"(TB).Chdir", Method, 24, ""}, - {"(TB).Cleanup", Method, 14, ""}, - {"(TB).Context", Method, 24, ""}, - {"(TB).Error", Method, 2, ""}, - {"(TB).Errorf", Method, 2, ""}, - {"(TB).Fail", Method, 2, ""}, - {"(TB).FailNow", Method, 2, ""}, - {"(TB).Failed", Method, 2, ""}, - {"(TB).Fatal", Method, 2, ""}, - {"(TB).Fatalf", Method, 2, ""}, - {"(TB).Helper", Method, 9, ""}, - {"(TB).Log", Method, 2, ""}, - {"(TB).Logf", Method, 2, ""}, - {"(TB).Name", Method, 8, ""}, - {"(TB).Output", Method, 25, ""}, - {"(TB).Setenv", Method, 17, ""}, - {"(TB).Skip", Method, 2, ""}, - {"(TB).SkipNow", Method, 2, ""}, - {"(TB).Skipf", Method, 2, ""}, - {"(TB).Skipped", Method, 2, ""}, - {"(TB).TempDir", Method, 15, ""}, - {"AllocsPerRun", Func, 1, "func(runs int, f func()) (avg float64)"}, - {"B", Type, 0, ""}, - {"B.N", Field, 0, ""}, - {"Benchmark", Func, 0, "func(f func(b *B)) BenchmarkResult"}, - {"BenchmarkResult", Type, 0, ""}, - {"BenchmarkResult.Bytes", Field, 0, ""}, - {"BenchmarkResult.Extra", Field, 13, ""}, - {"BenchmarkResult.MemAllocs", Field, 1, ""}, - {"BenchmarkResult.MemBytes", Field, 1, ""}, - {"BenchmarkResult.N", Field, 0, ""}, - {"BenchmarkResult.T", Field, 0, ""}, - {"Cover", Type, 2, ""}, - {"Cover.Blocks", Field, 2, ""}, - {"Cover.Counters", Field, 2, ""}, - {"Cover.CoveredPackages", Field, 2, ""}, - {"Cover.Mode", Field, 2, ""}, - {"CoverBlock", Type, 2, ""}, - {"CoverBlock.Col0", Field, 2, ""}, - {"CoverBlock.Col1", Field, 2, ""}, - {"CoverBlock.Line0", Field, 2, ""}, - {"CoverBlock.Line1", Field, 2, ""}, - {"CoverBlock.Stmts", Field, 2, ""}, - {"CoverMode", Func, 8, "func() string"}, - {"Coverage", Func, 4, "func() float64"}, - {"F", Type, 18, ""}, - {"Init", Func, 13, "func()"}, - {"InternalBenchmark", Type, 0, ""}, - {"InternalBenchmark.F", Field, 0, ""}, - {"InternalBenchmark.Name", Field, 0, ""}, - {"InternalExample", Type, 0, ""}, - {"InternalExample.F", Field, 0, ""}, - {"InternalExample.Name", Field, 0, ""}, - {"InternalExample.Output", Field, 0, ""}, - {"InternalExample.Unordered", Field, 7, ""}, - {"InternalFuzzTarget", Type, 18, ""}, - {"InternalFuzzTarget.Fn", Field, 18, ""}, - {"InternalFuzzTarget.Name", Field, 18, ""}, - {"InternalTest", Type, 0, ""}, - {"InternalTest.F", Field, 0, ""}, - {"InternalTest.Name", Field, 0, ""}, - {"M", Type, 4, ""}, - {"Main", Func, 0, "func(matchString func(pat string, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)"}, - {"MainStart", Func, 4, "func(deps testDeps, tests []InternalTest, benchmarks []InternalBenchmark, fuzzTargets []InternalFuzzTarget, examples []InternalExample) *M"}, - {"PB", Type, 3, ""}, - {"RegisterCover", Func, 2, "func(c Cover)"}, - {"RunBenchmarks", Func, 0, "func(matchString func(pat string, str string) (bool, error), benchmarks []InternalBenchmark)"}, - {"RunExamples", Func, 0, "func(matchString func(pat string, str string) (bool, error), examples []InternalExample) (ok bool)"}, - {"RunTests", Func, 0, "func(matchString func(pat string, str string) (bool, error), tests []InternalTest) (ok bool)"}, - {"Short", Func, 0, "func() bool"}, - {"T", Type, 0, ""}, - {"Testing", Func, 21, "func() bool"}, - {"Verbose", Func, 1, "func() bool"}, - }, - "testing/cryptotest": { - {"SetGlobalRandom", Func, 26, "func(t *testing.T, seed uint64)"}, - }, - "testing/fstest": { - {"(MapFS).Glob", Method, 16, ""}, - {"(MapFS).Lstat", Method, 25, ""}, - {"(MapFS).Open", Method, 16, ""}, - {"(MapFS).ReadDir", Method, 16, ""}, - {"(MapFS).ReadFile", Method, 16, ""}, - {"(MapFS).ReadLink", Method, 25, ""}, - {"(MapFS).Stat", Method, 16, ""}, - {"(MapFS).Sub", Method, 16, ""}, - {"MapFS", Type, 16, ""}, - {"MapFile", Type, 16, ""}, - {"MapFile.Data", Field, 16, ""}, - {"MapFile.ModTime", Field, 16, ""}, - {"MapFile.Mode", Field, 16, ""}, - {"MapFile.Sys", Field, 16, ""}, - {"TestFS", Func, 16, "func(fsys fs.FS, expected ...string) error"}, - }, - "testing/iotest": { - {"DataErrReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"ErrReader", Func, 16, "func(err error) io.Reader"}, - {"ErrTimeout", Var, 0, ""}, - {"HalfReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"NewReadLogger", Func, 0, "func(prefix string, r io.Reader) io.Reader"}, - {"NewWriteLogger", Func, 0, "func(prefix string, w io.Writer) io.Writer"}, - {"OneByteReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"TestReader", Func, 16, "func(r io.Reader, content []byte) error"}, - {"TimeoutReader", Func, 0, "func(r io.Reader) io.Reader"}, - {"TruncateWriter", Func, 0, "func(w io.Writer, n int64) io.Writer"}, - }, - "testing/quick": { - {"(*CheckEqualError).Error", Method, 0, ""}, - {"(*CheckError).Error", Method, 0, ""}, - {"(Generator).Generate", Method, 0, ""}, - {"(SetupError).Error", Method, 0, ""}, - {"Check", Func, 0, "func(f any, config *Config) error"}, - {"CheckEqual", Func, 0, "func(f any, g any, config *Config) error"}, - {"CheckEqualError", Type, 0, ""}, - {"CheckEqualError.CheckError", Field, 0, ""}, - {"CheckEqualError.Out1", Field, 0, ""}, - {"CheckEqualError.Out2", Field, 0, ""}, - {"CheckError", Type, 0, ""}, - {"CheckError.Count", Field, 0, ""}, - {"CheckError.In", Field, 0, ""}, - {"Config", Type, 0, ""}, - {"Config.MaxCount", Field, 0, ""}, - {"Config.MaxCountScale", Field, 0, ""}, - {"Config.Rand", Field, 0, ""}, - {"Config.Values", Field, 0, ""}, - {"Generator", Type, 0, ""}, - {"SetupError", Type, 0, ""}, - {"Value", Func, 0, "func(t reflect.Type, rand *rand.Rand) (value reflect.Value, ok bool)"}, - }, - "testing/slogtest": { - {"Run", Func, 22, "func(t *testing.T, newHandler func(*testing.T) slog.Handler, result func(*testing.T) map[string]any)"}, - {"TestHandler", Func, 21, "func(h slog.Handler, results func() []map[string]any) error"}, - }, - "testing/synctest": { - {"Sleep", Func, 27, "func(d time.Duration)"}, - {"Test", Func, 25, "func(t *testing.T, f func(*testing.T))"}, - {"Wait", Func, 25, "func()"}, - }, - "text/scanner": { - {"(*Position).IsValid", Method, 0, ""}, - {"(*Scanner).Init", Method, 0, ""}, - {"(*Scanner).IsValid", Method, 0, ""}, - {"(*Scanner).Next", Method, 0, ""}, - {"(*Scanner).Peek", Method, 0, ""}, - {"(*Scanner).Pos", Method, 0, ""}, - {"(*Scanner).Scan", Method, 0, ""}, - {"(*Scanner).TokenText", Method, 0, ""}, - {"(Position).String", Method, 0, ""}, - {"(Scanner).String", Method, 0, ""}, - {"Char", Const, 0, ""}, - {"Comment", Const, 0, ""}, - {"EOF", Const, 0, ""}, - {"Float", Const, 0, ""}, - {"GoTokens", Const, 0, ""}, - {"GoWhitespace", Const, 0, ""}, - {"Ident", Const, 0, ""}, - {"Int", Const, 0, ""}, - {"Position", Type, 0, ""}, - {"Position.Column", Field, 0, ""}, - {"Position.Filename", Field, 0, ""}, - {"Position.Line", Field, 0, ""}, - {"Position.Offset", Field, 0, ""}, - {"RawString", Const, 0, ""}, - {"ScanChars", Const, 0, ""}, - {"ScanComments", Const, 0, ""}, - {"ScanFloats", Const, 0, ""}, - {"ScanIdents", Const, 0, ""}, - {"ScanInts", Const, 0, ""}, - {"ScanRawStrings", Const, 0, ""}, - {"ScanStrings", Const, 0, ""}, - {"Scanner", Type, 0, ""}, - {"Scanner.Error", Field, 0, ""}, - {"Scanner.ErrorCount", Field, 0, ""}, - {"Scanner.IsIdentRune", Field, 4, ""}, - {"Scanner.Mode", Field, 0, ""}, - {"Scanner.Position", Field, 0, ""}, - {"Scanner.Whitespace", Field, 0, ""}, - {"SkipComments", Const, 0, ""}, - {"String", Const, 0, ""}, - {"TokenString", Func, 0, "func(tok rune) string"}, - }, - "text/tabwriter": { - {"(*Writer).Flush", Method, 0, ""}, - {"(*Writer).Init", Method, 0, ""}, - {"(*Writer).Write", Method, 0, ""}, - {"AlignRight", Const, 0, ""}, - {"Debug", Const, 0, ""}, - {"DiscardEmptyColumns", Const, 0, ""}, - {"Escape", Const, 0, ""}, - {"FilterHTML", Const, 0, ""}, - {"NewWriter", Func, 0, "func(output io.Writer, minwidth int, tabwidth int, padding int, padchar byte, flags uint) *Writer"}, - {"StripEscape", Const, 0, ""}, - {"TabIndent", Const, 0, ""}, - {"Writer", Type, 0, ""}, - }, - "text/template": { - {"(*Template).AddParseTree", Method, 0, ""}, - {"(*Template).Clone", Method, 0, ""}, - {"(*Template).DefinedTemplates", Method, 5, ""}, - {"(*Template).Delims", Method, 0, ""}, - {"(*Template).Execute", Method, 0, ""}, - {"(*Template).ExecuteTemplate", Method, 0, ""}, - {"(*Template).Funcs", Method, 0, ""}, - {"(*Template).Lookup", Method, 0, ""}, - {"(*Template).Name", Method, 0, ""}, - {"(*Template).New", Method, 0, ""}, - {"(*Template).Option", Method, 5, ""}, - {"(*Template).Parse", Method, 0, ""}, - {"(*Template).ParseFS", Method, 16, ""}, - {"(*Template).ParseFiles", Method, 0, ""}, - {"(*Template).ParseGlob", Method, 0, ""}, - {"(*Template).Templates", Method, 0, ""}, - {"(ExecError).Error", Method, 6, ""}, - {"(ExecError).Unwrap", Method, 13, ""}, - {"(Template).Copy", Method, 2, ""}, - {"(Template).ErrorContext", Method, 1, ""}, - {"ExecError", Type, 6, ""}, - {"ExecError.Err", Field, 6, ""}, - {"ExecError.Name", Field, 6, ""}, - {"FuncMap", Type, 0, ""}, - {"HTMLEscape", Func, 0, "func(w io.Writer, b []byte)"}, - {"HTMLEscapeString", Func, 0, "func(s string) string"}, - {"HTMLEscaper", Func, 0, "func(args ...any) string"}, - {"IsTrue", Func, 6, "func(val any) (truth bool, ok bool)"}, - {"JSEscape", Func, 0, "func(w io.Writer, b []byte)"}, - {"JSEscapeString", Func, 0, "func(s string) string"}, - {"JSEscaper", Func, 0, "func(args ...any) string"}, - {"Must", Func, 0, "func(t *Template, err error) *Template"}, - {"New", Func, 0, "func(name string) *Template"}, - {"ParseFS", Func, 16, "func(fsys fs.FS, patterns ...string) (*Template, error)"}, - {"ParseFiles", Func, 0, "func(filenames ...string) (*Template, error)"}, - {"ParseGlob", Func, 0, "func(pattern string) (*Template, error)"}, - {"Template", Type, 0, ""}, - {"Template.Tree", Field, 0, ""}, - {"URLQueryEscaper", Func, 0, "func(args ...any) string"}, - }, - "text/template/parse": { - {"(*ActionNode).Copy", Method, 0, ""}, - {"(*ActionNode).String", Method, 0, ""}, - {"(*BoolNode).Copy", Method, 0, ""}, - {"(*BoolNode).String", Method, 0, ""}, - {"(*BranchNode).Copy", Method, 4, ""}, - {"(*BranchNode).String", Method, 0, ""}, - {"(*BreakNode).Copy", Method, 18, ""}, - {"(*BreakNode).String", Method, 18, ""}, - {"(*ChainNode).Add", Method, 1, ""}, - {"(*ChainNode).Copy", Method, 1, ""}, - {"(*ChainNode).String", Method, 1, ""}, - {"(*CommandNode).Copy", Method, 0, ""}, - {"(*CommandNode).String", Method, 0, ""}, - {"(*CommentNode).Copy", Method, 16, ""}, - {"(*CommentNode).String", Method, 16, ""}, - {"(*ContinueNode).Copy", Method, 18, ""}, - {"(*ContinueNode).String", Method, 18, ""}, - {"(*DotNode).Copy", Method, 0, ""}, - {"(*DotNode).String", Method, 0, ""}, - {"(*DotNode).Type", Method, 0, ""}, - {"(*FieldNode).Copy", Method, 0, ""}, - {"(*FieldNode).String", Method, 0, ""}, - {"(*IdentifierNode).Copy", Method, 0, ""}, - {"(*IdentifierNode).SetPos", Method, 1, ""}, - {"(*IdentifierNode).SetTree", Method, 4, ""}, - {"(*IdentifierNode).String", Method, 0, ""}, - {"(*IfNode).Copy", Method, 0, ""}, - {"(*IfNode).String", Method, 0, ""}, - {"(*ListNode).Copy", Method, 0, ""}, - {"(*ListNode).CopyList", Method, 0, ""}, - {"(*ListNode).String", Method, 0, ""}, - {"(*NilNode).Copy", Method, 1, ""}, - {"(*NilNode).String", Method, 1, ""}, - {"(*NilNode).Type", Method, 1, ""}, - {"(*NumberNode).Copy", Method, 0, ""}, - {"(*NumberNode).String", Method, 0, ""}, - {"(*PipeNode).Copy", Method, 0, ""}, - {"(*PipeNode).CopyPipe", Method, 0, ""}, - {"(*PipeNode).String", Method, 0, ""}, - {"(*RangeNode).Copy", Method, 0, ""}, - {"(*RangeNode).String", Method, 0, ""}, - {"(*StringNode).Copy", Method, 0, ""}, - {"(*StringNode).String", Method, 0, ""}, - {"(*TemplateNode).Copy", Method, 0, ""}, - {"(*TemplateNode).String", Method, 0, ""}, - {"(*TextNode).Copy", Method, 0, ""}, - {"(*TextNode).String", Method, 0, ""}, - {"(*Tree).Copy", Method, 2, ""}, - {"(*Tree).ErrorContext", Method, 1, ""}, - {"(*Tree).Parse", Method, 0, ""}, - {"(*VariableNode).Copy", Method, 0, ""}, - {"(*VariableNode).String", Method, 0, ""}, - {"(*WithNode).Copy", Method, 0, ""}, - {"(*WithNode).String", Method, 0, ""}, - {"(ActionNode).Position", Method, 1, ""}, - {"(ActionNode).Type", Method, 0, ""}, - {"(BoolNode).Position", Method, 1, ""}, - {"(BoolNode).Type", Method, 0, ""}, - {"(BranchNode).Position", Method, 1, ""}, - {"(BranchNode).Type", Method, 0, ""}, - {"(BreakNode).Position", Method, 18, ""}, - {"(BreakNode).Type", Method, 18, ""}, - {"(ChainNode).Position", Method, 1, ""}, - {"(ChainNode).Type", Method, 1, ""}, - {"(CommandNode).Position", Method, 1, ""}, - {"(CommandNode).Type", Method, 0, ""}, - {"(CommentNode).Position", Method, 16, ""}, - {"(CommentNode).Type", Method, 16, ""}, - {"(ContinueNode).Position", Method, 18, ""}, - {"(ContinueNode).Type", Method, 18, ""}, - {"(DotNode).Position", Method, 1, ""}, - {"(FieldNode).Position", Method, 1, ""}, - {"(FieldNode).Type", Method, 0, ""}, - {"(IdentifierNode).Position", Method, 1, ""}, - {"(IdentifierNode).Type", Method, 0, ""}, - {"(IfNode).Position", Method, 1, ""}, - {"(IfNode).Type", Method, 0, ""}, - {"(ListNode).Position", Method, 1, ""}, - {"(ListNode).Type", Method, 0, ""}, - {"(NilNode).Position", Method, 1, ""}, - {"(Node).Copy", Method, 0, ""}, - {"(Node).Position", Method, 1, ""}, - {"(Node).String", Method, 0, ""}, - {"(Node).Type", Method, 0, ""}, - {"(NodeType).Type", Method, 0, ""}, - {"(NumberNode).Position", Method, 1, ""}, - {"(NumberNode).Type", Method, 0, ""}, - {"(PipeNode).Position", Method, 1, ""}, - {"(PipeNode).Type", Method, 0, ""}, - {"(Pos).Position", Method, 1, ""}, - {"(RangeNode).Position", Method, 1, ""}, - {"(RangeNode).Type", Method, 0, ""}, - {"(StringNode).Position", Method, 1, ""}, - {"(StringNode).Type", Method, 0, ""}, - {"(TemplateNode).Position", Method, 1, ""}, - {"(TemplateNode).Type", Method, 0, ""}, - {"(TextNode).Position", Method, 1, ""}, - {"(TextNode).Type", Method, 0, ""}, - {"(VariableNode).Position", Method, 1, ""}, - {"(VariableNode).Type", Method, 0, ""}, - {"(WithNode).Position", Method, 1, ""}, - {"(WithNode).Type", Method, 0, ""}, - {"ActionNode", Type, 0, ""}, - {"ActionNode.Line", Field, 0, ""}, - {"ActionNode.NodeType", Field, 0, ""}, - {"ActionNode.Pipe", Field, 0, ""}, - {"ActionNode.Pos", Field, 1, ""}, - {"BoolNode", Type, 0, ""}, - {"BoolNode.NodeType", Field, 0, ""}, - {"BoolNode.Pos", Field, 1, ""}, - {"BoolNode.True", Field, 0, ""}, - {"BranchNode", Type, 0, ""}, - {"BranchNode.ElseList", Field, 0, ""}, - {"BranchNode.Line", Field, 0, ""}, - {"BranchNode.List", Field, 0, ""}, - {"BranchNode.NodeType", Field, 0, ""}, - {"BranchNode.Pipe", Field, 0, ""}, - {"BranchNode.Pos", Field, 1, ""}, - {"BreakNode", Type, 18, ""}, - {"BreakNode.Line", Field, 18, ""}, - {"BreakNode.NodeType", Field, 18, ""}, - {"BreakNode.Pos", Field, 18, ""}, - {"ChainNode", Type, 1, ""}, - {"ChainNode.Field", Field, 1, ""}, - {"ChainNode.Node", Field, 1, ""}, - {"ChainNode.NodeType", Field, 1, ""}, - {"ChainNode.Pos", Field, 1, ""}, - {"CommandNode", Type, 0, ""}, - {"CommandNode.Args", Field, 0, ""}, - {"CommandNode.NodeType", Field, 0, ""}, - {"CommandNode.Pos", Field, 1, ""}, - {"CommentNode", Type, 16, ""}, - {"CommentNode.NodeType", Field, 16, ""}, - {"CommentNode.Pos", Field, 16, ""}, - {"CommentNode.Text", Field, 16, ""}, - {"ContinueNode", Type, 18, ""}, - {"ContinueNode.Line", Field, 18, ""}, - {"ContinueNode.NodeType", Field, 18, ""}, - {"ContinueNode.Pos", Field, 18, ""}, - {"DotNode", Type, 0, ""}, - {"DotNode.NodeType", Field, 4, ""}, - {"DotNode.Pos", Field, 1, ""}, - {"FieldNode", Type, 0, ""}, - {"FieldNode.Ident", Field, 0, ""}, - {"FieldNode.NodeType", Field, 0, ""}, - {"FieldNode.Pos", Field, 1, ""}, - {"IdentifierNode", Type, 0, ""}, - {"IdentifierNode.Ident", Field, 0, ""}, - {"IdentifierNode.NodeType", Field, 0, ""}, - {"IdentifierNode.Pos", Field, 1, ""}, - {"IfNode", Type, 0, ""}, - {"IfNode.BranchNode", Field, 0, ""}, - {"IsEmptyTree", Func, 0, "func(n Node) bool"}, - {"ListNode", Type, 0, ""}, - {"ListNode.NodeType", Field, 0, ""}, - {"ListNode.Nodes", Field, 0, ""}, - {"ListNode.Pos", Field, 1, ""}, - {"Mode", Type, 16, ""}, - {"New", Func, 0, "func(name string, funcs ...map[string]any) *Tree"}, - {"NewIdentifier", Func, 0, "func(ident string) *IdentifierNode"}, - {"NilNode", Type, 1, ""}, - {"NilNode.NodeType", Field, 4, ""}, - {"NilNode.Pos", Field, 1, ""}, - {"Node", Type, 0, ""}, - {"NodeAction", Const, 0, ""}, - {"NodeBool", Const, 0, ""}, - {"NodeBreak", Const, 18, ""}, - {"NodeChain", Const, 1, ""}, - {"NodeCommand", Const, 0, ""}, - {"NodeComment", Const, 16, ""}, - {"NodeContinue", Const, 18, ""}, - {"NodeDot", Const, 0, ""}, - {"NodeField", Const, 0, ""}, - {"NodeIdentifier", Const, 0, ""}, - {"NodeIf", Const, 0, ""}, - {"NodeList", Const, 0, ""}, - {"NodeNil", Const, 1, ""}, - {"NodeNumber", Const, 0, ""}, - {"NodePipe", Const, 0, ""}, - {"NodeRange", Const, 0, ""}, - {"NodeString", Const, 0, ""}, - {"NodeTemplate", Const, 0, ""}, - {"NodeText", Const, 0, ""}, - {"NodeType", Type, 0, ""}, - {"NodeVariable", Const, 0, ""}, - {"NodeWith", Const, 0, ""}, - {"NumberNode", Type, 0, ""}, - {"NumberNode.Complex128", Field, 0, ""}, - {"NumberNode.Float64", Field, 0, ""}, - {"NumberNode.Int64", Field, 0, ""}, - {"NumberNode.IsComplex", Field, 0, ""}, - {"NumberNode.IsFloat", Field, 0, ""}, - {"NumberNode.IsInt", Field, 0, ""}, - {"NumberNode.IsUint", Field, 0, ""}, - {"NumberNode.NodeType", Field, 0, ""}, - {"NumberNode.Pos", Field, 1, ""}, - {"NumberNode.Text", Field, 0, ""}, - {"NumberNode.Uint64", Field, 0, ""}, - {"Parse", Func, 0, "func(name string, text string, leftDelim string, rightDelim string, funcs ...map[string]any) (map[string]*Tree, error)"}, - {"ParseComments", Const, 16, ""}, - {"PipeNode", Type, 0, ""}, - {"PipeNode.Cmds", Field, 0, ""}, - {"PipeNode.Decl", Field, 0, ""}, - {"PipeNode.IsAssign", Field, 11, ""}, - {"PipeNode.Line", Field, 0, ""}, - {"PipeNode.NodeType", Field, 0, ""}, - {"PipeNode.Pos", Field, 1, ""}, - {"Pos", Type, 1, ""}, - {"RangeNode", Type, 0, ""}, - {"RangeNode.BranchNode", Field, 0, ""}, - {"SkipFuncCheck", Const, 17, ""}, - {"StringNode", Type, 0, ""}, - {"StringNode.NodeType", Field, 0, ""}, - {"StringNode.Pos", Field, 1, ""}, - {"StringNode.Quoted", Field, 0, ""}, - {"StringNode.Text", Field, 0, ""}, - {"TemplateNode", Type, 0, ""}, - {"TemplateNode.Line", Field, 0, ""}, - {"TemplateNode.Name", Field, 0, ""}, - {"TemplateNode.NodeType", Field, 0, ""}, - {"TemplateNode.Pipe", Field, 0, ""}, - {"TemplateNode.Pos", Field, 1, ""}, - {"TextNode", Type, 0, ""}, - {"TextNode.NodeType", Field, 0, ""}, - {"TextNode.Pos", Field, 1, ""}, - {"TextNode.Text", Field, 0, ""}, - {"Tree", Type, 0, ""}, - {"Tree.Mode", Field, 16, ""}, - {"Tree.Name", Field, 0, ""}, - {"Tree.ParseName", Field, 1, ""}, - {"Tree.Root", Field, 0, ""}, - {"VariableNode", Type, 0, ""}, - {"VariableNode.Ident", Field, 0, ""}, - {"VariableNode.NodeType", Field, 0, ""}, - {"VariableNode.Pos", Field, 1, ""}, - {"WithNode", Type, 0, ""}, - {"WithNode.BranchNode", Field, 0, ""}, - }, - "time": { - {"(*Location).String", Method, 0, ""}, - {"(*ParseError).Error", Method, 0, ""}, - {"(*Ticker).Reset", Method, 15, ""}, - {"(*Ticker).Stop", Method, 0, ""}, - {"(*Time).GobDecode", Method, 0, ""}, - {"(*Time).UnmarshalBinary", Method, 2, ""}, - {"(*Time).UnmarshalJSON", Method, 0, ""}, - {"(*Time).UnmarshalText", Method, 2, ""}, - {"(*Timer).Reset", Method, 1, ""}, - {"(*Timer).Stop", Method, 0, ""}, - {"(Duration).Abs", Method, 19, ""}, - {"(Duration).Hours", Method, 0, ""}, - {"(Duration).Microseconds", Method, 13, ""}, - {"(Duration).Milliseconds", Method, 13, ""}, - {"(Duration).Minutes", Method, 0, ""}, - {"(Duration).Nanoseconds", Method, 0, ""}, - {"(Duration).Round", Method, 9, ""}, - {"(Duration).Seconds", Method, 0, ""}, - {"(Duration).String", Method, 0, ""}, - {"(Duration).Truncate", Method, 9, ""}, - {"(Month).String", Method, 0, ""}, - {"(Time).Add", Method, 0, ""}, - {"(Time).AddDate", Method, 0, ""}, - {"(Time).After", Method, 0, ""}, - {"(Time).AppendBinary", Method, 24, ""}, - {"(Time).AppendFormat", Method, 5, ""}, - {"(Time).AppendText", Method, 24, ""}, - {"(Time).Before", Method, 0, ""}, - {"(Time).Clock", Method, 0, ""}, - {"(Time).Compare", Method, 20, ""}, - {"(Time).Date", Method, 0, ""}, - {"(Time).Day", Method, 0, ""}, - {"(Time).Equal", Method, 0, ""}, - {"(Time).Format", Method, 0, ""}, - {"(Time).GoString", Method, 17, ""}, - {"(Time).GobEncode", Method, 0, ""}, - {"(Time).Hour", Method, 0, ""}, - {"(Time).ISOWeek", Method, 0, ""}, - {"(Time).In", Method, 0, ""}, - {"(Time).IsDST", Method, 17, ""}, - {"(Time).IsZero", Method, 0, ""}, - {"(Time).Local", Method, 0, ""}, - {"(Time).Location", Method, 0, ""}, - {"(Time).MarshalBinary", Method, 2, ""}, - {"(Time).MarshalJSON", Method, 0, ""}, - {"(Time).MarshalText", Method, 2, ""}, - {"(Time).Minute", Method, 0, ""}, - {"(Time).Month", Method, 0, ""}, - {"(Time).Nanosecond", Method, 0, ""}, - {"(Time).Round", Method, 1, ""}, - {"(Time).Second", Method, 0, ""}, - {"(Time).String", Method, 0, ""}, - {"(Time).Sub", Method, 0, ""}, - {"(Time).Truncate", Method, 1, ""}, - {"(Time).UTC", Method, 0, ""}, - {"(Time).Unix", Method, 0, ""}, - {"(Time).UnixMicro", Method, 17, ""}, - {"(Time).UnixMilli", Method, 17, ""}, - {"(Time).UnixNano", Method, 0, ""}, - {"(Time).Weekday", Method, 0, ""}, - {"(Time).Year", Method, 0, ""}, - {"(Time).YearDay", Method, 1, ""}, - {"(Time).Zone", Method, 0, ""}, - {"(Time).ZoneBounds", Method, 19, ""}, - {"(Weekday).String", Method, 0, ""}, - {"ANSIC", Const, 0, ""}, - {"After", Func, 0, "func(d Duration) <-chan Time"}, - {"AfterFunc", Func, 0, "func(d Duration, f func()) *Timer"}, - {"April", Const, 0, ""}, - {"August", Const, 0, ""}, - {"Date", Func, 0, "func(year int, month Month, day int, hour int, min int, sec int, nsec int, loc *Location) Time"}, - {"DateOnly", Const, 20, ""}, - {"DateTime", Const, 20, ""}, - {"December", Const, 0, ""}, - {"Duration", Type, 0, ""}, - {"February", Const, 0, ""}, - {"FixedZone", Func, 0, "func(name string, offset int) *Location"}, - {"Friday", Const, 0, ""}, - {"Hour", Const, 0, ""}, - {"January", Const, 0, ""}, - {"July", Const, 0, ""}, - {"June", Const, 0, ""}, - {"Kitchen", Const, 0, ""}, - {"Layout", Const, 17, ""}, - {"LoadLocation", Func, 0, "func(name string) (*Location, error)"}, - {"LoadLocationFromTZData", Func, 10, "func(name string, data []byte) (*Location, error)"}, - {"Local", Var, 0, ""}, - {"Location", Type, 0, ""}, - {"March", Const, 0, ""}, - {"May", Const, 0, ""}, - {"Microsecond", Const, 0, ""}, - {"Millisecond", Const, 0, ""}, - {"Minute", Const, 0, ""}, - {"Monday", Const, 0, ""}, - {"Month", Type, 0, ""}, - {"Nanosecond", Const, 0, ""}, - {"NewTicker", Func, 0, "func(d Duration) *Ticker"}, - {"NewTimer", Func, 0, "func(d Duration) *Timer"}, - {"November", Const, 0, ""}, - {"Now", Func, 0, "func() Time"}, - {"October", Const, 0, ""}, - {"Parse", Func, 0, "func(layout string, value string) (Time, error)"}, - {"ParseDuration", Func, 0, "func(s string) (Duration, error)"}, - {"ParseError", Type, 0, ""}, - {"ParseError.Layout", Field, 0, ""}, - {"ParseError.LayoutElem", Field, 0, ""}, - {"ParseError.Message", Field, 0, ""}, - {"ParseError.Value", Field, 0, ""}, - {"ParseError.ValueElem", Field, 0, ""}, - {"ParseInLocation", Func, 1, "func(layout string, value string, loc *Location) (Time, error)"}, - {"RFC1123", Const, 0, ""}, - {"RFC1123Z", Const, 0, ""}, - {"RFC3339", Const, 0, ""}, - {"RFC3339Nano", Const, 0, ""}, - {"RFC822", Const, 0, ""}, - {"RFC822Z", Const, 0, ""}, - {"RFC850", Const, 0, ""}, - {"RubyDate", Const, 0, ""}, - {"Saturday", Const, 0, ""}, - {"Second", Const, 0, ""}, - {"September", Const, 0, ""}, - {"Since", Func, 0, "func(t Time) Duration"}, - {"Sleep", Func, 0, "func(d Duration)"}, - {"Stamp", Const, 0, ""}, - {"StampMicro", Const, 0, ""}, - {"StampMilli", Const, 0, ""}, - {"StampNano", Const, 0, ""}, - {"Sunday", Const, 0, ""}, - {"Thursday", Const, 0, ""}, - {"Tick", Func, 0, "func(d Duration) <-chan Time"}, - {"Ticker", Type, 0, ""}, - {"Ticker.C", Field, 0, ""}, - {"Time", Type, 0, ""}, - {"TimeOnly", Const, 20, ""}, - {"Timer", Type, 0, ""}, - {"Timer.C", Field, 0, ""}, - {"Tuesday", Const, 0, ""}, - {"UTC", Var, 0, ""}, - {"Unix", Func, 0, "func(sec int64, nsec int64) Time"}, - {"UnixDate", Const, 0, ""}, - {"UnixMicro", Func, 17, "func(usec int64) Time"}, - {"UnixMilli", Func, 17, "func(msec int64) Time"}, - {"Until", Func, 8, "func(t Time) Duration"}, - {"Wednesday", Const, 0, ""}, - {"Weekday", Type, 0, ""}, - }, - "unicode": { - {"(SpecialCase).ToLower", Method, 0, ""}, - {"(SpecialCase).ToTitle", Method, 0, ""}, - {"(SpecialCase).ToUpper", Method, 0, ""}, - {"ASCII_Hex_Digit", Var, 0, ""}, - {"Adlam", Var, 7, ""}, - {"Ahom", Var, 5, ""}, - {"Anatolian_Hieroglyphs", Var, 5, ""}, - {"Arabic", Var, 0, ""}, - {"Armenian", Var, 0, ""}, - {"Avestan", Var, 0, ""}, - {"AzeriCase", Var, 0, ""}, - {"Balinese", Var, 0, ""}, - {"Bamum", Var, 0, ""}, - {"Bassa_Vah", Var, 4, ""}, - {"Batak", Var, 0, ""}, - {"Bengali", Var, 0, ""}, - {"Beria_Erfe", Var, 27, ""}, - {"Bhaiksuki", Var, 7, ""}, - {"Bidi_Control", Var, 0, ""}, - {"Bopomofo", Var, 0, ""}, - {"Brahmi", Var, 0, ""}, - {"Braille", Var, 0, ""}, - {"Buginese", Var, 0, ""}, - {"Buhid", Var, 0, ""}, - {"C", Var, 0, ""}, - {"Canadian_Aboriginal", Var, 0, ""}, - {"Carian", Var, 0, ""}, - {"CaseRange", Type, 0, ""}, - {"CaseRange.Delta", Field, 0, ""}, - {"CaseRange.Hi", Field, 0, ""}, - {"CaseRange.Lo", Field, 0, ""}, - {"CaseRanges", Var, 0, ""}, - {"Categories", Var, 0, ""}, - {"CategoryAliases", Var, 25, ""}, - {"Caucasian_Albanian", Var, 4, ""}, - {"Cc", Var, 0, ""}, - {"Cf", Var, 0, ""}, - {"Chakma", Var, 1, ""}, - {"Cham", Var, 0, ""}, - {"Cherokee", Var, 0, ""}, - {"Chorasmian", Var, 16, ""}, - {"Cn", Var, 25, ""}, - {"Co", Var, 0, ""}, - {"Common", Var, 0, ""}, - {"Coptic", Var, 0, ""}, - {"Cs", Var, 0, ""}, - {"Cuneiform", Var, 0, ""}, - {"Cypriot", Var, 0, ""}, - {"Cypro_Minoan", Var, 21, ""}, - {"Cyrillic", Var, 0, ""}, - {"Dash", Var, 0, ""}, - {"Deprecated", Var, 0, ""}, - {"Deseret", Var, 0, ""}, - {"Devanagari", Var, 0, ""}, - {"Diacritic", Var, 0, ""}, - {"Digit", Var, 0, ""}, - {"Dives_Akuru", Var, 16, ""}, - {"Dogra", Var, 13, ""}, - {"Duployan", Var, 4, ""}, - {"Egyptian_Hieroglyphs", Var, 0, ""}, - {"Elbasan", Var, 4, ""}, - {"Elymaic", Var, 14, ""}, - {"Ethiopic", Var, 0, ""}, - {"Extender", Var, 0, ""}, - {"FoldCategory", Var, 0, ""}, - {"FoldScript", Var, 0, ""}, - {"Garay", Var, 27, ""}, - {"Georgian", Var, 0, ""}, - {"Glagolitic", Var, 0, ""}, - {"Gothic", Var, 0, ""}, - {"Grantha", Var, 4, ""}, - {"GraphicRanges", Var, 0, ""}, - {"Greek", Var, 0, ""}, - {"Gujarati", Var, 0, ""}, - {"Gunjala_Gondi", Var, 13, ""}, - {"Gurmukhi", Var, 0, ""}, - {"Gurung_Khema", Var, 27, ""}, - {"Han", Var, 0, ""}, - {"Hangul", Var, 0, ""}, - {"Hanifi_Rohingya", Var, 13, ""}, - {"Hanunoo", Var, 0, ""}, - {"Hatran", Var, 5, ""}, - {"Hebrew", Var, 0, ""}, - {"Hex_Digit", Var, 0, ""}, - {"Hiragana", Var, 0, ""}, - {"Hyphen", Var, 0, ""}, - {"IDS_Binary_Operator", Var, 0, ""}, - {"IDS_Trinary_Operator", Var, 0, ""}, - {"IDS_Unary_Operator", Var, 27, ""}, - {"ID_Compat_Math_Continue", Var, 27, ""}, - {"ID_Compat_Math_Start", Var, 27, ""}, - {"Ideographic", Var, 0, ""}, - {"Imperial_Aramaic", Var, 0, ""}, - {"In", Func, 2, "func(r rune, ranges ...*RangeTable) bool"}, - {"Inherited", Var, 0, ""}, - {"Inscriptional_Pahlavi", Var, 0, ""}, - {"Inscriptional_Parthian", Var, 0, ""}, - {"Is", Func, 0, "func(rangeTab *RangeTable, r rune) bool"}, - {"IsControl", Func, 0, "func(r rune) bool"}, - {"IsDigit", Func, 0, "func(r rune) bool"}, - {"IsGraphic", Func, 0, "func(r rune) bool"}, - {"IsLetter", Func, 0, "func(r rune) bool"}, - {"IsLower", Func, 0, "func(r rune) bool"}, - {"IsMark", Func, 0, "func(r rune) bool"}, - {"IsNumber", Func, 0, "func(r rune) bool"}, - {"IsOneOf", Func, 0, "func(ranges []*RangeTable, r rune) bool"}, - {"IsPrint", Func, 0, "func(r rune) bool"}, - {"IsPunct", Func, 0, "func(r rune) bool"}, - {"IsSpace", Func, 0, "func(r rune) bool"}, - {"IsSymbol", Func, 0, "func(r rune) bool"}, - {"IsTitle", Func, 0, "func(r rune) bool"}, - {"IsUpper", Func, 0, "func(r rune) bool"}, - {"Javanese", Var, 0, ""}, - {"Join_Control", Var, 0, ""}, - {"Kaithi", Var, 0, ""}, - {"Kannada", Var, 0, ""}, - {"Katakana", Var, 0, ""}, - {"Kawi", Var, 21, ""}, - {"Kayah_Li", Var, 0, ""}, - {"Kharoshthi", Var, 0, ""}, - {"Khitan_Small_Script", Var, 16, ""}, - {"Khmer", Var, 0, ""}, - {"Khojki", Var, 4, ""}, - {"Khudawadi", Var, 4, ""}, - {"Kirat_Rai", Var, 27, ""}, - {"L", Var, 0, ""}, - {"LC", Var, 25, ""}, - {"Lao", Var, 0, ""}, - {"Latin", Var, 0, ""}, - {"Lepcha", Var, 0, ""}, - {"Letter", Var, 0, ""}, - {"Limbu", Var, 0, ""}, - {"Linear_A", Var, 4, ""}, - {"Linear_B", Var, 0, ""}, - {"Lisu", Var, 0, ""}, - {"Ll", Var, 0, ""}, - {"Lm", Var, 0, ""}, - {"Lo", Var, 0, ""}, - {"Logical_Order_Exception", Var, 0, ""}, - {"Lower", Var, 0, ""}, - {"LowerCase", Const, 0, ""}, - {"Lt", Var, 0, ""}, - {"Lu", Var, 0, ""}, - {"Lycian", Var, 0, ""}, - {"Lydian", Var, 0, ""}, - {"M", Var, 0, ""}, - {"Mahajani", Var, 4, ""}, - {"Makasar", Var, 13, ""}, - {"Malayalam", Var, 0, ""}, - {"Mandaic", Var, 0, ""}, - {"Manichaean", Var, 4, ""}, - {"Marchen", Var, 7, ""}, - {"Mark", Var, 0, ""}, - {"Masaram_Gondi", Var, 10, ""}, - {"MaxASCII", Const, 0, ""}, - {"MaxCase", Const, 0, ""}, - {"MaxLatin1", Const, 0, ""}, - {"MaxRune", Const, 0, ""}, - {"Mc", Var, 0, ""}, - {"Me", Var, 0, ""}, - {"Medefaidrin", Var, 13, ""}, - {"Meetei_Mayek", Var, 0, ""}, - {"Mende_Kikakui", Var, 4, ""}, - {"Meroitic_Cursive", Var, 1, ""}, - {"Meroitic_Hieroglyphs", Var, 1, ""}, - {"Miao", Var, 1, ""}, - {"Mn", Var, 0, ""}, - {"Modi", Var, 4, ""}, - {"Modifier_Combining_Mark", Var, 27, ""}, - {"Mongolian", Var, 0, ""}, - {"Mro", Var, 4, ""}, - {"Multani", Var, 5, ""}, - {"Myanmar", Var, 0, ""}, - {"N", Var, 0, ""}, - {"Nabataean", Var, 4, ""}, - {"Nag_Mundari", Var, 21, ""}, - {"Nandinagari", Var, 14, ""}, - {"Nd", Var, 0, ""}, - {"New_Tai_Lue", Var, 0, ""}, - {"Newa", Var, 7, ""}, - {"Nko", Var, 0, ""}, - {"Nl", Var, 0, ""}, - {"No", Var, 0, ""}, - {"Noncharacter_Code_Point", Var, 0, ""}, - {"Number", Var, 0, ""}, - {"Nushu", Var, 10, ""}, - {"Nyiakeng_Puachue_Hmong", Var, 14, ""}, - {"Ogham", Var, 0, ""}, - {"Ol_Chiki", Var, 0, ""}, - {"Ol_Onal", Var, 27, ""}, - {"Old_Hungarian", Var, 5, ""}, - {"Old_Italic", Var, 0, ""}, - {"Old_North_Arabian", Var, 4, ""}, - {"Old_Permic", Var, 4, ""}, - {"Old_Persian", Var, 0, ""}, - {"Old_Sogdian", Var, 13, ""}, - {"Old_South_Arabian", Var, 0, ""}, - {"Old_Turkic", Var, 0, ""}, - {"Old_Uyghur", Var, 21, ""}, - {"Oriya", Var, 0, ""}, - {"Osage", Var, 7, ""}, - {"Osmanya", Var, 0, ""}, - {"Other", Var, 0, ""}, - {"Other_Alphabetic", Var, 0, ""}, - {"Other_Default_Ignorable_Code_Point", Var, 0, ""}, - {"Other_Grapheme_Extend", Var, 0, ""}, - {"Other_ID_Continue", Var, 0, ""}, - {"Other_ID_Start", Var, 0, ""}, - {"Other_Lowercase", Var, 0, ""}, - {"Other_Math", Var, 0, ""}, - {"Other_Uppercase", Var, 0, ""}, - {"P", Var, 0, ""}, - {"Pahawh_Hmong", Var, 4, ""}, - {"Palmyrene", Var, 4, ""}, - {"Pattern_Syntax", Var, 0, ""}, - {"Pattern_White_Space", Var, 0, ""}, - {"Pau_Cin_Hau", Var, 4, ""}, - {"Pc", Var, 0, ""}, - {"Pd", Var, 0, ""}, - {"Pe", Var, 0, ""}, - {"Pf", Var, 0, ""}, - {"Phags_Pa", Var, 0, ""}, - {"Phoenician", Var, 0, ""}, - {"Pi", Var, 0, ""}, - {"Po", Var, 0, ""}, - {"Prepended_Concatenation_Mark", Var, 7, ""}, - {"PrintRanges", Var, 0, ""}, - {"Properties", Var, 0, ""}, - {"Ps", Var, 0, ""}, - {"Psalter_Pahlavi", Var, 4, ""}, - {"Punct", Var, 0, ""}, - {"Quotation_Mark", Var, 0, ""}, - {"Radical", Var, 0, ""}, - {"Range16", Type, 0, ""}, - {"Range16.Hi", Field, 0, ""}, - {"Range16.Lo", Field, 0, ""}, - {"Range16.Stride", Field, 0, ""}, - {"Range32", Type, 0, ""}, - {"Range32.Hi", Field, 0, ""}, - {"Range32.Lo", Field, 0, ""}, - {"Range32.Stride", Field, 0, ""}, - {"RangeTable", Type, 0, ""}, - {"RangeTable.LatinOffset", Field, 1, ""}, - {"RangeTable.R16", Field, 0, ""}, - {"RangeTable.R32", Field, 0, ""}, - {"Regional_Indicator", Var, 10, ""}, - {"Rejang", Var, 0, ""}, - {"ReplacementChar", Const, 0, ""}, - {"Runic", Var, 0, ""}, - {"S", Var, 0, ""}, - {"STerm", Var, 0, ""}, - {"Samaritan", Var, 0, ""}, - {"Saurashtra", Var, 0, ""}, - {"Sc", Var, 0, ""}, - {"Scripts", Var, 0, ""}, - {"Sentence_Terminal", Var, 7, ""}, - {"Sharada", Var, 1, ""}, - {"Shavian", Var, 0, ""}, - {"Siddham", Var, 4, ""}, - {"Sidetic", Var, 27, ""}, - {"SignWriting", Var, 5, ""}, - {"SimpleFold", Func, 0, "func(r rune) rune"}, - {"Sinhala", Var, 0, ""}, - {"Sk", Var, 0, ""}, - {"Sm", Var, 0, ""}, - {"So", Var, 0, ""}, - {"Soft_Dotted", Var, 0, ""}, - {"Sogdian", Var, 13, ""}, - {"Sora_Sompeng", Var, 1, ""}, - {"Soyombo", Var, 10, ""}, - {"Space", Var, 0, ""}, - {"SpecialCase", Type, 0, ""}, - {"Sundanese", Var, 0, ""}, - {"Sunuwar", Var, 27, ""}, - {"Syloti_Nagri", Var, 0, ""}, - {"Symbol", Var, 0, ""}, - {"Syriac", Var, 0, ""}, - {"Tagalog", Var, 0, ""}, - {"Tagbanwa", Var, 0, ""}, - {"Tai_Le", Var, 0, ""}, - {"Tai_Tham", Var, 0, ""}, - {"Tai_Viet", Var, 0, ""}, - {"Tai_Yo", Var, 27, ""}, - {"Takri", Var, 1, ""}, - {"Tamil", Var, 0, ""}, - {"Tangsa", Var, 21, ""}, - {"Tangut", Var, 7, ""}, - {"Telugu", Var, 0, ""}, - {"Terminal_Punctuation", Var, 0, ""}, - {"Thaana", Var, 0, ""}, - {"Thai", Var, 0, ""}, - {"Tibetan", Var, 0, ""}, - {"Tifinagh", Var, 0, ""}, - {"Tirhuta", Var, 4, ""}, - {"Title", Var, 0, ""}, - {"TitleCase", Const, 0, ""}, - {"To", Func, 0, "func(_case int, r rune) rune"}, - {"ToLower", Func, 0, "func(r rune) rune"}, - {"ToTitle", Func, 0, "func(r rune) rune"}, - {"ToUpper", Func, 0, "func(r rune) rune"}, - {"Todhri", Var, 27, ""}, - {"Tolong_Siki", Var, 27, ""}, - {"Toto", Var, 21, ""}, - {"Tulu_Tigalari", Var, 27, ""}, - {"TurkishCase", Var, 0, ""}, - {"Ugaritic", Var, 0, ""}, - {"Unified_Ideograph", Var, 0, ""}, - {"Upper", Var, 0, ""}, - {"UpperCase", Const, 0, ""}, - {"UpperLower", Const, 0, ""}, - {"Vai", Var, 0, ""}, - {"Variation_Selector", Var, 0, ""}, - {"Version", Const, 0, ""}, - {"Vithkuqi", Var, 21, ""}, - {"Wancho", Var, 14, ""}, - {"Warang_Citi", Var, 4, ""}, - {"White_Space", Var, 0, ""}, - {"Yezidi", Var, 16, ""}, - {"Yi", Var, 0, ""}, - {"Z", Var, 0, ""}, - {"Zanabazar_Square", Var, 10, ""}, - {"Zl", Var, 0, ""}, - {"Zp", Var, 0, ""}, - {"Zs", Var, 0, ""}, - }, - "unicode/utf16": { - {"AppendRune", Func, 20, "func(a []uint16, r rune) []uint16"}, - {"Decode", Func, 0, "func(s []uint16) []rune"}, - {"DecodeRune", Func, 0, "func(r1 rune, r2 rune) rune"}, - {"Encode", Func, 0, "func(s []rune) []uint16"}, - {"EncodeRune", Func, 0, "func(r rune) (r1 rune, r2 rune)"}, - {"IsSurrogate", Func, 0, "func(r rune) bool"}, - {"RuneLen", Func, 23, "func(r rune) int"}, - }, - "unicode/utf8": { - {"AppendRune", Func, 18, "func(p []byte, r rune) []byte"}, - {"DecodeLastRune", Func, 0, "func(p []byte) (r rune, size int)"}, - {"DecodeLastRuneInString", Func, 0, "func(s string) (r rune, size int)"}, - {"DecodeRune", Func, 0, "func(p []byte) (r rune, size int)"}, - {"DecodeRuneInString", Func, 0, "func(s string) (r rune, size int)"}, - {"EncodeRune", Func, 0, "func(p []byte, r rune) int"}, - {"FullRune", Func, 0, "func(p []byte) bool"}, - {"FullRuneInString", Func, 0, "func(s string) bool"}, - {"MaxRune", Const, 0, ""}, - {"RuneCount", Func, 0, "func(p []byte) int"}, - {"RuneCountInString", Func, 0, "func(s string) (n int)"}, - {"RuneError", Const, 0, ""}, - {"RuneLen", Func, 0, "func(r rune) int"}, - {"RuneSelf", Const, 0, ""}, - {"RuneStart", Func, 0, "func(b byte) bool"}, - {"UTFMax", Const, 0, ""}, - {"Valid", Func, 0, "func(p []byte) bool"}, - {"ValidRune", Func, 1, "func(r rune) bool"}, - {"ValidString", Func, 0, "func(s string) bool"}, - }, - "unique": { - {"(Handle).Value", Method, 23, ""}, - {"Handle", Type, 23, ""}, - {"Make", Func, 23, "func[T comparable](value T) Handle[T]"}, - }, - "unsafe": { - {"Add", Func, 0, ""}, - {"Alignof", Func, 0, ""}, - {"Offsetof", Func, 0, ""}, - {"Pointer", Type, 0, ""}, - {"Sizeof", Func, 0, ""}, - {"Slice", Func, 0, ""}, - {"SliceData", Func, 0, ""}, - {"String", Func, 0, ""}, - {"StringData", Func, 0, ""}, - }, - "uuid": { - {"(*UUID).UnmarshalText", Method, 27, ""}, - {"(UUID).AppendText", Method, 27, ""}, - {"(UUID).Compare", Method, 27, ""}, - {"(UUID).MarshalText", Method, 27, ""}, - {"(UUID).String", Method, 27, ""}, - {"Max", Func, 27, "func() UUID"}, - {"MustParse", Func, 27, "func(s string) UUID"}, - {"New", Func, 27, "func() UUID"}, - {"NewV4", Func, 27, "func() UUID"}, - {"NewV7", Func, 27, "func() UUID"}, - {"Nil", Func, 27, "func() UUID"}, - {"Parse", Func, 27, "func(s string) (UUID, error)"}, - {"UUID", Type, 27, ""}, - }, - "weak": { - {"(Pointer).Value", Method, 24, ""}, - {"Make", Func, 24, "func[T any](ptr *T) Pointer[T]"}, - {"Pointer", Type, 24, ""}, - }, -} diff --git a/vendor/golang.org/x/tools/internal/stdlib/stdlib.go b/vendor/golang.org/x/tools/internal/stdlib/stdlib.go deleted file mode 100644 index 59a5de36a23..00000000000 --- a/vendor/golang.org/x/tools/internal/stdlib/stdlib.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run generate.go - -// Package stdlib provides a table of all exported symbols in the -// standard library, along with the version at which they first -// appeared. It also provides the import graph of std packages. -package stdlib - -import ( - "fmt" - "strings" -) - -type Symbol struct { - Name string - Kind Kind - Version Version // Go version that first included the symbol - // Signature provides the type of a function (defined only for Kind=Func). - // Imported types are denoted as pkg.T; pkg is not fully qualified. - // TODO(adonovan): use an unambiguous encoding that is parseable. - // - // Example2: - // func[M ~map[K]V, K comparable, V any](m M) M - // func(fi fs.FileInfo, link string) (*Header, error) - Signature string // if Kind == stdlib.Func -} - -// A Kind indicates the kind of a symbol: -// function, variable, constant, type, and so on. -type Kind int8 - -const ( - Invalid Kind = iota // Example name: - Type // "Buffer" - Func // "Println" - Var // "EOF" - Const // "Pi" - Field // "Point.X" - Method // "(*Buffer).Grow" or "(Reader).Read" -) - -func (kind Kind) String() string { - return [...]string{ - Invalid: "invalid", - Type: "type", - Func: "func", - Var: "var", - Const: "const", - Field: "field", - Method: "method", - }[kind] -} - -// A Version represents a version of Go of the form "go1.%d". -type Version int8 - -// String returns a version string of the form "go1.23", without allocating. -func (v Version) String() string { return versions[v] } - -var versions [30]string // (increase constant as needed) - -func init() { - for i := range versions { - versions[i] = fmt.Sprintf("go1.%d", i) - } -} - -// HasPackage reports whether the specified package path is part of -// the standard library's public API. -func HasPackage(path string) bool { - _, ok := PackageSymbols[path] - return ok -} - -// SplitField splits the field symbol name into type and field -// components. It must be called only on Field symbols. -// -// Example: "File.Package" -> ("File", "Package") -func (sym *Symbol) SplitField() (typename, name string) { - if sym.Kind != Field { - panic("not a field") - } - typename, name, _ = strings.Cut(sym.Name, ".") - return -} - -// SplitMethod splits the method symbol name into pointer, receiver, -// and method components. It must be called only on Method symbols. -// -// Example: "(*Buffer).Grow" -> (true, "Buffer", "Grow") -func (sym *Symbol) SplitMethod() (ptr bool, recv, name string) { - if sym.Kind != Method { - panic("not a method") - } - recv, name, _ = strings.Cut(sym.Name, ".") - recv = recv[len("(") : len(recv)-len(")")] - ptr = recv[0] == '*' - if ptr { - recv = recv[len("*"):] - } - return -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/assignedaddress.go b/vendor/golang.org/x/tools/internal/typesinternal/assignedaddress.go deleted file mode 100644 index 020defc3839..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/assignedaddress.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2026 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/ast" - "go/token" - "go/types" - - "golang.org/x/tools/go/ast/edge" - "golang.org/x/tools/go/ast/inspector" -) - -// IsAssignedOrAddressTaken reports whether the expression cur denotes a -// variable and appears in a context that assigns it or that takes its address, -// potentially leading to indirect assignment. -// -// These examples cause IsAssignedOrAddressTaken on the identifier for x to -// return true: -// -// x = 1 -// x++ -// x[i] = 1 (assume x is an array) -// x.a[i] = 1 (assume x.a is a non-pointer struct field) -// use(&x) -// -// whereas these cause it to return false: -// -// y = x -// f(x) -// use(x.a[i]) -// use(*x) -// -// The expression may itself be a compound, for example: -// -// use(&(*ptr)) => IsAssignedOrAddressTaken("*ptr") = true -// x.a[i] = 1 => IsAssignedOrAddressTaken("x.a") = true -// _ = x.a[i] => IsAssignedOrAddressTaken("x.a") = false -// -// A variable's declaration is not considered to be an assignment: -// -// var x int => IsAssignedOrAddressTaken(x) = false -// x := 1 => IsAssignedOrAddressTaken(x) = false -// -// TODO(adonovan): revisit the surprising behavior for declarations. -func IsAssignedOrAddressTaken(info *types.Info, cur inspector.Cursor) bool { - // Unfortunately we can't simply use info.Types[e].Assignable() - // as it is always true for a variable even when that variable is - // used only as an r-value. So we must inspect enclosing syntax. -outer: - // Ascend to outermost aggregate of which - // original cur is a part: - // x -> (x) | x.f | x[i] | x[i:j] - for cur = range cur.Enclosing() { - switch cur.ParentEdgeKind() { - case edge.ParenExpr_X: - // If x is an lvalue, then (x) is an lvalue. - case edge.SelectorExpr_X: - // If x is an lvalue, then x.f is an lvalue iff - // the selection does not traverse a pointer. - sel := cur.Parent().Node().(*ast.SelectorExpr) - if seln, ok := info.Selections[sel]; ok { - // Note: there is a bug in Indirect() where it spuriously returns true - // when both the selection receiver and parameter are pointers. However, - // it's okay in this case because there is no address taken when a - // pointer receiver method is called on a pointer type. - if seln.Indirect() { - return false - } - if seln.Kind() == types.MethodVal { - sig := seln.Obj().Type().(*types.Signature) - if is[*types.Pointer](sig.Recv().Type().Underlying()) { - t := seln.Recv() - // The receiver may be an embedded field, so we need - // to get the inner-most type (right before the method - // call in seln.Index()) - for _, idx := range seln.Index()[:len(seln.Index())-1] { - t = t.Underlying().(*types.Struct).Field(idx).Type() - } - if !is[*types.Pointer](t.Underlying()) { - return true // takes address of receiver - } - } - return false - } - } - case edge.IndexExpr_X, edge.SliceExpr_X: - // If x[i] or x[i:j] is an lvalue, - // then x is an lvalue iff x is an array. - if !is[*types.Array](info.TypeOf(cur.Node().(ast.Expr)).Underlying()) { - return false - } - default: - break outer - } - } - switch cur.ParentEdgeKind() { - case edge.AssignStmt_Lhs: - assign := cur.Parent().Node().(*ast.AssignStmt) - if assign.Tok != token.DEFINE { - return true // x = j or x += j - } - id := cur.Node().(*ast.Ident) - // Re-assigned identifiers are recorded in the Uses map. - if _, ok := info.Uses[id]; ok { - return true // reassignment of x (x, y := 1, 2) - } - case edge.RangeStmt_Key, edge.RangeStmt_Value: - rng := cur.Parent().Node().(*ast.RangeStmt) - if rng.Tok == token.ASSIGN { - return true // "for k, v = range x" is like an AssignStmt to k, v - } - case edge.IncDecStmt_X: - return true // x++, x-- - case edge.UnaryExpr_X: - if cur.Parent().Node().(*ast.UnaryExpr).Op == token.AND { - return true // &x - } - } - return false -} - -func is[T any](x any) bool { - _, ok := x.(T) - return ok -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go b/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go deleted file mode 100644 index d5c40a2e50f..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "fmt" - "go/ast" - "go/types" -) - -// CallKind describes the function position of an [*ast.CallExpr]. -type CallKind int - -const ( - CallStatic CallKind = iota // static call to known function - CallInterface // dynamic call through an interface method - CallDynamic // dynamic call of a func value - CallBuiltin // call to a builtin function - CallConversion // a conversion (not a call) -) - -var callKindNames = []string{ - "CallStatic", - "CallInterface", - "CallDynamic", - "CallBuiltin", - "CallConversion", -} - -func (k CallKind) String() string { - if i := int(k); i >= 0 && i < len(callKindNames) { - return callKindNames[i] - } - return fmt.Sprintf("typeutil.CallKind(%d)", k) -} - -// ClassifyCall classifies the function position of a call expression ([*ast.CallExpr]). -// It distinguishes among true function calls, calls to builtins, and type conversions, -// and further classifies function calls as static calls (where the function is known), -// dynamic interface calls, and other dynamic calls. -// -// For the declarations: -// -// func f() {} -// func g[T any]() {} -// var v func() -// var s []func() -// type I interface { M() } -// var i I -// -// ClassifyCall returns the following: -// -// f() CallStatic -// g[int]() CallStatic -// i.M() CallInterface -// min(1, 2) CallBuiltin -// v() CallDynamic -// s[0]() CallDynamic -// int(x) CallConversion -// []byte("") CallConversion -func ClassifyCall(info *types.Info, call *ast.CallExpr) CallKind { - if info.Types == nil { - panic("ClassifyCall: info.Types is nil") - } - tv := info.Types[call.Fun] - if tv.IsType() { - return CallConversion - } - if tv.IsBuiltin() { - return CallBuiltin - } - id := UsedIdent(info, call.Fun) - if id == nil { - return CallDynamic - } - obj := info.Uses[id] - // Classify the call by the type of the object, if any. - switch obj := obj.(type) { - case *types.Func: - if isInterfaceMethod(obj) { - return CallInterface - } - return CallStatic - default: - return CallDynamic - } -} - -// UsedIdent returns the identifier such that info.Uses[UsedIdent(info, e)] -// is the [types.Object] used by e, if any. -// -// If e is one of various forms of reference: -// -// f, c, v, T lexical reference -// pkg.X qualified identifier -// f[T] or pkg.F[K,V] instantiations of the above kinds -// expr.f field or method value selector -// T.f method expression selector -// -// UsedIdent returns the identifier whose is associated value in [types.Info.Uses] -// is the object to which it refers. -// -// For the declarations: -// -// func F[T any] {...} -// type I interface { M() } -// var ( -// x int -// s struct { f int } -// a []int -// i I -// ) -// -// UsedIdent returns the following: -// -// Expr UsedIdent -// x x -// s.f f -// F[int] F -// i.M M -// I.M M -// min min -// int int -// 1 nil -// a[0] nil -// []byte nil -// -// Note: if e is an instantiated function or method, UsedIdent returns -// the corresponding generic function or method on the generic type. -func UsedIdent(info *types.Info, e ast.Expr) *ast.Ident { - if info.Types == nil || info.Uses == nil { - panic("one of info.Types or info.Uses is nil; both must be populated") - } - // Look through type instantiation if necessary. - switch d := ast.Unparen(e).(type) { - case *ast.IndexExpr: - if info.Types[d.Index].IsType() { - e = d.X - } - case *ast.IndexListExpr: - e = d.X - } - - switch e := ast.Unparen(e).(type) { - // info.Uses always has the object we want, even for selector expressions. - // We don't need info.Selections. - // See go/types/recording.go:recordSelection. - case *ast.Ident: - return e - case *ast.SelectorExpr: - return e.Sel - } - return nil -} - -// See [golang.org/x/tools/go/types/typeutil.Callee]. -func Callee(info *types.Info, call *ast.CallExpr) types.Object { - id := UsedIdent(info, call.Fun) - if id == nil { - return nil - } - obj := info.Uses[id] - if obj == nil { - return nil - } - if _, ok := obj.(*types.TypeName); ok { - return nil - } - if fn, ok := obj.(*types.Func); ok { - return fn.Origin() - } - return obj -} - -// See [golang.org/x/tools/go/types/typeutil.StaticCallee]. -func StaticCallee(info *types.Info, call *ast.CallExpr) *types.Func { - id := UsedIdent(info, call.Fun) - if id == nil { - return nil - } - obj := info.Uses[id] - if obj == nil { - return nil - } - fn, _ := obj.(*types.Func) - if fn == nil || isInterfaceMethod(fn) { - return nil - } - return fn.Origin() -} - -// isInterfaceMethod reports whether its argument is a method of an interface. -func isInterfaceMethod(f *types.Func) bool { - recv := f.Signature().Recv() - return recv != nil && types.IsInterface(recv.Type()) -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/element.go b/vendor/golang.org/x/tools/internal/typesinternal/element.go deleted file mode 100644 index bab37fbfe0e..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/element.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "fmt" - "go/types" -) - -// ForEachElement calls f for type T and each type reachable from its -// type through reflection. It does this by recursively stripping off -// type constructors; in addition, for each named type N, the type *N -// is added to the result as it may have additional methods. -// -// The access argument passed to f indicates whether the type is -// inaccessible to reflection (for example, intermediate tuple types -// or underlying types of named types). -// -// The result of f indicates whether the caller has seen this type -// already, so we can prune the traversal. -// -// methodSetOf abstracts (*typeutil.MethodSetCache).MethodSet, -// avoiding an import cycle. -func ForEachElement(methodSetOf func(types.Type) *types.MethodSet, T types.Type, f func(T types.Type, access bool) bool) { - var visit func(T types.Type, access bool) - visit = func(T types.Type, access bool) { - if f(T, access) { - return // duplicate; prune descent - } - - // Recursion over signatures of each method. - tmset := methodSetOf(T) - for method := range tmset.Methods() { - sig := method.Type().(*types.Signature) - if sig.TypeParams() != nil { - continue // skip type-parameterized methods - } - - // It is tempting to call visit(sig, false) - // but, as noted in golang.org/cl/65450043, - // the Signature.Recv field is ignored by - // types.Identical and typeutil.Map, which - // is confusing at best. - // - // More importantly, the true signature rtype - // reachable from a method using reflection - // has no receiver but an extra ordinary parameter. - // For the Read method of io.Reader we want: - // func(Reader, []byte) (int, error) - // but here sig is: - // func([]byte) (int, error) - // with .Recv = Reader (though it is hard to - // notice because it doesn't affect Signature.String - // or types.Identical). - // - // TODO(adonovan): construct and visit the correct - // non-method signature with an extra parameter - // (though since unnamed func types have no methods - // there is essentially no actual demand for this). - // - // TODO(adonovan): document whether or not it is - // safe to skip non-exported methods (as RTA does). - visit(sig.Params(), false) // the Tuple is inaccessible - visit(sig.Results(), false) // the Tuple is inaccessible - } - - switch T := T.(type) { - case *types.Alias: - visit(types.Unalias(T), access) // emulates the pre-Alias behavior - - case *types.Basic: - // nop - - case *types.Interface: - // nop---handled by recursion over method set. - - case *types.Pointer: - visit(T.Elem(), true) - - case *types.Slice: - visit(T.Elem(), true) - - case *types.Chan: - visit(T.Elem(), true) - - case *types.Map: - visit(T.Key(), true) - visit(T.Elem(), true) - - case *types.Signature: - if T.Recv() != nil { - panic(fmt.Sprintf("Signature %s has Recv %s", T, T.Recv())) - } - visit(T.Params(), false) // the Tuple is inaccessible - visit(T.Results(), false) // the Tuple is inaccessible - - case *types.Named: - // A pointer-to-named type can be derived from a named - // type via reflection. It may have methods too. - visit(types.NewPointer(T), true) - - // Consider 'type T struct{S}' where S has methods. - // Reflection provides no way to get from T to struct{S}, - // only to S, so the method set of struct{S} is unwanted, - // so mark it inaccessible during recursion. - visit(T.Underlying(), false) // skip the unnamed type - - case *types.Array: - visit(T.Elem(), true) - - case *types.Struct: - for i, n := 0, T.NumFields(); i < n; i++ { - // TODO(adonovan): document whether or not - // it is safe to skip non-exported fields. - visit(T.Field(i).Type(), true) - } - - case *types.Tuple: - for i, n := 0, T.Len(); i < n; i++ { - visit(T.At(i).Type(), true) - } - - case *types.TypeParam, *types.Union: - // forEachReachable must not be called on parameterized types. - panic(fmt.Sprintf("ForEachElement called on type containing %T", T)) - - default: - panic(fmt.Sprintf("ForEachElement called on unexpected type %T", T)) - } - } - visit(T, true) -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go deleted file mode 100644 index 235a6defc4c..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go +++ /dev/null @@ -1,1560 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -//go:generate stringer -type=ErrorCode - -type ErrorCode int - -// This file defines the error codes that can be produced during type-checking. -// Collectively, these codes provide an identifier that may be used to -// implement special handling for certain types of errors. -// -// Error codes should be fine-grained enough that the exact nature of the error -// can be easily determined, but coarse enough that they are not an -// implementation detail of the type checking algorithm. As a rule-of-thumb, -// errors should be considered equivalent if there is a theoretical refactoring -// of the type checker in which they are emitted in exactly one place. For -// example, the type checker emits different error messages for "too many -// arguments" and "too few arguments", but one can imagine an alternative type -// checker where this check instead just emits a single "wrong number of -// arguments", so these errors should have the same code. -// -// Error code names should be as brief as possible while retaining accuracy and -// distinctiveness. In most cases names should start with an adjective -// describing the nature of the error (e.g. "invalid", "unused", "misplaced"), -// and end with a noun identifying the relevant language object. For example, -// "DuplicateDecl" or "InvalidSliceExpr". For brevity, naming follows the -// convention that "bad" implies a problem with syntax, and "invalid" implies a -// problem with types. - -const ( - // InvalidSyntaxTree occurs if an invalid syntax tree is provided - // to the type checker. It should never happen. - InvalidSyntaxTree ErrorCode = -1 -) - -const ( - _ ErrorCode = iota - - // Test is reserved for errors that only apply while in self-test mode. - Test - - /* package names */ - - // BlankPkgName occurs when a package name is the blank identifier "_". - // - // Per the spec: - // "The PackageName must not be the blank identifier." - BlankPkgName - - // MismatchedPkgName occurs when a file's package name doesn't match the - // package name already established by other files. - MismatchedPkgName - - // InvalidPkgUse occurs when a package identifier is used outside of a - // selector expression. - // - // Example: - // import "fmt" - // - // var _ = fmt - InvalidPkgUse - - /* imports */ - - // BadImportPath occurs when an import path is not valid. - BadImportPath - - // BrokenImport occurs when importing a package fails. - // - // Example: - // import "amissingpackage" - BrokenImport - - // ImportCRenamed occurs when the special import "C" is renamed. "C" is a - // pseudo-package, and must not be renamed. - // - // Example: - // import _ "C" - ImportCRenamed - - // UnusedImport occurs when an import is unused. - // - // Example: - // import "fmt" - // - // func main() {} - UnusedImport - - /* initialization */ - - // InvalidInitCycle occurs when an invalid cycle is detected within the - // initialization graph. - // - // Example: - // var x int = f() - // - // func f() int { return x } - InvalidInitCycle - - /* decls */ - - // DuplicateDecl occurs when an identifier is declared multiple times. - // - // Example: - // var x = 1 - // var x = 2 - DuplicateDecl - - // InvalidDeclCycle occurs when a declaration cycle is not valid. - // - // Example: - // import "unsafe" - // - // type T struct { - // a [n]int - // } - // - // var n = unsafe.Sizeof(T{}) - InvalidDeclCycle - - // InvalidTypeCycle occurs when a cycle in type definitions results in a - // type that is not well-defined. - // - // Example: - // import "unsafe" - // - // type T [unsafe.Sizeof(T{})]int - InvalidTypeCycle - - /* decls > const */ - - // InvalidConstInit occurs when a const declaration has a non-constant - // initializer. - // - // Example: - // var x int - // const _ = x - InvalidConstInit - - // InvalidConstVal occurs when a const value cannot be converted to its - // target type. - // - // TODO(findleyr): this error code and example are not very clear. Consider - // removing it. - // - // Example: - // const _ = 1 << "hello" - InvalidConstVal - - // InvalidConstType occurs when the underlying type in a const declaration - // is not a valid constant type. - // - // Example: - // const c *int = 4 - InvalidConstType - - /* decls > var (+ other variable assignment codes) */ - - // UntypedNilUse occurs when the predeclared (untyped) value nil is used to - // initialize a variable declared without an explicit type. - // - // Example: - // var x = nil - UntypedNilUse - - // WrongAssignCount occurs when the number of values on the right-hand side - // of an assignment or initialization expression does not match the number - // of variables on the left-hand side. - // - // Example: - // var x = 1, 2 - WrongAssignCount - - // UnassignableOperand occurs when the left-hand side of an assignment is - // not assignable. - // - // Example: - // func f() { - // const c = 1 - // c = 2 - // } - UnassignableOperand - - // NoNewVar occurs when a short variable declaration (':=') does not declare - // new variables. - // - // Example: - // func f() { - // x := 1 - // x := 2 - // } - NoNewVar - - // MultiValAssignOp occurs when an assignment operation (+=, *=, etc) does - // not have single-valued left-hand or right-hand side. - // - // Per the spec: - // "In assignment operations, both the left- and right-hand expression lists - // must contain exactly one single-valued expression" - // - // Example: - // func f() int { - // x, y := 1, 2 - // x, y += 1 - // return x + y - // } - MultiValAssignOp - - // InvalidIfaceAssign occurs when a value of type T is used as an - // interface, but T does not implement a method of the expected interface. - // - // Example: - // type I interface { - // f() - // } - // - // type T int - // - // var x I = T(1) - InvalidIfaceAssign - - // InvalidChanAssign occurs when a chan assignment is invalid. - // - // Per the spec, a value x is assignable to a channel type T if: - // "x is a bidirectional channel value, T is a channel type, x's type V and - // T have identical element types, and at least one of V or T is not a - // defined type." - // - // Example: - // type T1 chan int - // type T2 chan int - // - // var x T1 - // // Invalid assignment because both types are named - // var _ T2 = x - InvalidChanAssign - - // IncompatibleAssign occurs when the type of the right-hand side expression - // in an assignment cannot be assigned to the type of the variable being - // assigned. - // - // Example: - // var x []int - // var _ int = x - IncompatibleAssign - - // UnaddressableFieldAssign occurs when trying to assign to a struct field - // in a map value. - // - // Example: - // func f() { - // m := make(map[string]struct{i int}) - // m["foo"].i = 42 - // } - UnaddressableFieldAssign - - /* decls > type (+ other type expression codes) */ - - // NotAType occurs when the identifier used as the underlying type in a type - // declaration or the right-hand side of a type alias does not denote a type. - // - // Example: - // var S = 2 - // - // type T S - NotAType - - // InvalidArrayLen occurs when an array length is not a constant value. - // - // Example: - // var n = 3 - // var _ = [n]int{} - InvalidArrayLen - - // BlankIfaceMethod occurs when a method name is '_'. - // - // Per the spec: - // "The name of each explicitly specified method must be unique and not - // blank." - // - // Example: - // type T interface { - // _(int) - // } - BlankIfaceMethod - - // IncomparableMapKey occurs when a map key type does not support the == and - // != operators. - // - // Per the spec: - // "The comparison operators == and != must be fully defined for operands of - // the key type; thus the key type must not be a function, map, or slice." - // - // Example: - // var x map[T]int - // - // type T []int - IncomparableMapKey - - // InvalidIfaceEmbed occurs when a non-interface type is embedded in an - // interface. - // - // Example: - // type T struct {} - // - // func (T) m() - // - // type I interface { - // T - // } - InvalidIfaceEmbed - - // InvalidPtrEmbed occurs when an embedded field is of the pointer form *T, - // and T itself is itself a pointer, an unsafe.Pointer, or an interface. - // - // Per the spec: - // "An embedded field must be specified as a type name T or as a pointer to - // a non-interface type name *T, and T itself may not be a pointer type." - // - // Example: - // type T *int - // - // type S struct { - // *T - // } - InvalidPtrEmbed - - /* decls > func and method */ - - // BadRecv occurs when a method declaration does not have exactly one - // receiver parameter. - // - // Example: - // func () _() {} - BadRecv - - // InvalidRecv occurs when a receiver type expression is not of the form T - // or *T, or T is a pointer type. - // - // Example: - // type T struct {} - // - // func (**T) m() {} - InvalidRecv - - // DuplicateFieldAndMethod occurs when an identifier appears as both a field - // and method name. - // - // Example: - // type T struct { - // m int - // } - // - // func (T) m() {} - DuplicateFieldAndMethod - - // DuplicateMethod occurs when two methods on the same receiver type have - // the same name. - // - // Example: - // type T struct {} - // func (T) m() {} - // func (T) m(i int) int { return i } - DuplicateMethod - - /* decls > special */ - - // InvalidBlank occurs when a blank identifier is used as a value or type. - // - // Per the spec: - // "The blank identifier may appear as an operand only on the left-hand side - // of an assignment." - // - // Example: - // var x = _ - InvalidBlank - - // InvalidIota occurs when the predeclared identifier iota is used outside - // of a constant declaration. - // - // Example: - // var x = iota - InvalidIota - - // MissingInitBody occurs when an init function is missing its body. - // - // Example: - // func init() - MissingInitBody - - // InvalidInitSig occurs when an init function declares parameters or - // results. - // - // Example: - // func init() int { return 1 } - InvalidInitSig - - // InvalidInitDecl occurs when init is declared as anything other than a - // function. - // - // Example: - // var init = 1 - InvalidInitDecl - - // InvalidMainDecl occurs when main is declared as anything other than a - // function, in a main package. - InvalidMainDecl - - /* exprs */ - - // TooManyValues occurs when a function returns too many values for the - // expression context in which it is used. - // - // Example: - // func ReturnTwo() (int, int) { - // return 1, 2 - // } - // - // var x = ReturnTwo() - TooManyValues - - // NotAnExpr occurs when a type expression is used where a value expression - // is expected. - // - // Example: - // type T struct {} - // - // func f() { - // T - // } - NotAnExpr - - /* exprs > const */ - - // TruncatedFloat occurs when a float constant is truncated to an integer - // value. - // - // Example: - // var _ int = 98.6 - TruncatedFloat - - // NumericOverflow occurs when a numeric constant overflows its target type. - // - // Example: - // var x int8 = 1000 - NumericOverflow - - /* exprs > operation */ - - // UndefinedOp occurs when an operator is not defined for the type(s) used - // in an operation. - // - // Example: - // var c = "a" - "b" - UndefinedOp - - // MismatchedTypes occurs when operand types are incompatible in a binary - // operation. - // - // Example: - // var a = "hello" - // var b = 1 - // var c = a - b - MismatchedTypes - - // DivByZero occurs when a division operation is provable at compile - // time to be a division by zero. - // - // Example: - // const divisor = 0 - // var x int = 1/divisor - DivByZero - - // NonNumericIncDec occurs when an increment or decrement operator is - // applied to a non-numeric value. - // - // Example: - // func f() { - // var c = "c" - // c++ - // } - NonNumericIncDec - - /* exprs > ptr */ - - // UnaddressableOperand occurs when the & operator is applied to an - // unaddressable expression. - // - // Example: - // var x = &1 - UnaddressableOperand - - // InvalidIndirection occurs when a non-pointer value is indirected via the - // '*' operator. - // - // Example: - // var x int - // var y = *x - InvalidIndirection - - /* exprs > [] */ - - // NonIndexableOperand occurs when an index operation is applied to a value - // that cannot be indexed. - // - // Example: - // var x = 1 - // var y = x[1] - NonIndexableOperand - - // InvalidIndex occurs when an index argument is not of integer type, - // negative, or out-of-bounds. - // - // Example: - // var s = [...]int{1,2,3} - // var x = s[5] - // - // Example: - // var s = []int{1,2,3} - // var _ = s[-1] - // - // Example: - // var s = []int{1,2,3} - // var i string - // var _ = s[i] - InvalidIndex - - // SwappedSliceIndices occurs when constant indices in a slice expression - // are decreasing in value. - // - // Example: - // var _ = []int{1,2,3}[2:1] - SwappedSliceIndices - - /* operators > slice */ - - // NonSliceableOperand occurs when a slice operation is applied to a value - // whose type is not sliceable, or is unaddressable. - // - // Example: - // var x = [...]int{1, 2, 3}[:1] - // - // Example: - // var x = 1 - // var y = 1[:1] - NonSliceableOperand - - // InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is - // applied to a string. - // - // Example: - // var s = "hello" - // var x = s[1:2:3] - InvalidSliceExpr - - /* exprs > shift */ - - // InvalidShiftCount occurs when the right-hand side of a shift operation is - // either non-integer, negative, or too large. - // - // Example: - // var ( - // x string - // y int = 1 << x - // ) - InvalidShiftCount - - // InvalidShiftOperand occurs when the shifted operand is not an integer. - // - // Example: - // var s = "hello" - // var x = s << 2 - InvalidShiftOperand - - /* exprs > chan */ - - // InvalidReceive occurs when there is a channel receive from a value that - // is either not a channel, or is a send-only channel. - // - // Example: - // func f() { - // var x = 1 - // <-x - // } - InvalidReceive - - // InvalidSend occurs when there is a channel send to a value that is not a - // channel, or is a receive-only channel. - // - // Example: - // func f() { - // var x = 1 - // x <- "hello!" - // } - InvalidSend - - /* exprs > literal */ - - // DuplicateLitKey occurs when an index is duplicated in a slice, array, or - // map literal. - // - // Example: - // var _ = []int{0:1, 0:2} - // - // Example: - // var _ = map[string]int{"a": 1, "a": 2} - DuplicateLitKey - - // MissingLitKey occurs when a map literal is missing a key expression. - // - // Example: - // var _ = map[string]int{1} - MissingLitKey - - // InvalidLitIndex occurs when the key in a key-value element of a slice or - // array literal is not an integer constant. - // - // Example: - // var i = 0 - // var x = []string{i: "world"} - InvalidLitIndex - - // OversizeArrayLit occurs when an array literal exceeds its length. - // - // Example: - // var _ = [2]int{1,2,3} - OversizeArrayLit - - // MixedStructLit occurs when a struct literal contains a mix of positional - // and named elements. - // - // Example: - // var _ = struct{i, j int}{i: 1, 2} - MixedStructLit - - // InvalidStructLit occurs when a positional struct literal has an incorrect - // number of values. - // - // Example: - // var _ = struct{i, j int}{1,2,3} - InvalidStructLit - - // MissingLitField occurs when a struct literal refers to a field that does - // not exist on the struct type. - // - // Example: - // var _ = struct{i int}{j: 2} - MissingLitField - - // DuplicateLitField occurs when a struct literal contains duplicated - // fields. - // - // Example: - // var _ = struct{i int}{i: 1, i: 2} - DuplicateLitField - - // UnexportedLitField occurs when a positional struct literal implicitly - // assigns an unexported field of an imported type. - UnexportedLitField - - // InvalidLitField occurs when a field name is not a valid identifier. - // - // Example: - // var _ = struct{i int}{1: 1} - InvalidLitField - - // UntypedLit occurs when a composite literal omits a required type - // identifier. - // - // Example: - // type outer struct{ - // inner struct { i int } - // } - // - // var _ = outer{inner: {1}} - UntypedLit - - // InvalidLit occurs when a composite literal expression does not match its - // type. - // - // Example: - // type P *struct{ - // x int - // } - // var _ = P {} - InvalidLit - - /* exprs > selector */ - - // AmbiguousSelector occurs when a selector is ambiguous. - // - // Example: - // type E1 struct { i int } - // type E2 struct { i int } - // type T struct { E1; E2 } - // - // var x T - // var _ = x.i - AmbiguousSelector - - // UndeclaredImportedName occurs when a package-qualified identifier is - // undeclared by the imported package. - // - // Example: - // import "go/types" - // - // var _ = types.NotAnActualIdentifier - UndeclaredImportedName - - // UnexportedName occurs when a selector refers to an unexported identifier - // of an imported package. - // - // Example: - // import "reflect" - // - // type _ reflect.flag - UnexportedName - - // UndeclaredName occurs when an identifier is not declared in the current - // scope. - // - // Example: - // var x T - UndeclaredName - - // MissingFieldOrMethod occurs when a selector references a field or method - // that does not exist. - // - // Example: - // type T struct {} - // - // var x = T{}.f - MissingFieldOrMethod - - /* exprs > ... */ - - // BadDotDotDotSyntax occurs when a "..." occurs in a context where it is - // not valid. - // - // Example: - // var _ = map[int][...]int{0: {}} - BadDotDotDotSyntax - - // NonVariadicDotDotDot occurs when a "..." is used on the final argument to - // a non-variadic function. - // - // Example: - // func printArgs(s []string) { - // for _, a := range s { - // println(a) - // } - // } - // - // func f() { - // s := []string{"a", "b", "c"} - // printArgs(s...) - // } - NonVariadicDotDotDot - - // MisplacedDotDotDot occurs when a "..." is used somewhere other than the - // final argument to a function call. - // - // Example: - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func f() { - // a := []int{1,2,3} - // printArgs(0, a...) - // } - MisplacedDotDotDot - - // InvalidDotDotDotOperand occurs when a "..." operator is applied to a - // single-valued operand. - // - // Example: - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func f() { - // a := 1 - // printArgs(a...) - // } - // - // Example: - // func args() (int, int) { - // return 1, 2 - // } - // - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func g() { - // printArgs(args()...) - // } - InvalidDotDotDotOperand - - // InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in - // function. - // - // Example: - // var s = []int{1, 2, 3} - // var l = len(s...) - InvalidDotDotDot - - /* exprs > built-in */ - - // UncalledBuiltin occurs when a built-in function is used as a - // function-valued expression, instead of being called. - // - // Per the spec: - // "The built-in functions do not have standard Go types, so they can only - // appear in call expressions; they cannot be used as function values." - // - // Example: - // var _ = copy - UncalledBuiltin - - // InvalidAppend occurs when append is called with a first argument that is - // not a slice. - // - // Example: - // var _ = append(1, 2) - InvalidAppend - - // InvalidCap occurs when an argument to the cap built-in function is not of - // supported type. - // - // See https://golang.org/ref/spec#Length_and_capacity for information on - // which underlying types are supported as arguments to cap and len. - // - // Example: - // var s = 2 - // var x = cap(s) - InvalidCap - - // InvalidClose occurs when close(...) is called with an argument that is - // not of channel type, or that is a receive-only channel. - // - // Example: - // func f() { - // var x int - // close(x) - // } - InvalidClose - - // InvalidCopy occurs when the arguments are not of slice type or do not - // have compatible type. - // - // See https://golang.org/ref/spec#Appending_and_copying_slices for more - // information on the type requirements for the copy built-in. - // - // Example: - // func f() { - // var x []int - // y := []int64{1,2,3} - // copy(x, y) - // } - InvalidCopy - - // InvalidComplex occurs when the complex built-in function is called with - // arguments with incompatible types. - // - // Example: - // var _ = complex(float32(1), float64(2)) - InvalidComplex - - // InvalidDelete occurs when the delete built-in function is called with a - // first argument that is not a map. - // - // Example: - // func f() { - // m := "hello" - // delete(m, "e") - // } - InvalidDelete - - // InvalidImag occurs when the imag built-in function is called with an - // argument that does not have complex type. - // - // Example: - // var _ = imag(int(1)) - InvalidImag - - // InvalidLen occurs when an argument to the len built-in function is not of - // supported type. - // - // See https://golang.org/ref/spec#Length_and_capacity for information on - // which underlying types are supported as arguments to cap and len. - // - // Example: - // var s = 2 - // var x = len(s) - InvalidLen - - // SwappedMakeArgs occurs when make is called with three arguments, and its - // length argument is larger than its capacity argument. - // - // Example: - // var x = make([]int, 3, 2) - SwappedMakeArgs - - // InvalidMake occurs when make is called with an unsupported type argument. - // - // See https://golang.org/ref/spec#Making_slices_maps_and_channels for - // information on the types that may be created using make. - // - // Example: - // var x = make(int) - InvalidMake - - // InvalidReal occurs when the real built-in function is called with an - // argument that does not have complex type. - // - // Example: - // var _ = real(int(1)) - InvalidReal - - /* exprs > assertion */ - - // InvalidAssert occurs when a type assertion is applied to a - // value that is not of interface type. - // - // Example: - // var x = 1 - // var _ = x.(float64) - InvalidAssert - - // ImpossibleAssert occurs for a type assertion x.(T) when the value x of - // interface cannot have dynamic type T, due to a missing or mismatching - // method on T. - // - // Example: - // type T int - // - // func (t *T) m() int { return int(*t) } - // - // type I interface { m() int } - // - // var x I - // var _ = x.(T) - ImpossibleAssert - - /* exprs > conversion */ - - // InvalidConversion occurs when the argument type cannot be converted to the - // target. - // - // See https://golang.org/ref/spec#Conversions for the rules of - // convertibility. - // - // Example: - // var x float64 - // var _ = string(x) - InvalidConversion - - // InvalidUntypedConversion occurs when there is no valid implicit - // conversion from an untyped value satisfying the type constraints of the - // context in which it is used. - // - // Example: - // var _ = 1 + "" - InvalidUntypedConversion - - /* offsetof */ - - // BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument - // that is not a selector expression. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Offsetof(x) - BadOffsetofSyntax - - // InvalidOffsetof occurs when unsafe.Offsetof is called with a method - // selector, rather than a field selector, or when the field is embedded via - // a pointer. - // - // Per the spec: - // - // "If f is an embedded field, it must be reachable without pointer - // indirections through fields of the struct. " - // - // Example: - // import "unsafe" - // - // type T struct { f int } - // type S struct { *T } - // var s S - // var _ = unsafe.Offsetof(s.f) - // - // Example: - // import "unsafe" - // - // type S struct{} - // - // func (S) m() {} - // - // var s S - // var _ = unsafe.Offsetof(s.m) - InvalidOffsetof - - /* control flow > scope */ - - // UnusedExpr occurs when a side-effect free expression is used as a - // statement. Such a statement has no effect. - // - // Example: - // func f(i int) { - // i*i - // } - UnusedExpr - - // UnusedVar occurs when a variable is declared but unused. - // - // Example: - // func f() { - // x := 1 - // } - UnusedVar - - // MissingReturn occurs when a function with results is missing a return - // statement. - // - // Example: - // func f() int {} - MissingReturn - - // WrongResultCount occurs when a return statement returns an incorrect - // number of values. - // - // Example: - // func ReturnOne() int { - // return 1, 2 - // } - WrongResultCount - - // OutOfScopeResult occurs when the name of a value implicitly returned by - // an empty return statement is shadowed in a nested scope. - // - // Example: - // func factor(n int) (i int) { - // for i := 2; i < n; i++ { - // if n%i == 0 { - // return - // } - // } - // return 0 - // } - OutOfScopeResult - - /* control flow > if */ - - // InvalidCond occurs when an if condition is not a boolean expression. - // - // Example: - // func checkReturn(i int) { - // if i { - // panic("non-zero return") - // } - // } - InvalidCond - - /* control flow > for */ - - // InvalidPostDecl occurs when there is a declaration in a for-loop post - // statement. - // - // Example: - // func f() { - // for i := 0; i < 10; j := 0 {} - // } - InvalidPostDecl - - // InvalidChanRange occurs when a send-only channel used in a range - // expression. - // - // Example: - // func sum(c chan<- int) { - // s := 0 - // for i := range c { - // s += i - // } - // } - InvalidChanRange - - // InvalidIterVar occurs when two iteration variables are used while ranging - // over a channel. - // - // Example: - // func f(c chan int) { - // for k, v := range c { - // println(k, v) - // } - // } - InvalidIterVar - - // InvalidRangeExpr occurs when the type of a range expression is not array, - // slice, string, map, or channel. - // - // Example: - // func f(i int) { - // for j := range i { - // println(j) - // } - // } - InvalidRangeExpr - - /* control flow > switch */ - - // MisplacedBreak occurs when a break statement is not within a for, switch, - // or select statement of the innermost function definition. - // - // Example: - // func f() { - // break - // } - MisplacedBreak - - // MisplacedContinue occurs when a continue statement is not within a for - // loop of the innermost function definition. - // - // Example: - // func sumeven(n int) int { - // proceed := func() { - // continue - // } - // sum := 0 - // for i := 1; i <= n; i++ { - // if i % 2 != 0 { - // proceed() - // } - // sum += i - // } - // return sum - // } - MisplacedContinue - - // MisplacedFallthrough occurs when a fallthrough statement is not within an - // expression switch. - // - // Example: - // func typename(i interface{}) string { - // switch i.(type) { - // case int64: - // fallthrough - // case int: - // return "int" - // } - // return "unsupported" - // } - MisplacedFallthrough - - // DuplicateCase occurs when a type or expression switch has duplicate - // cases. - // - // Example: - // func printInt(i int) { - // switch i { - // case 1: - // println("one") - // case 1: - // println("One") - // } - // } - DuplicateCase - - // DuplicateDefault occurs when a type or expression switch has multiple - // default clauses. - // - // Example: - // func printInt(i int) { - // switch i { - // case 1: - // println("one") - // default: - // println("One") - // default: - // println("1") - // } - // } - DuplicateDefault - - // BadTypeKeyword occurs when a .(type) expression is used anywhere other - // than a type switch. - // - // Example: - // type I interface { - // m() - // } - // var t I - // var _ = t.(type) - BadTypeKeyword - - // InvalidTypeSwitch occurs when .(type) is used on an expression that is - // not of interface type. - // - // Example: - // func f(i int) { - // switch x := i.(type) {} - // } - InvalidTypeSwitch - - // InvalidExprSwitch occurs when a switch expression is not comparable. - // - // Example: - // func _() { - // var a struct{ _ func() } - // switch a /* ERROR cannot switch on a */ { - // } - // } - InvalidExprSwitch - - /* control flow > select */ - - // InvalidSelectCase occurs when a select case is not a channel send or - // receive. - // - // Example: - // func checkChan(c <-chan int) bool { - // select { - // case c: - // return true - // default: - // return false - // } - // } - InvalidSelectCase - - /* control flow > labels and jumps */ - - // UndeclaredLabel occurs when an undeclared label is jumped to. - // - // Example: - // func f() { - // goto L - // } - UndeclaredLabel - - // DuplicateLabel occurs when a label is declared more than once. - // - // Example: - // func f() int { - // L: - // L: - // return 1 - // } - DuplicateLabel - - // MisplacedLabel occurs when a break or continue label is not on a for, - // switch, or select statement. - // - // Example: - // func f() { - // L: - // a := []int{1,2,3} - // for _, e := range a { - // if e > 10 { - // break L - // } - // println(a) - // } - // } - MisplacedLabel - - // UnusedLabel occurs when a label is declared but not used. - // - // Example: - // func f() { - // L: - // } - UnusedLabel - - // JumpOverDecl occurs when a label jumps over a variable declaration. - // - // Example: - // func f() int { - // goto L - // x := 2 - // L: - // x++ - // return x - // } - JumpOverDecl - - // JumpIntoBlock occurs when a forward jump goes to a label inside a nested - // block. - // - // Example: - // func f(x int) { - // goto L - // if x > 0 { - // L: - // print("inside block") - // } - // } - JumpIntoBlock - - /* control flow > calls */ - - // InvalidMethodExpr occurs when a pointer method is called but the argument - // is not addressable. - // - // Example: - // type T struct {} - // - // func (*T) m() int { return 1 } - // - // var _ = T.m(T{}) - InvalidMethodExpr - - // WrongArgCount occurs when too few or too many arguments are passed by a - // function call. - // - // Example: - // func f(i int) {} - // var x = f() - WrongArgCount - - // InvalidCall occurs when an expression is called that is not of function - // type. - // - // Example: - // var x = "x" - // var y = x() - InvalidCall - - /* control flow > suspended */ - - // UnusedResults occurs when a restricted expression-only built-in function - // is suspended via go or defer. Such a suspension discards the results of - // these side-effect free built-in functions, and therefore is ineffectual. - // - // Example: - // func f(a []int) int { - // defer len(a) - // return i - // } - UnusedResults - - // InvalidDefer occurs when a deferred expression is not a function call, - // for example if the expression is a type conversion. - // - // Example: - // func f(i int) int { - // defer int32(i) - // return i - // } - InvalidDefer - - // InvalidGo occurs when a go expression is not a function call, for example - // if the expression is a type conversion. - // - // Example: - // func f(i int) int { - // go int32(i) - // return i - // } - InvalidGo - - // All codes below were added in Go 1.17. - - /* decl */ - - // BadDecl occurs when a declaration has invalid syntax. - BadDecl - - // RepeatedDecl occurs when an identifier occurs more than once on the left - // hand side of a short variable declaration. - // - // Example: - // func _() { - // x, y, y := 1, 2, 3 - // } - RepeatedDecl - - /* unsafe */ - - // InvalidUnsafeAdd occurs when unsafe.Add is called with a - // length argument that is not of integer type. - // - // Example: - // import "unsafe" - // - // var p unsafe.Pointer - // var _ = unsafe.Add(p, float64(1)) - InvalidUnsafeAdd - - // InvalidUnsafeSlice occurs when unsafe.Slice is called with a - // pointer argument that is not of pointer type or a length argument - // that is not of integer type, negative, or out of bounds. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(x, 1) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, float64(1)) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, -1) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, uint64(1) << 63) - InvalidUnsafeSlice - - // All codes below were added in Go 1.18. - - /* features */ - - // UnsupportedFeature occurs when a language feature is used that is not - // supported at this Go version. - UnsupportedFeature - - /* type params */ - - // NotAGenericType occurs when a non-generic type is used where a generic - // type is expected: in type or function instantiation. - // - // Example: - // type T int - // - // var _ T[int] - NotAGenericType - - // WrongTypeArgCount occurs when a type or function is instantiated with an - // incorrect number of type arguments, including when a generic type or - // function is used without instantiation. - // - // Errors involving failed type inference are assigned other error codes. - // - // Example: - // type T[p any] int - // - // var _ T[int, string] - // - // Example: - // func f[T any]() {} - // - // var x = f - WrongTypeArgCount - - // CannotInferTypeArgs occurs when type or function type argument inference - // fails to infer all type arguments. - // - // Example: - // func f[T any]() {} - // - // func _() { - // f() - // } - // - // Example: - // type N[P, Q any] struct{} - // - // var _ N[int] - CannotInferTypeArgs - - // InvalidTypeArg occurs when a type argument does not satisfy its - // corresponding type parameter constraints. - // - // Example: - // type T[P ~int] struct{} - // - // var _ T[string] - InvalidTypeArg // arguments? InferenceFailed - - // InvalidInstanceCycle occurs when an invalid cycle is detected - // within the instantiation graph. - // - // Example: - // func f[T any]() { f[*T]() } - InvalidInstanceCycle - - // InvalidUnion occurs when an embedded union or approximation element is - // not valid. - // - // Example: - // type _ interface { - // ~int | interface{ m() } - // } - InvalidUnion - - // MisplacedConstraintIface occurs when a constraint-type interface is used - // outside of constraint position. - // - // Example: - // type I interface { ~int } - // - // var _ I - MisplacedConstraintIface - - // InvalidMethodTypeParams occurs when methods have type parameters. - // - // It cannot be encountered with an AST parsed using go/parser. - InvalidMethodTypeParams - - // MisplacedTypeParam occurs when a type parameter is used in a place where - // it is not permitted. - // - // Example: - // type T[P any] P - // - // Example: - // type T[P any] struct{ *P } - MisplacedTypeParam - - // InvalidUnsafeSliceData occurs when unsafe.SliceData is called with - // an argument that is not of slice type. It also occurs if it is used - // in a package compiled for a language version before go1.20. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.SliceData(x) - InvalidUnsafeSliceData - - // InvalidUnsafeString occurs when unsafe.String is called with - // a length argument that is not of integer type, negative, or - // out of bounds. It also occurs if it is used in a package - // compiled for a language version before go1.20. - // - // Example: - // import "unsafe" - // - // var b [10]byte - // var _ = unsafe.String(&b[0], -1) - InvalidUnsafeString - - // InvalidUnsafeStringData occurs if it is used in a package - // compiled for a language version before go1.20. - _ // not used anymore - -) diff --git a/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go b/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go deleted file mode 100644 index 15ecf7c5ded..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT. - -package typesinternal - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[InvalidSyntaxTree - -1] - _ = x[Test-1] - _ = x[BlankPkgName-2] - _ = x[MismatchedPkgName-3] - _ = x[InvalidPkgUse-4] - _ = x[BadImportPath-5] - _ = x[BrokenImport-6] - _ = x[ImportCRenamed-7] - _ = x[UnusedImport-8] - _ = x[InvalidInitCycle-9] - _ = x[DuplicateDecl-10] - _ = x[InvalidDeclCycle-11] - _ = x[InvalidTypeCycle-12] - _ = x[InvalidConstInit-13] - _ = x[InvalidConstVal-14] - _ = x[InvalidConstType-15] - _ = x[UntypedNilUse-16] - _ = x[WrongAssignCount-17] - _ = x[UnassignableOperand-18] - _ = x[NoNewVar-19] - _ = x[MultiValAssignOp-20] - _ = x[InvalidIfaceAssign-21] - _ = x[InvalidChanAssign-22] - _ = x[IncompatibleAssign-23] - _ = x[UnaddressableFieldAssign-24] - _ = x[NotAType-25] - _ = x[InvalidArrayLen-26] - _ = x[BlankIfaceMethod-27] - _ = x[IncomparableMapKey-28] - _ = x[InvalidIfaceEmbed-29] - _ = x[InvalidPtrEmbed-30] - _ = x[BadRecv-31] - _ = x[InvalidRecv-32] - _ = x[DuplicateFieldAndMethod-33] - _ = x[DuplicateMethod-34] - _ = x[InvalidBlank-35] - _ = x[InvalidIota-36] - _ = x[MissingInitBody-37] - _ = x[InvalidInitSig-38] - _ = x[InvalidInitDecl-39] - _ = x[InvalidMainDecl-40] - _ = x[TooManyValues-41] - _ = x[NotAnExpr-42] - _ = x[TruncatedFloat-43] - _ = x[NumericOverflow-44] - _ = x[UndefinedOp-45] - _ = x[MismatchedTypes-46] - _ = x[DivByZero-47] - _ = x[NonNumericIncDec-48] - _ = x[UnaddressableOperand-49] - _ = x[InvalidIndirection-50] - _ = x[NonIndexableOperand-51] - _ = x[InvalidIndex-52] - _ = x[SwappedSliceIndices-53] - _ = x[NonSliceableOperand-54] - _ = x[InvalidSliceExpr-55] - _ = x[InvalidShiftCount-56] - _ = x[InvalidShiftOperand-57] - _ = x[InvalidReceive-58] - _ = x[InvalidSend-59] - _ = x[DuplicateLitKey-60] - _ = x[MissingLitKey-61] - _ = x[InvalidLitIndex-62] - _ = x[OversizeArrayLit-63] - _ = x[MixedStructLit-64] - _ = x[InvalidStructLit-65] - _ = x[MissingLitField-66] - _ = x[DuplicateLitField-67] - _ = x[UnexportedLitField-68] - _ = x[InvalidLitField-69] - _ = x[UntypedLit-70] - _ = x[InvalidLit-71] - _ = x[AmbiguousSelector-72] - _ = x[UndeclaredImportedName-73] - _ = x[UnexportedName-74] - _ = x[UndeclaredName-75] - _ = x[MissingFieldOrMethod-76] - _ = x[BadDotDotDotSyntax-77] - _ = x[NonVariadicDotDotDot-78] - _ = x[MisplacedDotDotDot-79] - _ = x[InvalidDotDotDotOperand-80] - _ = x[InvalidDotDotDot-81] - _ = x[UncalledBuiltin-82] - _ = x[InvalidAppend-83] - _ = x[InvalidCap-84] - _ = x[InvalidClose-85] - _ = x[InvalidCopy-86] - _ = x[InvalidComplex-87] - _ = x[InvalidDelete-88] - _ = x[InvalidImag-89] - _ = x[InvalidLen-90] - _ = x[SwappedMakeArgs-91] - _ = x[InvalidMake-92] - _ = x[InvalidReal-93] - _ = x[InvalidAssert-94] - _ = x[ImpossibleAssert-95] - _ = x[InvalidConversion-96] - _ = x[InvalidUntypedConversion-97] - _ = x[BadOffsetofSyntax-98] - _ = x[InvalidOffsetof-99] - _ = x[UnusedExpr-100] - _ = x[UnusedVar-101] - _ = x[MissingReturn-102] - _ = x[WrongResultCount-103] - _ = x[OutOfScopeResult-104] - _ = x[InvalidCond-105] - _ = x[InvalidPostDecl-106] - _ = x[InvalidChanRange-107] - _ = x[InvalidIterVar-108] - _ = x[InvalidRangeExpr-109] - _ = x[MisplacedBreak-110] - _ = x[MisplacedContinue-111] - _ = x[MisplacedFallthrough-112] - _ = x[DuplicateCase-113] - _ = x[DuplicateDefault-114] - _ = x[BadTypeKeyword-115] - _ = x[InvalidTypeSwitch-116] - _ = x[InvalidExprSwitch-117] - _ = x[InvalidSelectCase-118] - _ = x[UndeclaredLabel-119] - _ = x[DuplicateLabel-120] - _ = x[MisplacedLabel-121] - _ = x[UnusedLabel-122] - _ = x[JumpOverDecl-123] - _ = x[JumpIntoBlock-124] - _ = x[InvalidMethodExpr-125] - _ = x[WrongArgCount-126] - _ = x[InvalidCall-127] - _ = x[UnusedResults-128] - _ = x[InvalidDefer-129] - _ = x[InvalidGo-130] - _ = x[BadDecl-131] - _ = x[RepeatedDecl-132] - _ = x[InvalidUnsafeAdd-133] - _ = x[InvalidUnsafeSlice-134] - _ = x[UnsupportedFeature-135] - _ = x[NotAGenericType-136] - _ = x[WrongTypeArgCount-137] - _ = x[CannotInferTypeArgs-138] - _ = x[InvalidTypeArg-139] - _ = x[InvalidInstanceCycle-140] - _ = x[InvalidUnion-141] - _ = x[MisplacedConstraintIface-142] - _ = x[InvalidMethodTypeParams-143] - _ = x[MisplacedTypeParam-144] - _ = x[InvalidUnsafeSliceData-145] - _ = x[InvalidUnsafeString-146] -} - -const ( - _ErrorCode_name_0 = "InvalidSyntaxTree" - _ErrorCode_name_1 = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilUseWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKeyInvalidIfaceEmbedInvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDotInvalidDotDotDotOperandInvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDeclInvalidChanRangeInvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidExprSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGoBadDeclRepeatedDeclInvalidUnsafeAddInvalidUnsafeSliceUnsupportedFeatureNotAGenericTypeWrongTypeArgCountCannotInferTypeArgsInvalidTypeArgInvalidInstanceCycleInvalidUnionMisplacedConstraintIfaceInvalidMethodTypeParamsMisplacedTypeParamInvalidUnsafeSliceDataInvalidUnsafeString" -) - -var ( - _ErrorCode_index_1 = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 218, 234, 253, 261, 277, 295, 312, 330, 354, 362, 377, 393, 411, 428, 443, 450, 461, 484, 499, 511, 522, 537, 551, 566, 581, 594, 603, 617, 632, 643, 658, 667, 683, 703, 721, 740, 752, 771, 790, 806, 823, 842, 856, 867, 882, 895, 910, 926, 940, 956, 971, 988, 1006, 1021, 1031, 1041, 1058, 1080, 1094, 1108, 1128, 1146, 1166, 1184, 1207, 1223, 1238, 1251, 1261, 1273, 1284, 1298, 1311, 1322, 1332, 1347, 1358, 1369, 1382, 1398, 1415, 1439, 1456, 1471, 1481, 1490, 1503, 1519, 1535, 1546, 1561, 1577, 1591, 1607, 1621, 1638, 1658, 1671, 1687, 1701, 1718, 1735, 1752, 1767, 1781, 1795, 1806, 1818, 1831, 1848, 1861, 1872, 1885, 1897, 1906, 1913, 1925, 1941, 1959, 1977, 1992, 2009, 2028, 2042, 2062, 2074, 2098, 2121, 2139, 2161, 2180} -) - -func (i ErrorCode) String() string { - switch { - case i == -1: - return _ErrorCode_name_0 - case 1 <= i && i <= 146: - i -= 1 - return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]] - default: - return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" - } -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/fx.go b/vendor/golang.org/x/tools/internal/typesinternal/fx.go deleted file mode 100644 index c846a53d5fe..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/fx.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/ast" - "go/token" - "go/types" -) - -// NoEffects reports whether the expression has no side effects, i.e., it -// does not modify the memory state. This function is conservative: it may -// return false even when the expression has no effect. -func NoEffects(info *types.Info, expr ast.Expr) bool { - noEffects := true - ast.Inspect(expr, func(n ast.Node) bool { - switch v := n.(type) { - case nil, *ast.Ident, *ast.BasicLit, *ast.BinaryExpr, *ast.ParenExpr, - *ast.SelectorExpr, *ast.IndexExpr, *ast.SliceExpr, *ast.TypeAssertExpr, - *ast.StarExpr, *ast.CompositeLit, - // non-expressions that may appear within expressions - *ast.KeyValueExpr, - *ast.FieldList, - *ast.Field, - *ast.Ellipsis, - *ast.IndexListExpr: - // No effect. - - case *ast.ArrayType, - *ast.StructType, - *ast.ChanType, - *ast.FuncType, - *ast.MapType, - *ast.InterfaceType: - // Type syntax: no effects, recursively. - // Prune descent. - return false - - case *ast.UnaryExpr: - // Channel send <-ch has effects. - if v.Op == token.ARROW { - noEffects = false - } - - case *ast.CallExpr: - // Type conversion has no effects. - if !info.Types[v.Fun].IsType() { - if CallsPureBuiltin(info, v) { - // A call such as len(e) has no effects of its - // own, though the subexpression e might. - } else { - noEffects = false - } - } - - case *ast.FuncLit: - // A FuncLit has no effects, but do not descend into it. - return false - - default: - // All other expressions have effects - noEffects = false - } - - return noEffects - }) - return noEffects -} - -// CallsPureBuiltin reports whether call is a call of a built-in -// function that is a pure computation over its operands (analogous to -// a + operator). Because it does not depend on program state, it may -// be evaluated at any point--though not necessarily at multiple -// points (consider new, make). -func CallsPureBuiltin(info *types.Info, call *ast.CallExpr) bool { - if id, ok := ast.Unparen(call.Fun).(*ast.Ident); ok { - if b, ok := info.ObjectOf(id).(*types.Builtin); ok { - switch b.Name() { - case "len", "cap", "complex", "imag", "real", "make", "new", "max", "min": - return true - } - // Not: append clear close copy delete panic print println recover - } - } - return false -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/isnamed.go b/vendor/golang.org/x/tools/internal/typesinternal/isnamed.go deleted file mode 100644 index e0d63c46c6a..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/isnamed.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2025 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/types" - "slices" -) - -// IsTypeNamed reports whether t is (or is an alias for) a -// package-level defined type with the given package path and one of -// the given names. It returns false if t is nil. -// -// This function avoids allocating the concatenation of "pkg.Name", -// which is important for the performance of syntax matching. -func IsTypeNamed(t types.Type, pkgPath string, names ...string) bool { - if named, ok := types.Unalias(t).(*types.Named); ok { - tname := named.Obj() - return tname != nil && - IsPackageLevel(tname) && - tname.Pkg().Path() == pkgPath && - slices.Contains(names, tname.Name()) - } - return false -} - -// IsPointerToNamed reports whether t is (or is an alias for) a pointer to a -// package-level defined type with the given package path and one of the given -// names. It returns false if t is not a pointer type. -func IsPointerToNamed(t types.Type, pkgPath string, names ...string) bool { - r := Unpointer(t) - if r == t { - return false - } - return IsTypeNamed(r, pkgPath, names...) -} - -// IsFunctionNamed reports whether obj is a package-level function -// defined in the given package and has one of the given names. -// It returns false if obj is nil. -// -// This function avoids allocating the concatenation of "pkg.Name", -// which is important for the performance of syntax matching. -func IsFunctionNamed(obj types.Object, pkgPath string, names ...string) bool { - f, ok := obj.(*types.Func) - return ok && - IsPackageLevel(obj) && - f.Pkg().Path() == pkgPath && - f.Signature().Recv() == nil && - slices.Contains(names, f.Name()) -} - -// IsMethodNamed reports whether obj is a method defined on a -// package-level type with the given package and type name, and has -// one of the given names. It returns false if obj is nil. -// -// This function avoids allocating the concatenation of "pkg.TypeName.Name", -// which is important for the performance of syntax matching. -func IsMethodNamed(obj types.Object, pkgPath string, typeName string, names ...string) bool { - if fn, ok := obj.(*types.Func); ok { - if recv := fn.Signature().Recv(); recv != nil { - _, T := ReceiverNamed(recv) - return T != nil && - IsTypeNamed(T, pkgPath, typeName) && - slices.Contains(names, fn.Name()) - } - } - return false -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/qualifier.go b/vendor/golang.org/x/tools/internal/typesinternal/qualifier.go deleted file mode 100644 index 4e2756fc491..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/qualifier.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/ast" - "go/types" - "strconv" -) - -// FileQualifier returns a [types.Qualifier] function that qualifies -// imported symbols appropriately based on the import environment of a given -// file. -// If the same package is imported multiple times, the last appearance is -// recorded. -// -// TODO(adonovan): this function ignores the effect of shadowing. It -// should accept a [token.Pos] and a [types.Info] and compute only the -// set of imports that are not shadowed at that point, analogous to -// [analysis.AddImport]. It could also compute (as a side -// effect) the set of additional imports required to ensure that there -// is an accessible import for each necessary package, making it -// converge even more closely with AddImport. -func FileQualifier(f *ast.File, pkg *types.Package) types.Qualifier { - // Construct mapping of import paths to their defined names. - // It is only necessary to look at renaming imports. - imports := make(map[string]string) - for _, imp := range f.Imports { - if imp.Name != nil && imp.Name.Name != "_" { - path, _ := strconv.Unquote(imp.Path.Value) - imports[path] = imp.Name.Name - } - } - - // Define qualifier to replace full package paths with names of the imports. - return func(p *types.Package) string { - if p == nil || p == pkg { - return "" - } - - if name, ok := imports[p.Path()]; ok { - if name == "." { - return "" - } else { - return name - } - } - - // If there is no local renaming, fall back to the package name. - return p.Name() - } -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/recv.go b/vendor/golang.org/x/tools/internal/typesinternal/recv.go deleted file mode 100644 index 8352ea76173..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/recv.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/types" -) - -// ReceiverNamed returns the named type (if any) associated with the -// type of recv, which may be of the form N or *N, or aliases thereof. -// It also reports whether a Pointer was present. -// -// The named result may be nil if recv is from a method on an -// anonymous interface or struct types or in ill-typed code. -func ReceiverNamed(recv *types.Var) (isPtr bool, named *types.Named) { - t := recv.Type() - if ptr, ok := types.Unalias(t).(*types.Pointer); ok { - isPtr = true - t = ptr.Elem() - } - named, _ = types.Unalias(t).(*types.Named) - return -} - -// Unpointer returns T given *T or an alias thereof. -// For all other types it is the identity function. -// It does not look at underlying types. -// The result may be an alias. -// -// Use this function to strip off the optional pointer on a receiver -// in a field or method selection, without losing the named type -// (which is needed to compute the method set). -// -// See also [typeparams.MustDeref], which removes one level of -// indirection from the type, regardless of named types (analogous to -// a LOAD instruction). -func Unpointer(t types.Type) types.Type { - if ptr, ok := types.Unalias(t).(*types.Pointer); ok { - return ptr.Elem() - } - return t -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/toonew.go b/vendor/golang.org/x/tools/internal/typesinternal/toonew.go deleted file mode 100644 index 386c59c7409..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/toonew.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "go/types" - - "golang.org/x/tools/internal/stdlib" - "golang.org/x/tools/internal/versions" -) - -// TooNewStdSymbols computes the set of package-level symbols -// exported by pkg that are not available at the specified version. -// -// The pkg is allowed to contain type errors. -func TooNewStdSymbols(pkg *types.Package, version string) map[types.Object]stdlib.Symbol { - disallowed := make(map[types.Object]stdlib.Symbol) - - // Some symbols are accessible before their release but - // only with specific build tags unknown to us here. - // Avoid false positives in such cases. - if pkg.Path() == "testing/synctest" && versions.AtLeast(version, "go1.24") { - // requires go1.24 && goexperiment.synctest || go1.25 - return disallowed - } - if (pkg.Path() == "encoding/json/v2" || pkg.Path() == "encoding/json/jsontext") && versions.AtLeast(version, "go1.25") { - // requires go1.25 && goexperiment.jsonv2 || go1.27 - return disallowed - } - - // Pass 1: package-level symbols. - symbols := stdlib.PackageSymbols[pkg.Path()] - for _, sym := range symbols { - if versions.Before(version, sym.Version.String()) { - switch sym.Kind { - case stdlib.Func, stdlib.Var, stdlib.Const, stdlib.Type: - disallowed[pkg.Scope().Lookup(sym.Name)] = sym - } - } - } - - // Pass 2: fields and methods. - // - // We allow fields and methods if their associated type is - // disallowed, as otherwise we would report false positives - // for compatibility shims. Consider: - // - // //go:build go1.22 - // type T struct { F std.Real } // correct new API - // - // //go:build !go1.22 - // type T struct { F fake } // shim - // type fake struct { ... } - // func (fake) M () {} - // - // These alternative declarations of T use either the std.Real - // type, introduced in go1.22, or a fake type, for the field - // F. (The fakery could be arbitrarily deep, involving more - // nested fields and methods than are shown here.) Clients - // that use the compatibility shim T will compile with any - // version of go, whether older or newer than go1.22, but only - // the newer version will use the std.Real implementation. - // - // Now consider a reference to method M in new(T).F.M() in a - // module that requires a minimum of go1.21. The analysis may - // occur using a version of Go higher than 1.21, selecting the - // first version of T, so the method M is Real.M. This would - // spuriously cause the analyzer to report a reference to a - // too-new symbol even though this expression compiles just - // fine (with the fake implementation) using go1.21. - var noSym stdlib.Symbol - depth := make(map[types.Object]int) - for _, sym := range symbols { - if !versions.Before(version, sym.Version.String()) { - continue // allowed - } - - var obj types.Object - var indices []int - switch sym.Kind { - case stdlib.Field: - typename, name := sym.SplitField() - if t := pkg.Scope().Lookup(typename); t != nil && disallowed[t] == noSym { - obj, indices, _ = types.LookupFieldOrMethod(t.Type(), false, pkg, name) - } - - case stdlib.Method: - ptr, recvname, name := sym.SplitMethod() - if t := pkg.Scope().Lookup(recvname); t != nil && disallowed[t] == noSym { - obj, indices, _ = types.LookupFieldOrMethod(t.Type(), ptr, pkg, name) - } - } - if obj != nil { - // In the presence of embedding, two or more "pkg.T.name" - // strings may map to the same types.Object. - // Prefer the Object with the shorter index path. - if min, ok := depth[obj]; !ok || len(indices) < min { - depth[obj] = len(indices) - disallowed[obj] = sym - } - } - } - - return disallowed -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go deleted file mode 100644 index 9fd48b088f8..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/types.go +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package typesinternal provides helpful operators for dealing with -// go/types: -// -// - operators for querying typed syntax trees (e.g. [Imports], [IsFunctionNamed]); -// - functions for converting types to strings or syntax (e.g. [TypeExpr], FileQualifier]); -// - helpers for working with the [go/types] API (e.g. [NewTypesInfo]); -// - access to internal go/types APIs that are not yet -// exported (e.g. [SetUsesCgo], [ErrorCodeStartEnd], [VarKind]); and -// - common algorithms related to types (e.g. [TooNewStdSymbols]). -// -// See also: -// - [golang.org/x/tools/internal/astutil], for operations on untyped syntax; -// - [golang.org/x/tools/internal/analysisinernal], for helpers for analyzers; -// - [golang.org/x/tools/internal/refactor], for operators to compute text edits. -package typesinternal - -import ( - "go/ast" - "go/token" - "go/types" - "iter" - "reflect" - - "golang.org/x/tools/go/ast/inspector" -) - -func SetUsesCgo(conf *types.Config) bool { - v := reflect.ValueOf(conf).Elem() - - f := v.FieldByName("go115UsesCgo") - if !f.IsValid() { - f = v.FieldByName("UsesCgo") - if !f.IsValid() { - return false - } - } - - *(*bool)(f.Addr().UnsafePointer()) = true - - return true -} - -// ErrorCodeStartEnd extracts additional information from types.Error values -// generated by Go version 1.16 and later: the error code, start position, and -// end position. If all positions are valid, start <= err.Pos <= end. -// -// If the data could not be read, the final result parameter will be false. -// -// TODO(adonovan): eliminate start/end when proposal #71803 is accepted. -func ErrorCodeStartEnd(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) { - var data [3]int - // By coincidence all of these fields are ints, which simplifies things. - v := reflect.ValueOf(err) - for i, name := range []string{"go116code", "go116start", "go116end"} { - f := v.FieldByName(name) - if !f.IsValid() { - return 0, 0, 0, false - } - data[i] = int(f.Int()) - } - return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true -} - -// NameRelativeTo returns a types.Qualifier that qualifies members of -// all packages other than pkg, using only the package name. -// (By contrast, [types.RelativeTo] uses the complete package path, -// which is often excessive.) -// -// If pkg is nil, it is equivalent to [*types.Package.Name]. -// -// TODO(adonovan): all uses of this with TypeString should be -// eliminated when https://go.dev/issues/75604 is resolved. -func NameRelativeTo(pkg *types.Package) types.Qualifier { - return func(other *types.Package) string { - if pkg != nil && pkg == other { - return "" // same package; unqualified - } - return other.Name() - } -} - -// TypeNameFor returns the type name symbol for the specified type, if -// it is a [*types.Alias], [*types.Named], [*types.TypeParam], or a -// [*types.Basic] representing a type. -// -// For all other types, and for Basic types representing a builtin, -// constant, or nil, it returns nil. Be careful not to convert the -// resulting nil pointer to a [types.Object]! -// -// If t is the type of a constant, it may be an "untyped" type, which -// has no TypeName. To access the name of such types (e.g. "untyped -// int"), use [types.Basic.Name]. -func TypeNameFor(t types.Type) *types.TypeName { - switch t := t.(type) { - case *types.Alias: - return t.Obj() - case *types.Named: - return t.Obj() - case *types.TypeParam: - return t.Obj() - case *types.Basic: - // See issues #71886 and #66890 for some history. - if tname, ok := types.Universe.Lookup(t.Name()).(*types.TypeName); ok { - return tname - } - } - return nil -} - -// A NamedOrAlias is a [types.Type] that is named (as -// defined by the spec) and capable of bearing type parameters: it -// abstracts aliases ([types.Alias]) and defined types -// ([types.Named]). -// -// Every type declared by an explicit "type" declaration is a -// NamedOrAlias. (Built-in type symbols may additionally -// have type [types.Basic], which is not a NamedOrAlias, -// though the spec regards them as "named"; see [TypeNameFor].) -// -// NamedOrAlias cannot expose the Origin method, because -// [types.Alias.Origin] and [types.Named.Origin] have different -// (covariant) result types; use [Origin] instead. -type NamedOrAlias interface { - types.Type - Obj() *types.TypeName - TypeArgs() *types.TypeList - TypeParams() *types.TypeParamList - SetTypeParams(tparams []*types.TypeParam) -} - -var ( - _ NamedOrAlias = (*types.Alias)(nil) - _ NamedOrAlias = (*types.Named)(nil) -) - -// Origin returns the generic type of the Named or Alias type t if it -// is instantiated, otherwise it returns t. -func Origin(t NamedOrAlias) NamedOrAlias { - switch t := t.(type) { - case *types.Alias: - return t.Origin() - case *types.Named: - return t.Origin() - } - return t -} - -// IsPackageLevel reports whether obj is a package-level symbol. -func IsPackageLevel(obj types.Object) bool { - return obj.Pkg() != nil && obj.Parent() == obj.Pkg().Scope() -} - -// NewTypesInfo returns a *types.Info with all maps populated. -func NewTypesInfo() *types.Info { - return &types.Info{ - Types: map[ast.Expr]types.TypeAndValue{}, - Instances: map[*ast.Ident]types.Instance{}, - Defs: map[*ast.Ident]types.Object{}, - Uses: map[*ast.Ident]types.Object{}, - Implicits: map[ast.Node]types.Object{}, - Selections: map[*ast.SelectorExpr]*types.Selection{}, - Scopes: map[ast.Node]*types.Scope{}, - FileVersions: map[*ast.File]string{}, - } -} - -// EnclosingScope returns the innermost block logically enclosing the cursor. -func EnclosingScope(info *types.Info, cur inspector.Cursor) *types.Scope { - for cur := range cur.Enclosing() { - n := cur.Node() - // A function's Scope is associated with its FuncType. - switch f := n.(type) { - case *ast.FuncDecl: - n = f.Type - case *ast.FuncLit: - n = f.Type - } - if b := info.Scopes[n]; b != nil { - return b - } - } - panic("no Scope for *ast.File") -} - -// Imports reports whether path is imported by pkg. -func Imports(pkg *types.Package, path string) bool { - for _, imp := range pkg.Imports() { - if imp.Path() == path { - return true - } - } - return false -} - -// ObjectKind returns a description of the object's kind. -// -// from objectKind in go/types -func ObjectKind(obj types.Object) string { - switch obj := obj.(type) { - case *types.PkgName: - return "package name" - case *types.Const: - return "constant" - case *types.TypeName: - if obj.IsAlias() { - return "type alias" - } else if _, ok := obj.Type().(*types.TypeParam); ok { - return "type parameter" - } else { - return "defined type" - } - case *types.Var: - switch obj.Kind() { - case PackageVar: - return "package-level variable" - case LocalVar: - return "local variable" - case RecvVar: - return "receiver" - case ParamVar: - return "parameter" - case ResultVar: - return "result variable" - case FieldVar: - return "struct field" - } - case *types.Func: - if obj.Signature().Recv() != nil { - return "method" - } else { - return "function" - } - case *types.Label: - return "label" - case *types.Builtin: - return "built-in function" - case *types.Nil: - return "untyped nil" - } - return "unknown symbol" -} - -// ImplicitFieldSelections returns the sequence of implicit embedded fields -// traversed by the given selection. It skips the final leaf field or method. -// The boolean component indicates whether the traversal traversed a pointer. -func ImplicitFieldSelections(seln types.Selection) iter.Seq2[*types.Var, bool] { - return func(yield func(*types.Var, bool) bool) { - var ( - t = seln.Recv() - indices = seln.Index() - ) - for _, idx := range indices[:len(indices)-1] { - ptr, isPtr := t.Underlying().(*types.Pointer) - if isPtr { - t = ptr.Elem() - } - structType, ok := t.Underlying().(*types.Struct) - if !ok { - break - } - field := structType.Field(idx) - if !yield(field, isPtr) { - break - } - t = field.Type() - } - } -} - -func TupleOf(elems ...types.Type) *types.Tuple { - params := make([]*types.Var, len(elems)) - for i, elem := range elems { - params[i] = types.NewParam(token.NoPos, nil, "", elem) - } - return types.NewTuple(params...) -} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/varkind.go b/vendor/golang.org/x/tools/internal/typesinternal/varkind.go deleted file mode 100644 index 26499cdd2e7..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/varkind.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.25 - -package typesinternal - -import "go/types" - -type VarKind = types.VarKind - -const ( - PackageVar = types.PackageVar - LocalVar = types.LocalVar - RecvVar = types.RecvVar - ParamVar = types.ParamVar - ResultVar = types.ResultVar - FieldVar = types.FieldVar -) - -func GetVarKind(v *types.Var) VarKind { return v.Kind() } -func SetVarKind(v *types.Var, kind VarKind) { v.SetKind(kind) } diff --git a/vendor/golang.org/x/tools/internal/typesinternal/varkind_go124.go b/vendor/golang.org/x/tools/internal/typesinternal/varkind_go124.go deleted file mode 100644 index 17b1804b4e8..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/varkind_go124.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.25 - -package typesinternal - -import "go/types" - -type VarKind uint8 - -const ( - _ VarKind = iota // (not meaningful) - PackageVar // a package-level variable - LocalVar // a local variable - RecvVar // a method receiver variable - ParamVar // a function parameter variable - ResultVar // a function result variable - FieldVar // a struct field -) - -func (kind VarKind) String() string { - return [...]string{ - 0: "VarKind(0)", - PackageVar: "PackageVar", - LocalVar: "LocalVar", - RecvVar: "RecvVar", - ParamVar: "ParamVar", - ResultVar: "ResultVar", - FieldVar: "FieldVar", - }[kind] -} - -// GetVarKind returns an invalid VarKind. -func GetVarKind(v *types.Var) VarKind { return 0 } - -// SetVarKind has no effect. -func SetVarKind(v *types.Var, kind VarKind) {} diff --git a/vendor/golang.org/x/tools/internal/typesinternal/zerovalue.go b/vendor/golang.org/x/tools/internal/typesinternal/zerovalue.go deleted file mode 100644 index 706ad33ef89..00000000000 --- a/vendor/golang.org/x/tools/internal/typesinternal/zerovalue.go +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - "strings" -) - -// ZeroString returns the string representation of the zero value for any type t. -// The boolean result indicates whether the type is or contains an invalid type -// or a non-basic (constraint) interface type. -// -// Even for invalid input types, ZeroString may return a partially correct -// string representation. The caller should use the returned isValid boolean -// to determine the validity of the expression. -// -// When assigning to a wider type (such as 'any'), it's the caller's -// responsibility to handle any necessary type conversions. -// -// This string can be used on the right-hand side of an assignment where the -// left-hand side has that explicit type. -// References to named types are qualified by an appropriate (optional) -// qualifier function. -// Exception: This does not apply to tuples. Their string representation is -// informational only and cannot be used in an assignment. -// -// See [ZeroExpr] for a variant that returns an [ast.Expr]. -func ZeroString(t types.Type, qual types.Qualifier) (_ string, isValid bool) { - switch t := t.(type) { - case *types.Basic: - switch { - case t.Info()&types.IsBoolean != 0: - return "false", true - case t.Info()&types.IsNumeric != 0: - return "0", true - case t.Info()&types.IsString != 0: - return `""`, true - case t.Kind() == types.UnsafePointer: - fallthrough - case t.Kind() == types.UntypedNil: - return "nil", true - case t.Kind() == types.Invalid: - return "invalid", false - default: - panic(fmt.Sprintf("ZeroString for unexpected type %v", t)) - } - - case *types.Pointer, *types.Slice, *types.Chan, *types.Map, *types.Signature: - return "nil", true - - case *types.Interface: - if !t.IsMethodSet() { - return "invalid", false - } - return "nil", true - - case *types.Named: - switch under := t.Underlying().(type) { - case *types.Struct, *types.Array: - return types.TypeString(t, qual) + "{}", true - default: - return ZeroString(under, qual) - } - - case *types.Alias: - switch t.Underlying().(type) { - case *types.Struct, *types.Array: - return types.TypeString(t, qual) + "{}", true - default: - // A type parameter can have alias but alias type's underlying type - // can never be a type parameter. - // Use types.Unalias to preserve the info of type parameter instead - // of call Underlying() going right through and get the underlying - // type of the type parameter which is always an interface. - return ZeroString(types.Unalias(t), qual) - } - - case *types.Array, *types.Struct: - return types.TypeString(t, qual) + "{}", true - - case *types.TypeParam: - // Assumes func new is not shadowed. - return "*new(" + types.TypeString(t, qual) + ")", true - - case *types.Tuple: - // Tuples are not normal values. - // We are currently format as "(t[0], ..., t[n])". Could be something else. - isValid := true - components := make([]string, t.Len()) - for i := 0; i < t.Len(); i++ { - comp, ok := ZeroString(t.At(i).Type(), qual) - - components[i] = comp - isValid = isValid && ok - } - return "(" + strings.Join(components, ", ") + ")", isValid - - case *types.Union: - // Variables of these types cannot be created, so it makes - // no sense to ask for their zero value. - panic(fmt.Sprintf("invalid type for a variable: %v", t)) - - default: - panic(t) // unreachable. - } -} - -// ZeroExpr returns the ast.Expr representation of the zero value for any type t. -// The boolean result indicates whether the type is or contains an invalid type -// or a non-basic (constraint) interface type. -// -// Even for invalid input types, ZeroExpr may return a partially correct ast.Expr -// representation. The caller should use the returned isValid boolean to determine -// the validity of the expression. -// -// This function is designed for types suitable for variables and should not be -// used with Tuple or Union types.References to named types are qualified by an -// appropriate (optional) qualifier function. -// -// See [ZeroString] for a variant that returns a string. -func ZeroExpr(t types.Type, qual types.Qualifier) (_ ast.Expr, isValid bool) { - switch t := t.(type) { - case *types.Basic: - switch { - case t.Info()&types.IsBoolean != 0: - return &ast.Ident{Name: "false"}, true - case t.Info()&types.IsNumeric != 0: - return &ast.BasicLit{Kind: token.INT, Value: "0"}, true - case t.Info()&types.IsString != 0: - return &ast.BasicLit{Kind: token.STRING, Value: `""`}, true - case t.Kind() == types.UnsafePointer: - fallthrough - case t.Kind() == types.UntypedNil: - return ast.NewIdent("nil"), true - case t.Kind() == types.Invalid: - return &ast.BasicLit{Kind: token.STRING, Value: `"invalid"`}, false - default: - panic(fmt.Sprintf("ZeroExpr for unexpected type %v", t)) - } - - case *types.Pointer, *types.Slice, *types.Chan, *types.Map, *types.Signature: - return ast.NewIdent("nil"), true - - case *types.Interface: - if !t.IsMethodSet() { - return &ast.BasicLit{Kind: token.STRING, Value: `"invalid"`}, false - } - return ast.NewIdent("nil"), true - - case *types.Named: - switch under := t.Underlying().(type) { - case *types.Struct, *types.Array: - return &ast.CompositeLit{ - Type: TypeExpr(t, qual), - }, true - default: - return ZeroExpr(under, qual) - } - - case *types.Alias: - switch t.Underlying().(type) { - case *types.Struct, *types.Array: - return &ast.CompositeLit{ - Type: TypeExpr(t, qual), - }, true - default: - return ZeroExpr(types.Unalias(t), qual) - } - - case *types.Array, *types.Struct: - return &ast.CompositeLit{ - Type: TypeExpr(t, qual), - }, true - - case *types.TypeParam: - return &ast.StarExpr{ // *new(T) - X: &ast.CallExpr{ - // Assumes func new is not shadowed. - Fun: ast.NewIdent("new"), - Args: []ast.Expr{ - ast.NewIdent(t.Obj().Name()), - }, - }, - }, true - - case *types.Tuple: - // Unlike ZeroString, there is no ast.Expr can express tuple by - // "(t[0], ..., t[n])". - panic(fmt.Sprintf("invalid type for a variable: %v", t)) - - case *types.Union: - // Variables of these types cannot be created, so it makes - // no sense to ask for their zero value. - panic(fmt.Sprintf("invalid type for a variable: %v", t)) - - default: - panic(t) // unreachable. - } -} - -// TypeExpr returns syntax for the specified type. References to named types -// are qualified by an appropriate (optional) qualifier function. -// It may panic for types such as Tuple or Union. -// -// See also https://go.dev/issues/75604, which will provide a robust -// Type-to-valid-Go-syntax formatter. -func TypeExpr(t types.Type, qual types.Qualifier) ast.Expr { - switch t := t.(type) { - case *types.Basic: - switch t.Kind() { - case types.UnsafePointer: - return &ast.SelectorExpr{X: ast.NewIdent(qual(types.NewPackage("unsafe", "unsafe"))), Sel: ast.NewIdent("Pointer")} - default: - return ast.NewIdent(t.Name()) - } - - case *types.Pointer: - return &ast.UnaryExpr{ - Op: token.MUL, - X: TypeExpr(t.Elem(), qual), - } - - case *types.Array: - return &ast.ArrayType{ - Len: &ast.BasicLit{ - Kind: token.INT, - Value: fmt.Sprintf("%d", t.Len()), - }, - Elt: TypeExpr(t.Elem(), qual), - } - - case *types.Slice: - return &ast.ArrayType{ - Elt: TypeExpr(t.Elem(), qual), - } - - case *types.Map: - return &ast.MapType{ - Key: TypeExpr(t.Key(), qual), - Value: TypeExpr(t.Elem(), qual), - } - - case *types.Chan: - dir := ast.ChanDir(t.Dir()) - if t.Dir() == types.SendRecv { - dir = ast.SEND | ast.RECV - } - return &ast.ChanType{ - Dir: dir, - Value: TypeExpr(t.Elem(), qual), - } - - case *types.Signature: - var params []*ast.Field - for v := range t.Params().Variables() { - var names []*ast.Ident - if v.Name() != "" { - names = []*ast.Ident{ast.NewIdent(v.Name())} - } - params = append(params, &ast.Field{ - Type: TypeExpr(v.Type(), qual), - Names: names, - }) - } - if t.Variadic() { - last := params[len(params)-1] - last.Type = &ast.Ellipsis{Elt: last.Type.(*ast.ArrayType).Elt} - } - var returns []*ast.Field - for v := range t.Results().Variables() { - returns = append(returns, &ast.Field{ - Type: TypeExpr(v.Type(), qual), - }) - } - return &ast.FuncType{ - Params: &ast.FieldList{ - List: params, - }, - Results: &ast.FieldList{ - List: returns, - }, - } - - case *types.TypeParam: - pkgName := qual(t.Obj().Pkg()) - if pkgName == "" || t.Obj().Pkg() == nil { - return ast.NewIdent(t.Obj().Name()) - } - return &ast.SelectorExpr{ - X: ast.NewIdent(pkgName), - Sel: ast.NewIdent(t.Obj().Name()), - } - - // types.TypeParam also implements interface NamedOrAlias. To differentiate, - // case TypeParam need to be present before case NamedOrAlias. - // TODO(hxjiang): remove this comment once TypeArgs() is added to interface - // NamedOrAlias. - case NamedOrAlias: - var expr ast.Expr = ast.NewIdent(t.Obj().Name()) - if pkgName := qual(t.Obj().Pkg()); pkgName != "." && pkgName != "" { - expr = &ast.SelectorExpr{ - X: ast.NewIdent(pkgName), - Sel: expr.(*ast.Ident), - } - } - - // TODO(hxjiang): call t.TypeArgs after adding method TypeArgs() to - // typesinternal.NamedOrAlias. - if hasTypeArgs, ok := t.(interface{ TypeArgs() *types.TypeList }); ok { - if typeArgs := hasTypeArgs.TypeArgs(); typeArgs != nil && typeArgs.Len() > 0 { - var indices []ast.Expr - for t0 := range typeArgs.Types() { - indices = append(indices, TypeExpr(t0, qual)) - } - expr = &ast.IndexListExpr{ - X: expr, - Indices: indices, - } - } - } - - return expr - - case *types.Struct: - return ast.NewIdent(types.TypeString(t, qual)) - - case *types.Interface: - return ast.NewIdent(types.TypeString(t, qual)) - - case *types.Union: - if t.Len() == 0 { - panic("Union type should have at least one term") - } - // Same as go/ast, the return expression will put last term in the - // Y field at topmost level of BinaryExpr. - // For union of type "float32 | float64 | int64", the structure looks - // similar to: - // { - // X: { - // X: float32, - // Op: | - // Y: float64, - // } - // Op: |, - // Y: int64, - // } - var union ast.Expr - for i := range t.Len() { - term := t.Term(i) - termExpr := TypeExpr(term.Type(), qual) - if term.Tilde() { - termExpr = &ast.UnaryExpr{ - Op: token.TILDE, - X: termExpr, - } - } - if i == 0 { - union = termExpr - } else { - union = &ast.BinaryExpr{ - X: union, - Op: token.OR, - Y: termExpr, - } - } - } - return union - - case *types.Tuple: - panic("invalid input type types.Tuple") - - default: - panic("unreachable") - } -} diff --git a/vendor/golang.org/x/tools/internal/versions/features.go b/vendor/golang.org/x/tools/internal/versions/features.go deleted file mode 100644 index 360a5b55297..00000000000 --- a/vendor/golang.org/x/tools/internal/versions/features.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package versions - -// This file contains predicates for working with file versions to -// decide when a tool should consider a language feature enabled. - -// named constants, to avoid misspelling -const ( - Go1_17 = "go1.17" - Go1_18 = "go1.18" - Go1_19 = "go1.19" - Go1_20 = "go1.20" - Go1_21 = "go1.21" - Go1_22 = "go1.22" - Go1_23 = "go1.23" - Go1_24 = "go1.24" - Go1_25 = "go1.25" - Go1_26 = "go1.26" - Go1_27 = "go1.27" -) - -// Future is an invalid unknown Go version sometime in the future. -// Do not use directly with Compare. -const Future = "" - -// AtLeast reports whether the file version v comes after a Go release. -// -// Use this predicate to enable a behavior once a certain Go release -// has happened (and stays enabled in the future). -func AtLeast(v, release string) bool { - if v == Future { - return true // an unknown future version is always after y. - } - return Compare(Lang(v), Lang(release)) >= 0 -} - -// Before reports whether the file version v is strictly before a Go release. -// -// Use this predicate to disable a behavior once a certain Go release -// has happened (and stays enabled in the future). -func Before(v, release string) bool { - if v == Future { - return false // an unknown future version happens after y. - } - return Compare(Lang(v), Lang(release)) < 0 -} diff --git a/vendor/golang.org/x/tools/internal/versions/gover.go b/vendor/golang.org/x/tools/internal/versions/gover.go deleted file mode 100644 index bbabcd22e94..00000000000 --- a/vendor/golang.org/x/tools/internal/versions/gover.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This is a fork of internal/gover for use by x/tools until -// go1.21 and earlier are no longer supported by x/tools. - -package versions - -import "strings" - -// A gover is a parsed Go gover: major[.Minor[.Patch]][kind[pre]] -// The numbers are the original decimal strings to avoid integer overflows -// and since there is very little actual math. (Probably overflow doesn't matter in practice, -// but at the time this code was written, there was an existing test that used -// go1.99999999999, which does not fit in an int on 32-bit platforms. -// The "big decimal" representation avoids the problem entirely.) -type gover struct { - major string // decimal - minor string // decimal or "" - patch string // decimal or "" - kind string // "", "alpha", "beta", "rc" - pre string // decimal or "" -} - -// compare returns -1, 0, or +1 depending on whether -// x < y, x == y, or x > y, interpreted as toolchain versions. -// The versions x and y must not begin with a "go" prefix: just "1.21" not "go1.21". -// Malformed versions compare less than well-formed versions and equal to each other. -// The language version "1.21" compares less than the release candidate and eventual releases "1.21rc1" and "1.21.0". -func compare(x, y string) int { - vx := parse(x) - vy := parse(y) - - if c := cmpInt(vx.major, vy.major); c != 0 { - return c - } - if c := cmpInt(vx.minor, vy.minor); c != 0 { - return c - } - if c := cmpInt(vx.patch, vy.patch); c != 0 { - return c - } - if c := strings.Compare(vx.kind, vy.kind); c != 0 { // "" < alpha < beta < rc - return c - } - if c := cmpInt(vx.pre, vy.pre); c != 0 { - return c - } - return 0 -} - -// lang returns the Go language version. For example, lang("1.2.3") == "1.2". -func lang(x string) string { - v := parse(x) - if v.minor == "" || v.major == "1" && v.minor == "0" { - return v.major - } - return v.major + "." + v.minor -} - -// isValid reports whether the version x is valid. -func isValid(x string) bool { - return parse(x) != gover{} -} - -// parse parses the Go version string x into a version. -// It returns the zero version if x is malformed. -func parse(x string) gover { - var v gover - - // Parse major version. - var ok bool - v.major, x, ok = cutInt(x) - if !ok { - return gover{} - } - if x == "" { - // Interpret "1" as "1.0.0". - v.minor = "0" - v.patch = "0" - return v - } - - // Parse . before minor version. - if x[0] != '.' { - return gover{} - } - - // Parse minor version. - v.minor, x, ok = cutInt(x[1:]) - if !ok { - return gover{} - } - if x == "" { - // Patch missing is same as "0" for older versions. - // Starting in Go 1.21, patch missing is different from explicit .0. - if cmpInt(v.minor, "21") < 0 { - v.patch = "0" - } - return v - } - - // Parse patch if present. - if x[0] == '.' { - v.patch, x, ok = cutInt(x[1:]) - if !ok || x != "" { - // Note that we are disallowing prereleases (alpha, beta, rc) for patch releases here (x != ""). - // Allowing them would be a bit confusing because we already have: - // 1.21 < 1.21rc1 - // But a prerelease of a patch would have the opposite effect: - // 1.21.3rc1 < 1.21.3 - // We've never needed them before, so let's not start now. - return gover{} - } - return v - } - - // Parse prerelease. - i := 0 - for i < len(x) && (x[i] < '0' || '9' < x[i]) { - if x[i] < 'a' || 'z' < x[i] { - return gover{} - } - i++ - } - if i == 0 { - return gover{} - } - v.kind, x = x[:i], x[i:] - if x == "" { - return v - } - v.pre, x, ok = cutInt(x) - if !ok || x != "" { - return gover{} - } - - return v -} - -// cutInt scans the leading decimal number at the start of x to an integer -// and returns that value and the rest of the string. -func cutInt(x string) (n, rest string, ok bool) { - i := 0 - for i < len(x) && '0' <= x[i] && x[i] <= '9' { - i++ - } - if i == 0 || x[0] == '0' && i != 1 { // no digits or unnecessary leading zero - return "", "", false - } - return x[:i], x[i:], true -} - -// cmpInt returns cmp.Compare(x, y) interpreting x and y as decimal numbers. -// (Copied from golang.org/x/mod/semver's compareInt.) -func cmpInt(x, y string) int { - if x == y { - return 0 - } - if len(x) < len(y) { - return -1 - } - if len(x) > len(y) { - return +1 - } - if x < y { - return -1 - } else { - return +1 - } -} diff --git a/vendor/golang.org/x/tools/internal/versions/types.go b/vendor/golang.org/x/tools/internal/versions/types.go deleted file mode 100644 index 0fc10ce4eb5..00000000000 --- a/vendor/golang.org/x/tools/internal/versions/types.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package versions - -import ( - "go/ast" - "go/types" -) - -// FileVersion returns a file's Go version. -// The reported version is an unknown Future version if a -// version cannot be determined. -func FileVersion(info *types.Info, file *ast.File) string { - // In tools built with Go >= 1.22, the Go version of a file - // follow a cascades of sources: - // 1) types.Info.FileVersion, which follows the cascade: - // 1.a) file version (ast.File.GoVersion), - // 1.b) the package version (types.Config.GoVersion), or - // 2) is some unknown Future version. - // - // File versions require a valid package version to be provided to types - // in Config.GoVersion. Config.GoVersion is either from the package's module - // or the toolchain (go run). This value should be provided by go/packages - // or unitchecker.Config.GoVersion. - if v := info.FileVersions[file]; IsValid(v) { - return v - } - // Note: we could instead return runtime.Version() [if valid]. - // This would act as a max version on what a tool can support. - return Future -} diff --git a/vendor/golang.org/x/tools/internal/versions/versions.go b/vendor/golang.org/x/tools/internal/versions/versions.go deleted file mode 100644 index 8d1f7453dbf..00000000000 --- a/vendor/golang.org/x/tools/internal/versions/versions.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package versions - -import ( - "strings" -) - -// Note: If we use build tags to use go/versions when go >=1.22, -// we run into go.dev/issue/53737. Under some operations users would see an -// import of "go/versions" even if they would not compile the file. -// For example, during `go get -u ./...` (go.dev/issue/64490) we do not try to include -// For this reason, this library just a clone of go/versions for the moment. - -// Lang returns the Go language version for version x. -// If x is not a valid version, Lang returns the empty string. -// For example: -// -// Lang("go1.21rc2") = "go1.21" -// Lang("go1.21.2") = "go1.21" -// Lang("go1.21") = "go1.21" -// Lang("go1") = "go1" -// Lang("bad") = "" -// Lang("1.21") = "" -func Lang(x string) string { - v := lang(stripGo(x)) - if v == "" { - return "" - } - return x[:2+len(v)] // "go"+v without allocation -} - -// Compare returns -1, 0, or +1 depending on whether -// x < y, x == y, or x > y, interpreted as Go versions. -// The versions x and y must begin with a "go" prefix: "go1.21" not "1.21". -// Invalid versions, including the empty string, compare less than -// valid versions and equal to each other. -// The language version "go1.21" compares less than the -// release candidate and eventual releases "go1.21rc1" and "go1.21.0". -// Custom toolchain suffixes are ignored during comparison: -// "go1.21.0" and "go1.21.0-bigcorp" are equal. -func Compare(x, y string) int { return compare(stripGo(x), stripGo(y)) } - -// IsValid reports whether the version x is valid. -func IsValid(x string) bool { return isValid(stripGo(x)) } - -// stripGo converts from a "go1.21" version to a "1.21" version. -// If v does not start with "go", stripGo returns the empty string (a known invalid version). -func stripGo(v string) string { - v, _, _ = strings.Cut(v, "-") // strip -bigcorp suffix. - if len(v) < 2 || v[:2] != "go" { - return "" - } - return v[2:] -} diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index c4bca5203eb..b27c7e84a3d 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -24,12 +24,10 @@ import ( "fmt" "math" "net/url" - "os" "slices" "strings" "sync" "sync/atomic" - "syscall" "time" "google.golang.org/grpc/balancer" @@ -1573,26 +1571,13 @@ func (ac *addrConn) createTransport(ctx context.Context, addr resolver.Address, // to the provided transport.GoAwayInfo, as specified by gRFC A94: // https://github.com/grpc/proposal/blob/master/A94-grpc-subchannel-disconnections-metrics.md func disconnectErrorString(info transport.GoAwayInfo) string { - err := info.Err - var sysErr syscall.Errno - switch { - case info.Reason != transport.GoAwayInvalid: + if info.Reason != transport.GoAwayInvalid { return fmt.Sprintf("GOAWAY %s", info.GoAwayCode.String()) - case err == nil: - return "unknown" - case errors.Is(err, context.Canceled): - return "subchannel shutdown" - case errors.Is(err, syscall.ECONNRESET): - return "connection reset" - case errors.Is(err, syscall.ETIMEDOUT), errors.Is(err, context.DeadlineExceeded), errors.Is(err, os.ErrDeadlineExceeded): - return "connection timed out" - case errors.Is(err, syscall.ECONNABORTED): - return "connection aborted" - case errors.As(err, &sysErr): - return "socket error" - default: + } + if info.Err == nil { return "unknown" } + return disconnectErrorLabel(info.Err) } // startHealthCheck starts the health checking stream (RPC) to watch the health diff --git a/vendor/google.golang.org/grpc/clientconn_disconnect_reason_noplan9.go b/vendor/google.golang.org/grpc/clientconn_disconnect_reason_noplan9.go new file mode 100644 index 00000000000..f0fcd884237 --- /dev/null +++ b/vendor/google.golang.org/grpc/clientconn_disconnect_reason_noplan9.go @@ -0,0 +1,48 @@ +//go:build !plan9 + +/* + * + * Copyright 2026 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" + "errors" + "os" + "syscall" +) + +// disconnectErrorLabel returns the grpc.disconnect_error metric label for a +// transport error, as specified by gRFC A94. +func disconnectErrorLabel(err error) string { + var sysErr syscall.Errno + switch { + case errors.Is(err, context.Canceled): + return "subchannel shutdown" + case errors.Is(err, syscall.ECONNRESET): + return "connection reset" + case errors.Is(err, syscall.ETIMEDOUT), errors.Is(err, context.DeadlineExceeded), errors.Is(err, os.ErrDeadlineExceeded): + return "connection timed out" + case errors.Is(err, syscall.ECONNABORTED): + return "connection aborted" + case errors.As(err, &sysErr): + return "socket error" + default: + return "unknown" + } +} diff --git a/vendor/google.golang.org/grpc/clientconn_disconnect_reason_plan9.go b/vendor/google.golang.org/grpc/clientconn_disconnect_reason_plan9.go new file mode 100644 index 00000000000..930b12664cc --- /dev/null +++ b/vendor/google.golang.org/grpc/clientconn_disconnect_reason_plan9.go @@ -0,0 +1,39 @@ +/* + * + * Copyright 2026 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" + "errors" + "os" +) + +// disconnectErrorLabel returns the grpc.disconnect_error metric label for a +// transport error, as specified by gRFC A94. syscall.Errno does not exist on +// plan9, so only the portable classifications are available. +func disconnectErrorLabel(err error) string { + switch { + case errors.Is(err, context.Canceled): + return "subchannel shutdown" + case errors.Is(err, context.DeadlineExceeded), errors.Is(err, os.ErrDeadlineExceeded): + return "connection timed out" + default: + return "unknown" + } +} diff --git a/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go b/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go index 89bf22691ef..022416b2607 100644 --- a/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go +++ b/vendor/google.golang.org/grpc/credentials/alts/internal/conn/record.go @@ -257,6 +257,9 @@ func (p *conn) ReadOnReady(bufSize int, pool mem.BufferPool) (*[]byte, int, erro } // Now we have a complete frame, decrypted it. msg := framedMsg[MsgLenFieldSize:] + if len(msg) < msgTypeFieldSize { + return nil, 0, fmt.Errorf("received frame with size %v which is shorter than message type field size %v", len(msg), msgTypeFieldSize) + } msgType := binary.LittleEndian.Uint32(msg[:msgTypeFieldSize]) if msgType&0xff != altsRecordMsgType { return nil, 0, fmt.Errorf("received frame with incorrect message type %v, expected lower byte %v", diff --git a/vendor/google.golang.org/grpc/credentials/google/gcp_service_account_identity_credentials.go b/vendor/google.golang.org/grpc/credentials/google/gcp_service_account_identity_credentials.go new file mode 100644 index 00000000000..160ec81dc3a --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/google/gcp_service_account_identity_credentials.go @@ -0,0 +1,278 @@ +/* +* +* Copyright 2026 gRPC authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* + */ + +package google + +import ( + "context" + "errors" + "fmt" + "sync" + "time" + + "cloud.google.com/go/auth" + "cloud.google.com/go/auth/credentials/idtoken" + "cloud.google.com/go/compute/metadata" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/google/internal" + "google.golang.org/grpc/internal/backoff" + "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/status" +) + +const ( + // preemptiveRefresh is the window before a token's actual expiration during + // which the token is considered stale. Requests using a stale but still + // valid token will trigger a background asynchronous refresh. This avoids + // blocking the current RPC, preventing periodic latency spikes during token + // refresh. + preemptiveRefresh = 1 * time.Minute + + // metadataTimeout is the timeout for the call to the metadata server to + // prevent the background token fetch from hanging indefinitely in case + // of connection issues. + metadataTimeout = 60 * time.Second +) + +type gcpServiceAccountIdentityCallCreds struct { + // The following fields are initialized at creation time and are read-only + // after that. + ctx context.Context + audience string + creds *auth.Credentials + backoff backoff.Strategy + + // The following fields are protected by mu. + mu sync.Mutex + token *auth.Token + tokenExpiry time.Time // timestamp after which the cached token is considered invalid + preemptiveTokenRefresh time.Time // timestamp after which background preemptive refresh is triggered + fetching chan struct{} // used to ensure a single in-progress background token fetch + nextRetryTime time.Time // timestamp after which we can attempt the next token fetch + retryAttempt int // consecutive fetch failure count used to compute backoff delay + lastErr error // cached error returned from the most recent token fetch attempt +} + +func init() { + internal.BackoffStrategy = backoff.DefaultExponential + internal.NewIDTokenCredentials = func(opts *idtoken.Options) (*auth.Credentials, error) { + return idtoken.NewCredentials(opts) + } +} + +// NewServiceAccountIdentityCredentials creates a PerRPCCredentials that +// authenticates using a GCP Service Account Identity JWT token for the given +// audience. +// +// This credential fetches the ID token from the GCE metadata server and is +// only valid for use in environments running on GCP. The ctx and audience +// parameters cannot be empty. +// +// The credentials object starts asynchronous background token fetches to +// refresh expired tokens. The provided context propagates cancellation to +// these background tasks. Users should not pass an RPC-scoped context here, +// but rather a context that is valid for the entire lifetime of the +// credentials and should cancel the context when they are done. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func NewServiceAccountIdentityCredentials(ctx context.Context, audience string) (credentials.PerRPCCredentials, error) { + if ctx == nil { + return nil, fmt.Errorf("credentials: ctx cannot be nil") + } + + if audience == "" { + return nil, fmt.Errorf("credentials: audience cannot be empty") + } + + creds, err := internal.NewIDTokenCredentials(&idtoken.Options{Audience: audience}) + if err != nil { + return nil, fmt.Errorf("credentials: failed to create ID token credentials: %v", err) + } + + return &gcpServiceAccountIdentityCallCreds{ + ctx: ctx, + audience: audience, + creds: creds, + backoff: internal.BackoffStrategy, + }, nil +} + +// GetRequestMetadata gets the current request metadata, refreshing tokens if +// required. This implementation follows the PerRPCCredentials interface. +// +// It guarantees that only one underlying token fetch will be executed +// concurrently. If a valid token is cached, it is returned immediately. If +// a fetch recently failed, the cached error is returned until the backoff +// interval expires. Otherwise, it initiates a new token fetch or blocks +// waiting for an already-in-progress fetch to complete. +func (c *gcpServiceAccountIdentityCallCreds) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) { + ri, _ := credentials.RequestInfoFromContext(ctx) + if err := credentials.CheckSecurityLevel(ri.AuthInfo, credentials.PrivacyAndIntegrity); err != nil { + return nil, fmt.Errorf("credentials: cannot send secure credentials on an insecure connection: %v", err) + } + + if md, err := c.cachedRequestMetadata(true); md != nil || err != nil { + return md, err + } + + c.mu.Lock() + // Now that we have the lock, did someone else finish the fetch while we + // were waiting for the lock? + md, err := c.cachedRequestMetadataLocked(false) + if md != nil || err != nil { + c.mu.Unlock() + return md, err + } + + // If no one is fetching, start it. + if c.fetching == nil { + c.fetching = make(chan struct{}) + go c.startFetch() + } + wait := c.fetching + c.mu.Unlock() + + select { + case <-wait: + // Return the new cached result from the most recent fetch. + md, err := c.cachedRequestMetadata(false) + if md == nil && err == nil { + return nil, status.Error(codes.Unavailable, "credentials: fetched token is expired") + } + return md, err + case <-ctx.Done(): + return nil, ctx.Err() + } +} + +// cachedRequestMetadata handles its own locking for the "fast path". +func (c *gcpServiceAccountIdentityCallCreds) cachedRequestMetadata(attemptPreemptiveRefresh bool) (map[string]string, error) { + c.mu.Lock() + defer c.mu.Unlock() + return c.cachedRequestMetadataLocked(attemptPreemptiveRefresh) +} + +// cachedRequestMetadataLocked returns the cached token if it is valid, or nil +// if it is not. If attemptPreemptiveRefresh is true, it will also trigger a +// background refresh if the token is stale but still valid. It returns the +// cached error if the last fetch failed and the backoff interval has not +// expired. +// +// Returns (nil, nil) if the token is not valid and a new fetch is required. The +// caller is responsible for initiating the fetch or waiting for an in-progress +// fetch to complete. +// +// It must be called with mu locked. +func (c *gcpServiceAccountIdentityCallCreds) cachedRequestMetadataLocked(attemptPreemptiveRefresh bool) (map[string]string, error) { + if c.token != nil && c.isTokenValidLocked() { + if attemptPreemptiveRefresh && c.isTokenStaleLocked() && c.fetching == nil { + c.fetching = make(chan struct{}) + go c.startFetch() + } + + return map[string]string{"authorization": "Bearer " + c.token.Value}, nil + } + + if c.lastErr != nil && time.Now().Before(c.nextRetryTime) { + return nil, c.lastErr + } + + return nil, nil +} + +// RequireTransportSecurity indicates whether the credentials requires +// transport security. +func (c *gcpServiceAccountIdentityCallCreds) RequireTransportSecurity() bool { + return true +} + +// isTokenStaleLocked checks if the token falls within the +// preemptiveRefresh window. It must be called with mu locked. +func (c *gcpServiceAccountIdentityCallCreds) isTokenStaleLocked() bool { + return c.preemptiveTokenRefresh.Before(time.Now()) +} + +// isTokenValidLocked checks if the token is not expired yet. It must be called +// with mu locked. +func (c *gcpServiceAccountIdentityCallCreds) isTokenValidLocked() bool { + return c.tokenExpiry.After(time.Now()) +} + +// startFetch initiates a token fetch and updates the credential +// state upon completion. +func (c *gcpServiceAccountIdentityCallCreds) startFetch() { + ctx, cancel := context.WithTimeout(c.ctx, metadataTimeout) + defer cancel() + token, err := c.creds.TokenProvider.Token(ctx) + + c.mu.Lock() + defer c.mu.Unlock() + + close(c.fetching) + c.fetching = nil + c.updateStateLocked(token, err) +} + +// updateStateLocked updates the credentials local token cache and +// backoff state based on the outcome of a background fetch attempt. +// +// If the fetch succeeded, the cached token is updated, and the backoff timers +// and error are reset. +// +// If the fetch failed, backoff attempts are calculated and the error is mapped +// to a gRPC status. +// - If the HTTP request fails with a status that maps to gRPC UNAVAILABLE +// according to HTTP to gRPC status code mappings, it returns UNAVAILABLE. +// - All other HTTP error status codes map to UNAUTHENTICATED. +// - Non-HTTP request failures are mapped to UNAVAILABLE. +// +// It must be called with mu locked. +func (c *gcpServiceAccountIdentityCallCreds) updateStateLocked(token *auth.Token, err error) { + if err != nil { + var mappedErr error + var metadataErr *metadata.Error + if errors.As(err, &metadataErr) { + switch transport.HTTPStatusConvTab[metadataErr.Code] { + case codes.Unavailable: + mappedErr = status.Errorf(codes.Unavailable, "credentials: failed to fetch token from metadata server: %v", err) + default: + mappedErr = status.Errorf(codes.Unauthenticated, "credentials: failed to fetch token from metadata server: %v", err) + } + } else { + mappedErr = status.Errorf(codes.Unavailable, "credentials: failed to fetch ID token: %v", err) + } + + c.lastErr = mappedErr + backoffDelay := c.backoff.Backoff(c.retryAttempt) + c.retryAttempt++ + c.nextRetryTime = time.Now().Add(backoffDelay) + return + } + c.lastErr = nil + c.retryAttempt = 0 + c.nextRetryTime = time.Time{} + c.token = token + // Per gRFC A83, the cached token is considered invalid 30 seconds before its + // actual expiration time to accommodate for clock skew. + c.tokenExpiry = token.Expiry.Add(-30 * time.Second) + c.preemptiveTokenRefresh = c.tokenExpiry.Add(-preemptiveRefresh) +} diff --git a/vendor/google.golang.org/grpc/credentials/google/internal/internal.go b/vendor/google.golang.org/grpc/credentials/google/internal/internal.go new file mode 100644 index 00000000000..9557d264d2b --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/google/internal/internal.go @@ -0,0 +1,35 @@ +/* +* +* Copyright 2026 gRPC authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* + */ + +// Package internal contains functionality internal to the google package. +package internal + +import ( + "cloud.google.com/go/auth" + "cloud.google.com/go/auth/credentials/idtoken" + "google.golang.org/grpc/internal/backoff" +) + +// The following variables are overridden in tests. +var ( + // BackoffStrategy is the backoff strategy to use when token fetch fails. + BackoffStrategy backoff.Strategy + + // NewIDTokenCredentials builds idtoken credentials using specified options. + NewIDTokenCredentials func(opts *idtoken.Options) (*auth.Credentials, error) +) diff --git a/vendor/google.golang.org/grpc/internal/credentials/xds/handshake_info.go b/vendor/google.golang.org/grpc/internal/credentials/xds/handshake_info.go index 637254eb42e..404b9cc9e2d 100644 --- a/vendor/google.golang.org/grpc/internal/credentials/xds/handshake_info.go +++ b/vendor/google.golang.org/grpc/internal/credentials/xds/handshake_info.go @@ -210,6 +210,9 @@ func (hi *HandshakeInfo) ClientSideTLSConfig(ctx context.Context, hostname strin func (hi *HandshakeInfo) buildVerifyFunc(km *certprovider.KeyMaterial, isClient bool, sni string) func(rawCerts [][]byte, _ [][]*x509.Certificate) error { return func(rawCerts [][]byte, _ [][]*x509.Certificate) error { + if len(rawCerts) == 0 { + return fmt.Errorf("xds: no peer certificates presented") + } // Parse all raw certificates presented by the peer. var certs []*x509.Certificate for _, rc := range rawCerts { diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 29d332e7b67..33344812746 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -150,8 +150,18 @@ var ( // throttling limit if unforeseen issues arise, and it will be removed in a // future release. // - // TODO: Remove this env var once v1.83.0 is release. + // TODO: Remove this env var once v1.83.0 is released. ControlBufferThrottleLimit = uint64FromEnv("GRPC_GO_EXPERIMENTAL_CONTROL_BUFFER_THROTTLE_LIMIT", 100, 1, 10000) + + // EnableReceiveBufferCompaction enables the compaction of data buffers + // to reduce the number of buffers in the receive buffer. + // + // This environment variable serves as an escape hatch to disable the + // feature if unforeseen issues arise, and it will be removed in a future + // release. + // + // TODO: Remove this env var once v1.85.0 is released. + EnableReceiveBufferCompaction = boolFromEnv("GRPC_GO_EXPERIMENTAL_ENABLE_RECEIVE_BUFFER_COMPACTION", true) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/vendor/google.golang.org/grpc/internal/envconfig/xds.go b/vendor/google.golang.org/grpc/internal/envconfig/xds.go index a2312f8eacf..e4b69191382 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/xds.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/xds.go @@ -69,9 +69,8 @@ var ( // https://github.com/grpc/proposal/blob/master/A87-mtls-spiffe-support.md XDSSPIFFEEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_MTLS_SPIFFE", false) - // XDSHTTPConnectEnabled is true if gRPC should parse custom Metadata - // configuring use of an HTTP CONNECT proxy via xDS from cluster resources. - // For more details, see: + // XDSHTTPConnectEnabled controls support for dynamic HTTP CONNECT proxying + // configured via the xDS control plane. For more details, see: // https://github.com/grpc/proposal/blob/master/A86-xds-http-connect.md XDSHTTPConnectEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_HTTP_CONNECT", false) @@ -88,7 +87,7 @@ var ( // XDSORCAToLRSPropEnabled controls whether ORCA metrics are explicitly // filtered and prefix-propagated to the LRS server. For more details, see: // https://github.com/grpc/proposal/blob/master/A85-lrs-custom-metrics-changes.md - XDSORCAToLRSPropEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_ORCA_LRS_PROPAGATION", false) + XDSORCAToLRSPropEnabled = boolFromEnv("GRPC_EXPERIMENTAL_XDS_ORCA_LRS_PROPAGATION", true) // XDSClientExtProcEnabled indicates whether ExtProc filter is enabled on // the client side. For more details, see: diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go index 9b6d8a1fa3f..d4999fcca83 100644 --- a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go +++ b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go @@ -20,10 +20,15 @@ package grpcsync import ( "context" + "errors" "google.golang.org/grpc/internal/buffer" ) +// ErrSerializerClosed is returned by ScheduleAndWait if the CallbackSerializer +// was closed before the callback could be scheduled. +var ErrSerializerClosed = errors.New("callback serializer is closed") + // CallbackSerializer provides a mechanism to schedule callbacks in a // synchronized manner. It provides a FIFO guarantee on the order of execution // of scheduled callbacks. New callbacks can be scheduled by invoking the @@ -77,6 +82,27 @@ func (cs *CallbackSerializer) ScheduleOr(f func(ctx context.Context), onFailure } } +// ScheduleAndWait schedules the provided callback function f to be executed in +// the order it was added and blocks until f has run. If the context passed to +// NewCallbackSerializer was canceled before this method is called, f is not run +// and ScheduleAndWait returns ErrSerializerClosed. +// +// Callbacks are expected to honor the context when performing any blocking +// operations, and should return early when the context is canceled. +func (cs *CallbackSerializer) ScheduleAndWait(f func(ctx context.Context)) error { + done := make(chan struct{}) + var err error + cs.ScheduleOr(func(ctx context.Context) { + f(ctx) + close(done) + }, func() { + err = ErrSerializerClosed + close(done) + }) + <-done + return err +} + func (cs *CallbackSerializer) run(ctx context.Context) { defer close(cs.done) diff --git a/vendor/google.golang.org/grpc/internal/mem/buffer_pool.go b/vendor/google.golang.org/grpc/internal/mem/buffer_pool.go index 2d83b2eced1..00aeca419fe 100644 --- a/vendor/google.golang.org/grpc/internal/mem/buffer_pool.go +++ b/vendor/google.golang.org/grpc/internal/mem/buffer_pool.go @@ -26,12 +26,26 @@ import ( "slices" "sort" "sync" + + "google.golang.org/grpc/internal" ) const ( goPageSize = 4 * 1024 // 4KiB. N.B. this must be a power of 2. ) +var ( + // BufferPoolingThreshold is the minimum size of a buffer that can be pooled. + // This is used to determine whether to pool buffers or allocate them directly. + BufferPoolingThreshold = 1 << 10 +) + +func init() { + internal.SetBufferPoolingThresholdForTesting = func(threshold int) { + BufferPoolingThreshold = threshold + } +} + var uintSize = bits.UintSize // use a variable for mocking during tests. // bufferPool is a copy of the public bufferPool interface used to avoid diff --git a/vendor/google.golang.org/grpc/internal/resolver/config_selector.go b/vendor/google.golang.org/grpc/internal/resolver/config_selector.go index 6320e9b576b..238950bbbf9 100644 --- a/vendor/google.golang.org/grpc/internal/resolver/config_selector.go +++ b/vendor/google.golang.org/grpc/internal/resolver/config_selector.go @@ -24,7 +24,6 @@ import ( "sync" "google.golang.org/grpc/internal/serviceconfig" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/resolver" ) @@ -52,82 +51,7 @@ type RPCConfig struct { Context context.Context MethodConfig serviceconfig.MethodConfig // configuration to use for this RPC OnCommitted func() // Called when the RPC has been committed (retries no longer possible) - Interceptor ClientInterceptor -} - -// ClientStream is the same as grpc.ClientStream, but defined here for circular -// dependency reasons. -type ClientStream interface { - // Header returns the header metadata received from the server if there - // is any. It blocks if the metadata is not ready to read. - Header() (metadata.MD, error) - // Trailer returns the trailer metadata from the server, if there is any. - // It must only be called after stream.CloseAndRecv has returned, or - // stream.Recv has returned a non-nil error (including io.EOF). - Trailer() metadata.MD - // CloseSend closes the send direction of the stream. It closes the stream - // when non-nil error is met. It is also not safe to call CloseSend - // concurrently with SendMsg. - CloseSend() error - // Context returns the context for this stream. - // - // It should not be called until after Header or RecvMsg has returned. Once - // called, subsequent client-side retries are disabled. - Context() context.Context - // SendMsg is generally called by generated code. On error, SendMsg aborts - // the stream. If the error was generated by the client, the status is - // returned directly; otherwise, io.EOF is returned and the status of - // the stream may be discovered using RecvMsg. - // - // SendMsg blocks until: - // - There is sufficient flow control to schedule m with the transport, or - // - The stream is done, or - // - The stream breaks. - // - // SendMsg does not wait until the message is received by the server. An - // untimely stream closure may result in lost messages. To ensure delivery, - // users should ensure the RPC completed successfully using RecvMsg. - // - // It is safe to have a goroutine calling SendMsg and another goroutine - // calling RecvMsg on the same stream at the same time, but it is not safe - // to call SendMsg on the same stream in different goroutines. It is also - // not safe to call CloseSend concurrently with SendMsg. - SendMsg(m any) error - // RecvMsg blocks until it receives a message into m or the stream is - // done. It returns io.EOF when the stream completes successfully. On - // any other error, the stream is aborted and the error contains the RPC - // status. - // - // It is safe to have a goroutine calling SendMsg and another goroutine - // calling RecvMsg on the same stream at the same time, but it is not - // safe to call RecvMsg on the same stream in different goroutines. - RecvMsg(m any) error -} - -// ClientInterceptor is an interceptor for gRPC client streams. -type ClientInterceptor interface { - // NewStream creates a ClientStream for an RPC. - // - // Implementations must delegate stream creation to the provided newStream - // function. To intercept or override stream behavior, implementations - // may wrap the ClientStream returned by the delegate. - // - // Note: RPCInfo.Context is currently unused and will be nil. - // - // The done function is invoked when the RPC has finished using its - // underlying connection or if a connection could not be assigned. Because - // interceptors operate at the application layer, RPC operations may - // continue on the ClientStream even after done has been called. The - // caller must ensure done is non-nil. - // - // To ensure RPC completion notifications propagate through the entire - // interceptor chain, implementations must ensure that the done function - // passed to the delegate newStream invokes the done function passed to - // NewStream. - NewStream(ctx context.Context, ri RPCInfo, done func(), newStream func(ctx context.Context, done func()) (ClientStream, error)) (ClientStream, error) - // Close closes the interceptor. Once called, no new calls to NewStream are - // accepted. Ongoing calls to NewStream are allowed to complete. - Close() + Interceptor any } // ServerInterceptor is an interceptor for incoming RPC's on gRPC server side. diff --git a/vendor/google.golang.org/grpc/internal/transport/client_stream.go b/vendor/google.golang.org/grpc/internal/transport/client_stream.go index ad382b0fda1..046f0a55577 100644 --- a/vendor/google.golang.org/grpc/internal/transport/client_stream.go +++ b/vendor/google.golang.org/grpc/internal/transport/client_stream.go @@ -39,9 +39,8 @@ const nonGRPCDataMaxLen = 1024 type ClientStream struct { Stream // Embed for common stream functionality. - ct *http2Client - done chan struct{} // closed at the end of stream to unblock writers. - doneFunc func() // invoked at the end of stream. + ct *http2Client + done chan struct{} // closed at the end of stream to unblock writers. headerChan chan struct{} // closed to indicate the end of header metadata. header metadata.MD // the received header metadata diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go index a8356c9adbc..9cd8d28d33e 100644 --- a/vendor/google.golang.org/grpc/internal/transport/handler_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -424,7 +424,7 @@ func (ht *serverHandlerTransport) HandleStreams(ctx context.Context, startStream st: ht, headerWireLength: 0, // won't have access to header wire length until golang/go#18997. } - s.Stream.buf.init() + s.Stream.buf.init(ht.bufferPool) s.readRequester = s s.trReader = transportReader{ reader: recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: &s.buf}, diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 822c09ba621..10d19774159 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -498,10 +498,9 @@ func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr, handler s ct: t, done: make(chan struct{}), headerChan: make(chan struct{}), - doneFunc: callHdr.DoneFunc, statsHandler: handler, } - s.Stream.buf.init() + s.Stream.buf.init(t.bufferPool) s.Stream.wq.init(defaultWriteQuota, s.done) s.readRequester = s // The client side stream context should have exactly the same life cycle with the user provided context. @@ -998,9 +997,6 @@ func (t *http2Client) closeStream(s *ClientStream, err error, rst bool, rstCode t.controlBuf.executeAndPut(addBackStreamQuota, cleanup) // This will unblock write. close(s.done) - if s.doneFunc != nil { - s.doneFunc() - } } // Close kicks off the shutdown process of the transport. This should be called diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index be8ae9f9c54..63c6539a3d3 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -407,7 +407,7 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade st: t, headerWireLength: int(frame.Header().Length), } - s.Stream.buf.init() + s.Stream.buf.init(t.bufferPool) var ( // if false, content-type was missing or invalid isGRPC = false diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 6dfae39849e..5fc901e5cf1 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -30,11 +30,14 @@ import ( "sync" "sync/atomic" "time" + "unsafe" "golang.org/x/net/http2" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/envconfig" + imem "google.golang.org/grpc/internal/mem" "google.golang.org/grpc/internal/transport/internal" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/mem" @@ -45,7 +48,30 @@ import ( "google.golang.org/grpc/tap" ) -const logLevel = 2 +const ( + logLevel = 2 + // recvMsgSize estimates the memory overhead of a recvMsg in the backlog. + // It accounts for the recvMsg struct itself and the slice header of the + // underlying buffer's data. + recvMsgSize = int(unsafe.Sizeof(recvMsg{}) + unsafe.Sizeof([]byte{})) + + // utilizationFactor controls when we consider memory utilization acceptable. + // When backlogHeapSize / payloadSize <= utilizationFactor (meaning at least + // 50% of the heap memory is actual payload data), compaction is skipped. + utilizationFactor = 2 +) + +var ( + // compactionThreshold is approx 57KB (on 64-bit systems). It allows + // accumulating up to 1024 1-byte payloads before triggering compaction. + // + // Because individual payloads <= 1024 bytes are allocated on the heap + // outside mem.BufferPool, waiting for at least 1024 bytes to accumulate + // ensures that compaction coalesces those small heap allocations into a + // single large buffer from mem.BufferPool, enabling buffer reuse while + // avoiding frequent copying for small bursts of frames. + compactionThreshold = imem.BufferPoolingThreshold * (recvMsgSize + 1) +) func init() { internal.TimeNowFunc = func() int64 { return time.Now().UnixNano() } @@ -71,23 +97,31 @@ type recvBuffer struct { c chan recvMsg mu sync.Mutex backlog []recvMsg - err error + // uncompactedSuffixLen tracks the number of consecutive data messages at + // the tail of backlog that have not been compacted. + uncompactedSuffixLen int + // uncompactedBytes tracks the total payload bytes across the trailing + // uncompactedSuffixLen messages. + uncompactedBytes int + err error + bufPool mem.BufferPool } // init allows a recvBuffer to be initialized in-place, which is useful // for resetting a buffer or for avoiding a heap allocation when the buffer // is embedded in another struct. -func (b *recvBuffer) init() { +func (b *recvBuffer) init(pool mem.BufferPool) { b.c = make(chan recvMsg, 1) + b.bufPool = pool } func (b *recvBuffer) put(r recvMsg) { b.mu.Lock() + defer b.mu.Unlock() if b.err != nil { // drop the buffer on the floor. Since b.err is not nil, any subsequent reads // will always return an error, making this buffer inaccessible. r.buffer.Free() - b.mu.Unlock() // An error had occurred earlier, don't accept more // data or errors. return @@ -96,13 +130,70 @@ func (b *recvBuffer) put(r recvMsg) { if len(b.backlog) == 0 { select { case b.c <- r: - b.mu.Unlock() return default: } } b.backlog = append(b.backlog, r) - b.mu.Unlock() + b.compactBacklogLocked(r) +} + +func (b *recvBuffer) compactBacklogLocked(r recvMsg) { + if !envconfig.EnableReceiveBufferCompaction { + return + } + if r.buffer == nil { + b.uncompactedBytes = 0 + b.uncompactedSuffixLen = 0 + return + } + + b.uncompactedSuffixLen++ + b.uncompactedBytes += r.buffer.Len() + backlogHeapSize := b.uncompactedSuffixLen*recvMsgSize + b.uncompactedBytes + + // If the memory overhead is less than 50% of the heap usage (e.g., because + // a large DATA frame arrived), the average message size in the suffix is + // large enough that memory bloat is not a concern. Reset suffix tracking. + if backlogHeapSize <= utilizationFactor*b.uncompactedBytes { + b.uncompactedBytes = 0 + b.uncompactedSuffixLen = 0 + return + } + // Avoid compacting too frequently for short bursts of small frames. + // Wait until we have accumulated at least ~1024 small messages (~57 KB). + if backlogHeapSize <= compactionThreshold { + // Still can accumulate more payloads. + return + } + + // Since the memory utilization is less than 50%, the average payload size + // of each recvMsg must be less than recvMsgSize (approx 56 bytes). + // In the worst case for bytes copied (where the average payload is just + // below recvMsgSize), compaction will occur once every: + // compactionThreshold / (recvMsgSize + avg_payload) = ~520 messages, + // copying ~29KB of data. + + start := 0 + newBuf := b.bufPool.Get(b.uncompactedBytes) + startIdx := len(b.backlog) - b.uncompactedSuffixLen + + for i := startIdx; i < len(b.backlog); i++ { + m := b.backlog[i] + b.backlog[i] = recvMsg{} + start += copy((*newBuf)[start:], m.buffer.ReadOnlyData()) + m.buffer.Free() + } + b.backlog[startIdx] = recvMsg{ + buffer: mem.NewBuffer(newBuf, b.bufPool), + } + b.backlog = b.backlog[:startIdx+1] + // After compaction, the suffix is replaced with a single message containing + // the combined payload. The new utilization is close to 1.0 (overhead of + // one recvMsg relative to the large compacted payload), which is well + // below the utilization factor of 2. + b.uncompactedBytes = 0 + b.uncompactedSuffixLen = 0 } func (b *recvBuffer) load() { @@ -110,6 +201,13 @@ func (b *recvBuffer) load() { if len(b.backlog) > 0 { select { case b.c <- b.backlog[0]: + // backlog[0] is only part of the tracked uncompacted suffix if the + // entire backlog currently consists of the suffix. If an earlier + // compaction or reset occurred, backlog[0] is already compacted. + if envconfig.EnableReceiveBufferCompaction && b.uncompactedSuffixLen == len(b.backlog) { + b.uncompactedSuffixLen-- + b.uncompactedBytes -= b.backlog[0].buffer.Len() + } b.backlog[0] = recvMsg{} b.backlog = b.backlog[1:] default: @@ -594,8 +692,6 @@ type CallHdr struct { PreviousAttempts int // value of grpc-previous-rpc-attempts header to set - DoneFunc func() // called when the stream is finished - // Authority is used to explicitly override the `:authority` header. // // This value comes from one of two sources: diff --git a/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/configbuilder.go b/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/configbuilder.go index 336d240004f..6efeeb14b65 100644 --- a/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/configbuilder.go +++ b/vendor/google.golang.org/grpc/internal/xds/balancer/cdsbalancer/configbuilder.go @@ -28,6 +28,7 @@ import ( "google.golang.org/grpc/experimental/balancer/weight" "google.golang.org/grpc/internal/envconfig" "google.golang.org/grpc/internal/hierarchy" + "google.golang.org/grpc/internal/proxyattributes" internalserviceconfig "google.golang.org/grpc/internal/serviceconfig" xdsinternal "google.golang.org/grpc/internal/xds" "google.golang.org/grpc/internal/xds/balancer/clusterimpl" @@ -294,6 +295,24 @@ func priorityLocalitiesToClusterImpl(localities []xdsresource.Locality, priority resolverEndpoint := endpoint.ResolverEndpoint resolverEndpoint.Addresses = slices.Clone(endpoint.ResolverEndpoint.Addresses) + if clusterUpdate.IsHTTP11ProxyEnabled { + var proxyAddrStr string + if val, ok := endpoint.Metadata["envoy.http11_proxy_transport_socket.proxy_address"].(xdsresource.ProxyAddressMetadataValue); ok { + proxyAddrStr = val.Address + } else if val, ok := locality.Metadata["envoy.http11_proxy_transport_socket.proxy_address"].(xdsresource.ProxyAddressMetadataValue); ok { + proxyAddrStr = val.Address + } + if proxyAddrStr != "" { + for idx, addr := range resolverEndpoint.Addresses { + connectAddr := addr.Addr + addr.Addr = proxyAddrStr + resolverEndpoint.Addresses[idx] = proxyattributes.Set(addr, proxyattributes.Options{ + ConnectAddr: connectAddr, + }) + } + } + } + resolverEndpoint = hierarchy.SetInEndpoint(resolverEndpoint, []string{priorityName, localityStr}) resolverEndpoint = xdsinternal.SetLocalityIDInEndpoint(resolverEndpoint, locality.ID) // "To provide the xds_wrr_locality load balancer information about diff --git a/vendor/google.golang.org/grpc/internal/xds/balancer/clustermanager/picker.go b/vendor/google.golang.org/grpc/internal/xds/balancer/clustermanager/picker.go index 015cd2b7af4..97a167075b8 100644 --- a/vendor/google.golang.org/grpc/internal/xds/balancer/clustermanager/picker.go +++ b/vendor/google.golang.org/grpc/internal/xds/balancer/clustermanager/picker.go @@ -43,7 +43,7 @@ func newPickerGroup(idToPickerState map[string]*subBalancerState) *pickerGroup { } func (pg *pickerGroup) Pick(info balancer.PickInfo) (balancer.PickResult, error) { - cluster := getPickedCluster(info.Ctx) + cluster := PickedCluster(info.Ctx) if p := pg.pickers[cluster]; p != nil { return p.Pick(info) } @@ -52,17 +52,12 @@ func (pg *pickerGroup) Pick(info balancer.PickInfo) (balancer.PickResult, error) type clusterKey struct{} -func getPickedCluster(ctx context.Context) string { +// PickedCluster returns the cluster name stored in the context. +func PickedCluster(ctx context.Context) string { cluster, _ := ctx.Value(clusterKey{}).(string) return cluster } -// GetPickedClusterForTesting returns the cluster in the context; to be used -// for testing only. -func GetPickedClusterForTesting(ctx context.Context) string { - return getPickedCluster(ctx) -} - // SetPickedCluster adds the selected cluster to the context for the // xds_cluster_manager LB policy to pick. func SetPickedCluster(ctx context.Context, cluster string) context.Context { diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/fault/fault.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/fault/fault.go index 2d6f8afb800..58f34863698 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/fault/fault.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/fault/fault.go @@ -29,6 +29,7 @@ import ( "sync/atomic" "time" + "google.golang.org/grpc" "google.golang.org/grpc/codes" iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/xds/httpfilter" @@ -104,7 +105,7 @@ func (builder) IsTerminal() bool { return false } -func (builder) BuildClientFilter() httpfilter.ClientFilter { +func (builder) BuildClientFilter(httpfilter.ClientFilterOptions) httpfilter.ClientFilter { return clientFilter{} } @@ -114,7 +115,7 @@ type clientFilter struct{} func (clientFilter) Close() {} -func (clientFilter) BuildClientInterceptor(cfg, override httpfilter.FilterConfig) (iresolver.ClientInterceptor, error) { +func (clientFilter) BuildClientInterceptor(cfg, override httpfilter.FilterConfig) (httpfilter.ClientInterceptor, error) { if cfg == nil { return nil, fmt.Errorf("fault: nil config provided") } @@ -147,12 +148,12 @@ type interceptor struct { var activeFaults uint32 // global active faults; accessed atomically -func (i *interceptor) NewStream(ctx context.Context, _ iresolver.RPCInfo, done func(), newStream func(ctx context.Context, done func()) (iresolver.ClientStream, error)) (iresolver.ClientStream, error) { +func (i *interceptor) NewStream(ctx context.Context, _ iresolver.RPCInfo, newStream func(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStream, error), opts ...grpc.CallOption) (grpc.ClientStream, error) { if maxAF := i.config.GetMaxActiveFaults(); maxAF != nil { defer atomic.AddUint32(&activeFaults, ^uint32(0)) // decrement counter if af := atomic.AddUint32(&activeFaults, 1); af > maxAF.GetValue() { // Would exceed maximum active fault limit. - return newStream(ctx, done) + return newStream(ctx, opts...) } } @@ -166,7 +167,7 @@ func (i *interceptor) NewStream(ctx context.Context, _ iresolver.RPCInfo, done f } return nil, err } - return newStream(ctx, done) + return newStream(ctx, opts...) } func (i *interceptor) Close() {} diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/httpfilter.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/httpfilter.go index b37ed9d1513..cc31e755eaf 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/httpfilter.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/httpfilter.go @@ -21,6 +21,9 @@ package httpfilter import ( + "context" + + "google.golang.org/grpc" iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/protobuf/proto" ) @@ -66,11 +69,34 @@ type Builder interface { IsTerminal() bool } +// ClientInterceptor is an interceptor for gRPC client streams. +type ClientInterceptor interface { + // NewStream creates a ClientStream for an RPC. + // + // Implementations may delegate stream creation to the provided newStream + // function, passing the provided CallOption slice along with any new + // CallOption instances they wish to add. To intercept or override stream + // behavior, implementations may wrap the ClientStream returned by the + // delegate. + // + // Note: RPCInfo.Context is currently unused and will be nil. + NewStream(ctx context.Context, ri iresolver.RPCInfo, newStream func(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStream, error), opts ...grpc.CallOption) (grpc.ClientStream, error) + + // Close closes the interceptor. Once called, no new calls to NewStream are + // accepted. Ongoing calls to NewStream are allowed to complete. + Close() +} + +// ClientFilterOptions contains options for building a client filter. +type ClientFilterOptions struct { + FilterName string // FilterName is the filter name from the xDS configuration. +} + // ClientFilterBuilder is an optional interface that a Builder can implement to // indicate its capability to build client-side filters. type ClientFilterBuilder interface { // BuildClientFilter constructs a ClientFilter. - BuildClientFilter() ClientFilter + BuildClientFilter(opts ClientFilterOptions) ClientFilter } // ClientFilter represents the actual filter implementation on the client side. @@ -84,7 +110,7 @@ type ClientFilter interface { // // It is valid for this method to return a nil Interceptor and a nil error. // In this case, the RPC will not be intercepted by this filter. - BuildClientInterceptor(config, override FilterConfig) (iresolver.ClientInterceptor, error) + BuildClientInterceptor(config, override FilterConfig) (ClientInterceptor, error) // Close is called when the filter is no longer needed. Close() diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/rbac/rbac.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/rbac/rbac.go index eb42a7fb1ff..1af2c2065ba 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/rbac/rbac.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/rbac/rbac.go @@ -32,6 +32,7 @@ import ( "google.golang.org/protobuf/types/known/anypb" v3rbacpb "github.com/envoyproxy/go-control-plane/envoy/config/rbac/v3" + v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" rpb "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/rbac/v3" ) @@ -68,36 +69,25 @@ func parseConfig(rbacCfg *rpb.RBAC) (httpfilter.FilterConfig, error) { } // "It is also a validation failure if Permission or Principal has a - // header matcher for a grpc- prefixed header name or :scheme." - A41 - for _, principal := range policy.Principals { - name := principal.GetHeader().GetName() - if name == ":scheme" || strings.HasPrefix(name, "grpc-") { - return nil, fmt.Errorf("rbac: principal header matcher for %v is :scheme or starts with grpc", name) + // header matcher for a grpc- prefixed header name or :scheme." - A41. + // + // "Envoy aliases :authority and Host in its header map implementation, + // so they should be treated equivalent for the RBAC matchers; there must + // be no behavior change depending on which of the two header names is + // used in the RBAC policy." - A41. Any header matcher with value "host" + // is rewritten to ":authority", as that is what grpc-go shifts both + // headers to in the transport layer. + // + // Both rules apply to header matchers nested inside and/or/not rules, so + // the whole permission and principal trees are walked. + for _, principal := range policy.GetPrincipals() { + if err := normalizePrincipalHeaders(principal); err != nil { + return nil, err } } - for _, permission := range policy.Permissions { - name := permission.GetHeader().GetName() - if name == ":scheme" || strings.HasPrefix(name, "grpc-") { - return nil, fmt.Errorf("rbac: permission header matcher for %v is :scheme or starts with grpc", name) - } - } - } - - // "Envoy aliases :authority and Host in its header map implementation, so - // they should be treated equivalent for the RBAC matchers; there must be no - // behavior change depending on which of the two header names is used in the - // RBAC policy." - A41. Loop through config's principals and policies, change - // any header matcher with value "host" to :authority", as that is what - // grpc-go shifts both headers to in transport layer. - for _, policy := range rbacCfg.GetRules().GetPolicies() { - for _, principal := range policy.Principals { - if principal.GetHeader().GetName() == "host" { - principal.GetHeader().Name = ":authority" - } - } - for _, permission := range policy.Permissions { - if permission.GetHeader().GetName() == "host" { - permission.GetHeader().Name = ":authority" + for _, permission := range policy.GetPermissions() { + if err := normalizePermissionHeaders(permission); err != nil { + return nil, err } } } @@ -126,6 +116,82 @@ func parseConfig(rbacCfg *rpb.RBAC) (httpfilter.FilterConfig, error) { return config{chainEngine: ce}, nil } +// normalizePermissionHeaders applies the A41 header-name rules to every header +// matcher reachable from permission, including those nested inside and/or/not +// rules. +func normalizePermissionHeaders(permission *v3rbacpb.Permission) error { + switch p := permission.GetRule().(type) { + case *v3rbacpb.Permission_Header: + return normalizeHeaderMatcher(p.Header) + case *v3rbacpb.Permission_AndRules: + for _, rule := range p.AndRules.GetRules() { + if err := normalizePermissionHeaders(rule); err != nil { + return err + } + } + case *v3rbacpb.Permission_OrRules: + for _, rule := range p.OrRules.GetRules() { + if err := normalizePermissionHeaders(rule); err != nil { + return err + } + } + case *v3rbacpb.Permission_NotRule: + return normalizePermissionHeaders(p.NotRule) + } + return nil +} + +// normalizePrincipalHeaders applies the A41 header-name rules to every header +// matcher reachable from principal, including those nested inside and/or/not +// ids. +func normalizePrincipalHeaders(principal *v3rbacpb.Principal) error { + switch p := principal.GetIdentifier().(type) { + case *v3rbacpb.Principal_Header: + return normalizeHeaderMatcher(p.Header) + case *v3rbacpb.Principal_AndIds: + for _, id := range p.AndIds.GetIds() { + if err := normalizePrincipalHeaders(id); err != nil { + return err + } + } + case *v3rbacpb.Principal_OrIds: + for _, id := range p.OrIds.GetIds() { + if err := normalizePrincipalHeaders(id); err != nil { + return err + } + } + case *v3rbacpb.Principal_NotId: + return normalizePrincipalHeaders(p.NotId) + } + return nil +} + +// normalizeHeaderMatcher lowercases the name of a header matcher, rejects the +// names that A41 forbids (:scheme or a grpc- prefixed name) and rewrites a +// "host" matcher to ":authority". +func normalizeHeaderMatcher(header *v3routepb.HeaderMatcher) error { + // The keys of the metadata the matchers run against are always lowercase, + // so a name that contains an uppercase character matches no header at all + // and the rule using it never fires. Lowercase the name, as Envoy and + // grpc-java do, both to make it match and to keep the checks below from + // being evaded by the case of the name. + name := header.GetName() + lowerName := strings.ToLower(name) + if lowerName != name { + header.Name = lowerName + } + if lowerName == ":scheme" { + return fmt.Errorf("rbac: header matcher for %q is %q", name, ":scheme") + } + if strings.HasPrefix(lowerName, "grpc-") { + return fmt.Errorf("rbac: header matcher for %q starts with %q", name, "grpc-") + } + if lowerName == "host" { + header.Name = ":authority" + } + return nil +} + func (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, error) { if cfg == nil { return nil, fmt.Errorf("rbac: nil configuration message provided") diff --git a/vendor/google.golang.org/grpc/internal/xds/httpfilter/router/router.go b/vendor/google.golang.org/grpc/internal/xds/httpfilter/router/router.go index 7118ea14b4c..954528227a6 100644 --- a/vendor/google.golang.org/grpc/internal/xds/httpfilter/router/router.go +++ b/vendor/google.golang.org/grpc/internal/xds/httpfilter/router/router.go @@ -76,7 +76,7 @@ func (builder) IsTerminal() bool { return true } -func (builder) BuildClientFilter() httpfilter.ClientFilter { +func (builder) BuildClientFilter(httpfilter.ClientFilterOptions) httpfilter.ClientFilter { return filter{} } @@ -91,7 +91,7 @@ type filter struct{} func (filter) Close() {} -func (filter) BuildClientInterceptor(cfg, override httpfilter.FilterConfig) (iresolver.ClientInterceptor, error) { +func (filter) BuildClientInterceptor(cfg, override httpfilter.FilterConfig) (httpfilter.ClientInterceptor, error) { if _, ok := cfg.(config); !ok { return nil, fmt.Errorf("router: incorrect config type provided (%T): %v", cfg, cfg) } diff --git a/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go b/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go index b19bb7e3753..94801b77de0 100644 --- a/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go +++ b/vendor/google.golang.org/grpc/internal/xds/resolver/serviceconfig.go @@ -35,6 +35,7 @@ import ( "google.golang.org/grpc/internal/wrr" "google.golang.org/grpc/internal/xds/balancer/clusterimpl" "google.golang.org/grpc/internal/xds/balancer/clustermanager" + "google.golang.org/grpc/internal/xds/httpfilter" "google.golang.org/grpc/internal/xds/xdsclient/xdsresource" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" @@ -104,15 +105,15 @@ type virtualHost struct { // routeCluster holds information about a cluster as referenced by a route. type routeCluster struct { - name string // Name of the cluster. - interceptor iresolver.ClientInterceptor // HTTP filters to run for RPCs matching this route. + name string // Name of the cluster. + interceptor httpfilter.ClientInterceptor // HTTP filters to run for RPCs matching this route. } type route struct { - m *xdsresource.CompositeMatcher // converted from route matchers - actionType xdsresource.RouteActionType // holds route action type - clusters wrr.WRR // holds *routeCluster entries - interceptors []iresolver.ClientInterceptor // Interceptors across clusters belonging to this route + m *xdsresource.CompositeMatcher // converted from route matchers + actionType xdsresource.RouteActionType // holds route action type + clusters wrr.WRR // holds *routeCluster entries + interceptors []httpfilter.ClientInterceptor // Interceptors across clusters belonging to this route maxStreamDuration time.Duration retryConfig *xdsresource.RetryConfig hashPolicies []*xdsresource.HashPolicy diff --git a/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go b/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go index 3d4932bc29c..8dfa684a5fb 100644 --- a/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go +++ b/vendor/google.golang.org/grpc/internal/xds/resolver/xds_resolver.go @@ -27,6 +27,7 @@ import ( "strings" "sync/atomic" + "google.golang.org/grpc" estats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/grpclog" @@ -414,7 +415,7 @@ func (r *xdsResolver) newConfigSelector() (_ *configSelector, err error) { for i, rt := range r.xdsConfig.VirtualHost.Routes { clusters := rinternal.NewWRR.(func() wrr.WRR)() - interceptors := []iresolver.ClientInterceptor{} + interceptors := []httpfilter.ClientInterceptor{} // TODO: Carve out the common logic between the ClusterSpecifierPlugin // and WeightedClusters. if rt.ClusterSpecifierPlugin != "" { @@ -594,8 +595,8 @@ func (r *xdsResolver) onResourceError(err error) { // followed by the route override, and finally the virtual host override. // // Only executed in the context of a serializer callback. -func (r *xdsResolver) newInterceptor(filters []xdsresource.HTTPFilter, clusterOverride, routeOverride, virtualHostOverride map[string]httpfilter.FilterConfig) (_ iresolver.ClientInterceptor, err error) { - interceptors := make([]iresolver.ClientInterceptor, 0, len(filters)) +func (r *xdsResolver) newInterceptor(filters []xdsresource.HTTPFilter, clusterOverride, routeOverride, virtualHostOverride map[string]httpfilter.FilterConfig) (_ httpfilter.ClientInterceptor, err error) { + interceptors := make([]httpfilter.ClientInterceptor, 0, len(filters)) defer func() { // Clean up any interceptors that were successfully built before the // error occurred, to avoid leaking resources. @@ -652,18 +653,18 @@ func (r *xdsResolver) newInterceptor(filters []xdsresource.HTTPFilter, clusterOv // interceptorList is a client interceptor that contains a list of client // interceptors to execute in order. type interceptorList struct { - interceptors []iresolver.ClientInterceptor + interceptors []httpfilter.ClientInterceptor } -func (il *interceptorList) NewStream(ctx context.Context, ri iresolver.RPCInfo, _ func(), newStream func(ctx context.Context, _ func()) (iresolver.ClientStream, error)) (iresolver.ClientStream, error) { +func (il *interceptorList) NewStream(ctx context.Context, ri iresolver.RPCInfo, newStream func(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStream, error), opts ...grpc.CallOption) (grpc.ClientStream, error) { for idx := len(il.interceptors) - 1; idx >= 0; idx-- { ns := newStream i := il.interceptors[idx] - newStream = func(ctx context.Context, done func()) (iresolver.ClientStream, error) { - return i.NewStream(ctx, ri, done, ns) + newStream = func(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStream, error) { + return i.NewStream(ctx, ri, ns, opts...) } } - return newStream(ctx, func() {}) + return newStream(ctx, opts...) } func (il *interceptorList) Close() { @@ -684,7 +685,7 @@ func (r *xdsResolver) getOrCreateClientFilter(builder httpfilter.ClientFilterBui return clientFilter } - cf := builder.BuildClientFilter() + cf := builder.BuildClientFilter(httpfilter.ClientFilterOptions{FilterName: key.name}) r.httpFilters[key] = cf return cf } diff --git a/vendor/google.golang.org/grpc/internal/xds/server/listener_wrapper.go b/vendor/google.golang.org/grpc/internal/xds/server/listener_wrapper.go index 92b654b60d8..e53a4bd2d2f 100644 --- a/vendor/google.golang.org/grpc/internal/xds/server/listener_wrapper.go +++ b/vendor/google.golang.org/grpc/internal/xds/server/listener_wrapper.go @@ -439,7 +439,13 @@ func (lw *ldsWatcher) ResourceChanged(update *xdsresource.ListenerUpdate, onDone } l := lw.parent ilc := update.TCPListener - // Make sure that the socket address on the received Listener resource + + // A server-side listener update must contain inbound listener configuration + // (TCPListener). If it is nil, it indicates that a client-side listener (API + // Listener) resource was received instead. In this case, we transition the + // server to non-serving mode. + // + // Also, make sure that the socket address on the received Listener resource // matches the address of the net.Listener passed to us by the user. This // check is done here instead of at the XDSClient layer because of the // following couple of reasons: @@ -451,11 +457,16 @@ func (lw *ldsWatcher) ResourceChanged(update *xdsresource.ListenerUpdate, onDone // What this means is that the XDSClient has ACKed a resource which can push // the server into a "not serving" mode. This is not ideal, but this is // what we have decided to do. - if ilc.Address != l.addr || ilc.Port != l.port { + if ilc == nil || (ilc.Address != l.addr || ilc.Port != l.port) { // TODO(purnesh42h): Are there any other cases where this can be // treated as an ambient error? l.mu.Lock() - err := fmt.Errorf("[xDS node id: %v]: %w", l.xdsNodeID, fmt.Errorf("address (%s:%s) in Listener update does not match listening address: (%s:%s)", ilc.Address, ilc.Port, l.addr, l.port)) + var err error + if ilc == nil { + err = fmt.Errorf("[xDS node id: %v]: %w", l.xdsNodeID, fmt.Errorf("received client-side listener resource %q on server-side", lw.name)) + } else { + err = fmt.Errorf("[xDS node id: %v]: %w", l.xdsNodeID, fmt.Errorf("address (%s:%s) in Listener update does not match listening address: (%s:%s)", ilc.Address, ilc.Port, l.addr, l.port)) + } l.switchModeLocked(connectivity.ServingModeNotServing, err) l.mu.Unlock() return diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/matcher.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/matcher.go index c9202fc31ec..3eef12f23cb 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/matcher.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/matcher.go @@ -50,14 +50,8 @@ func RouteToMatcher(r *Route) *CompositeMatcher { var matcherT matcher.HeaderMatcher invert := h.InvertMatch != nil && *h.InvertMatch switch { - case h.ExactMatch != nil && *h.ExactMatch != "": - matcherT = matcher.NewHeaderExactMatcher(h.Name, *h.ExactMatch, invert) case h.RegexMatch != nil: matcherT = matcher.NewHeaderRegexMatcher(h.Name, h.RegexMatch, invert) - case h.PrefixMatch != nil && *h.PrefixMatch != "": - matcherT = matcher.NewHeaderPrefixMatcher(h.Name, *h.PrefixMatch, invert) - case h.SuffixMatch != nil && *h.SuffixMatch != "": - matcherT = matcher.NewHeaderSuffixMatcher(h.Name, *h.SuffixMatch, invert) case h.RangeMatch != nil: matcherT = matcher.NewHeaderRangeMatcher(h.Name, h.RangeMatch.Start, h.RangeMatch.End, invert) case h.PresentMatch != nil: diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/metadata.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/metadata.go index 4d915c5e456..bde5eb76f43 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/metadata.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/metadata.go @@ -22,6 +22,7 @@ import ( "net/netip" "google.golang.org/grpc/internal/envconfig" + "google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version" "google.golang.org/protobuf/types/known/anypb" v3corepb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" @@ -30,10 +31,10 @@ import ( func init() { if envconfig.XDSHTTPConnectEnabled { - registerMetadataConverter("type.googleapis.com/envoy.config.core.v3.Address", proxyAddressConvertor{}) + registerMetadataConverter(version.V3AddressURL, proxyAddressConverter{}) } if envconfig.GCPAuthenticationFilterEnabled { - registerMetadataConverter("type.googleapis.com/envoy.extensions.filters.http.gcp_authn.v3.Audience", audienceConverter{}) + registerMetadataConverter(version.V3AudienceURL, audienceConverter{}) } } @@ -61,10 +62,41 @@ func metadataConverterForType(typeURL string) metadataConverter { return metadataRegistry[typeURL] } -// unregisterMetadataConverterForTesting removes a converter from the registry. -// For testing only. -func unregisterMetadataConverterForTesting(typeURL string) { +// RegisterMetadataConverterForTesting registers the converter for testing +// purposes and returns a cleanup function to restore the registry to its +// previous state. +func RegisterMetadataConverterForTesting(typeURL string) (func(), error) { + var conv metadataConverter + switch typeURL { + case version.V3AddressURL: + conv = proxyAddressConverter{} + case version.V3AudienceURL: + conv = audienceConverter{} + default: + return nil, fmt.Errorf("unknown typeURL for testing: %s", typeURL) + } + curConverter, found := metadataRegistry[typeURL] + registerMetadataConverter(typeURL, conv) + return func() { + if found { + metadataRegistry[typeURL] = curConverter + return + } + delete(metadataRegistry, typeURL) + }, nil +} + +// UnregisterMetadataConverterForTesting unregisters the converter for testing +// purposes and returns a cleanup function to restore the registry to its +// previous state. +func UnregisterMetadataConverterForTesting(typeURL string) func() { + curConverter, found := metadataRegistry[typeURL] delete(metadataRegistry, typeURL) + return func() { + if found { + metadataRegistry[typeURL] = curConverter + } + } } // StructMetadataValue stores the values in a google.protobuf.Struct from @@ -85,9 +117,9 @@ type ProxyAddressMetadataValue struct { // proxyAddressConvertor implements the metadataConverter interface to handle // the conversion of envoy.config.core.v3.Address protobuf messages into an // internal representation. -type proxyAddressConvertor struct{} +type proxyAddressConverter struct{} -func (proxyAddressConvertor) convert(anyProto *anypb.Any) (any, error) { +func (proxyAddressConverter) convert(anyProto *anypb.Any) (any, error) { addressProto := &v3corepb.Address{} if err := anyProto.UnmarshalTo(addressProto); err != nil { return nil, fmt.Errorf("failed to unmarshal resource from Any proto: %v", err) diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_cds.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_cds.go index f2063827e30..6c359052863 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_cds.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_cds.go @@ -86,6 +86,10 @@ type ClusterUpdate struct { // Metadata contains the metadata from the cluster resource. Metadata map[string]any + + // IsHTTP11ProxyEnabled is true if the cluster transport socket is wrapped + // in Http11ProxyUpstreamTransport. + IsHTTP11ProxyEnabled bool } // LRSReportEndpointMetricsConfig holds the configuration for propagating ORCA diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_rds.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_rds.go index 48e8051b322..1cddfa5aff2 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_rds.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/type_rds.go @@ -166,14 +166,12 @@ type WeightedCluster struct { HTTPFilterConfigOverride map[string]httpfilter.FilterConfig } -// HeaderMatcher represents header matchers. +// HeaderMatcher represents header matchers. Exact, prefix, suffix and contains +// matches are represented as a StringMatch. type HeaderMatcher struct { Name string InvertMatch *bool - ExactMatch *string RegexMatch *regexp.Regexp - PrefixMatch *string - SuffixMatch *string RangeMatch *Int64Range PresentMatch *bool StringMatch *matcher.StringMatcher diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_cds.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_cds.go index 151143a16fc..ea6d001d9ee 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_cds.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_cds.go @@ -29,6 +29,7 @@ import ( v3clusterpb "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3" v3corepb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" v3aggregateclusterpb "github.com/envoyproxy/go-control-plane/envoy/extensions/clusters/aggregate/v3" + v3http11proxypb "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3" v3tlspb "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3" "google.golang.org/grpc/internal/envconfig" @@ -161,7 +162,8 @@ func validateClusterAndConstructClusterUpdate(cluster *v3clusterpb.Cluster, serv // Process security configuration received from the control plane iff the // corresponding environment variable is set. var sc *SecurityConfig - if sc, err = securityConfigFromCluster(cluster); err != nil { + var isHTTP11ProxyEnabled bool + if sc, isHTTP11ProxyEnabled, err = securityConfigFromCluster(cluster); err != nil { return ClusterUpdate{}, err } @@ -232,6 +234,7 @@ func validateClusterAndConstructClusterUpdate(cluster *v3clusterpb.Cluster, serv TelemetryLabels: telemetryLabels, LRSReportEndpointMetrics: lrsReportEndpointMetrics, Metadata: metadata, + IsHTTP11ProxyEnabled: isHTTP11ProxyEnabled, } if lrs := cluster.GetLrsServer(); lrs != nil { @@ -318,50 +321,67 @@ func dnsHostNameFromCluster(cluster *v3clusterpb.Cluster) (string, error) { // securityConfigFromCluster extracts the relevant security configuration from // the received Cluster resource. -func securityConfigFromCluster(cluster *v3clusterpb.Cluster) (*SecurityConfig, error) { +func securityConfigFromCluster(cluster *v3clusterpb.Cluster) (*SecurityConfig, bool, error) { if tsm := cluster.GetTransportSocketMatches(); len(tsm) != 0 { - return nil, fmt.Errorf("unsupported transport_socket_matches field is non-empty: %+v", tsm) + return nil, false, fmt.Errorf("unsupported transport_socket_matches field is non-empty: %+v", tsm) } // The Cluster resource contains a `transport_socket` field, which contains // a oneof `typed_config` field of type `protobuf.Any`. The any proto // contains a marshaled representation of an `UpstreamTlsContext` message. ts := cluster.GetTransportSocket() if ts == nil { - return nil, nil + return nil, false, nil } + var isHTTP11ProxyEnabled bool + tc := ts.GetTypedConfig() + typeURL := tc.GetTypeUrl() + + if envconfig.XDSHTTPConnectEnabled && typeURL == version.V3HTTP11ProxyUpstreamTransportURL { + isHTTP11ProxyEnabled = true + http11Proxy := &v3http11proxypb.Http11ProxyUpstreamTransport{} + if err := proto.Unmarshal(tc.GetValue(), http11Proxy); err != nil { + return nil, false, fmt.Errorf("failed to unmarshal Http11ProxyUpstreamTransport in CDS response: %v", err) + } + ts = http11Proxy.GetTransportSocket() + if ts == nil { + return nil, true, nil + } + tc = ts.GetTypedConfig() + typeURL = tc.GetTypeUrl() + } + if name := ts.GetName(); name != transportSocketName { - return nil, fmt.Errorf("transport_socket field has unexpected name: %s", name) + return nil, false, fmt.Errorf("transport_socket field has unexpected name: %s", name) } - tc := ts.GetTypedConfig() - if typeURL := tc.GetTypeUrl(); typeURL != version.V3UpstreamTLSContextURL { - return nil, fmt.Errorf("transport_socket missing typed_config or wrong type_url: %q", typeURL) + if typeURL != version.V3UpstreamTLSContextURL { + return nil, false, fmt.Errorf("transport_socket missing typed_config or wrong type_url: %q", typeURL) } upstreamCtx := &v3tlspb.UpstreamTlsContext{} if err := proto.Unmarshal(tc.GetValue(), upstreamCtx); err != nil { - return nil, fmt.Errorf("failed to unmarshal UpstreamTlsContext in CDS response: %v", err) + return nil, false, fmt.Errorf("failed to unmarshal UpstreamTlsContext in CDS response: %v", err) } // The following fields from `UpstreamTlsContext` are ignored: // - allow_renegotiation // - max_session_keys if upstreamCtx.GetCommonTlsContext() == nil { - return nil, errors.New("UpstreamTlsContext in CDS response does not contain a CommonTlsContext") + return nil, false, errors.New("UpstreamTlsContext in CDS response does not contain a CommonTlsContext") } sc, err := securityConfigFromCommonTLSContext(upstreamCtx.GetCommonTlsContext(), false) if err != nil { - return nil, err + return nil, false, err } // Set SNI related fields in SecurityConfig from UpstreamTlsContext if // `GRPC_EXPERIMENTAL_XDS_SNI` is enabled. if envconfig.XDSSNIEnabled { sc.SNI = upstreamCtx.GetSni() if len(sc.SNI) > maxSNILength { - return nil, fmt.Errorf("SNI value %q in UpstreamTlsContext in CDS response exceeds max length of %d", sc.SNI, maxSNILength) + return nil, false, fmt.Errorf("SNI value %q in UpstreamTlsContext in CDS response exceeds max length of %d", sc.SNI, maxSNILength) } sc.UseAutoHostSNI = upstreamCtx.GetAutoHostSni() sc.AutoSNISANValidation = upstreamCtx.GetAutoSniSanValidation() } - return sc, nil + return sc, isHTTP11ProxyEnabled, nil } // common is expected to be not nil. diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go index 15a8e1036db..a053db22350 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/unmarshal_rds.go @@ -33,6 +33,7 @@ import ( "google.golang.org/protobuf/types/known/anypb" v3routepb "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" + v3matcherpb "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" v3typepb "github.com/envoyproxy/go-control-plane/envoy/type/v3" ) @@ -256,9 +257,13 @@ func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecif for _, h := range match.GetHeaders() { var header HeaderMatcher + // The deprecated exact/prefix/suffix/contains match fields are + // converted to the equivalent StringMatcher so that + // StringMatcherFromProto owns validation for all of them. + var smProto *v3matcherpb.StringMatcher switch ht := h.GetHeaderMatchSpecifier().(type) { case *v3routepb.HeaderMatcher_ExactMatch: - header.ExactMatch = &ht.ExactMatch + smProto = &v3matcherpb.StringMatcher{MatchPattern: &v3matcherpb.StringMatcher_Exact{Exact: ht.ExactMatch}} case *v3routepb.HeaderMatcher_SafeRegexMatch: regex := ht.SafeRegexMatch.GetRegex() re, err := matcher.CompileSafeRegex(regex) @@ -274,18 +279,26 @@ func routesProtoToSlice(routes []*v3routepb.Route, csps map[string]clusterspecif case *v3routepb.HeaderMatcher_PresentMatch: header.PresentMatch = &ht.PresentMatch case *v3routepb.HeaderMatcher_PrefixMatch: - header.PrefixMatch = &ht.PrefixMatch + smProto = &v3matcherpb.StringMatcher{MatchPattern: &v3matcherpb.StringMatcher_Prefix{Prefix: ht.PrefixMatch}} case *v3routepb.HeaderMatcher_SuffixMatch: - header.SuffixMatch = &ht.SuffixMatch + smProto = &v3matcherpb.StringMatcher{MatchPattern: &v3matcherpb.StringMatcher_Suffix{Suffix: ht.SuffixMatch}} + case *v3routepb.HeaderMatcher_ContainsMatch: + smProto = &v3matcherpb.StringMatcher{MatchPattern: &v3matcherpb.StringMatcher_Contains{Contains: ht.ContainsMatch}} case *v3routepb.HeaderMatcher_StringMatch: - sm, err := matcher.StringMatcherFromProto(ht.StringMatch) - if err != nil { - return nil, nil, fmt.Errorf("route %+v has an invalid string matcher: %v", err, ht.StringMatch) + if ht.StringMatch == nil { + return nil, nil, fmt.Errorf("route %+v has an empty string matcher", r) } - header.StringMatch = &sm + smProto = ht.StringMatch default: return nil, nil, fmt.Errorf("route %+v has an unrecognized header matcher: %+v", r, ht) } + if smProto != nil { + sm, err := matcher.StringMatcherFromProto(smProto) + if err != nil { + return nil, nil, fmt.Errorf("route %+v has an invalid header matcher: %v", r, err) + } + header.StringMatch = &sm + } header.Name = h.GetName() invert := h.GetInvertMatch() header.InvertMatch = &invert diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version/version.go b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version/version.go index 82ad5fe52c7..b1945925599 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version/version.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsclient/xdsresource/version/version.go @@ -30,12 +30,15 @@ const ( V3ClusterType = "envoy.config.cluster.v3.Cluster" V3EndpointsType = "envoy.config.endpoint.v3.ClusterLoadAssignment" - V3ResourceWrapperURL = googleapiPrefix + "envoy.service.discovery.v3.Resource" - V3ListenerURL = googleapiPrefix + V3ListenerType - V3RouteConfigURL = googleapiPrefix + V3RouteConfigType - V3ClusterURL = googleapiPrefix + V3ClusterType - V3EndpointsURL = googleapiPrefix + V3EndpointsType - V3HTTPConnManagerURL = googleapiPrefix + "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager" - V3UpstreamTLSContextURL = googleapiPrefix + "envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext" - V3DownstreamTLSContextURL = googleapiPrefix + "envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext" + V3ResourceWrapperURL = googleapiPrefix + "envoy.service.discovery.v3.Resource" + V3ListenerURL = googleapiPrefix + V3ListenerType + V3RouteConfigURL = googleapiPrefix + V3RouteConfigType + V3ClusterURL = googleapiPrefix + V3ClusterType + V3EndpointsURL = googleapiPrefix + V3EndpointsType + V3HTTPConnManagerURL = googleapiPrefix + "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager" + V3UpstreamTLSContextURL = googleapiPrefix + "envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext" + V3DownstreamTLSContextURL = googleapiPrefix + "envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext" + V3HTTP11ProxyUpstreamTransportURL = googleapiPrefix + "envoy.extensions.transport_sockets.http_11_proxy.v3.Http11ProxyUpstreamTransport" + V3AddressURL = googleapiPrefix + "envoy.config.core.v3.Address" + V3AudienceURL = googleapiPrefix + "envoy.extensions.filters.http.gcp_authn.v3.Audience" ) diff --git a/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/xds_dependency_manager.go b/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/xds_dependency_manager.go index 7ce0218440b..c0a7a58e0e6 100644 --- a/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/xds_dependency_manager.go +++ b/vendor/google.golang.org/grpc/internal/xds/xdsdepmgr/xds_dependency_manager.go @@ -498,6 +498,16 @@ func (m *DependencyManager) applyRouteConfigUpdateLocked(update *xdsresource.Rou } func (m *DependencyManager) onListenerResourceUpdate(update *xdsresource.ListenerUpdate, onDone func()) { + // A client-side listener update must contain API listener configuration. If + // it is nil, it indicates that a server-side listener (TCP Listener) resource + // was received instead. We report this error to the resolver watcher so it + // can transition the channel into TRANSIENT_FAILURE. + if update.APIListener == nil { + err := fmt.Errorf("client-side listener resource %q does not contain API listener configuration", m.ldsResourceName) + m.onListenerResourceError(err, onDone) + return + } + m.mu.Lock() defer m.mu.Unlock() @@ -512,7 +522,7 @@ func (m *DependencyManager) onListenerResourceUpdate(update *xdsresource.Listene m.listenerWatcher.setLastUpdate(update) - if update.APIListener != nil && update.APIListener.InlineRouteConfig != nil { + if update.APIListener.InlineRouteConfig != nil { // If there was a previous route config watcher because of a non-inline // route configuration, cancel it. m.rdsResourceName = "" @@ -527,10 +537,6 @@ func (m *DependencyManager) onListenerResourceUpdate(update *xdsresource.Listene // We get here only if there was no inline route configuration. If the route // config name has not changed, send an update with existing route // configuration and the newly received listener configuration. - if update.APIListener == nil { - m.logger.Errorf("Received a listener resource with no api_listener configuration") - return - } if m.rdsResourceName == update.APIListener.RouteConfigName { m.maybeSendUpdateLocked() return diff --git a/vendor/google.golang.org/grpc/mem/buffer_pool.go b/vendor/google.golang.org/grpc/mem/buffer_pool.go index 3b02b909164..aa121379fd5 100644 --- a/vendor/google.golang.org/grpc/mem/buffer_pool.go +++ b/vendor/google.golang.org/grpc/mem/buffer_pool.go @@ -59,10 +59,6 @@ func init() { internal.SetDefaultBufferPool = func(pool BufferPool) { defaultBufferPool = pool } - - internal.SetBufferPoolingThresholdForTesting = func(threshold int) { - bufferPoolingThreshold = threshold - } } // DefaultBufferPool returns the current default buffer pool. It is a BufferPool diff --git a/vendor/google.golang.org/grpc/mem/buffers.go b/vendor/google.golang.org/grpc/mem/buffers.go index 2b410b16ebd..9b355d4465b 100644 --- a/vendor/google.golang.org/grpc/mem/buffers.go +++ b/vendor/google.golang.org/grpc/mem/buffers.go @@ -29,6 +29,8 @@ import ( "fmt" "sync" "sync/atomic" + + "google.golang.org/grpc/internal/mem" ) // A Buffer represents a reference counted piece of data (in bytes) that can be @@ -63,8 +65,6 @@ type Buffer interface { } var ( - bufferPoolingThreshold = 1 << 10 - bufferObjectPool = sync.Pool{New: func() any { return new(buffer) }} ) @@ -72,7 +72,7 @@ var ( // equal to the threshold for buffer pooling. This is used to determine whether // to pool buffers or allocate them directly. func IsBelowBufferPoolingThreshold(size int) bool { - return size <= bufferPoolingThreshold + return size <= mem.BufferPoolingThreshold } type buffer struct { diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 4aac644a833..51aff85dfba 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -201,6 +201,15 @@ func endOfClientStream(cc *ClientConn, err error, opts ...CallOption) { } } +// clientInterceptor is structurally identical to the ClientInterceptor defined +// in internal/xds/httpfilter/httpfilter.go. It is defined locally here so that +// we can type-assert the generic Interceptor field in iresolver.RPCConfig +// without introducing a dependency on xDS packages. +type clientInterceptor interface { + NewStream(ctx context.Context, ri iresolver.RPCInfo, newStream func(ctx context.Context, opts ...CallOption) (ClientStream, error), opts ...CallOption) (ClientStream, error) + Close() +} + func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) { if channelz.IsOn() { cc.incrCallsStarted() @@ -244,8 +253,11 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth mc := &emptyMethodConfig var onCommit func() - newStream := func(ctx context.Context, done func()) (iresolver.ClientStream, error) { - return newClientStreamWithParams(ctx, desc, cc, method, mc, onCommit, done, nameResolutionDelayed, opts...) + newStream := func(ctx context.Context, filterOpts ...CallOption) (ClientStream, error) { + if filterOpts != nil { + opts = combine(opts, filterOpts) + } + return newClientStreamWithParams(ctx, desc, cc, method, mc, onCommit, nameResolutionDelayed, opts...) } rpcInfo := iresolver.RPCInfo{Context: ctx, Method: method} @@ -270,20 +282,24 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth if rpcConfig.Interceptor != nil { rpcInfo.Context = nil ns := newStream - newStream = func(ctx context.Context, done func()) (iresolver.ClientStream, error) { - cs, err := rpcConfig.Interceptor.NewStream(ctx, rpcInfo, done, ns) - if err != nil { - return nil, toRPCErr(err) + if interceptor, ok := rpcConfig.Interceptor.(clientInterceptor); ok { + newStream = func(ctx context.Context, filterOpts ...CallOption) (ClientStream, error) { + cs, err := interceptor.NewStream(ctx, rpcInfo, ns, filterOpts...) + if err != nil { + return nil, toRPCErr(err) + } + return cs, nil } - return cs, nil + } else { + return nil, status.Errorf(codes.Internal, "invalid client interceptor type %T", rpcConfig.Interceptor) } } } - return newStream(ctx, func() {}) + return newStream(ctx) } -func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, mc *serviceconfig.MethodConfig, onCommit, doneFunc func(), nameResolutionDelayed bool, opts ...CallOption) (_ iresolver.ClientStream, err error) { +func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, mc *serviceconfig.MethodConfig, onCommit func(), nameResolutionDelayed bool, opts ...CallOption) (_ ClientStream, err error) { callInfo := defaultCallInfo() if mc.WaitForReady != nil { callInfo.failFast = !*mc.WaitForReady @@ -321,7 +337,6 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client Host: cc.authority, Method: method, ContentSubtype: callInfo.contentSubtype, - DoneFunc: doneFunc, Authority: callInfo.authority, } if allowed := callInfo.acceptedResponseCompressors; len(allowed) > 0 { diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 53c737feeb9..64ec3b3cfd0 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.82.1" +const Version = "1.83.1" diff --git a/vendor/google.golang.org/grpc/xds/googledirectpath/googlec2p.go b/vendor/google.golang.org/grpc/xds/googledirectpath/googlec2p.go index 50f64889a2a..ed0e8e22d50 100644 --- a/vendor/google.golang.org/grpc/xds/googledirectpath/googlec2p.go +++ b/vendor/google.golang.org/grpc/xds/googledirectpath/googlec2p.go @@ -136,24 +136,38 @@ func (c2pResolverBuilder) Build(t resolver.Target, cc resolver.ClientConn, opts return nil, fmt.Errorf("google-c2p URI scheme does not support authorities") } - if !runDirectPath() { + isGCE := onGCE() + // We check only for the presence of the "force-xds" query parameter key, + // and do not evaluate its value. + _, forceXDS := t.URL.Query()["force-xds"] + if !forceXDS && !isGCE { // If not xDS, fallback to DNS. t.URL.Scheme = dnsName return resolver.Get(dnsName).Build(t, cc, opts) } - // Note that the following calls to getZone() and getIPv6Capable() does I/O, - // and has 10 seconds timeout each. - // - // This should be fine in most of the cases. In certain error cases, this - // could block Dial() for up to 10 seconds (each blocking call has its own - // goroutine). - zoneCh, ipv6CapableCh := make(chan string), make(chan bool) - go func() { zoneCh <- getZone(httpReqTimeout) }() - go func() { ipv6CapableCh <- getIPv6Capable(httpReqTimeout) }() + var zone string + var ipv6Capable bool + if forceXDS { + // If the force-xds query parameter is present, GCE metadata server + // queries are bypassed. + zone = "" + ipv6Capable = true + } else { + // Note that the following calls to getZone() and getIPv6Capable() does I/O, + // and has 10 seconds timeout each. + // + // This should be fine in most of the cases. In certain error cases, this + // could block Dial() for up to 10 seconds (each blocking call has its own + // goroutine). + var wg sync.WaitGroup + wg.Go(func() { zone = getZone(httpReqTimeout) }) + wg.Go(func() { ipv6Capable = getIPv6Capable(httpReqTimeout) }) + wg.Wait() + } xdsServerURI := getXdsServerURI() - nodeCfg := newNodeConfig(<-zoneCh, <-ipv6CapableCh) + nodeCfg := newNodeConfig(zone, ipv6Capable, forceXDS) xdsServerCfg := newXdsServerConfig(xdsServerURI) authoritiesCfg := newAuthoritiesConfig(xdsServerCfg) @@ -203,10 +217,16 @@ func (b c2pResolverBuilder) Scheme() string { return c2pScheme } -func newNodeConfig(zone string, ipv6Capable bool) map[string]any { +func newNodeConfig(zone string, ipv6Capable bool, forceXDS bool) map[string]any { + prefix := "C2P" + if forceXDS { + prefix = "C2P-non-gcp" + } node := map[string]any{ - "id": fmt.Sprintf("C2P-%d", randInt()), - "locality": map[string]any{"zone": zone}, + "id": fmt.Sprintf("%s-%d", prefix, randInt()), + } + if zone != "" { + node["locality"] = map[string]any{"zone": zone} } // Enable dualstack endpoints in TD. if ipv6Capable { @@ -228,10 +248,3 @@ func newXdsServerConfig(uri string) map[string]any { "server_features": []any{"ignore_resource_deletion"}, } } - -// runDirectPath returns whether this resolver should use direct path. -// -// direct path is enabled if this client is running on GCE. -func runDirectPath() bool { - return onGCE() -} diff --git a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb index 04696351eeeef14cbbd69fd1f4250530b1fbfd56..ad35ea4c449a6b23a78974a905b3fcba120223c6 100644 GIT binary patch delta 50 zcmbQmxSw&t6m2eLiGDvNNe)H>4lG0U`MWs{jB1 diff --git a/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go b/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go index 328dc733b04..079a53dd15a 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go @@ -69,19 +69,19 @@ func Unmarshal(s string, k protoreflect.Kind, evs protoreflect.EnumValueDescript } } case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - if v, err := strconv.ParseInt(s, 10, 32); err == nil { + if v, err := strconv.ParseInt(s, 0, 32); err == nil { return protoreflect.ValueOfInt32(int32(v)), nil, nil } case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - if v, err := strconv.ParseInt(s, 10, 64); err == nil { + if v, err := strconv.ParseInt(s, 0, 64); err == nil { return protoreflect.ValueOfInt64(int64(v)), nil, nil } case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - if v, err := strconv.ParseUint(s, 10, 32); err == nil { + if v, err := strconv.ParseUint(s, 0, 32); err == nil { return protoreflect.ValueOfUint32(uint32(v)), nil, nil } case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - if v, err := strconv.ParseUint(s, 10, 64); err == nil { + if v, err := strconv.ParseUint(s, 0, 64); err == nil { return protoreflect.ValueOfUint64(uint64(v)), nil, nil } case protoreflect.FloatKind, protoreflect.DoubleKind: diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 65aaf4d210a..58aeff8456d 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -26,6 +26,7 @@ const ( Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 Edition_EDITION_2024_enum_value = 1001 + Edition_EDITION_2026_enum_value = 1002 Edition_EDITION_UNSTABLE_enum_value = 9999 Edition_EDITION_1_TEST_ONLY_enum_value = 1 Edition_EDITION_2_TEST_ONLY_enum_value = 2 @@ -806,11 +807,13 @@ const ( FieldOptions_FeatureSupport_EditionDeprecated_field_name protoreflect.Name = "edition_deprecated" FieldOptions_FeatureSupport_DeprecationWarning_field_name protoreflect.Name = "deprecation_warning" FieldOptions_FeatureSupport_EditionRemoved_field_name protoreflect.Name = "edition_removed" + FieldOptions_FeatureSupport_RemovalError_field_name protoreflect.Name = "removal_error" FieldOptions_FeatureSupport_EditionIntroduced_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_introduced" FieldOptions_FeatureSupport_EditionDeprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_deprecated" FieldOptions_FeatureSupport_DeprecationWarning_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.deprecation_warning" FieldOptions_FeatureSupport_EditionRemoved_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_removed" + FieldOptions_FeatureSupport_RemovalError_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.removal_error" ) // Field numbers for google.protobuf.FieldOptions.FeatureSupport. @@ -819,6 +822,7 @@ const ( FieldOptions_FeatureSupport_EditionDeprecated_field_number protoreflect.FieldNumber = 2 FieldOptions_FeatureSupport_DeprecationWarning_field_number protoreflect.FieldNumber = 3 FieldOptions_FeatureSupport_EditionRemoved_field_number protoreflect.FieldNumber = 4 + FieldOptions_FeatureSupport_RemovalError_field_number protoreflect.FieldNumber = 5 ) // Names for google.protobuf.OneofOptions. @@ -1152,6 +1156,7 @@ const ( FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN_enum_value = 0 FeatureSet_STYLE2024_enum_value = 1 FeatureSet_STYLE_LEGACY_enum_value = 2 + FeatureSet_STYLE2026_enum_value = 3 ) // Names for google.protobuf.FeatureSet.VisibilityFeature. diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index bfb2cfdea5b..58ff0e24644 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -52,8 +52,8 @@ import ( const ( Major = 1 Minor = 36 - Patch = 11 - PreRelease = "devel" + Patch = 12 + PreRelease = "" ) // String formats the version string for this module in semver format. diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go index 730331e6668..86f0d092620 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go @@ -546,6 +546,8 @@ func (p *SourcePath) appendFieldOptions_FeatureSupport(b []byte) []byte { b = p.appendSingularField(b, "deprecation_warning", nil) case 4: b = p.appendSingularField(b, "edition_removed", nil) + case 5: + b = p.appendSingularField(b, "removal_error", nil) } return b } diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 0b23faa957c..a51cb1e546c 100644 --- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -1,32 +1,9 @@ // Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ +// Copyright 2008 Google LLC. All rights reserved. // -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by @@ -69,6 +46,7 @@ const ( // comparison. Edition_EDITION_2023 Edition = 1000 Edition_EDITION_2024 Edition = 1001 + Edition_EDITION_2026 Edition = 1002 // A placeholder edition for developing and testing unscheduled features. Edition_EDITION_UNSTABLE Edition = 9999 // Placeholder editions for testing feature resolution. These should not be @@ -93,6 +71,7 @@ var ( 999: "EDITION_PROTO3", 1000: "EDITION_2023", 1001: "EDITION_2024", + 1002: "EDITION_2026", 9999: "EDITION_UNSTABLE", 1: "EDITION_1_TEST_ONLY", 2: "EDITION_2_TEST_ONLY", @@ -108,6 +87,7 @@ var ( "EDITION_PROTO3": 999, "EDITION_2023": 1000, "EDITION_2024": 1001, + "EDITION_2026": 1002, "EDITION_UNSTABLE": 9999, "EDITION_1_TEST_ONLY": 1, "EDITION_2_TEST_ONLY": 2, @@ -1213,6 +1193,7 @@ const ( FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN FeatureSet_EnforceNamingStyle = 0 FeatureSet_STYLE2024 FeatureSet_EnforceNamingStyle = 1 FeatureSet_STYLE_LEGACY FeatureSet_EnforceNamingStyle = 2 + FeatureSet_STYLE2026 FeatureSet_EnforceNamingStyle = 3 ) // Enum value maps for FeatureSet_EnforceNamingStyle. @@ -1221,11 +1202,13 @@ var ( 0: "ENFORCE_NAMING_STYLE_UNKNOWN", 1: "STYLE2024", 2: "STYLE_LEGACY", + 3: "STYLE2026", } FeatureSet_EnforceNamingStyle_value = map[string]int32{ "ENFORCE_NAMING_STYLE_UNKNOWN": 0, "STYLE2024": 1, "STYLE_LEGACY": 2, + "STYLE2026": 3, } ) @@ -4204,8 +4187,11 @@ type FieldOptions_FeatureSupport struct { // this one, the last default assigned will be used, and proto files will // not be able to override it. EditionRemoved *Edition `protobuf:"varint,4,opt,name=edition_removed,json=editionRemoved,enum=google.protobuf.Edition" json:"edition_removed,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // The removal error text if this feature is used after the edition it was + // removed in. + RemovalError *string `protobuf:"bytes,5,opt,name=removal_error,json=removalError" json:"removal_error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FieldOptions_FeatureSupport) Reset() { @@ -4266,6 +4252,13 @@ func (x *FieldOptions_FeatureSupport) GetEditionRemoved() Edition { return Edition_EDITION_UNKNOWN } +func (x *FieldOptions_FeatureSupport) GetRemovalError() string { + if x != nil && x.RemovalError != nil { + return *x.RemovalError + } + return "" +} + // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). @@ -4719,7 +4712,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\aoptions\x18\x03 \x01(\v2&.google.protobuf.ExtensionRangeOptionsR\aoptions\x1a7\n" + "\rReservedRange\x12\x14\n" + "\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" + - "\x03end\x18\x02 \x01(\x05R\x03end\"\xcc\x04\n" + + "\x03end\x18\x02 \x01(\x05R\x03end\"\xd4\x04\n" + "\x15ExtensionRangeOptions\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x12Y\n" + "\vdeclaration\x18\x02 \x03(\v22.google.protobuf.ExtensionRangeOptions.DeclarationB\x03\x88\x01\x02R\vdeclaration\x127\n" + @@ -4735,7 +4728,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x11VerificationState\x12\x0f\n" + "\vDECLARATION\x10\x00\x12\x0e\n" + "\n" + - "UNVERIFIED\x10\x01*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" + + "UNVERIFIED\x10\x01*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xc1\x06\n" + "\x14FieldDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x03 \x01(\x05R\x06number\x12A\n" + @@ -4810,12 +4803,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "outputType\x128\n" + "\aoptions\x18\x04 \x01(\v2\x1e.google.protobuf.MethodOptionsR\aoptions\x120\n" + "\x10client_streaming\x18\x05 \x01(\b:\x05falseR\x0fclientStreaming\x120\n" + - "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xad\t\n" + + "\x10server_streaming\x18\x06 \x01(\b:\x05falseR\x0fserverStreaming\"\xfa\n" + + "\n" + "\vFileOptions\x12!\n" + "\fjava_package\x18\x01 \x01(\tR\vjavaPackage\x120\n" + - "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x125\n" + + "\x14java_outer_classname\x18\b \x01(\tR\x12javaOuterClassname\x12\xf9\x01\n" + "\x13java_multiple_files\x18\n" + - " \x01(\b:\x05falseR\x11javaMultipleFiles\x12D\n" + + " \x01(\b:\x05falseB\xc1\x01\xb2\x01\xbd\x01\b\xe6\a \xe9\a*\xb4\x01This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.R\x11javaMultipleFiles\x12D\n" + "\x1djava_generate_equals_and_hash\x18\x14 \x01(\bB\x02\x18\x01R\x19javaGenerateEqualsAndHash\x12:\n" + "\x16java_string_check_utf8\x18\x1b \x01(\b:\x05falseR\x13javaStringCheckUtf8\x12S\n" + "\foptimize_for\x18\t \x01(\x0e2).google.protobuf.FileOptions.OptimizeMode:\x05SPEEDR\voptimizeFor\x12\x1d\n" + @@ -4840,7 +4834,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\fOptimizeMode\x12\t\n" + "\x05SPEED\x10\x01\x12\r\n" + "\tCODE_SIZE\x10\x02\x12\x10\n" + - "\fLITE_RUNTIME\x10\x03*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xf4\x03\n" + + "\fLITE_RUNTIME\x10\x03*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b*\x10+J\x04\b&\x10'R\x14php_generic_services\"\xfc\x03\n" + "\x0eMessageOptions\x12<\n" + "\x17message_set_wire_format\x18\x01 \x01(\b:\x05falseR\x14messageSetWireFormat\x12L\n" + "\x1fno_standard_descriptor_accessor\x18\x02 \x01(\b:\x05falseR\x1cnoStandardDescriptorAccessor\x12%\n" + @@ -4850,8 +4844,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\tmap_entry\x18\a \x01(\bR\bmapEntry\x12V\n" + "&deprecated_legacy_json_field_conflicts\x18\v \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\f \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" + - "\"\xa1\r\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" + + "\"\xce\r\n" + "\fFieldOptions\x12A\n" + "\x05ctype\x18\x01 \x01(\x0e2#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05ctype\x12\x16\n" + "\x06packed\x18\x02 \x01(\bR\x06packed\x12G\n" + @@ -4872,12 +4866,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption\x1aZ\n" + "\x0eEditionDefault\x122\n" + "\aedition\x18\x03 \x01(\x0e2\x18.google.protobuf.EditionR\aedition\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value\x1a\x96\x02\n" + + "\x05value\x18\x02 \x01(\tR\x05value\x1a\xbb\x02\n" + "\x0eFeatureSupport\x12G\n" + "\x12edition_introduced\x18\x01 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionIntroduced\x12G\n" + "\x12edition_deprecated\x18\x02 \x01(\x0e2\x18.google.protobuf.EditionR\x11editionDeprecated\x12/\n" + "\x13deprecation_warning\x18\x03 \x01(\tR\x12deprecationWarning\x12A\n" + - "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\"/\n" + + "\x0fedition_removed\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eeditionRemoved\x12#\n" + + "\rremoval_error\x18\x05 \x01(\tR\fremovalError\"/\n" + "\x05CType\x12\n" + "\n" + "\x06STRING\x10\x00\x12\b\n" + @@ -4901,10 +4896,10 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x10TARGET_TYPE_ENUM\x10\x06\x12\x1a\n" + "\x16TARGET_TYPE_ENUM_ENTRY\x10\a\x12\x17\n" + "\x13TARGET_TYPE_SERVICE\x10\b\x12\x16\n" + - "\x12TARGET_TYPE_METHOD\x10\t*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xac\x01\n" + + "\x12TARGET_TYPE_METHOD\x10\t*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x12\x10\x13\"\xb4\x01\n" + "\fOneofOptions\x127\n" + "\bfeatures\x18\x01 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd1\x02\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd9\x02\n" + "\vEnumOptions\x12\x1f\n" + "\vallow_alias\x18\x02 \x01(\bR\n" + "allowAlias\x12%\n" + @@ -4913,7 +4908,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "deprecated\x12V\n" + "&deprecated_legacy_json_field_conflicts\x18\x06 \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\a \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xd8\x02\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x05\x10\x06\"\xe0\x02\n" + "\x10EnumValueOptions\x12%\n" + "\n" + "deprecated\x18\x01 \x01(\b:\x05falseR\n" + @@ -4921,13 +4916,13 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bfeatures\x18\x02 \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12(\n" + "\fdebug_redact\x18\x03 \x01(\b:\x05falseR\vdebugRedact\x12U\n" + "\x0ffeature_support\x18\x04 \x01(\v2,.google.protobuf.FieldOptions.FeatureSupportR\x0efeatureSupport\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xd5\x01\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xdd\x01\n" + "\x0eServiceOptions\x127\n" + "\bfeatures\x18\" \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12%\n" + "\n" + "deprecated\x18! \x01(\b:\x05falseR\n" + "deprecated\x12X\n" + - "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x99\x03\n" + + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\xa1\x03\n" + "\rMethodOptions\x12%\n" + "\n" + "deprecated\x18! \x01(\b:\x05falseR\n" + @@ -4939,7 +4934,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x13IDEMPOTENCY_UNKNOWN\x10\x00\x12\x13\n" + "\x0fNO_SIDE_EFFECTS\x10\x01\x12\x0e\n" + "\n" + - "IDEMPOTENT\x10\x02*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" + + "IDEMPOTENT\x10\x02*\x06\b\xde\a\x10\xe7\a*\t\b\xe8\a\x10\x80\x80\x80\x80\x02\"\x9a\x03\n" + "\x13UninterpretedOption\x12A\n" + "\x04name\x18\x02 \x03(\v2-.google.protobuf.UninterpretedOption.NamePartR\x04name\x12)\n" + "\x10identifier_value\x18\x03 \x01(\tR\x0fidentifierValue\x12,\n" + @@ -4950,7 +4945,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x0faggregate_value\x18\b \x01(\tR\x0eaggregateValue\x1aJ\n" + "\bNamePart\x12\x1b\n" + "\tname_part\x18\x01 \x02(\tR\bnamePart\x12!\n" + - "\fis_extension\x18\x02 \x02(\bR\visExtension\"\x8e\x0f\n" + + "\fis_extension\x18\x02 \x02(\bR\visExtension\"\xae\x0f\n" + "\n" + "FeatureSet\x12\x91\x01\n" + "\x0efield_presence\x18\x01 \x01(\x0e2).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\bEXPLICIT\x18\x84\a\xa2\x01\r\x12\bIMPLICIT\x18\xe7\a\xa2\x01\r\x12\bEXPLICIT\x18\xe8\a\xb2\x01\x03\b\xe8\aR\rfieldPresence\x12l\n" + @@ -4960,8 +4955,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x10message_encoding\x18\x05 \x01(\x0e2+.google.protobuf.FeatureSet.MessageEncodingB&\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\x14\x12\x0fLENGTH_PREFIXED\x18\x84\a\xb2\x01\x03\b\xe8\aR\x0fmessageEncoding\x12\x82\x01\n" + "\vjson_format\x18\x06 \x01(\x0e2&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\a\xa2\x01\n" + "\x12\x05ALLOW\x18\xe7\a\xb2\x01\x03\b\xe8\aR\n" + - "jsonFormat\x12\xab\x01\n" + - "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" + + "jsonFormat\x12\xbc\x01\n" + + "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBZ\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xa2\x01\x0e\x12\tSTYLE2026\x18\x8fN\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" + "\x19default_symbol_visibility\x18\b \x01(\x0e2E.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\n" + "EXPORT_ALL\x18\x84\a\xa2\x01\x15\x12\x10EXPORT_TOP_LEVEL\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x17defaultSymbolVisibility\x1a\xa1\x01\n" + "\x11VisibilityFeature\"\x81\x01\n" + @@ -5001,11 +4996,12 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "JsonFormat\x12\x17\n" + "\x13JSON_FORMAT_UNKNOWN\x10\x00\x12\t\n" + "\x05ALLOW\x10\x01\x12\x16\n" + - "\x12LEGACY_BEST_EFFORT\x10\x02\"W\n" + + "\x12LEGACY_BEST_EFFORT\x10\x02\"f\n" + "\x12EnforceNamingStyle\x12 \n" + "\x1cENFORCE_NAMING_STYLE_UNKNOWN\x10\x00\x12\r\n" + "\tSTYLE2024\x10\x01\x12\x10\n" + - "\fSTYLE_LEGACY\x10\x02*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" + + "\fSTYLE_LEGACY\x10\x02\x12\r\n" + + "\tSTYLE2026\x10\x03*\x06\b\xe8\a\x10\x8bN*\x06\b\x8bN\x10\x90N*\x06\b\x90N\x10\x91NJ\x06\b\xe7\a\x10\xe8\a\"\xef\x03\n" + "\x12FeatureSetDefaults\x12X\n" + "\bdefaults\x18\x01 \x03(\v2<.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefaultR\bdefaults\x12A\n" + "\x0fminimum_edition\x18\x04 \x01(\x0e2\x18.google.protobuf.EditionR\x0eminimumEdition\x12A\n" + @@ -5037,14 +5033,15 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bSemantic\x12\b\n" + "\x04NONE\x10\x00\x12\a\n" + "\x03SET\x10\x01\x12\t\n" + - "\x05ALIAS\x10\x02*\xbe\x02\n" + + "\x05ALIAS\x10\x02*\xd1\x02\n" + "\aEdition\x12\x13\n" + "\x0fEDITION_UNKNOWN\x10\x00\x12\x13\n" + "\x0eEDITION_LEGACY\x10\x84\a\x12\x13\n" + "\x0eEDITION_PROTO2\x10\xe6\a\x12\x13\n" + "\x0eEDITION_PROTO3\x10\xe7\a\x12\x11\n" + "\fEDITION_2023\x10\xe8\a\x12\x11\n" + - "\fEDITION_2024\x10\xe9\a\x12\x15\n" + + "\fEDITION_2024\x10\xe9\a\x12\x11\n" + + "\fEDITION_2026\x10\xea\a\x12\x15\n" + "\x10EDITION_UNSTABLE\x10\x8fN\x12\x17\n" + "\x13EDITION_1_TEST_ONLY\x10\x01\x12\x17\n" + "\x13EDITION_2_TEST_ONLY\x10\x02\x12\x1d\n" + diff --git a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go index 1ff0d1494d4..510894f2b0d 100644 --- a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go @@ -128,120 +128,66 @@ import ( // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// // or ... -// if (any.isSameTypeAs(Foo.getDefaultInstance())) { -// foo = any.unpack(Foo.getDefaultInstance()); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } +// In its binary encoding, an `Any` is an ordinary message; but in other wire +// forms like JSON, it has a special encoding. The format of the type URL is +// described on the `type_url` field. +// +// Protobuf APIs provide utilities to interact with `Any` values: +// +// - A 'pack' operation accepts a message and constructs a generic `Any` wrapper +// around it. +// - An 'unpack' operation reads the content of an `Any` message, either into an +// existing message or a new one. Unpack operations must check the type of the +// value they unpack against the declared `type_url`. +// - An 'is' operation decides whether an `Any` contains a message of the given +// type, i.e. whether it can 'unpack' that type. +// +// The JSON format representation of an `Any` follows one of these cases: +// +// - For types without special-cased JSON encodings, the JSON format +// representation of the `Any` is the same as that of the message, with an +// additional `@type` field which contains the type URL. +// - For types with special-cased JSON encodings (typically called 'well-known' +// types, listed in https://protobuf.dev/programming-guides/json/#any), the +// JSON format representation has a key `@type` which contains the type URL +// and a key `value` which contains the JSON-serialized value. +// +// The text format representation of an `Any` is like a message with one field +// whose name is the type URL in brackets. For example, an `Any` containing a +// `foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`. type Any struct { state protoimpl.MessageState `protogen:"open.v1"` - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). + // Identifies the type of the serialized Protobuf message with a URI reference + // consisting of a prefix ending in a slash and the fully-qualified type name. + // + // Example: type.googleapis.com/google.protobuf.StringValue // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: + // This string must contain at least one `/` character, and the content after + // the last `/` must be the fully-qualified name of the type in canonical + // form, without a leading dot. Do not write a scheme on these URI references + // so that clients do not attempt to contact them. // - // - If no scheme is provided, `https` is assumed. - // - An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // - Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) + // The prefix is arbitrary and Protobuf implementations are expected to + // simply strip off everything up to and including the last `/` to identify + // the type. `type.googleapis.com/` is a common default prefix that some + // legacy implementations require. This prefix does not indicate the origin of + // the type, and URIs containing it are not expected to respond to any + // requests. // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. As of May 2023, there are no widely used type server - // implementations and no plans to implement one. + // All type URL strings must be legal URI references with the additional + // restriction (for the text format) that the content of the reference + // must consist only of alphanumeric characters, percent-encoded escapes, and + // characters in the following set (not including the outer backticks): + // `/-.~_!$&()*+,;=`. Despite our allowing percent encodings, implementations + // should not unescape them to prevent confusion with existing parsers. For + // example, `type.googleapis.com%2FFoo` should be rejected. // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. + // In the original design of `Any`, the possibility of launching a type + // resolution service at these type URLs was considered but Protobuf never + // implemented one and considers contacting these URLs to be problematic and + // a potential security issue. Do not attempt to contact type URLs. TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` - // Must be a valid serialized protocol buffer of the above specified type. + // Holds a Protobuf serialization of the type described by type_url. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache diff --git a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go index 91ee89a5cd9..4a0437911d9 100644 --- a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go @@ -197,24 +197,22 @@ import ( // An implementation may provide options to override this default behavior for // repeated and message fields. // -// In order to reset a field's value to the default, the field must -// be in the mask and set to the default value in the provided resource. -// Hence, in order to reset all fields of a resource, provide a default -// instance of the resource and set all fields in the mask, or do -// not provide a mask as described below. -// -// If a field mask is not present on update, the operation applies to -// all fields (as if a field mask of all fields has been specified). -// Note that in the presence of schema evolution, this may mean that -// fields the client does not know and has therefore not filled into -// the request will be reset to their default. If this is unwanted -// behavior, a specific service may require a client to always specify -// a field mask, producing an error if not. -// -// As with get operations, the location of the resource which -// describes the updated values in the request message depends on the -// operation kind. In any case, the effect of the field mask is -// required to be honored by the API. +// Note that libraries which implement FieldMask resolution have various +// different behaviors in the face of empty masks or the special "*" mask. +// When implementing a service you should confirm these cases have the +// appropriate behavior in the underlying FieldMask library that you desire, +// and you may need to special case those cases in your application code if +// the underlying field mask library behavior differs from your intended +// service semantics. +// +// Update methods implementing https://google.aip.dev/134 +// - MUST support the special value * meaning "full replace" +// - MUST treat an omitted field mask as "replace fields which are present". +// +// Other methods implementing https://google.aip.dev/157 +// - SHOULD support the special value "*" to mean "get all". +// - MUST treat an omitted field mask to mean "get all", unless otherwise +// documented. // // ## Considerations for HTTP REST // diff --git a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go index 30411b72838..8325a504892 100644 --- a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go @@ -131,10 +131,15 @@ import ( unsafe "unsafe" ) -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. +// Represents a JSON `null`. // -// The JSON representation for `NullValue` is JSON `null`. +// `NullValue` is a sentinel, using an enum with only one value to represent +// the null value for the `Value` type union. +// +// A field of type `NullValue` with any value other than `0` is considered +// invalid. Most ProtoJSON serializers will emit a Value with a `null_value` set +// as a JSON `null` regardless of the integer value, and so will round trip to +// a `0` value. type NullValue int32 const ( @@ -179,14 +184,19 @@ func (NullValue) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0} } -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. +// Represents a JSON object. +// +// An unordered key-value map, intending to perfectly capture the semantics of a +// JSON object. This enables parsing any arbitrary JSON payload as a message +// field in ProtoJSON format. +// +// This follows RFC 8259 guidelines for interoperable JSON: notably this type +// cannot represent large Int64 values or `NaN`/`Infinity` numbers, +// since the JSON format generally does not support those values in its number +// type. // -// The JSON representation for `Struct` is JSON object. +// If you do not intend to parse arbitrary JSON into your message, a custom +// typed message should be preferred instead of using this type. type Struct struct { state protoimpl.MessageState `protogen:"open.v1"` // Unordered map of dynamically typed values. @@ -269,12 +279,12 @@ func (x *Struct) GetFields() map[string]*Value { return nil } +// Represents a JSON value. +// // `Value` represents a dynamically typed value which can be either // null, a number, a string, a boolean, a recursive struct value, or a // list of values. A producer of value is expected to set one of these -// variants. Absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. +// variants. Absence of any variant is an invalid state. type Value struct { state protoimpl.MessageState `protogen:"open.v1"` // The kind of value. @@ -548,32 +558,35 @@ type isValue_Kind interface { } type Value_NullValue struct { - // Represents a null value. + // Represents a JSON `null`. NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` } type Value_NumberValue struct { - // Represents a double value. + // Represents a JSON number. Must not be `NaN`, `Infinity` or + // `-Infinity`, since those are not supported in JSON. This also cannot + // represent large Int64 values, since JSON format generally does not + // support them in its number type. NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"` } type Value_StringValue struct { - // Represents a string value. + // Represents a JSON string. StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"` } type Value_BoolValue struct { - // Represents a boolean value. + // Represents a JSON boolean (`true` or `false` literal in JSON). BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"` } type Value_StructValue struct { - // Represents a structured value. + // Represents a JSON object. StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"` } type Value_ListValue struct { - // Represents a repeated `Value`. + // Represents a JSON array. ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"` } @@ -589,9 +602,7 @@ func (*Value_StructValue) isValue_Kind() {} func (*Value_ListValue) isValue_Kind() {} -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. +// Represents a JSON array. type ListValue struct { state protoimpl.MessageState `protogen:"open.v1"` // Repeated field of dynamically typed values. diff --git a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go index 484c21fd536..2cd60946cf0 100644 --- a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go @@ -153,8 +153,8 @@ import ( // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required. A proto3 JSON serializer should always use UTC (as indicated by -// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// is required. A ProtoJSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a ProtoJSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past @@ -173,7 +173,7 @@ import ( type Timestamp struct { state protoimpl.MessageState `protogen:"open.v1"` // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must - // be between -315576000000 and 315576000000 inclusive (which corresponds to + // be between -62135596800 and 253402300799 inclusive (which corresponds to // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Non-negative fractions of a second at nanosecond resolution. This field is diff --git a/vendor/gopkg.in/ini.v1/key.go b/vendor/gopkg.in/ini.v1/key.go index b1ef5c96d7f..800d04a473b 100644 --- a/vendor/gopkg.in/ini.v1/key.go +++ b/vendor/gopkg.in/ini.v1/key.go @@ -15,12 +15,12 @@ package ini import ( - "bytes" "errors" "fmt" "strconv" "strings" "time" + "unicode/utf8" ) // Key represents a key under a section. @@ -495,31 +495,38 @@ func (k *Key) Strings(delim string) []string { return []string{} } - runes := []rune(str) - vals := make([]string, 0, 2) - var buf bytes.Buffer - escape := false - idx := 0 + maxParts := strings.Count(str, delim) + 1 + vals := make([]string, 0, maxParts) + + var buf strings.Builder + buf.Grow(len(str)) + + i := 0 for { - if escape { - escape = false - if runes[idx] != '\\' && !strings.HasPrefix(string(runes[idx:]), delim) { + if str[i] == '\\' { + i++ + if i >= len(str) { + break + } + + if str[i] != '\\' && !strings.HasPrefix(str[i:], delim) { buf.WriteRune('\\') } - buf.WriteRune(runes[idx]) + + r, size := utf8.DecodeRuneInString(str[i:]) + i += size + buf.WriteRune(r) + } else if strings.HasPrefix(str[i:], delim) { + i += len(delim) + vals = append(vals, strings.TrimSpace(buf.String())) + buf.Reset() } else { - if runes[idx] == '\\' { - escape = true - } else if strings.HasPrefix(string(runes[idx:]), delim) { - idx += len(delim) - 1 - vals = append(vals, strings.TrimSpace(buf.String())) - buf.Reset() - } else { - buf.WriteRune(runes[idx]) - } + r, size := utf8.DecodeRuneInString(str[i:]) + i += size + buf.WriteRune(r) } - idx++ - if idx == len(runes) { + + if i >= len(str) { break } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 3b125fca9c0..6ea3bec9424 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# cel.dev/expr v0.25.1 +# cel.dev/expr v0.25.3 ## explicit; go 1.23.0 cel.dev/expr # cloud.google.com/go v0.123.0 @@ -7,10 +7,12 @@ cloud.google.com/go/internal cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version -# cloud.google.com/go/auth v0.23.0 +# cloud.google.com/go/auth v0.23.2 ## explicit; go 1.25.0 cloud.google.com/go/auth cloud.google.com/go/auth/credentials +cloud.google.com/go/auth/credentials/idtoken +cloud.google.com/go/auth/credentials/impersonate cloud.google.com/go/auth/credentials/internal/externalaccount cloud.google.com/go/auth/credentials/internal/externalaccountuser cloud.google.com/go/auth/credentials/internal/gdch @@ -123,8 +125,8 @@ github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity github.com/AzureAD/microsoft-authentication-library-for-go/apps/public -# github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 -## explicit; go 1.24.0 +# github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 +## explicit; go 1.25.0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp # github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.60.0 ## explicit; go 1.25.0 @@ -163,15 +165,14 @@ github.com/alicebob/miniredis/v2/metro github.com/alicebob/miniredis/v2/proto github.com/alicebob/miniredis/v2/server github.com/alicebob/miniredis/v2/size -# github.com/andybalholm/brotli v1.2.2 +# github.com/andybalholm/brotli v1.2.4 ## explicit; go 1.22 github.com/andybalholm/brotli -github.com/andybalholm/brotli/flate github.com/andybalholm/brotli/matchfinder # github.com/antchfx/xmlquery v1.5.1 ## explicit; go 1.14 github.com/antchfx/xmlquery -# github.com/antchfx/xpath v1.3.6 +# github.com/antchfx/xpath v1.3.8 ## explicit; go 1.14 github.com/antchfx/xpath # github.com/apache/thrift v0.24.0 @@ -237,7 +238,7 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 github.com/aws/aws-sdk-go-v2/internal/v4a github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4 -# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.15 +# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 ## explicit; go 1.24 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding # github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.35 @@ -263,7 +264,7 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc/types github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.27.6 +# github.com/aws/smithy-go v1.28.1 ## explicit; go 1.24 github.com/aws/smithy-go github.com/aws/smithy-go/auth @@ -313,10 +314,10 @@ github.com/bits-and-blooms/bloom/v3 # github.com/buger/jsonparser v1.6.1 ## explicit; go 1.13 github.com/buger/jsonparser -# github.com/bytedance/gopkg v0.1.3 +# github.com/bytedance/gopkg v0.1.4 ## explicit; go 1.18 github.com/bytedance/gopkg/lang/dirtmake -# github.com/bytedance/sonic v1.15.1 +# github.com/bytedance/sonic v1.15.4 ## explicit; go 1.18 github.com/bytedance/sonic github.com/bytedance/sonic/ast @@ -351,7 +352,7 @@ github.com/bytedance/sonic/internal/utils github.com/bytedance/sonic/option github.com/bytedance/sonic/unquote github.com/bytedance/sonic/utf8 -# github.com/bytedance/sonic/loader v0.5.1 +# github.com/bytedance/sonic/loader v0.5.2 ## explicit; go 1.16 github.com/bytedance/sonic/loader github.com/bytedance/sonic/loader/internal/abi @@ -373,7 +374,7 @@ github.com/clipperhouse/displaywidth # github.com/clipperhouse/uax29/v2 v2.7.0 ## explicit; go 1.18 github.com/clipperhouse/uax29/v2/graphemes -# github.com/cloudwego/base64x v0.1.6 +# github.com/cloudwego/base64x v0.1.7 ## explicit; go 1.17 github.com/cloudwego/base64x github.com/cloudwego/base64x/internal/native @@ -417,7 +418,7 @@ github.com/drone/envsubst/path # github.com/dustin/go-humanize v1.0.1 ## explicit; go 1.16 github.com/dustin/go-humanize -# github.com/ebitengine/purego v0.10.0 +# github.com/ebitengine/purego v0.10.2 ## explicit; go 1.18 github.com/ebitengine/purego github.com/ebitengine/purego/internal/cgo @@ -433,7 +434,7 @@ github.com/elastic/go-grok github.com/elastic/go-grok/dev-tools/mage github.com/elastic/go-grok/dev-tools/mage/gotool github.com/elastic/go-grok/patterns -# github.com/elastic/lunes v0.2.0 +# github.com/elastic/lunes v0.2.2 ## explicit; go 1.24.0 github.com/elastic/lunes github.com/elastic/lunes/dev-tools/mage @@ -471,6 +472,7 @@ github.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/ github.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/ring_hash/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/load_balancing_policies/wrr_locality/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/rbac/audit_loggers/stream/v3 +github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3 github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3 github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3 github.com/envoyproxy/go-control-plane/envoy/service/load_stats/v3 @@ -517,18 +519,18 @@ github.com/fatih/color # github.com/felixge/httpsnoop v1.1.0 ## explicit; go 1.25 github.com/felixge/httpsnoop -# github.com/foxboron/go-tpm-keyfiles v0.0.0-20251226215517-609e4778396f -## explicit; go 1.22.0 +# github.com/foxboron/go-tpm-keyfiles v0.0.0-20260902202739-8c9c2d1005f4 +## explicit; go 1.25.0 github.com/foxboron/go-tpm-keyfiles github.com/foxboron/go-tpm-keyfiles/template # github.com/fsnotify/fsnotify v1.10.1 ## explicit; go 1.23 github.com/fsnotify/fsnotify github.com/fsnotify/fsnotify/internal -# github.com/fxamacker/cbor/v2 v2.9.0 +# github.com/fxamacker/cbor/v2 v2.9.3 ## explicit; go 1.20 github.com/fxamacker/cbor/v2 -# github.com/go-jose/go-jose/v4 v4.1.4 +# github.com/go-jose/go-jose/v4 v4.1.5 ## explicit; go 1.24.0 github.com/go-jose/go-jose/v4 github.com/go-jose/go-jose/v4/cipher @@ -540,7 +542,7 @@ github.com/go-kit/log/level # github.com/go-logfmt/logfmt v0.6.1 ## explicit; go 1.21 github.com/go-logfmt/logfmt -# github.com/go-logr/logr v1.4.3 +# github.com/go-logr/logr v1.4.4 ## explicit; go 1.18 github.com/go-logr/logr github.com/go-logr/logr/funcr @@ -551,8 +553,8 @@ github.com/go-logr/stdr ## explicit; go 1.12 github.com/go-ole/go-ole github.com/go-ole/go-ole/oleutil -# github.com/go-openapi/analysis v0.26.1 -## explicit; go 1.25.0 +# github.com/go-openapi/analysis v1.0.0 +## explicit; go 1.26.0 github.com/go-openapi/analysis github.com/go-openapi/analysis/internal/debug github.com/go-openapi/analysis/internal/flatten/normalize @@ -563,65 +565,65 @@ github.com/go-openapi/analysis/internal/flatten/sortref # github.com/go-openapi/errors v0.22.8 ## explicit; go 1.25.0 github.com/go-openapi/errors -# github.com/go-openapi/jsonpointer v1.0.0 -## explicit; go 1.25.0 +# github.com/go-openapi/jsonpointer v1.0.1 +## explicit; go 1.26.0 github.com/go-openapi/jsonpointer github.com/go-openapi/jsonpointer/jsonname -# github.com/go-openapi/jsonreference v1.0.0 -## explicit; go 1.25.0 +# github.com/go-openapi/jsonreference v1.0.2 +## explicit; go 1.26.0 github.com/go-openapi/jsonreference github.com/go-openapi/jsonreference/internal -# github.com/go-openapi/loads v0.25.1 -## explicit; go 1.25.0 +# github.com/go-openapi/loads v0.25.3 +## explicit; go 1.26.0 github.com/go-openapi/loads -# github.com/go-openapi/spec v0.22.10 -## explicit; go 1.25.0 +# github.com/go-openapi/spec v1.0.1 +## explicit; go 1.26.0 github.com/go-openapi/spec -# github.com/go-openapi/strfmt v0.27.0 -## explicit; go 1.25.0 +# github.com/go-openapi/strfmt v0.27.2 +## explicit; go 1.26.0 github.com/go-openapi/strfmt github.com/go-openapi/strfmt/internal/bsonlite github.com/go-openapi/strfmt/internal/countries -# github.com/go-openapi/swag v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag -# github.com/go-openapi/swag/cmdutils v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/cmdutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/cmdutils -# github.com/go-openapi/swag/conv v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/conv v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/conv -# github.com/go-openapi/swag/fileutils v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/fileutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/fileutils -# github.com/go-openapi/swag/jsonutils v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/jsonutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/jsonutils github.com/go-openapi/swag/jsonutils/adapters github.com/go-openapi/swag/jsonutils/adapters/ifaces github.com/go-openapi/swag/jsonutils/adapters/stdlib/json -# github.com/go-openapi/swag/loading v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/loading v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/loading -# github.com/go-openapi/swag/mangling v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/mangling v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/mangling -# github.com/go-openapi/swag/netutils v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/netutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/netutils -# github.com/go-openapi/swag/pools v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/pools v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/pools -# github.com/go-openapi/swag/stringutils v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/stringutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/stringutils -# github.com/go-openapi/swag/typeutils v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/typeutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/typeutils -# github.com/go-openapi/swag/yamlutils v0.29.1 -## explicit; go 1.25.0 +# github.com/go-openapi/swag/yamlutils v0.29.2 +## explicit; go 1.26.0 github.com/go-openapi/swag/yamlutils -# github.com/go-openapi/validate v0.26.0 +# github.com/go-openapi/validate v0.26.5 ## explicit; go 1.25.0 github.com/go-openapi/validate # github.com/go-viper/mapstructure/v2 v2.5.0 @@ -689,14 +691,14 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-tpm v0.9.8 +# github.com/google/go-tpm v0.9.9-0.20260124013517-8f8f42cba0de ## explicit; go 1.22 github.com/google/go-tpm/legacy/tpm2 github.com/google/go-tpm/tpm2 github.com/google/go-tpm/tpm2/transport github.com/google/go-tpm/tpmutil github.com/google/go-tpm/tpmutil/tbs -# github.com/google/jsonschema-go v0.4.2 +# github.com/google/jsonschema-go v0.4.3 ## explicit; go 1.23.0 github.com/google/jsonschema-go/jsonschema # github.com/google/s2a-go v0.1.9 @@ -725,7 +727,7 @@ github.com/google/s2a-go/stream # github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid -# github.com/googleapis/enterprise-certificate-proxy v0.3.17 +# github.com/googleapis/enterprise-certificate-proxy v0.3.22 ## explicit; go 1.25.0 github.com/googleapis/enterprise-certificate-proxy/client github.com/googleapis/enterprise-certificate-proxy/client/util @@ -797,8 +799,8 @@ github.com/grafana/gomemcache/memcache # github.com/grafana/otel-profiling-go v0.6.0 ## explicit; go 1.25.0 github.com/grafana/otel-profiling-go -# github.com/grafana/pyroscope-go/godeltaprof v0.1.9 -## explicit; go 1.18 +# github.com/grafana/pyroscope-go/godeltaprof v0.1.12 +## explicit; go 1.25.0 github.com/grafana/pyroscope-go/godeltaprof github.com/grafana/pyroscope-go/godeltaprof/http/pprof github.com/grafana/pyroscope-go/godeltaprof/internal/pprof @@ -815,8 +817,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options github.com/grpc-ecosystem/grpc-gateway/v2/runtime github.com/grpc-ecosystem/grpc-gateway/v2/utilities -# github.com/hashicorp/consul/api v1.34.4 -## explicit; go 1.26 +# github.com/hashicorp/consul/api v1.34.5 +## explicit; go 1.26.7 github.com/hashicorp/consul/api # github.com/hashicorp/errwrap v1.1.0 ## explicit @@ -972,20 +974,20 @@ github.com/klauspost/cpuid/v2 # github.com/klauspost/crc32 v1.3.0 ## explicit; go 1.23.0 github.com/klauspost/crc32 -# github.com/knadh/koanf/maps v0.1.2 +# github.com/knadh/koanf/maps v0.1.3 ## explicit; go 1.18 github.com/knadh/koanf/maps -# github.com/knadh/koanf/providers/confmap v1.0.0 +# github.com/knadh/koanf/providers/confmap v1.0.1 ## explicit; go 1.23.0 github.com/knadh/koanf/providers/confmap -# github.com/knadh/koanf/v2 v2.3.4 +# github.com/knadh/koanf/v2 v2.3.6 ## explicit; go 1.23.0 github.com/knadh/koanf/v2 # github.com/kylelemons/godebug v1.1.0 ## explicit; go 1.11 github.com/kylelemons/godebug/diff github.com/kylelemons/godebug/pretty -# github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 +# github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 ## explicit; go 1.21 github.com/lufia/plan9stats # github.com/magefile/mage v1.17.2 @@ -1003,11 +1005,11 @@ github.com/mark3labs/mcp-go/util # github.com/mattn/go-colorable v0.1.15 ## explicit; go 1.18 github.com/mattn/go-colorable -# github.com/mattn/go-isatty v0.0.22 -## explicit; go 1.21 -github.com/mattn/go-isatty -# github.com/mattn/go-runewidth v0.0.23 +# github.com/mattn/go-isatty v0.0.24 ## explicit; go 1.20 +github.com/mattn/go-isatty +# github.com/mattn/go-runewidth v0.0.30 +## explicit; go 1.23 github.com/mattn/go-runewidth # github.com/maypok86/otter/v2 v2.3.0 ## explicit; go 1.24.0 @@ -1029,8 +1031,8 @@ github.com/mdlayher/socket # github.com/mdlayher/vsock v1.3.0 ## explicit; go 1.25.0 github.com/mdlayher/vsock -# github.com/miekg/dns v1.1.72 -## explicit; go 1.24.0 +# github.com/miekg/dns v1.1.73 +## explicit; go 1.25.0 github.com/miekg/dns # github.com/minio/crc64nvme v1.1.1 ## explicit; go 1.22 @@ -1084,7 +1086,7 @@ github.com/olekukonko/cat # github.com/olekukonko/errors v1.3.0 ## explicit; go 1.21 github.com/olekukonko/errors -# github.com/olekukonko/ll v0.1.6 +# github.com/olekukonko/ll v0.1.8 ## explicit; go 1.21 github.com/olekukonko/ll github.com/olekukonko/ll/lh @@ -1219,8 +1221,8 @@ github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver ## explicit; go 1.25.0 github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver/internal/metadata -# github.com/opentracing-contrib/go-grpc v0.1.2 -## explicit; go 1.23.8 +# github.com/opentracing-contrib/go-grpc v0.1.4 +## explicit; go 1.25.0 github.com/opentracing-contrib/go-grpc # github.com/opentracing-contrib/go-stdlib v1.1.1 ## explicit; go 1.14 @@ -1272,7 +1274,7 @@ github.com/parquet-go/parquet-go/internal/memory github.com/parquet-go/parquet-go/internal/unsafecast github.com/parquet-go/parquet-go/sparse github.com/parquet-go/parquet-go/variant -# github.com/pb33f/jsonpath v0.8.2 +# github.com/pb33f/jsonpath v0.8.3 ## explicit; go 1.24 github.com/pb33f/jsonpath/pkg/jsonpath github.com/pb33f/jsonpath/pkg/jsonpath/config @@ -1306,7 +1308,7 @@ github.com/pelletier/go-toml/v2/unstable # github.com/philhofer/fwd v1.2.0 ## explicit; go 1.20 github.com/philhofer/fwd -# github.com/pierrec/lz4/v4 v4.1.26 +# github.com/pierrec/lz4/v4 v4.1.29 ## explicit; go 1.17 github.com/pierrec/lz4/v4 github.com/pierrec/lz4/v4/internal/lz4block @@ -1334,7 +1336,7 @@ github.com/planetscale/vtprotobuf/types/known/wrapperspb # github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 ## explicit github.com/pmezard/go-difflib/difflib -# github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 +# github.com/power-devops/perfstat v0.0.0-20260805114148-88456608a4f6 ## explicit; go 1.14 github.com/power-devops/perfstat # github.com/prometheus/alertmanager v0.32.1 @@ -1359,8 +1361,8 @@ github.com/prometheus/client_golang/prometheus/testutil/promlint/validations ## explicit; go 1.24.0 github.com/prometheus/client_golang/exp/api/remote github.com/prometheus/client_golang/exp/internal/github.com/efficientgo/core/backoff -# github.com/prometheus/client_model v0.6.2 -## explicit; go 1.22.0 +# github.com/prometheus/client_model v0.6.3 +## explicit; go 1.23 github.com/prometheus/client_model/go # github.com/prometheus/common v0.70.1 ## explicit; go 1.25.0 @@ -1480,7 +1482,7 @@ github.com/rs/xid # github.com/sagikazarmark/locafero v0.11.0 ## explicit; go 1.23.0 github.com/sagikazarmark/locafero -# github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 +# github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 ## explicit; go 1.21 github.com/santhosh-tekuri/jsonschema/v6 github.com/santhosh-tekuri/jsonschema/v6/kind @@ -1493,7 +1495,7 @@ github.com/segmentio/fasthash/fnv1a # github.com/sercand/kuberesolver/v6 v6.0.1 ## explicit; go 1.22.0 github.com/sercand/kuberesolver/v6 -# github.com/shirou/gopsutil/v4 v4.26.4 +# github.com/shirou/gopsutil/v4 v4.26.8 ## explicit; go 1.24.0 github.com/shirou/gopsutil/v4/common github.com/shirou/gopsutil/v4/cpu @@ -1532,17 +1534,18 @@ github.com/spf13/viper/internal/encoding/json github.com/spf13/viper/internal/encoding/toml github.com/spf13/viper/internal/encoding/yaml github.com/spf13/viper/internal/features -# github.com/spiffe/go-spiffe/v2 v2.6.0 +# github.com/spiffe/go-spiffe/v2 v2.7.0 ## explicit; go 1.24.0 github.com/spiffe/go-spiffe/v2/bundle/jwtbundle github.com/spiffe/go-spiffe/v2/bundle/spiffebundle github.com/spiffe/go-spiffe/v2/bundle/x509bundle +github.com/spiffe/go-spiffe/v2/exp/bundle/witbundle github.com/spiffe/go-spiffe/v2/internal/cryptoutil github.com/spiffe/go-spiffe/v2/internal/jwtutil github.com/spiffe/go-spiffe/v2/internal/pemutil github.com/spiffe/go-spiffe/v2/internal/x509util github.com/spiffe/go-spiffe/v2/spiffeid -# github.com/stretchr/objx v0.5.2 +# github.com/stretchr/objx v0.5.3 ## explicit; go 1.20 github.com/stretchr/objx # github.com/stretchr/testify v1.11.1 @@ -1554,7 +1557,7 @@ github.com/stretchr/testify/require # github.com/subosito/gotenv v1.6.0 ## explicit; go 1.18 github.com/subosito/gotenv -# github.com/tinylib/msgp v1.6.1 +# github.com/tinylib/msgp v1.6.4 ## explicit; go 1.24 github.com/tinylib/msgp/msgp github.com/tinylib/msgp/msgp/setof @@ -1583,7 +1586,7 @@ github.com/twitchyliquid64/golang-asm/objabi github.com/twitchyliquid64/golang-asm/src github.com/twitchyliquid64/golang-asm/sys github.com/twitchyliquid64/golang-asm/unsafeheader -# github.com/twmb/franz-go v1.21.2 +# github.com/twmb/franz-go v1.21.6 ## explicit; go 1.25.0 github.com/twmb/franz-go/pkg/kbin github.com/twmb/franz-go/pkg/kerr @@ -1626,7 +1629,7 @@ github.com/twmb/murmur3 github.com/twpayne/go-geom github.com/twpayne/go-geom/encoding/wkb github.com/twpayne/go-geom/encoding/wkbcommon -# github.com/ua-parser/uap-go v0.0.0-20251207011819-db9adb27a0b8 +# github.com/ua-parser/uap-go v0.0.0-20260529044130-17c35e68e58c ## explicit; go 1.22.11 github.com/ua-parser/uap-go/uaparser # github.com/uber/jaeger-client-go v2.30.0+incompatible @@ -1659,8 +1662,8 @@ github.com/x448/float16 # github.com/yosida95/uritemplate/v3 v3.0.2 ## explicit; go 1.14 github.com/yosida95/uritemplate/v3 -# github.com/yuin/gopher-lua v1.1.1 -## explicit; go 1.17 +# github.com/yuin/gopher-lua v1.1.2 +## explicit; go 1.23 github.com/yuin/gopher-lua github.com/yuin/gopher-lua/ast github.com/yuin/gopher-lua/parse @@ -1960,7 +1963,7 @@ go.opentelemetry.io/contrib/bridges/otelzap # go.opentelemetry.io/contrib/bridges/prometheus v0.69.0 ## explicit; go 1.25.0 go.opentelemetry.io/contrib/bridges/prometheus -# go.opentelemetry.io/contrib/detectors/gcp v1.43.0 +# go.opentelemetry.io/contrib/detectors/gcp v1.44.0 ## explicit; go 1.25.0 go.opentelemetry.io/contrib/detectors/gcp # go.opentelemetry.io/contrib/exporters/autoexport v0.69.0 @@ -2207,8 +2210,8 @@ go.yaml.in/yaml/v4/plugin/limit # golang.org/x/arch v0.0.0-20210923205945-b76863e36670 ## explicit; go 1.17 golang.org/x/arch/x86/x86asm -# golang.org/x/crypto v0.55.0 -## explicit; go 1.25.0 +# golang.org/x/crypto v0.57.0 +## explicit; go 1.26.0 golang.org/x/crypto/argon2 golang.org/x/crypto/bcrypt golang.org/x/crypto/blake2b @@ -2224,16 +2227,13 @@ golang.org/x/crypto/md4 golang.org/x/crypto/pbkdf2 golang.org/x/crypto/pkcs12 golang.org/x/crypto/pkcs12/internal/rc2 -# golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 -## explicit; go 1.25.0 +# golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba +## explicit; go 1.26.0 golang.org/x/exp/constraints golang.org/x/exp/maps golang.org/x/exp/slices -# golang.org/x/mod v0.40.0 -## explicit; go 1.25.0 -golang.org/x/mod/semver -# golang.org/x/net v0.58.0 -## explicit; go 1.25.0 +# golang.org/x/net v0.59.0 +## explicit; go 1.26.0 golang.org/x/net/bpf golang.org/x/net/html golang.org/x/net/html/atom @@ -2267,13 +2267,13 @@ golang.org/x/oauth2/google/internal/stsexchange golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.22.0 -## explicit; go 1.25.0 +# golang.org/x/sync v0.23.0 +## explicit; go 1.26.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.47.0 -## explicit; go 1.25.0 +# golang.org/x/sys v0.48.0 +## explicit; go 1.26.0 golang.org/x/sys/cpu golang.org/x/sys/plan9 golang.org/x/sys/unix @@ -2281,11 +2281,11 @@ golang.org/x/sys/windows golang.org/x/sys/windows/registry golang.org/x/sys/windows/svc golang.org/x/sys/windows/svc/eventlog -# golang.org/x/term v0.45.0 -## explicit; go 1.25.0 +# golang.org/x/term v0.46.0 +## explicit; go 1.26.0 golang.org/x/term -# golang.org/x/text v0.41.0 -## explicit; go 1.25.0 +# golang.org/x/text v0.42.0 +## explicit; go 1.26.0 golang.org/x/text/cases golang.org/x/text/currency golang.org/x/text/encoding @@ -2321,26 +2321,6 @@ golang.org/x/text/width # golang.org/x/time v0.15.0 ## explicit; go 1.25.0 golang.org/x/time/rate -# golang.org/x/tools v0.49.0 -## explicit; go 1.25.0 -golang.org/x/tools/go/ast/edge -golang.org/x/tools/go/ast/inspector -golang.org/x/tools/go/gcexportdata -golang.org/x/tools/go/packages -golang.org/x/tools/go/types/objectpath -golang.org/x/tools/internal/aliases -golang.org/x/tools/internal/event -golang.org/x/tools/internal/event/core -golang.org/x/tools/internal/event/keys -golang.org/x/tools/internal/event/label -golang.org/x/tools/internal/gcimporter -golang.org/x/tools/internal/gocommand -golang.org/x/tools/internal/moremaps -golang.org/x/tools/internal/packagesinternal -golang.org/x/tools/internal/pkgbits -golang.org/x/tools/internal/stdlib -golang.org/x/tools/internal/typesinternal -golang.org/x/tools/internal/versions # gonum.org/v1/gonum v0.17.0 ## explicit; go 1.24.0 gonum.org/v1/gonum/blas @@ -2386,13 +2366,13 @@ google.golang.org/api/storage/v1 google.golang.org/api/transport google.golang.org/api/transport/grpc google.golang.org/api/transport/http -# google.golang.org/genproto v0.0.0-20260519071638-aa98bba5eb94 +# google.golang.org/genproto v0.0.0-20260911204522-f61a6ca850bd ## explicit; go 1.25.0 google.golang.org/genproto/googleapis/type/calendarperiod google.golang.org/genproto/googleapis/type/date google.golang.org/genproto/googleapis/type/expr google.golang.org/genproto/googleapis/type/timeofday -# google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 +# google.golang.org/genproto/googleapis/api v0.0.0-20260911204522-f61a6ca850bd ## explicit; go 1.25.0 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations @@ -2402,12 +2382,12 @@ google.golang.org/genproto/googleapis/api/httpbody google.golang.org/genproto/googleapis/api/label google.golang.org/genproto/googleapis/api/metric google.golang.org/genproto/googleapis/api/monitoredres -# google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20260911204522-f61a6ca850bd ## explicit; go 1.25.0 google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.82.1 +# google.golang.org/grpc v1.83.1 ## explicit; go 1.25.0 google.golang.org/grpc google.golang.org/grpc/attributes @@ -2446,6 +2426,7 @@ google.golang.org/grpc/credentials/alts/internal/handshaker google.golang.org/grpc/credentials/alts/internal/handshaker/service google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp google.golang.org/grpc/credentials/google +google.golang.org/grpc/credentials/google/internal google.golang.org/grpc/credentials/insecure google.golang.org/grpc/credentials/jwt google.golang.org/grpc/credentials/oauth @@ -2570,7 +2551,7 @@ google.golang.org/grpc/xds google.golang.org/grpc/xds/bootstrap google.golang.org/grpc/xds/csds google.golang.org/grpc/xds/googledirectpath -# google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af +# google.golang.org/protobuf v1.36.12 ## explicit; go 1.23 google.golang.org/protobuf/encoding/protodelim google.golang.org/protobuf/encoding/protojson @@ -2617,7 +2598,7 @@ google.golang.org/protobuf/types/known/wrapperspb # gopkg.in/inf.v0 v0.9.1 ## explicit gopkg.in/inf.v0 -# gopkg.in/ini.v1 v1.67.2 +# gopkg.in/ini.v1 v1.67.3 ## explicit; go 1.13 gopkg.in/ini.v1 # gopkg.in/yaml.v3 v3.0.1 @@ -2706,7 +2687,7 @@ k8s.io/utils/dump k8s.io/utils/internal/third_party/forked/golang/net k8s.io/utils/net k8s.io/utils/ptr -# sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 +# sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5 ## explicit; go 1.23 sigs.k8s.io/json sigs.k8s.io/json/internal/golang/encoding/json @@ -2714,7 +2695,7 @@ sigs.k8s.io/json/internal/golang/encoding/json ## explicit; go 1.18 sigs.k8s.io/randfill sigs.k8s.io/randfill/bytesource -# sigs.k8s.io/structured-merge-diff/v6 v6.4.1 +# sigs.k8s.io/structured-merge-diff/v6 v6.4.2 ## explicit; go 1.23 sigs.k8s.io/structured-merge-diff/v6/value # sigs.k8s.io/yaml v1.6.0