Merge pull request #322 from red-hat-storage/sync_us--devel

Syncing latest changes from upstream devel for ceph-csi
This commit is contained in:
openshift-merge-bot[bot] 2024-06-20 09:00:47 +00:00 committed by GitHub
commit a6c404326b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 3247 additions and 737 deletions

6
go.mod
View File

@ -4,10 +4,10 @@ go 1.22.0
require ( require (
github.com/IBM/keyprotect-go-client v0.12.2 github.com/IBM/keyprotect-go-client v0.12.2
github.com/aws/aws-sdk-go v1.51.12 github.com/aws/aws-sdk-go v1.53.14
github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 github.com/aws/aws-sdk-go-v2/service/sts v1.28.1
github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000 github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000
github.com/ceph/go-ceph v0.27.0 github.com/ceph/go-ceph v0.28.0
github.com/container-storage-interface/spec v1.9.0 github.com/container-storage-interface/spec v1.9.0
github.com/csi-addons/spec v0.2.1-0.20230606140122-d20966d2e444 github.com/csi-addons/spec v0.2.1-0.20230606140122-d20966d2e444
github.com/gemalto/kmip-go v0.0.10 github.com/gemalto/kmip-go v0.0.10
@ -29,7 +29,7 @@ require (
golang.org/x/net v0.26.0 golang.org/x/net v0.26.0
golang.org/x/sys v0.21.0 golang.org/x/sys v0.21.0
google.golang.org/grpc v1.64.0 google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.1 google.golang.org/protobuf v1.34.2
// //
// when updating k8s.io/kubernetes, make sure to update the replace section too // when updating k8s.io/kubernetes, make sure to update the replace section too
// //

12
go.sum
View File

@ -834,8 +834,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/aws/aws-sdk-go v1.44.164/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go v1.44.164/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.51.12 h1:DvuhIHZXwnjaR1/Gu19gUe1EGPw4J0qSJw4Qs/5PA8g= github.com/aws/aws-sdk-go v1.53.14 h1:SzhkC2Pzag0iRW8WBb80RzKdGXDydJR9LAMs2GyKJ2M=
github.com/aws/aws-sdk-go v1.51.12/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.53.14/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w= github.com/aws/aws-sdk-go-v2 v1.25.2 h1:/uiG1avJRgLGiQM9X3qJM8+Qa6KRGK5rRPuXE0HUM+w=
github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo= github.com/aws/aws-sdk-go-v2 v1.25.2/go.mod h1:Evoc5AsmtveRt1komDwIsjHFyrP5tDuF1D1U+6z6pNo=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 h1:bNo4LagzUKbjdxE0tIcR9pMzLR2U/Tgie1Hq1HQ3iH8=
@ -871,8 +871,8 @@ github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyY
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
github.com/ceph/go-ceph v0.27.0 h1:5rUTIun/EtUFTH2qb6UokCyw9zul1Vr8iKgJo/VBYr8= github.com/ceph/go-ceph v0.28.0 h1:ZjlDV9XiVmBQIe9bKbT5j2Ft/bse3Jm+Ui65yE/oFFU=
github.com/ceph/go-ceph v0.27.0/go.mod h1:GFlSfPG6JNhliRTZtI4oWbu1QGUMFner9bba1ecNAnk= github.com/ceph/go-ceph v0.28.0/go.mod h1:EwEITEDpuFCMnFrPLbV+/Vyi59jUihgCxBKvlTWGot0=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@ -2561,8 +2561,8 @@ google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/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.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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 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-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

File diff suppressed because it is too large Load Diff

View File

@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go" const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK // SDKVersion is the version of this SDK
const SDKVersion = "1.51.12" const SDKVersion = "1.53.14"

View File

@ -122,8 +122,8 @@ func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix stri
} }
func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
// If it's empty, generate an empty value // If it's empty, and not ec2, generate an empty value
if !value.IsNil() && value.Len() == 0 { if !value.IsNil() && value.Len() == 0 && !q.isEC2 {
v.Set(prefix, "") v.Set(prefix, "")
return nil return nil
} }

File diff suppressed because it is too large Load Diff

View File

@ -97,6 +97,13 @@ const (
// operation. // operation.
ErrCodeCloudHsmClusterNotRelatedException = "CloudHsmClusterNotRelatedException" ErrCodeCloudHsmClusterNotRelatedException = "CloudHsmClusterNotRelatedException"
// ErrCodeConflictException for service response error code
// "ConflictException".
//
// The request was rejected because an automatic rotation of this key is currently
// in progress or scheduled to begin within the next 20 minutes.
ErrCodeConflictException = "ConflictException"
// ErrCodeCustomKeyStoreHasCMKsException for service response error code // ErrCodeCustomKeyStoreHasCMKsException for service response error code
// "CustomKeyStoreHasCMKsException". // "CustomKeyStoreHasCMKsException".
// //
@ -488,6 +495,7 @@ var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"CloudHsmClusterNotActiveException": newErrorCloudHsmClusterNotActiveException, "CloudHsmClusterNotActiveException": newErrorCloudHsmClusterNotActiveException,
"CloudHsmClusterNotFoundException": newErrorCloudHsmClusterNotFoundException, "CloudHsmClusterNotFoundException": newErrorCloudHsmClusterNotFoundException,
"CloudHsmClusterNotRelatedException": newErrorCloudHsmClusterNotRelatedException, "CloudHsmClusterNotRelatedException": newErrorCloudHsmClusterNotRelatedException,
"ConflictException": newErrorConflictException,
"CustomKeyStoreHasCMKsException": newErrorCustomKeyStoreHasCMKsException, "CustomKeyStoreHasCMKsException": newErrorCustomKeyStoreHasCMKsException,
"CustomKeyStoreInvalidStateException": newErrorCustomKeyStoreInvalidStateException, "CustomKeyStoreInvalidStateException": newErrorCustomKeyStoreInvalidStateException,
"CustomKeyStoreNameInUseException": newErrorCustomKeyStoreNameInUseException, "CustomKeyStoreNameInUseException": newErrorCustomKeyStoreNameInUseException,

View File

@ -179,8 +179,8 @@ func (c *SSOOIDC) CreateTokenWithIAMRequest(input *CreateTokenWithIAMInput) (req
// //
// Creates and returns access and refresh tokens for clients and applications // Creates and returns access and refresh tokens for clients and applications
// that are authenticated using IAM entities. The access token can be used to // that are authenticated using IAM entities. The access token can be used to
// fetch short-term credentials for the assigned AWS accounts or to access application // fetch short-term credentials for the assigned Amazon Web Services accounts
// APIs using bearer authentication. // or to access application APIs using bearer authentication.
// //
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about // with awserr.Error's Code and Message methods to get detailed information about
@ -331,6 +331,13 @@ func (c *SSOOIDC) RegisterClientRequest(input *RegisterClientInput) (req *reques
// Indicates that an error from the service occurred while trying to process // Indicates that an error from the service occurred while trying to process
// a request. // a request.
// //
// - InvalidRedirectUriException
// Indicates that one or more redirect URI in the request is not supported for
// this operation.
//
// - UnsupportedGrantTypeException
// Indicates that the grant type in the request is not supported by the service.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/RegisterClient // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/RegisterClient
func (c *SSOOIDC) RegisterClient(input *RegisterClientInput) (*RegisterClientOutput, error) { func (c *SSOOIDC) RegisterClient(input *RegisterClientInput) (*RegisterClientOutput, error) {
req, out := c.RegisterClientRequest(input) req, out := c.RegisterClientRequest(input)
@ -619,6 +626,15 @@ type CreateTokenInput struct {
// type is currently unsupported for the CreateToken API. // type is currently unsupported for the CreateToken API.
Code *string `locationName:"code" type:"string"` Code *string `locationName:"code" type:"string"`
// Used only when calling this API for the Authorization Code grant type. This
// value is generated by the client and presented to validate the original code
// challenge value the client passed at authorization time.
//
// CodeVerifier is a sensitive parameter and its value will be
// replaced with "sensitive" in string returned by CreateTokenInput's
// String and GoString methods.
CodeVerifier *string `locationName:"codeVerifier" type:"string" sensitive:"true"`
// Used only when calling this API for the Device Code grant type. This short-term // Used only when calling this API for the Device Code grant type. This short-term
// code is used to identify this authorization request. This comes from the // code is used to identify this authorization request. This comes from the
// result of the StartDeviceAuthorization API. // result of the StartDeviceAuthorization API.
@ -718,6 +734,12 @@ func (s *CreateTokenInput) SetCode(v string) *CreateTokenInput {
return s return s
} }
// SetCodeVerifier sets the CodeVerifier field's value.
func (s *CreateTokenInput) SetCodeVerifier(v string) *CreateTokenInput {
s.CodeVerifier = &v
return s
}
// SetDeviceCode sets the DeviceCode field's value. // SetDeviceCode sets the DeviceCode field's value.
func (s *CreateTokenInput) SetDeviceCode(v string) *CreateTokenInput { func (s *CreateTokenInput) SetDeviceCode(v string) *CreateTokenInput {
s.DeviceCode = &v s.DeviceCode = &v
@ -751,7 +773,8 @@ func (s *CreateTokenInput) SetScope(v []*string) *CreateTokenInput {
type CreateTokenOutput struct { type CreateTokenOutput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// A bearer token to access AWS accounts and applications assigned to a user. // A bearer token to access Amazon Web Services accounts and applications assigned
// to a user.
// //
// AccessToken is a sensitive parameter and its value will be // AccessToken is a sensitive parameter and its value will be
// replaced with "sensitive" in string returned by CreateTokenOutput's // replaced with "sensitive" in string returned by CreateTokenOutput's
@ -863,6 +886,15 @@ type CreateTokenWithIAMInput struct {
// persisted in the Authorization Code GrantOptions for the application. // persisted in the Authorization Code GrantOptions for the application.
Code *string `locationName:"code" type:"string"` Code *string `locationName:"code" type:"string"`
// Used only when calling this API for the Authorization Code grant type. This
// value is generated by the client and presented to validate the original code
// challenge value the client passed at authorization time.
//
// CodeVerifier is a sensitive parameter and its value will be
// replaced with "sensitive" in string returned by CreateTokenWithIAMInput's
// String and GoString methods.
CodeVerifier *string `locationName:"codeVerifier" type:"string" sensitive:"true"`
// Supports the following OAuth grant types: Authorization Code, Refresh Token, // Supports the following OAuth grant types: Authorization Code, Refresh Token,
// JWT Bearer, and Token Exchange. Specify one of the following values, depending // JWT Bearer, and Token Exchange. Specify one of the following values, depending
// on the grant type that you want: // on the grant type that you want:
@ -982,6 +1014,12 @@ func (s *CreateTokenWithIAMInput) SetCode(v string) *CreateTokenWithIAMInput {
return s return s
} }
// SetCodeVerifier sets the CodeVerifier field's value.
func (s *CreateTokenWithIAMInput) SetCodeVerifier(v string) *CreateTokenWithIAMInput {
s.CodeVerifier = &v
return s
}
// SetGrantType sets the GrantType field's value. // SetGrantType sets the GrantType field's value.
func (s *CreateTokenWithIAMInput) SetGrantType(v string) *CreateTokenWithIAMInput { func (s *CreateTokenWithIAMInput) SetGrantType(v string) *CreateTokenWithIAMInput {
s.GrantType = &v s.GrantType = &v
@ -1027,7 +1065,8 @@ func (s *CreateTokenWithIAMInput) SetSubjectTokenType(v string) *CreateTokenWith
type CreateTokenWithIAMOutput struct { type CreateTokenWithIAMOutput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure"`
// A bearer token to access AWS accounts and applications assigned to a user. // A bearer token to access Amazon Web Services accounts and applications assigned
// to a user.
// //
// AccessToken is a sensitive parameter and its value will be // AccessToken is a sensitive parameter and its value will be
// replaced with "sensitive" in string returned by CreateTokenWithIAMOutput's // replaced with "sensitive" in string returned by CreateTokenWithIAMOutput's
@ -1495,6 +1534,78 @@ func (s *InvalidGrantException) RequestID() string {
return s.RespMetadata.RequestID return s.RespMetadata.RequestID
} }
// Indicates that one or more redirect URI in the request is not supported for
// this operation.
type InvalidRedirectUriException struct {
_ struct{} `type:"structure"`
RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
// Single error code. For this exception the value will be invalid_redirect_uri.
Error_ *string `locationName:"error" type:"string"`
// Human-readable text providing additional information, used to assist the
// client developer in understanding the error that occurred.
Error_description *string `locationName:"error_description" type:"string"`
Message_ *string `locationName:"message" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s InvalidRedirectUriException) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s InvalidRedirectUriException) GoString() string {
return s.String()
}
func newErrorInvalidRedirectUriException(v protocol.ResponseMetadata) error {
return &InvalidRedirectUriException{
RespMetadata: v,
}
}
// Code returns the exception type name.
func (s *InvalidRedirectUriException) Code() string {
return "InvalidRedirectUriException"
}
// Message returns the exception's message.
func (s *InvalidRedirectUriException) Message() string {
if s.Message_ != nil {
return *s.Message_
}
return ""
}
// OrigErr always returns nil, satisfies awserr.Error interface.
func (s *InvalidRedirectUriException) OrigErr() error {
return nil
}
func (s *InvalidRedirectUriException) Error() string {
return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String())
}
// Status code returns the HTTP status code for the request's response error.
func (s *InvalidRedirectUriException) StatusCode() int {
return s.RespMetadata.StatusCode
}
// RequestID returns the service's response RequestID for request.
func (s *InvalidRedirectUriException) RequestID() string {
return s.RespMetadata.RequestID
}
// Indicates that something is wrong with the input to the request. For example, // Indicates that something is wrong with the input to the request. For example,
// a required parameter might be missing or out of range. // a required parameter might be missing or out of range.
type InvalidRequestException struct { type InvalidRequestException struct {
@ -1731,6 +1842,25 @@ type RegisterClientInput struct {
// ClientType is a required field // ClientType is a required field
ClientType *string `locationName:"clientType" type:"string" required:"true"` ClientType *string `locationName:"clientType" type:"string" required:"true"`
// This IAM Identity Center application ARN is used to define administrator-managed
// configuration for public client access to resources. At authorization, the
// scopes, grants, and redirect URI available to this client will be restricted
// by this application resource.
EntitledApplicationArn *string `locationName:"entitledApplicationArn" type:"string"`
// The list of OAuth 2.0 grant types that are defined by the client. This list
// is used to restrict the token granting flows available to the client.
GrantTypes []*string `locationName:"grantTypes" type:"list"`
// The IAM Identity Center Issuer URL associated with an instance of IAM Identity
// Center. This value is needed for user access to resources through the client.
IssuerUrl *string `locationName:"issuerUrl" type:"string"`
// The list of redirect URI that are defined by the client. At completion of
// authorization, this list is used to restrict what locations the user agent
// can be redirected back to.
RedirectUris []*string `locationName:"redirectUris" type:"list"`
// The list of scopes that are defined by the client. Upon authorization, this // The list of scopes that are defined by the client. Upon authorization, this
// list is used to restrict permissions when granting an access token. // list is used to restrict permissions when granting an access token.
Scopes []*string `locationName:"scopes" type:"list"` Scopes []*string `locationName:"scopes" type:"list"`
@ -1782,6 +1912,30 @@ func (s *RegisterClientInput) SetClientType(v string) *RegisterClientInput {
return s return s
} }
// SetEntitledApplicationArn sets the EntitledApplicationArn field's value.
func (s *RegisterClientInput) SetEntitledApplicationArn(v string) *RegisterClientInput {
s.EntitledApplicationArn = &v
return s
}
// SetGrantTypes sets the GrantTypes field's value.
func (s *RegisterClientInput) SetGrantTypes(v []*string) *RegisterClientInput {
s.GrantTypes = v
return s
}
// SetIssuerUrl sets the IssuerUrl field's value.
func (s *RegisterClientInput) SetIssuerUrl(v string) *RegisterClientInput {
s.IssuerUrl = &v
return s
}
// SetRedirectUris sets the RedirectUris field's value.
func (s *RegisterClientInput) SetRedirectUris(v []*string) *RegisterClientInput {
s.RedirectUris = v
return s
}
// SetScopes sets the Scopes field's value. // SetScopes sets the Scopes field's value.
func (s *RegisterClientInput) SetScopes(v []*string) *RegisterClientInput { func (s *RegisterClientInput) SetScopes(v []*string) *RegisterClientInput {
s.Scopes = v s.Scopes = v

View File

@ -57,6 +57,13 @@ const (
// makes a CreateToken request with an invalid grant type. // makes a CreateToken request with an invalid grant type.
ErrCodeInvalidGrantException = "InvalidGrantException" ErrCodeInvalidGrantException = "InvalidGrantException"
// ErrCodeInvalidRedirectUriException for service response error code
// "InvalidRedirectUriException".
//
// Indicates that one or more redirect URI in the request is not supported for
// this operation.
ErrCodeInvalidRedirectUriException = "InvalidRedirectUriException"
// ErrCodeInvalidRequestException for service response error code // ErrCodeInvalidRequestException for service response error code
// "InvalidRequestException". // "InvalidRequestException".
// //
@ -106,6 +113,7 @@ var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"InvalidClientException": newErrorInvalidClientException, "InvalidClientException": newErrorInvalidClientException,
"InvalidClientMetadataException": newErrorInvalidClientMetadataException, "InvalidClientMetadataException": newErrorInvalidClientMetadataException,
"InvalidGrantException": newErrorInvalidGrantException, "InvalidGrantException": newErrorInvalidGrantException,
"InvalidRedirectUriException": newErrorInvalidRedirectUriException,
"InvalidRequestException": newErrorInvalidRequestException, "InvalidRequestException": newErrorInvalidRequestException,
"InvalidRequestRegionException": newErrorInvalidRequestRegionException, "InvalidRequestRegionException": newErrorInvalidRequestRegionException,
"InvalidScopeException": newErrorInvalidScopeException, "InvalidScopeException": newErrorInvalidScopeException,

View File

@ -102,7 +102,7 @@ type decoder struct {
} }
// newError returns an error object with position info. // newError returns an error object with position info.
func (d decoder) newError(pos int, f string, x ...interface{}) error { func (d decoder) newError(pos int, f string, x ...any) error {
line, column := d.Position(pos) line, column := d.Position(pos)
head := fmt.Sprintf("(line %d:%d): ", line, column) head := fmt.Sprintf("(line %d:%d): ", line, column)
return errors.New(head+f, x...) return errors.New(head+f, x...)
@ -114,7 +114,7 @@ func (d decoder) unexpectedTokenError(tok json.Token) error {
} }
// syntaxError returns a syntax error for given position. // syntaxError returns a syntax error for given position.
func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { func (d decoder) syntaxError(pos int, f string, x ...any) error {
line, column := d.Position(pos) line, column := d.Position(pos)
head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) head := fmt.Sprintf("syntax error (line %d:%d): ", line, column)
return errors.New(head+f, x...) return errors.New(head+f, x...)

View File

@ -84,7 +84,7 @@ type decoder struct {
} }
// newError returns an error object with position info. // newError returns an error object with position info.
func (d decoder) newError(pos int, f string, x ...interface{}) error { func (d decoder) newError(pos int, f string, x ...any) error {
line, column := d.Position(pos) line, column := d.Position(pos)
head := fmt.Sprintf("(line %d:%d): ", line, column) head := fmt.Sprintf("(line %d:%d): ", line, column)
return errors.New(head+f, x...) return errors.New(head+f, x...)
@ -96,7 +96,7 @@ func (d decoder) unexpectedTokenError(tok text.Token) error {
} }
// syntaxError returns a syntax error for given position. // syntaxError returns a syntax error for given position.
func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { func (d decoder) syntaxError(pos int, f string, x ...any) error {
line, column := d.Position(pos) line, column := d.Position(pos)
head := fmt.Sprintf("syntax error (line %d:%d): ", line, column) head := fmt.Sprintf("syntax error (line %d:%d): ", line, column)
return errors.New(head+f, x...) return errors.New(head+f, x...)

View File

@ -214,7 +214,7 @@ func (d *Decoder) parseNext() (Token, error) {
// newSyntaxError returns an error with line and column information useful for // newSyntaxError returns an error with line and column information useful for
// syntax errors. // syntax errors.
func (d *Decoder) newSyntaxError(pos int, f string, x ...interface{}) error { func (d *Decoder) newSyntaxError(pos int, f string, x ...any) error {
e := errors.New(f, x...) e := errors.New(f, x...)
line, column := d.Position(pos) line, column := d.Position(pos)
return errors.New("syntax error (line %d:%d): %v", line, column, e) return errors.New("syntax error (line %d:%d): %v", line, column, e)

View File

@ -601,7 +601,7 @@ func (d *Decoder) consumeToken(kind Kind, size int, attrs uint8) Token {
// newSyntaxError returns a syntax error with line and column information for // newSyntaxError returns a syntax error with line and column information for
// current position. // current position.
func (d *Decoder) newSyntaxError(f string, x ...interface{}) error { func (d *Decoder) newSyntaxError(f string, x ...any) error {
e := errors.New(f, x...) e := errors.New(f, x...)
line, column := d.Position(len(d.orig) - len(d.in)) line, column := d.Position(len(d.orig) - len(d.in))
return errors.New("syntax error (line %d:%d): %v", line, column, e) return errors.New("syntax error (line %d:%d): %v", line, column, e)

View File

@ -17,7 +17,7 @@ var Error = errors.New("protobuf error")
// New formats a string according to the format specifier and arguments and // New formats a string according to the format specifier and arguments and
// returns an error that has a "proto" prefix. // returns an error that has a "proto" prefix.
func New(f string, x ...interface{}) error { func New(f string, x ...any) error {
return &prefixError{s: format(f, x...)} return &prefixError{s: format(f, x...)}
} }
@ -43,7 +43,7 @@ func (e *prefixError) Unwrap() error {
// Wrap returns an error that has a "proto" prefix, the formatted string described // Wrap returns an error that has a "proto" prefix, the formatted string described
// by the format specifier and arguments, and a suffix of err. The error wraps err. // by the format specifier and arguments, and a suffix of err. The error wraps err.
func Wrap(err error, f string, x ...interface{}) error { func Wrap(err error, f string, x ...any) error {
return &wrapError{ return &wrapError{
s: format(f, x...), s: format(f, x...),
err: err, err: err,
@ -67,7 +67,7 @@ func (e *wrapError) Is(target error) bool {
return target == Error return target == Error
} }
func format(f string, x ...interface{}) string { func format(f string, x ...any) string {
// avoid "proto: " prefix when chaining // avoid "proto: " prefix when chaining
for i := 0; i < len(x); i++ { for i := 0; i < len(x); i++ {
switch e := x[i].(type) { switch e := x[i].(type) {

View File

@ -383,6 +383,10 @@ func (fd *Field) Message() protoreflect.MessageDescriptor {
} }
return fd.L1.Message return fd.L1.Message
} }
func (fd *Field) IsMapEntry() bool {
parent, ok := fd.L0.Parent.(protoreflect.MessageDescriptor)
return ok && parent.IsMapEntry()
}
func (fd *Field) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) } func (fd *Field) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) }
func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {} func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {}

View File

@ -534,7 +534,7 @@ func (sd *Service) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protor
} }
var nameBuilderPool = sync.Pool{ var nameBuilderPool = sync.Pool{
New: func() interface{} { return new(strs.Builder) }, New: func() any { return new(strs.Builder) },
} }
func getBuilder() *strs.Builder { func getBuilder() *strs.Builder {

View File

@ -45,6 +45,11 @@ func (file *File) resolveMessages() {
case protoreflect.MessageKind, protoreflect.GroupKind: case protoreflect.MessageKind, protoreflect.GroupKind:
fd.L1.Message = file.resolveMessageDependency(fd.L1.Message, listFieldDeps, depIdx) fd.L1.Message = file.resolveMessageDependency(fd.L1.Message, listFieldDeps, depIdx)
depIdx++ depIdx++
if fd.L1.Kind == protoreflect.GroupKind && (fd.IsMap() || fd.IsMapEntry()) {
// A map field might inherit delimited encoding from a file-wide default feature.
// But maps never actually use delimited encoding. (At least for now...)
fd.L1.Kind = protoreflect.MessageKind
}
} }
// Default is resolved here since it depends on Enum being resolved. // Default is resolved here since it depends on Enum being resolved.

View File

@ -68,7 +68,7 @@ type Builder struct {
// and for input and output messages referenced by service methods. // and for input and output messages referenced by service methods.
// Dependencies must come after declarations, but the ordering of // Dependencies must come after declarations, but the ordering of
// dependencies themselves is unspecified. // dependencies themselves is unspecified.
GoTypes []interface{} GoTypes []any
// DependencyIndexes is an ordered list of indexes into GoTypes for the // DependencyIndexes is an ordered list of indexes into GoTypes for the
// dependencies of messages, extensions, or services. // dependencies of messages, extensions, or services.
@ -268,7 +268,7 @@ func (x depIdxs) Get(i, j int32) int32 {
type ( type (
resolverByIndex struct { resolverByIndex struct {
goTypes []interface{} goTypes []any
depIdxs depIdxs depIdxs depIdxs
fileRegistry fileRegistry
} }

View File

@ -860,11 +860,13 @@ const (
EnumValueOptions_Deprecated_field_name protoreflect.Name = "deprecated" EnumValueOptions_Deprecated_field_name protoreflect.Name = "deprecated"
EnumValueOptions_Features_field_name protoreflect.Name = "features" EnumValueOptions_Features_field_name protoreflect.Name = "features"
EnumValueOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" EnumValueOptions_DebugRedact_field_name protoreflect.Name = "debug_redact"
EnumValueOptions_FeatureSupport_field_name protoreflect.Name = "feature_support"
EnumValueOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumValueOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
EnumValueOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.deprecated" EnumValueOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.deprecated"
EnumValueOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.features" EnumValueOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.features"
EnumValueOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.debug_redact" EnumValueOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.debug_redact"
EnumValueOptions_FeatureSupport_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.feature_support"
EnumValueOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.uninterpreted_option" EnumValueOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.uninterpreted_option"
) )
@ -873,6 +875,7 @@ const (
EnumValueOptions_Deprecated_field_number protoreflect.FieldNumber = 1 EnumValueOptions_Deprecated_field_number protoreflect.FieldNumber = 1
EnumValueOptions_Features_field_number protoreflect.FieldNumber = 2 EnumValueOptions_Features_field_number protoreflect.FieldNumber = 2
EnumValueOptions_DebugRedact_field_number protoreflect.FieldNumber = 3 EnumValueOptions_DebugRedact_field_number protoreflect.FieldNumber = 3
EnumValueOptions_FeatureSupport_field_number protoreflect.FieldNumber = 4
EnumValueOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 EnumValueOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
) )

View File

@ -22,13 +22,13 @@ type Export struct{}
// NewError formats a string according to the format specifier and arguments and // NewError formats a string according to the format specifier and arguments and
// returns an error that has a "proto" prefix. // returns an error that has a "proto" prefix.
func (Export) NewError(f string, x ...interface{}) error { func (Export) NewError(f string, x ...any) error {
return errors.New(f, x...) return errors.New(f, x...)
} }
// enum is any enum type generated by protoc-gen-go // enum is any enum type generated by protoc-gen-go
// and must be a named int32 type. // and must be a named int32 type.
type enum = interface{} type enum = any
// EnumOf returns the protoreflect.Enum interface over e. // EnumOf returns the protoreflect.Enum interface over e.
// It returns nil if e is nil. // It returns nil if e is nil.
@ -81,7 +81,7 @@ func (Export) EnumStringOf(ed protoreflect.EnumDescriptor, n protoreflect.EnumNu
// message is any message type generated by protoc-gen-go // message is any message type generated by protoc-gen-go
// and must be a pointer to a named struct type. // and must be a pointer to a named struct type.
type message = interface{} type message = any
// legacyMessageWrapper wraps a v2 message as a v1 message. // legacyMessageWrapper wraps a v2 message as a v1 message.
type legacyMessageWrapper struct{ m protoreflect.ProtoMessage } type legacyMessageWrapper struct{ m protoreflect.ProtoMessage }

View File

@ -68,7 +68,7 @@ func (mi *MessageInfo) isInitExtensions(ext *map[int32]ExtensionField) error {
} }
for _, x := range *ext { for _, x := range *ext {
ei := getExtensionFieldInfo(x.Type()) ei := getExtensionFieldInfo(x.Type())
if ei.funcs.isInit == nil { if ei.funcs.isInit == nil || x.isUnexpandedLazy() {
continue continue
} }
v := x.Value() v := x.Value()

View File

@ -99,6 +99,28 @@ func (f *ExtensionField) canLazy(xt protoreflect.ExtensionType) bool {
return false return false
} }
// isUnexpandedLazy returns true if the ExensionField is lazy and not
// yet expanded, which means it's present and already checked for
// initialized required fields.
func (f *ExtensionField) isUnexpandedLazy() bool {
return f.lazy != nil && atomic.LoadUint32(&f.lazy.atomicOnce) == 0
}
// lazyBuffer retrieves the buffer for a lazy extension if it's not yet expanded.
//
// The returned buffer has to be kept over whatever operation we're planning,
// as re-retrieving it will fail after the message is lazily decoded.
func (f *ExtensionField) lazyBuffer() []byte {
// This function might be in the critical path, so check the atomic without
// taking a look first, then only take the lock if needed.
if !f.isUnexpandedLazy() {
return nil
}
f.lazy.mu.Lock()
defer f.lazy.mu.Unlock()
return f.lazy.b
}
func (f *ExtensionField) lazyInit() { func (f *ExtensionField) lazyInit() {
f.lazy.mu.Lock() f.lazy.mu.Lock()
defer f.lazy.mu.Unlock() defer f.lazy.mu.Unlock()

View File

@ -26,6 +26,15 @@ func sizeMessageSet(mi *MessageInfo, p pointer, opts marshalOptions) (size int)
} }
num, _ := protowire.DecodeTag(xi.wiretag) num, _ := protowire.DecodeTag(xi.wiretag)
size += messageset.SizeField(num) size += messageset.SizeField(num)
if fullyLazyExtensions(opts) {
// Don't expand the extension, instead use the buffer to calculate size
if lb := x.lazyBuffer(); lb != nil {
// We got hold of the buffer, so it's still lazy.
// Don't count the tag size in the extension buffer, it's already added.
size += protowire.SizeTag(messageset.FieldMessage) + len(lb) - xi.tagsize
continue
}
}
size += xi.funcs.size(x.Value(), protowire.SizeTag(messageset.FieldMessage), opts) size += xi.funcs.size(x.Value(), protowire.SizeTag(messageset.FieldMessage), opts)
} }
@ -85,6 +94,19 @@ func marshalMessageSetField(mi *MessageInfo, b []byte, x ExtensionField, opts ma
xi := getExtensionFieldInfo(x.Type()) xi := getExtensionFieldInfo(x.Type())
num, _ := protowire.DecodeTag(xi.wiretag) num, _ := protowire.DecodeTag(xi.wiretag)
b = messageset.AppendFieldStart(b, num) b = messageset.AppendFieldStart(b, num)
if fullyLazyExtensions(opts) {
// Don't expand the extension if it's still in wire format, instead use the buffer content.
if lb := x.lazyBuffer(); lb != nil {
// The tag inside the lazy buffer is a different tag (the extension
// number), but what we need here is the tag for FieldMessage:
b = protowire.AppendVarint(b, protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType))
b = append(b, lb[xi.tagsize:]...)
b = messageset.AppendFieldEnd(b)
return b, nil
}
}
b, err := xi.funcs.marshal(b, x.Value(), protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType), opts) b, err := xi.funcs.marshal(b, x.Value(), protowire.EncodeTag(messageset.FieldMessage, protowire.BytesType), opts)
if err != nil { if err != nil {
return b, err return b, err

View File

@ -14,7 +14,7 @@ import (
// unwrapper unwraps the value to the underlying value. // unwrapper unwraps the value to the underlying value.
// This is implemented by List and Map. // This is implemented by List and Map.
type unwrapper interface { type unwrapper interface {
protoUnwrap() interface{} protoUnwrap() any
} }
// A Converter coverts to/from Go reflect.Value types and protobuf protoreflect.Value types. // A Converter coverts to/from Go reflect.Value types and protobuf protoreflect.Value types.

View File

@ -136,6 +136,6 @@ func (ls *listReflect) NewElement() protoreflect.Value {
func (ls *listReflect) IsValid() bool { func (ls *listReflect) IsValid() bool {
return !ls.v.IsNil() return !ls.v.IsNil()
} }
func (ls *listReflect) protoUnwrap() interface{} { func (ls *listReflect) protoUnwrap() any {
return ls.v.Interface() return ls.v.Interface()
} }

View File

@ -116,6 +116,6 @@ func (ms *mapReflect) NewValue() protoreflect.Value {
func (ms *mapReflect) IsValid() bool { func (ms *mapReflect) IsValid() bool {
return !ms.v.IsNil() return !ms.v.IsNil()
} }
func (ms *mapReflect) protoUnwrap() interface{} { func (ms *mapReflect) protoUnwrap() any {
return ms.v.Interface() return ms.v.Interface()
} }

View File

@ -49,8 +49,11 @@ func (mi *MessageInfo) sizePointer(p pointer, opts marshalOptions) (size int) {
return 0 return 0
} }
if opts.UseCachedSize() && mi.sizecacheOffset.IsValid() { if opts.UseCachedSize() && mi.sizecacheOffset.IsValid() {
if size := atomic.LoadInt32(p.Apply(mi.sizecacheOffset).Int32()); size >= 0 { // The size cache contains the size + 1, to allow the
return int(size) // zero value to be invalid, while also allowing for a
// 0 size to be cached.
if size := atomic.LoadInt32(p.Apply(mi.sizecacheOffset).Int32()); size > 0 {
return int(size - 1)
} }
} }
return mi.sizePointerSlow(p, opts) return mi.sizePointerSlow(p, opts)
@ -60,7 +63,7 @@ func (mi *MessageInfo) sizePointerSlow(p pointer, opts marshalOptions) (size int
if flags.ProtoLegacy && mi.isMessageSet { if flags.ProtoLegacy && mi.isMessageSet {
size = sizeMessageSet(mi, p, opts) size = sizeMessageSet(mi, p, opts)
if mi.sizecacheOffset.IsValid() { if mi.sizecacheOffset.IsValid() {
atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size)) atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size+1))
} }
return size return size
} }
@ -84,13 +87,16 @@ func (mi *MessageInfo) sizePointerSlow(p pointer, opts marshalOptions) (size int
} }
} }
if mi.sizecacheOffset.IsValid() { if mi.sizecacheOffset.IsValid() {
if size > math.MaxInt32 { if size > (math.MaxInt32 - 1) {
// The size is too large for the int32 sizecache field. // The size is too large for the int32 sizecache field.
// We will need to recompute the size when encoding; // We will need to recompute the size when encoding;
// unfortunately expensive, but better than invalid output. // unfortunately expensive, but better than invalid output.
atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), -1) atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), 0)
} else { } else {
atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size)) // The size cache contains the size + 1, to allow the
// zero value to be invalid, while also allowing for a
// 0 size to be cached.
atomic.StoreInt32(p.Apply(mi.sizecacheOffset).Int32(), int32(size+1))
} }
} }
return size return size
@ -149,6 +155,14 @@ func (mi *MessageInfo) marshalAppendPointer(b []byte, p pointer, opts marshalOpt
return b, nil return b, nil
} }
// fullyLazyExtensions returns true if we should attempt to keep extensions lazy over size and marshal.
func fullyLazyExtensions(opts marshalOptions) bool {
// When deterministic marshaling is requested, force an unmarshal for lazy
// extensions to produce a deterministic result, instead of passing through
// bytes lazily that may or may not match what Go Protobuf would produce.
return opts.flags&piface.MarshalDeterministic == 0
}
func (mi *MessageInfo) sizeExtensions(ext *map[int32]ExtensionField, opts marshalOptions) (n int) { func (mi *MessageInfo) sizeExtensions(ext *map[int32]ExtensionField, opts marshalOptions) (n int) {
if ext == nil { if ext == nil {
return 0 return 0
@ -158,6 +172,14 @@ func (mi *MessageInfo) sizeExtensions(ext *map[int32]ExtensionField, opts marsha
if xi.funcs.size == nil { if xi.funcs.size == nil {
continue continue
} }
if fullyLazyExtensions(opts) {
// Don't expand the extension, instead use the buffer to calculate size
if lb := x.lazyBuffer(); lb != nil {
// We got hold of the buffer, so it's still lazy.
n += len(lb)
continue
}
}
n += xi.funcs.size(x.Value(), xi.tagsize, opts) n += xi.funcs.size(x.Value(), xi.tagsize, opts)
} }
return n return n
@ -176,6 +198,13 @@ func (mi *MessageInfo) appendExtensions(b []byte, ext *map[int32]ExtensionField,
var err error var err error
for _, x := range *ext { for _, x := range *ext {
xi := getExtensionFieldInfo(x.Type()) xi := getExtensionFieldInfo(x.Type())
if fullyLazyExtensions(opts) {
// Don't expand the extension if it's still in wire format, instead use the buffer content.
if lb := x.lazyBuffer(); lb != nil {
b = append(b, lb...)
continue
}
}
b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts) b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts)
} }
return b, err return b, err
@ -191,6 +220,13 @@ func (mi *MessageInfo) appendExtensions(b []byte, ext *map[int32]ExtensionField,
for _, k := range keys { for _, k := range keys {
x := (*ext)[int32(k)] x := (*ext)[int32(k)]
xi := getExtensionFieldInfo(x.Type()) xi := getExtensionFieldInfo(x.Type())
if fullyLazyExtensions(opts) {
// Don't expand the extension if it's still in wire format, instead use the buffer content.
if lb := x.lazyBuffer(); lb != nil {
b = append(b, lb...)
continue
}
}
b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts) b, err = xi.funcs.marshal(b, x.Value(), xi.wiretag, opts)
if err != nil { if err != nil {
return b, err return b, err

View File

@ -53,7 +53,7 @@ type ExtensionInfo struct {
// type returned by InterfaceOf may not be identical. // type returned by InterfaceOf may not be identical.
// //
// Deprecated: Use InterfaceOf(xt.Zero()) instead. // Deprecated: Use InterfaceOf(xt.Zero()) instead.
ExtensionType interface{} ExtensionType any
// Field is the field number of the extension. // Field is the field number of the extension.
// //
@ -95,16 +95,16 @@ func (xi *ExtensionInfo) New() protoreflect.Value {
func (xi *ExtensionInfo) Zero() protoreflect.Value { func (xi *ExtensionInfo) Zero() protoreflect.Value {
return xi.lazyInit().Zero() return xi.lazyInit().Zero()
} }
func (xi *ExtensionInfo) ValueOf(v interface{}) protoreflect.Value { func (xi *ExtensionInfo) ValueOf(v any) protoreflect.Value {
return xi.lazyInit().PBValueOf(reflect.ValueOf(v)) return xi.lazyInit().PBValueOf(reflect.ValueOf(v))
} }
func (xi *ExtensionInfo) InterfaceOf(v protoreflect.Value) interface{} { func (xi *ExtensionInfo) InterfaceOf(v protoreflect.Value) any {
return xi.lazyInit().GoValueOf(v).Interface() return xi.lazyInit().GoValueOf(v).Interface()
} }
func (xi *ExtensionInfo) IsValidValue(v protoreflect.Value) bool { func (xi *ExtensionInfo) IsValidValue(v protoreflect.Value) bool {
return xi.lazyInit().IsValidPB(v) return xi.lazyInit().IsValidPB(v)
} }
func (xi *ExtensionInfo) IsValidInterface(v interface{}) bool { func (xi *ExtensionInfo) IsValidInterface(v any) bool {
return xi.lazyInit().IsValidGo(reflect.ValueOf(v)) return xi.lazyInit().IsValidGo(reflect.ValueOf(v))
} }
func (xi *ExtensionInfo) TypeDescriptor() protoreflect.ExtensionTypeDescriptor { func (xi *ExtensionInfo) TypeDescriptor() protoreflect.ExtensionTypeDescriptor {

View File

@ -97,7 +97,7 @@ func (e *legacyEnumWrapper) Number() protoreflect.EnumNumber {
func (e *legacyEnumWrapper) ProtoReflect() protoreflect.Enum { func (e *legacyEnumWrapper) ProtoReflect() protoreflect.Enum {
return e return e
} }
func (e *legacyEnumWrapper) protoUnwrap() interface{} { func (e *legacyEnumWrapper) protoUnwrap() any {
v := reflect.New(e.goTyp).Elem() v := reflect.New(e.goTyp).Elem()
v.SetInt(int64(e.num)) v.SetInt(int64(e.num))
return v.Interface() return v.Interface()

View File

@ -216,7 +216,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName
} }
for _, fn := range methods { for _, fn := range methods {
for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) {
if vs, ok := v.Interface().([]interface{}); ok { if vs, ok := v.Interface().([]any); ok {
for _, v := range vs { for _, v := range vs {
oneofWrappers = append(oneofWrappers, reflect.TypeOf(v)) oneofWrappers = append(oneofWrappers, reflect.TypeOf(v))
} }
@ -567,6 +567,6 @@ func (m aberrantMessage) IsValid() bool {
func (m aberrantMessage) ProtoMethods() *protoiface.Methods { func (m aberrantMessage) ProtoMethods() *protoiface.Methods {
return aberrantProtoMethods return aberrantProtoMethods
} }
func (m aberrantMessage) protoUnwrap() interface{} { func (m aberrantMessage) protoUnwrap() any {
return m.v.Interface() return m.v.Interface()
} }

View File

@ -35,7 +35,7 @@ type MessageInfo struct {
Exporter exporter Exporter exporter
// OneofWrappers is list of pointers to oneof wrapper struct types. // OneofWrappers is list of pointers to oneof wrapper struct types.
OneofWrappers []interface{} OneofWrappers []any
initMu sync.Mutex // protects all unexported fields initMu sync.Mutex // protects all unexported fields
initDone uint32 initDone uint32
@ -47,7 +47,7 @@ type MessageInfo struct {
// exporter is a function that returns a reference to the ith field of v, // exporter is a function that returns a reference to the ith field of v,
// where v is a pointer to a struct. It returns nil if it does not support // where v is a pointer to a struct. It returns nil if it does not support
// exporting the requested field (e.g., already exported). // exporting the requested field (e.g., already exported).
type exporter func(v interface{}, i int) interface{} type exporter func(v any, i int) any
// getMessageInfo returns the MessageInfo for any message type that // getMessageInfo returns the MessageInfo for any message type that
// is generated by our implementation of protoc-gen-go (for v2 and on). // is generated by our implementation of protoc-gen-go (for v2 and on).
@ -201,7 +201,7 @@ fieldLoop:
} }
for _, fn := range methods { for _, fn := range methods {
for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) {
if vs, ok := v.Interface().([]interface{}); ok { if vs, ok := v.Interface().([]any); ok {
oneofWrappers = vs oneofWrappers = vs
} }
} }
@ -256,7 +256,7 @@ func (mi *MessageInfo) Message(i int) protoreflect.MessageType {
type mapEntryType struct { type mapEntryType struct {
desc protoreflect.MessageDescriptor desc protoreflect.MessageDescriptor
valType interface{} // zero value of enum or message type valType any // zero value of enum or message type
} }
func (mt mapEntryType) New() protoreflect.Message { func (mt mapEntryType) New() protoreflect.Message {

View File

@ -20,7 +20,7 @@ type reflectMessageInfo struct {
// fieldTypes contains the zero value of an enum or message field. // fieldTypes contains the zero value of an enum or message field.
// For lists, it contains the element type. // For lists, it contains the element type.
// For maps, it contains the entry value type. // For maps, it contains the entry value type.
fieldTypes map[protoreflect.FieldNumber]interface{} fieldTypes map[protoreflect.FieldNumber]any
// denseFields is a subset of fields where: // denseFields is a subset of fields where:
// 0 < fieldDesc.Number() < len(denseFields) // 0 < fieldDesc.Number() < len(denseFields)
@ -28,7 +28,7 @@ type reflectMessageInfo struct {
denseFields []*fieldInfo denseFields []*fieldInfo
// rangeInfos is a list of all fields (not belonging to a oneof) and oneofs. // rangeInfos is a list of all fields (not belonging to a oneof) and oneofs.
rangeInfos []interface{} // either *fieldInfo or *oneofInfo rangeInfos []any // either *fieldInfo or *oneofInfo
getUnknown func(pointer) protoreflect.RawFields getUnknown func(pointer) protoreflect.RawFields
setUnknown func(pointer, protoreflect.RawFields) setUnknown func(pointer, protoreflect.RawFields)
@ -224,7 +224,7 @@ func (mi *MessageInfo) makeFieldTypes(si structInfo) {
} }
if ft != nil { if ft != nil {
if mi.fieldTypes == nil { if mi.fieldTypes == nil {
mi.fieldTypes = make(map[protoreflect.FieldNumber]interface{}) mi.fieldTypes = make(map[protoreflect.FieldNumber]any)
} }
mi.fieldTypes[fd.Number()] = reflect.Zero(ft).Interface() mi.fieldTypes[fd.Number()] = reflect.Zero(ft).Interface()
} }
@ -255,6 +255,10 @@ func (m *extensionMap) Has(xd protoreflect.ExtensionTypeDescriptor) (ok bool) {
if !ok { if !ok {
return false return false
} }
if x.isUnexpandedLazy() {
// Avoid calling x.Value(), which triggers a lazy unmarshal.
return true
}
switch { switch {
case xd.IsList(): case xd.IsList():
return x.Value().List().Len() > 0 return x.Value().List().Len() > 0
@ -389,7 +393,7 @@ var (
// MessageOf returns a reflective view over a message. The input must be a // MessageOf returns a reflective view over a message. The input must be a
// pointer to a named Go struct. If the provided type has a ProtoReflect method, // pointer to a named Go struct. If the provided type has a ProtoReflect method,
// it must be implemented by calling this method. // it must be implemented by calling this method.
func (mi *MessageInfo) MessageOf(m interface{}) protoreflect.Message { func (mi *MessageInfo) MessageOf(m any) protoreflect.Message {
if reflect.TypeOf(m) != mi.GoReflectType { if reflect.TypeOf(m) != mi.GoReflectType {
panic(fmt.Sprintf("type mismatch: got %T, want %v", m, mi.GoReflectType)) panic(fmt.Sprintf("type mismatch: got %T, want %v", m, mi.GoReflectType))
} }
@ -417,7 +421,7 @@ func (m *messageIfaceWrapper) Reset() {
func (m *messageIfaceWrapper) ProtoReflect() protoreflect.Message { func (m *messageIfaceWrapper) ProtoReflect() protoreflect.Message {
return (*messageReflectWrapper)(m) return (*messageReflectWrapper)(m)
} }
func (m *messageIfaceWrapper) protoUnwrap() interface{} { func (m *messageIfaceWrapper) protoUnwrap() any {
return m.p.AsIfaceOf(m.mi.GoReflectType.Elem()) return m.p.AsIfaceOf(m.mi.GoReflectType.Elem())
} }

View File

@ -23,7 +23,7 @@ func (m *messageState) New() protoreflect.Message {
func (m *messageState) Interface() protoreflect.ProtoMessage { func (m *messageState) Interface() protoreflect.ProtoMessage {
return m.protoUnwrap().(protoreflect.ProtoMessage) return m.protoUnwrap().(protoreflect.ProtoMessage)
} }
func (m *messageState) protoUnwrap() interface{} { func (m *messageState) protoUnwrap() any {
return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem())
} }
func (m *messageState) ProtoMethods() *protoiface.Methods { func (m *messageState) ProtoMethods() *protoiface.Methods {
@ -154,7 +154,7 @@ func (m *messageReflectWrapper) Interface() protoreflect.ProtoMessage {
} }
return (*messageIfaceWrapper)(m) return (*messageIfaceWrapper)(m)
} }
func (m *messageReflectWrapper) protoUnwrap() interface{} { func (m *messageReflectWrapper) protoUnwrap() any {
return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem()) return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem())
} }
func (m *messageReflectWrapper) ProtoMethods() *protoiface.Methods { func (m *messageReflectWrapper) ProtoMethods() *protoiface.Methods {

View File

@ -16,7 +16,7 @@ import (
const UnsafeEnabled = false const UnsafeEnabled = false
// Pointer is an opaque pointer type. // Pointer is an opaque pointer type.
type Pointer interface{} type Pointer any
// offset represents the offset to a struct field, accessible from a pointer. // offset represents the offset to a struct field, accessible from a pointer.
// The offset is the field index into a struct. // The offset is the field index into a struct.
@ -62,7 +62,7 @@ func pointerOfValue(v reflect.Value) pointer {
} }
// pointerOfIface returns the pointer portion of an interface. // pointerOfIface returns the pointer portion of an interface.
func pointerOfIface(v interface{}) pointer { func pointerOfIface(v any) pointer {
return pointer{v: reflect.ValueOf(v)} return pointer{v: reflect.ValueOf(v)}
} }
@ -93,7 +93,7 @@ func (p pointer) AsValueOf(t reflect.Type) reflect.Value {
// AsIfaceOf treats p as a pointer to an object of type t and returns the value. // AsIfaceOf treats p as a pointer to an object of type t and returns the value.
// It is equivalent to p.AsValueOf(t).Interface() // It is equivalent to p.AsValueOf(t).Interface()
func (p pointer) AsIfaceOf(t reflect.Type) interface{} { func (p pointer) AsIfaceOf(t reflect.Type) any {
return p.AsValueOf(t).Interface() return p.AsValueOf(t).Interface()
} }

View File

@ -50,7 +50,7 @@ func pointerOfValue(v reflect.Value) pointer {
} }
// pointerOfIface returns the pointer portion of an interface. // pointerOfIface returns the pointer portion of an interface.
func pointerOfIface(v interface{}) pointer { func pointerOfIface(v any) pointer {
type ifaceHeader struct { type ifaceHeader struct {
Type unsafe.Pointer Type unsafe.Pointer
Data unsafe.Pointer Data unsafe.Pointer
@ -80,7 +80,7 @@ func (p pointer) AsValueOf(t reflect.Type) reflect.Value {
// AsIfaceOf treats p as a pointer to an object of type t and returns the value. // AsIfaceOf treats p as a pointer to an object of type t and returns the value.
// It is equivalent to p.AsValueOf(t).Interface() // It is equivalent to p.AsValueOf(t).Interface()
func (p pointer) AsIfaceOf(t reflect.Type) interface{} { func (p pointer) AsIfaceOf(t reflect.Type) any {
// TODO: Use tricky unsafe magic to directly create ifaceHeader. // TODO: Use tricky unsafe magic to directly create ifaceHeader.
return p.AsValueOf(t).Interface() return p.AsValueOf(t).Interface()
} }

View File

@ -18,7 +18,7 @@ type messageField struct {
} }
var messageFieldPool = sync.Pool{ var messageFieldPool = sync.Pool{
New: func() interface{} { return new([]messageField) }, New: func() any { return new([]messageField) },
} }
type ( type (
@ -69,7 +69,7 @@ type mapEntry struct {
} }
var mapEntryPool = sync.Pool{ var mapEntryPool = sync.Pool{
New: func() interface{} { return new([]mapEntry) }, New: func() any { return new([]mapEntry) },
} }
type ( type (

View File

@ -52,7 +52,7 @@ import (
const ( const (
Major = 1 Major = 1
Minor = 34 Minor = 34
Patch = 1 Patch = 2
PreRelease = "" PreRelease = ""
) )

View File

@ -39,7 +39,7 @@ func ClearExtension(m Message, xt protoreflect.ExtensionType) {
// If the field is unpopulated, it returns the default value for // If the field is unpopulated, it returns the default value for
// scalars and an immutable, empty value for lists or messages. // scalars and an immutable, empty value for lists or messages.
// It panics if xt does not extend m. // It panics if xt does not extend m.
func GetExtension(m Message, xt protoreflect.ExtensionType) interface{} { func GetExtension(m Message, xt protoreflect.ExtensionType) any {
// Treat nil message interface as an empty message; return the default. // Treat nil message interface as an empty message; return the default.
if m == nil { if m == nil {
return xt.InterfaceOf(xt.Zero()) return xt.InterfaceOf(xt.Zero())
@ -51,7 +51,7 @@ func GetExtension(m Message, xt protoreflect.ExtensionType) interface{} {
// SetExtension stores the value of an extension field. // SetExtension stores the value of an extension field.
// It panics if m is invalid, xt does not extend m, or if type of v // It panics if m is invalid, xt does not extend m, or if type of v
// is invalid for the specified extension field. // is invalid for the specified extension field.
func SetExtension(m Message, xt protoreflect.ExtensionType, v interface{}) { func SetExtension(m Message, xt protoreflect.ExtensionType, v any) {
xd := xt.TypeDescriptor() xd := xt.TypeDescriptor()
pv := xt.ValueOf(v) pv := xt.ValueOf(v)
@ -78,7 +78,7 @@ func SetExtension(m Message, xt protoreflect.ExtensionType, v interface{}) {
// It returns immediately if f returns false. // It returns immediately if f returns false.
// While iterating, mutating operations may only be performed // While iterating, mutating operations may only be performed
// on the current extension field. // on the current extension field.
func RangeExtensions(m Message, f func(protoreflect.ExtensionType, interface{}) bool) { func RangeExtensions(m Message, f func(protoreflect.ExtensionType, any) bool) {
// Treat nil message interface as an empty message; nothing to range over. // Treat nil message interface as an empty message; nothing to range over.
if m == nil { if m == nil {
return return

View File

@ -46,6 +46,11 @@ func (r *resolver) resolveMessageDependencies(ms []filedesc.Message, mds []*desc
if f.L1.Kind, f.L1.Enum, f.L1.Message, err = r.findTarget(f.Kind(), f.Parent().FullName(), partialName(fd.GetTypeName()), f.IsWeak()); err != nil { if f.L1.Kind, f.L1.Enum, f.L1.Message, err = r.findTarget(f.Kind(), f.Parent().FullName(), partialName(fd.GetTypeName()), f.IsWeak()); err != nil {
return errors.New("message field %q cannot resolve type: %v", f.FullName(), err) return errors.New("message field %q cannot resolve type: %v", f.FullName(), err)
} }
if f.L1.Kind == protoreflect.GroupKind && (f.IsMap() || f.IsMapEntry()) {
// A map field might inherit delimited encoding from a file-wide default feature.
// But maps never actually use delimited encoding. (At least for now...)
f.L1.Kind = protoreflect.MessageKind
}
if fd.DefaultValue != nil { if fd.DefaultValue != nil {
v, ev, err := unmarshalDefault(fd.GetDefaultValue(), f, r.allowUnresolvable) v, ev, err := unmarshalDefault(fd.GetDefaultValue(), f, r.allowUnresolvable)
if err != nil { if err != nil {

View File

@ -116,18 +116,6 @@ func validateMessageDeclarations(file *filedesc.File, ms []filedesc.Message, mds
if m.ExtensionRanges().Len() > 0 { if m.ExtensionRanges().Len() > 0 {
return errors.New("message %q using proto3 semantics cannot have extension ranges", m.FullName()) return errors.New("message %q using proto3 semantics cannot have extension ranges", m.FullName())
} }
// Verify that field names in proto3 do not conflict if lowercased
// with all underscores removed.
// See protoc v3.8.0: src/google/protobuf/descriptor.cc:5830-5847
names := map[string]protoreflect.FieldDescriptor{}
for i := 0; i < m.Fields().Len(); i++ {
f1 := m.Fields().Get(i)
s := strings.Replace(strings.ToLower(string(f1.Name())), "_", "", -1)
if f2, ok := names[s]; ok {
return errors.New("message %q using proto3 semantics has conflict: %q with %q", m.FullName(), f1.Name(), f2.Name())
}
names[s] = f1
}
} }
for j, fd := range md.GetField() { for j, fd := range md.GetField() {

View File

@ -485,6 +485,8 @@ func (p *SourcePath) appendEnumValueOptions(b []byte) []byte {
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
case 3: case 3:
b = p.appendSingularField(b, "debug_redact", nil) b = p.appendSingularField(b, "debug_redact", nil)
case 4:
b = p.appendSingularField(b, "feature_support", (*SourcePath).appendFieldOptions_FeatureSupport)
case 999: case 999:
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
} }

View File

@ -510,7 +510,7 @@ type ExtensionType interface {
// //
// ValueOf is more extensive than protoreflect.ValueOf for a given field's // ValueOf is more extensive than protoreflect.ValueOf for a given field's
// value as it has more type information available. // value as it has more type information available.
ValueOf(interface{}) Value ValueOf(any) Value
// InterfaceOf completely unwraps the Value to the underlying Go type. // InterfaceOf completely unwraps the Value to the underlying Go type.
// InterfaceOf panics if the input is nil or does not represent the // InterfaceOf panics if the input is nil or does not represent the
@ -519,13 +519,13 @@ type ExtensionType interface {
// //
// InterfaceOf is able to unwrap the Value further than Value.Interface // InterfaceOf is able to unwrap the Value further than Value.Interface
// as it has more type information available. // as it has more type information available.
InterfaceOf(Value) interface{} InterfaceOf(Value) any
// IsValidValue reports whether the Value is valid to assign to the field. // IsValidValue reports whether the Value is valid to assign to the field.
IsValidValue(Value) bool IsValidValue(Value) bool
// IsValidInterface reports whether the input is valid to assign to the field. // IsValidInterface reports whether the input is valid to assign to the field.
IsValidInterface(interface{}) bool IsValidInterface(any) bool
} }
// EnumDescriptor describes an enum and // EnumDescriptor describes an enum and

View File

@ -36,7 +36,7 @@ type value struct {
num uint64 // 8B num uint64 // 8B
str string // 16B str string // 16B
bin []byte // 24B bin []byte // 24B
iface interface{} // 16B iface any // 16B
} }
func valueOfString(v string) Value { func valueOfString(v string) Value {
@ -45,7 +45,7 @@ func valueOfString(v string) Value {
func valueOfBytes(v []byte) Value { func valueOfBytes(v []byte) Value {
return Value{typ: bytesType, bin: v} return Value{typ: bytesType, bin: v}
} }
func valueOfIface(v interface{}) Value { func valueOfIface(v any) Value {
return Value{typ: ifaceType, iface: v} return Value{typ: ifaceType, iface: v}
} }
@ -55,6 +55,6 @@ func (v Value) getString() string {
func (v Value) getBytes() []byte { func (v Value) getBytes() []byte {
return v.bin return v.bin
} }
func (v Value) getIface() interface{} { func (v Value) getIface() any {
return v.iface return v.iface
} }

View File

@ -69,8 +69,8 @@ import (
// composite Value. Modifying an empty, read-only value panics. // composite Value. Modifying an empty, read-only value panics.
type Value value type Value value
// The protoreflect API uses a custom Value union type instead of interface{} // The protoreflect API uses a custom Value union type instead of any
// to keep the future open for performance optimizations. Using an interface{} // to keep the future open for performance optimizations. Using an any
// always incurs an allocation for primitives (e.g., int64) since it needs to // always incurs an allocation for primitives (e.g., int64) since it needs to
// be boxed on the heap (as interfaces can only contain pointers natively). // be boxed on the heap (as interfaces can only contain pointers natively).
// Instead, we represent the Value union as a flat struct that internally keeps // Instead, we represent the Value union as a flat struct that internally keeps
@ -85,7 +85,7 @@ type Value value
// ValueOf returns a Value initialized with the concrete value stored in v. // ValueOf returns a Value initialized with the concrete value stored in v.
// This panics if the type does not match one of the allowed types in the // This panics if the type does not match one of the allowed types in the
// Value union. // Value union.
func ValueOf(v interface{}) Value { func ValueOf(v any) Value {
switch v := v.(type) { switch v := v.(type) {
case nil: case nil:
return Value{} return Value{}
@ -192,10 +192,10 @@ func (v Value) IsValid() bool {
return v.typ != nilType return v.typ != nilType
} }
// Interface returns v as an interface{}. // Interface returns v as an any.
// //
// Invariant: v == ValueOf(v).Interface() // Invariant: v == ValueOf(v).Interface()
func (v Value) Interface() interface{} { func (v Value) Interface() any {
switch v.typ { switch v.typ {
case nilType: case nilType:
return nil return nil
@ -406,8 +406,8 @@ func (k MapKey) IsValid() bool {
return Value(k).IsValid() return Value(k).IsValid()
} }
// Interface returns k as an interface{}. // Interface returns k as an any.
func (k MapKey) Interface() interface{} { func (k MapKey) Interface() any {
return Value(k).Interface() return Value(k).Interface()
} }

View File

@ -45,7 +45,7 @@ var (
// typeOf returns a pointer to the Go type information. // typeOf returns a pointer to the Go type information.
// The pointer is comparable and equal if and only if the types are identical. // The pointer is comparable and equal if and only if the types are identical.
func typeOf(t interface{}) unsafe.Pointer { func typeOf(t any) unsafe.Pointer {
return (*ifaceHeader)(unsafe.Pointer(&t)).Type return (*ifaceHeader)(unsafe.Pointer(&t)).Type
} }
@ -80,7 +80,7 @@ func valueOfBytes(v []byte) Value {
p := (*sliceHeader)(unsafe.Pointer(&v)) p := (*sliceHeader)(unsafe.Pointer(&v))
return Value{typ: bytesType, ptr: p.Data, num: uint64(len(v))} return Value{typ: bytesType, ptr: p.Data, num: uint64(len(v))}
} }
func valueOfIface(v interface{}) Value { func valueOfIface(v any) Value {
p := (*ifaceHeader)(unsafe.Pointer(&v)) p := (*ifaceHeader)(unsafe.Pointer(&v))
return Value{typ: p.Type, ptr: p.Data} return Value{typ: p.Type, ptr: p.Data}
} }
@ -93,7 +93,7 @@ func (v Value) getBytes() (x []byte) {
*(*sliceHeader)(unsafe.Pointer(&x)) = sliceHeader{Data: v.ptr, Len: int(v.num), Cap: int(v.num)} *(*sliceHeader)(unsafe.Pointer(&x)) = sliceHeader{Data: v.ptr, Len: int(v.num), Cap: int(v.num)}
return x return x
} }
func (v Value) getIface() (x interface{}) { func (v Value) getIface() (x any) {
*(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr}
return x return x
} }

View File

@ -15,7 +15,7 @@ import (
type ( type (
ifaceHeader struct { ifaceHeader struct {
_ [0]interface{} // if interfaces have greater alignment than unsafe.Pointer, this will enforce it. _ [0]any // if interfaces have greater alignment than unsafe.Pointer, this will enforce it.
Type unsafe.Pointer Type unsafe.Pointer
Data unsafe.Pointer Data unsafe.Pointer
} }
@ -37,7 +37,7 @@ var (
// typeOf returns a pointer to the Go type information. // typeOf returns a pointer to the Go type information.
// The pointer is comparable and equal if and only if the types are identical. // The pointer is comparable and equal if and only if the types are identical.
func typeOf(t interface{}) unsafe.Pointer { func typeOf(t any) unsafe.Pointer {
return (*ifaceHeader)(unsafe.Pointer(&t)).Type return (*ifaceHeader)(unsafe.Pointer(&t)).Type
} }
@ -70,7 +70,7 @@ func valueOfString(v string) Value {
func valueOfBytes(v []byte) Value { func valueOfBytes(v []byte) Value {
return Value{typ: bytesType, ptr: unsafe.Pointer(unsafe.SliceData(v)), num: uint64(len(v))} return Value{typ: bytesType, ptr: unsafe.Pointer(unsafe.SliceData(v)), num: uint64(len(v))}
} }
func valueOfIface(v interface{}) Value { func valueOfIface(v any) Value {
p := (*ifaceHeader)(unsafe.Pointer(&v)) p := (*ifaceHeader)(unsafe.Pointer(&v))
return Value{typ: p.Type, ptr: p.Data} return Value{typ: p.Type, ptr: p.Data}
} }
@ -81,7 +81,7 @@ func (v Value) getString() string {
func (v Value) getBytes() []byte { func (v Value) getBytes() []byte {
return unsafe.Slice((*byte)(v.ptr), v.num) return unsafe.Slice((*byte)(v.ptr), v.num)
} }
func (v Value) getIface() (x interface{}) { func (v Value) getIface() (x any) {
*(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr}
return x return x
} }

View File

@ -95,7 +95,7 @@ type Files struct {
// multiple files. Only top-level declarations are registered. // multiple files. Only top-level declarations are registered.
// Note that enum values are in the top-level since that are in the same // Note that enum values are in the top-level since that are in the same
// scope as the parent enum. // scope as the parent enum.
descsByName map[protoreflect.FullName]interface{} descsByName map[protoreflect.FullName]any
filesByPath map[string][]protoreflect.FileDescriptor filesByPath map[string][]protoreflect.FileDescriptor
numFiles int numFiles int
} }
@ -117,7 +117,7 @@ func (r *Files) RegisterFile(file protoreflect.FileDescriptor) error {
defer globalMutex.Unlock() defer globalMutex.Unlock()
} }
if r.descsByName == nil { if r.descsByName == nil {
r.descsByName = map[protoreflect.FullName]interface{}{ r.descsByName = map[protoreflect.FullName]any{
"": &packageDescriptor{}, "": &packageDescriptor{},
} }
r.filesByPath = make(map[string][]protoreflect.FileDescriptor) r.filesByPath = make(map[string][]protoreflect.FileDescriptor)
@ -485,7 +485,7 @@ type Types struct {
} }
type ( type (
typesByName map[protoreflect.FullName]interface{} typesByName map[protoreflect.FullName]any
extensionsByMessage map[protoreflect.FullName]extensionsByNumber extensionsByMessage map[protoreflect.FullName]extensionsByNumber
extensionsByNumber map[protoreflect.FieldNumber]protoreflect.ExtensionType extensionsByNumber map[protoreflect.FieldNumber]protoreflect.ExtensionType
) )
@ -570,7 +570,7 @@ func (r *Types) RegisterExtension(xt protoreflect.ExtensionType) error {
return nil return nil
} }
func (r *Types) register(kind string, desc protoreflect.Descriptor, typ interface{}) error { func (r *Types) register(kind string, desc protoreflect.Descriptor, typ any) error {
name := desc.FullName() name := desc.FullName()
prev := r.typesByName[name] prev := r.typesByName[name]
if prev != nil { if prev != nil {
@ -841,7 +841,7 @@ func (r *Types) RangeExtensionsByMessage(message protoreflect.FullName, f func(p
} }
} }
func typeName(t interface{}) string { func typeName(t any) string {
switch t.(type) { switch t.(type) {
case protoreflect.EnumType: case protoreflect.EnumType:
return "enum" return "enum"
@ -854,7 +854,7 @@ func typeName(t interface{}) string {
} }
} }
func amendErrorWithCaller(err error, prev, curr interface{}) error { func amendErrorWithCaller(err error, prev, curr any) error {
prevPkg := goPackage(prev) prevPkg := goPackage(prev)
currPkg := goPackage(curr) currPkg := goPackage(curr)
if prevPkg == "" || currPkg == "" || prevPkg == currPkg { if prevPkg == "" || currPkg == "" || prevPkg == currPkg {
@ -863,7 +863,7 @@ func amendErrorWithCaller(err error, prev, curr interface{}) error {
return errors.New("%s\n\tpreviously from: %q\n\tcurrently from: %q", err, prevPkg, currPkg) return errors.New("%s\n\tpreviously from: %q\n\tcurrently from: %q", err, prevPkg, currPkg)
} }
func goPackage(v interface{}) string { func goPackage(v any) string {
switch d := v.(type) { switch d := v.(type) {
case protoreflect.EnumType: case protoreflect.EnumType:
v = d.Descriptor() v = d.Descriptor()

File diff suppressed because it is too large Load Diff

View File

@ -294,7 +294,7 @@ func (m *Message) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
case fd.IsMap(): case fd.IsMap():
return protoreflect.ValueOfMap(&dynamicMap{ return protoreflect.ValueOfMap(&dynamicMap{
desc: fd, desc: fd,
mapv: make(map[interface{}]protoreflect.Value), mapv: make(map[any]protoreflect.Value),
}) })
case fd.IsList(): case fd.IsList():
return protoreflect.ValueOfList(&dynamicList{desc: fd}) return protoreflect.ValueOfList(&dynamicList{desc: fd})
@ -450,7 +450,7 @@ func (x *dynamicList) IsValid() bool {
type dynamicMap struct { type dynamicMap struct {
desc protoreflect.FieldDescriptor desc protoreflect.FieldDescriptor
mapv map[interface{}]protoreflect.Value mapv map[any]protoreflect.Value
} }
func (x *dynamicMap) Get(k protoreflect.MapKey) protoreflect.Value { return x.mapv[k.Interface()] } func (x *dynamicMap) Get(k protoreflect.MapKey) protoreflect.Value { return x.mapv[k.Interface()] }
@ -634,11 +634,11 @@ func newListEntry(fd protoreflect.FieldDescriptor) protoreflect.Value {
// //
// The InterfaceOf and ValueOf methods of the extension type are defined as: // The InterfaceOf and ValueOf methods of the extension type are defined as:
// //
// func (xt extensionType) ValueOf(iv interface{}) protoreflect.Value { // func (xt extensionType) ValueOf(iv any) protoreflect.Value {
// return protoreflect.ValueOf(iv) // return protoreflect.ValueOf(iv)
// } // }
// //
// func (xt extensionType) InterfaceOf(v protoreflect.Value) interface{} { // func (xt extensionType) InterfaceOf(v protoreflect.Value) any {
// return v.Interface() // return v.Interface()
// } // }
// //
@ -658,7 +658,7 @@ func (xt extensionType) New() protoreflect.Value {
case xt.desc.IsMap(): case xt.desc.IsMap():
return protoreflect.ValueOfMap(&dynamicMap{ return protoreflect.ValueOfMap(&dynamicMap{
desc: xt.desc, desc: xt.desc,
mapv: make(map[interface{}]protoreflect.Value), mapv: make(map[any]protoreflect.Value),
}) })
case xt.desc.IsList(): case xt.desc.IsList():
return protoreflect.ValueOfList(&dynamicList{desc: xt.desc}) return protoreflect.ValueOfList(&dynamicList{desc: xt.desc})
@ -686,18 +686,18 @@ func (xt extensionType) TypeDescriptor() protoreflect.ExtensionTypeDescriptor {
return xt.desc return xt.desc
} }
func (xt extensionType) ValueOf(iv interface{}) protoreflect.Value { func (xt extensionType) ValueOf(iv any) protoreflect.Value {
v := protoreflect.ValueOf(iv) v := protoreflect.ValueOf(iv)
typecheck(xt.desc, v) typecheck(xt.desc, v)
return v return v
} }
func (xt extensionType) InterfaceOf(v protoreflect.Value) interface{} { func (xt extensionType) InterfaceOf(v protoreflect.Value) any {
typecheck(xt.desc, v) typecheck(xt.desc, v)
return v.Interface() return v.Interface()
} }
func (xt extensionType) IsValidInterface(iv interface{}) bool { func (xt extensionType) IsValidInterface(iv any) bool {
return typeIsValid(xt.desc, protoreflect.ValueOf(iv)) == nil return typeIsValid(xt.desc, protoreflect.ValueOf(iv)) == nil
} }

View File

@ -90,27 +90,27 @@ var file_google_protobuf_go_features_proto_rawDesc = []byte{
0x66, 0x2f, 0x67, 0x6f, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x66, 0x2f, 0x67, 0x6f, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x01, 0x0a, 0x0a, 0x47, 0x6f, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x01, 0x0a, 0x0a, 0x47, 0x6f,
0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0xba, 0x01, 0x0a, 0x1a, 0x6c, 0x65, 0x67, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0xbe, 0x01, 0x0a, 0x1a, 0x6c, 0x65, 0x67,
0x61, 0x63, 0x79, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x6a, 0x73, 0x61, 0x63, 0x79, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x6a, 0x73,
0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x7d, 0x88, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x80, 0x01,
0x01, 0x01, 0x98, 0x01, 0x06, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x74, 0x72, 0x75, 0x65, 0x18, 0x84, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x74, 0x72,
0x07, 0xa2, 0x01, 0x0a, 0x12, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x18, 0xe7, 0x07, 0xb2, 0x01, 0x75, 0x65, 0x18, 0x84, 0x07, 0xa2, 0x01, 0x0a, 0x12, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x18,
0x5b, 0x08, 0xe8, 0x07, 0x10, 0xe8, 0x07, 0x1a, 0x53, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x67, 0xe7, 0x07, 0xb2, 0x01, 0x5b, 0x08, 0xe8, 0x07, 0x10, 0xe8, 0x07, 0x1a, 0x53, 0x54, 0x68, 0x65,
0x61, 0x63, 0x79, 0x20, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x4a, 0x53, 0x4f, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61,
0x4e, 0x20, 0x41, 0x50, 0x49, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x6c, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x41, 0x50, 0x49, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70,
0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c,
0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x66, 0x75, 0x74, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61,
0x75, 0x72, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x17, 0x6c, 0x65, 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
0x67, 0x61, 0x63, 0x79, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x4a, 0x73, 0x6f, 0x52, 0x17, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61,
0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x3c, 0x0a, 0x02, 0x67, 0x6f, 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x6c, 0x4a, 0x73, 0x6f, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x3a, 0x3c, 0x0a, 0x02, 0x67, 0x6f, 0x12,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x18, 0xea, 0x07, 0x20,
0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75,
0x02, 0x67, 0x6f, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x02, 0x67, 0x6f, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f,
0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x67, 0x6f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x67, 0x6f, 0x66, 0x65,
0x65, 0x73, 0x70, 0x62, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x70, 0x62,
} }
var ( var (
@ -126,7 +126,7 @@ func file_google_protobuf_go_features_proto_rawDescGZIP() []byte {
} }
var file_google_protobuf_go_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_go_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_protobuf_go_features_proto_goTypes = []interface{}{ var file_google_protobuf_go_features_proto_goTypes = []any{
(*GoFeatures)(nil), // 0: pb.GoFeatures (*GoFeatures)(nil), // 0: pb.GoFeatures
(*descriptorpb.FeatureSet)(nil), // 1: google.protobuf.FeatureSet (*descriptorpb.FeatureSet)(nil), // 1: google.protobuf.FeatureSet
} }
@ -146,7 +146,7 @@ func file_google_protobuf_go_features_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_protobuf_go_features_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_go_features_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*GoFeatures); i { switch v := v.(*GoFeatures); i {
case 0: case 0:
return &v.state return &v.state

View File

@ -445,7 +445,7 @@ func file_google_protobuf_any_proto_rawDescGZIP() []byte {
} }
var file_google_protobuf_any_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_any_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_protobuf_any_proto_goTypes = []interface{}{ var file_google_protobuf_any_proto_goTypes = []any{
(*Any)(nil), // 0: google.protobuf.Any (*Any)(nil), // 0: google.protobuf.Any
} }
var file_google_protobuf_any_proto_depIdxs = []int32{ var file_google_protobuf_any_proto_depIdxs = []int32{
@ -462,7 +462,7 @@ func file_google_protobuf_any_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_protobuf_any_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_any_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Any); i { switch v := v.(*Any); i {
case 0: case 0:
return &v.state return &v.state

View File

@ -323,7 +323,7 @@ func file_google_protobuf_duration_proto_rawDescGZIP() []byte {
} }
var file_google_protobuf_duration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_duration_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_protobuf_duration_proto_goTypes = []interface{}{ var file_google_protobuf_duration_proto_goTypes = []any{
(*Duration)(nil), // 0: google.protobuf.Duration (*Duration)(nil), // 0: google.protobuf.Duration
} }
var file_google_protobuf_duration_proto_depIdxs = []int32{ var file_google_protobuf_duration_proto_depIdxs = []int32{
@ -340,7 +340,7 @@ func file_google_protobuf_duration_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_protobuf_duration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_duration_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Duration); i { switch v := v.(*Duration); i {
case 0: case 0:
return &v.state return &v.state

View File

@ -115,7 +115,7 @@ func file_google_protobuf_empty_proto_rawDescGZIP() []byte {
} }
var file_google_protobuf_empty_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_empty_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_protobuf_empty_proto_goTypes = []interface{}{ var file_google_protobuf_empty_proto_goTypes = []any{
(*Empty)(nil), // 0: google.protobuf.Empty (*Empty)(nil), // 0: google.protobuf.Empty
} }
var file_google_protobuf_empty_proto_depIdxs = []int32{ var file_google_protobuf_empty_proto_depIdxs = []int32{
@ -132,7 +132,7 @@ func file_google_protobuf_empty_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_protobuf_empty_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_empty_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Empty); i { switch v := v.(*Empty); i {
case 0: case 0:
return &v.state return &v.state

View File

@ -537,7 +537,7 @@ func file_google_protobuf_field_mask_proto_rawDescGZIP() []byte {
} }
var file_google_protobuf_field_mask_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_field_mask_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_protobuf_field_mask_proto_goTypes = []interface{}{ var file_google_protobuf_field_mask_proto_goTypes = []any{
(*FieldMask)(nil), // 0: google.protobuf.FieldMask (*FieldMask)(nil), // 0: google.protobuf.FieldMask
} }
var file_google_protobuf_field_mask_proto_depIdxs = []int32{ var file_google_protobuf_field_mask_proto_depIdxs = []int32{
@ -554,7 +554,7 @@ func file_google_protobuf_field_mask_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_protobuf_field_mask_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_field_mask_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*FieldMask); i { switch v := v.(*FieldMask); i {
case 0: case 0:
return &v.state return &v.state

View File

@ -49,11 +49,11 @@
// The standard Go "encoding/json" package has functionality to serialize // The standard Go "encoding/json" package has functionality to serialize
// arbitrary types to a large degree. The Value.AsInterface, Struct.AsMap, and // arbitrary types to a large degree. The Value.AsInterface, Struct.AsMap, and
// ListValue.AsSlice methods can convert the protobuf message representation into // ListValue.AsSlice methods can convert the protobuf message representation into
// a form represented by interface{}, map[string]interface{}, and []interface{}. // a form represented by any, map[string]any, and []any.
// This form can be used with other packages that operate on such data structures // This form can be used with other packages that operate on such data structures
// and also directly with the standard json package. // and also directly with the standard json package.
// //
// In order to convert the interface{}, map[string]interface{}, and []interface{} // In order to convert the any, map[string]any, and []any
// forms back as Value, Struct, and ListValue messages, use the NewStruct, // forms back as Value, Struct, and ListValue messages, use the NewStruct,
// NewList, and NewValue constructor functions. // NewList, and NewValue constructor functions.
// //
@ -88,28 +88,28 @@
// //
// To construct a Value message representing the above JSON object: // To construct a Value message representing the above JSON object:
// //
// m, err := structpb.NewValue(map[string]interface{}{ // m, err := structpb.NewValue(map[string]any{
// "firstName": "John", // "firstName": "John",
// "lastName": "Smith", // "lastName": "Smith",
// "isAlive": true, // "isAlive": true,
// "age": 27, // "age": 27,
// "address": map[string]interface{}{ // "address": map[string]any{
// "streetAddress": "21 2nd Street", // "streetAddress": "21 2nd Street",
// "city": "New York", // "city": "New York",
// "state": "NY", // "state": "NY",
// "postalCode": "10021-3100", // "postalCode": "10021-3100",
// }, // },
// "phoneNumbers": []interface{}{ // "phoneNumbers": []any{
// map[string]interface{}{ // map[string]any{
// "type": "home", // "type": "home",
// "number": "212 555-1234", // "number": "212 555-1234",
// }, // },
// map[string]interface{}{ // map[string]any{
// "type": "office", // "type": "office",
// "number": "646 555-4567", // "number": "646 555-4567",
// }, // },
// }, // },
// "children": []interface{}{}, // "children": []any{},
// "spouse": nil, // "spouse": nil,
// }) // })
// if err != nil { // if err != nil {
@ -197,7 +197,7 @@ type Struct struct {
// NewStruct constructs a Struct from a general-purpose Go map. // NewStruct constructs a Struct from a general-purpose Go map.
// The map keys must be valid UTF-8. // The map keys must be valid UTF-8.
// The map values are converted using NewValue. // The map values are converted using NewValue.
func NewStruct(v map[string]interface{}) (*Struct, error) { func NewStruct(v map[string]any) (*Struct, error) {
x := &Struct{Fields: make(map[string]*Value, len(v))} x := &Struct{Fields: make(map[string]*Value, len(v))}
for k, v := range v { for k, v := range v {
if !utf8.ValidString(k) { if !utf8.ValidString(k) {
@ -214,9 +214,9 @@ func NewStruct(v map[string]interface{}) (*Struct, error) {
// AsMap converts x to a general-purpose Go map. // AsMap converts x to a general-purpose Go map.
// The map values are converted by calling Value.AsInterface. // The map values are converted by calling Value.AsInterface.
func (x *Struct) AsMap() map[string]interface{} { func (x *Struct) AsMap() map[string]any {
f := x.GetFields() f := x.GetFields()
vs := make(map[string]interface{}, len(f)) vs := make(map[string]any, len(f))
for k, v := range f { for k, v := range f {
vs[k] = v.AsInterface() vs[k] = v.AsInterface()
} }
@ -306,13 +306,13 @@ type Value struct {
// ║ float32, float64 │ stored as NumberValue ║ // ║ float32, float64 │ stored as NumberValue ║
// ║ string │ stored as StringValue; must be valid UTF-8 ║ // ║ string │ stored as StringValue; must be valid UTF-8 ║
// ║ []byte │ stored as StringValue; base64-encoded ║ // ║ []byte │ stored as StringValue; base64-encoded ║
// ║ map[string]interface{} │ stored as StructValue ║ // ║ map[string]any │ stored as StructValue ║
// ║ []interface{} │ stored as ListValue ║ // ║ []any │ stored as ListValue ║
// ╚════════════════════════╧════════════════════════════════════════════╝ // ╚════════════════════════╧════════════════════════════════════════════╝
// //
// When converting an int64 or uint64 to a NumberValue, numeric precision loss // When converting an int64 or uint64 to a NumberValue, numeric precision loss
// is possible since they are stored as a float64. // is possible since they are stored as a float64.
func NewValue(v interface{}) (*Value, error) { func NewValue(v any) (*Value, error) {
switch v := v.(type) { switch v := v.(type) {
case nil: case nil:
return NewNullValue(), nil return NewNullValue(), nil
@ -342,13 +342,13 @@ func NewValue(v interface{}) (*Value, error) {
case []byte: case []byte:
s := base64.StdEncoding.EncodeToString(v) s := base64.StdEncoding.EncodeToString(v)
return NewStringValue(s), nil return NewStringValue(s), nil
case map[string]interface{}: case map[string]any:
v2, err := NewStruct(v) v2, err := NewStruct(v)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return NewStructValue(v2), nil return NewStructValue(v2), nil
case []interface{}: case []any:
v2, err := NewList(v) v2, err := NewList(v)
if err != nil { if err != nil {
return nil, err return nil, err
@ -396,7 +396,7 @@ func NewListValue(v *ListValue) *Value {
// //
// Floating-point values (i.e., "NaN", "Infinity", and "-Infinity") are // Floating-point values (i.e., "NaN", "Infinity", and "-Infinity") are
// converted as strings to remain compatible with MarshalJSON. // converted as strings to remain compatible with MarshalJSON.
func (x *Value) AsInterface() interface{} { func (x *Value) AsInterface() any {
switch v := x.GetKind().(type) { switch v := x.GetKind().(type) {
case *Value_NumberValue: case *Value_NumberValue:
if v != nil { if v != nil {
@ -580,7 +580,7 @@ type ListValue struct {
// NewList constructs a ListValue from a general-purpose Go slice. // NewList constructs a ListValue from a general-purpose Go slice.
// The slice elements are converted using NewValue. // The slice elements are converted using NewValue.
func NewList(v []interface{}) (*ListValue, error) { func NewList(v []any) (*ListValue, error) {
x := &ListValue{Values: make([]*Value, len(v))} x := &ListValue{Values: make([]*Value, len(v))}
for i, v := range v { for i, v := range v {
var err error var err error
@ -594,9 +594,9 @@ func NewList(v []interface{}) (*ListValue, error) {
// AsSlice converts x to a general-purpose Go slice. // AsSlice converts x to a general-purpose Go slice.
// The slice elements are converted by calling Value.AsInterface. // The slice elements are converted by calling Value.AsInterface.
func (x *ListValue) AsSlice() []interface{} { func (x *ListValue) AsSlice() []any {
vals := x.GetValues() vals := x.GetValues()
vs := make([]interface{}, len(vals)) vs := make([]any, len(vals))
for i, v := range vals { for i, v := range vals {
vs[i] = v.AsInterface() vs[i] = v.AsInterface()
} }
@ -716,7 +716,7 @@ func file_google_protobuf_struct_proto_rawDescGZIP() []byte {
var file_google_protobuf_struct_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_google_protobuf_struct_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_google_protobuf_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_google_protobuf_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_google_protobuf_struct_proto_goTypes = []interface{}{ var file_google_protobuf_struct_proto_goTypes = []any{
(NullValue)(0), // 0: google.protobuf.NullValue (NullValue)(0), // 0: google.protobuf.NullValue
(*Struct)(nil), // 1: google.protobuf.Struct (*Struct)(nil), // 1: google.protobuf.Struct
(*Value)(nil), // 2: google.protobuf.Value (*Value)(nil), // 2: google.protobuf.Value
@ -743,7 +743,7 @@ func file_google_protobuf_struct_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_protobuf_struct_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_struct_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Struct); i { switch v := v.(*Struct); i {
case 0: case 0:
return &v.state return &v.state
@ -755,7 +755,7 @@ func file_google_protobuf_struct_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_struct_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_struct_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*Value); i { switch v := v.(*Value); i {
case 0: case 0:
return &v.state return &v.state
@ -767,7 +767,7 @@ func file_google_protobuf_struct_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_struct_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_struct_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ListValue); i { switch v := v.(*ListValue); i {
case 0: case 0:
return &v.state return &v.state
@ -780,7 +780,7 @@ func file_google_protobuf_struct_proto_init() {
} }
} }
} }
file_google_protobuf_struct_proto_msgTypes[1].OneofWrappers = []interface{}{ file_google_protobuf_struct_proto_msgTypes[1].OneofWrappers = []any{
(*Value_NullValue)(nil), (*Value_NullValue)(nil),
(*Value_NumberValue)(nil), (*Value_NumberValue)(nil),
(*Value_StringValue)(nil), (*Value_StringValue)(nil),

View File

@ -332,7 +332,7 @@ func file_google_protobuf_timestamp_proto_rawDescGZIP() []byte {
} }
var file_google_protobuf_timestamp_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_protobuf_timestamp_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_protobuf_timestamp_proto_goTypes = []interface{}{ var file_google_protobuf_timestamp_proto_goTypes = []any{
(*Timestamp)(nil), // 0: google.protobuf.Timestamp (*Timestamp)(nil), // 0: google.protobuf.Timestamp
} }
var file_google_protobuf_timestamp_proto_depIdxs = []int32{ var file_google_protobuf_timestamp_proto_depIdxs = []int32{
@ -349,7 +349,7 @@ func file_google_protobuf_timestamp_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_protobuf_timestamp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_timestamp_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Timestamp); i { switch v := v.(*Timestamp); i {
case 0: case 0:
return &v.state return &v.state

View File

@ -605,7 +605,7 @@ func file_google_protobuf_wrappers_proto_rawDescGZIP() []byte {
} }
var file_google_protobuf_wrappers_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_google_protobuf_wrappers_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_google_protobuf_wrappers_proto_goTypes = []interface{}{ var file_google_protobuf_wrappers_proto_goTypes = []any{
(*DoubleValue)(nil), // 0: google.protobuf.DoubleValue (*DoubleValue)(nil), // 0: google.protobuf.DoubleValue
(*FloatValue)(nil), // 1: google.protobuf.FloatValue (*FloatValue)(nil), // 1: google.protobuf.FloatValue
(*Int64Value)(nil), // 2: google.protobuf.Int64Value (*Int64Value)(nil), // 2: google.protobuf.Int64Value
@ -630,7 +630,7 @@ func file_google_protobuf_wrappers_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_protobuf_wrappers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*DoubleValue); i { switch v := v.(*DoubleValue); i {
case 0: case 0:
return &v.state return &v.state
@ -642,7 +642,7 @@ func file_google_protobuf_wrappers_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_wrappers_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*FloatValue); i { switch v := v.(*FloatValue); i {
case 0: case 0:
return &v.state return &v.state
@ -654,7 +654,7 @@ func file_google_protobuf_wrappers_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_wrappers_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*Int64Value); i { switch v := v.(*Int64Value); i {
case 0: case 0:
return &v.state return &v.state
@ -666,7 +666,7 @@ func file_google_protobuf_wrappers_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_wrappers_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*UInt64Value); i { switch v := v.(*UInt64Value); i {
case 0: case 0:
return &v.state return &v.state
@ -678,7 +678,7 @@ func file_google_protobuf_wrappers_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_wrappers_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*Int32Value); i { switch v := v.(*Int32Value); i {
case 0: case 0:
return &v.state return &v.state
@ -690,7 +690,7 @@ func file_google_protobuf_wrappers_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_wrappers_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*UInt32Value); i { switch v := v.(*UInt32Value); i {
case 0: case 0:
return &v.state return &v.state
@ -702,7 +702,7 @@ func file_google_protobuf_wrappers_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_wrappers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*BoolValue); i { switch v := v.(*BoolValue); i {
case 0: case 0:
return &v.state return &v.state
@ -714,7 +714,7 @@ func file_google_protobuf_wrappers_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_wrappers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*StringValue); i { switch v := v.(*StringValue); i {
case 0: case 0:
return &v.state return &v.state
@ -726,7 +726,7 @@ func file_google_protobuf_wrappers_proto_init() {
return nil return nil
} }
} }
file_google_protobuf_wrappers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_google_protobuf_wrappers_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*BytesValue); i { switch v := v.(*BytesValue); i {
case 0: case 0:
return &v.state return &v.state

8
vendor/modules.txt vendored
View File

@ -81,7 +81,7 @@ github.com/antlr/antlr4/runtime/Go/antlr/v4
# github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a # github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
## explicit ## explicit
github.com/asaskevich/govalidator github.com/asaskevich/govalidator
# github.com/aws/aws-sdk-go v1.51.12 # github.com/aws/aws-sdk-go v1.53.14
## explicit; go 1.19 ## explicit; go 1.19
github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws
github.com/aws/aws-sdk-go/aws/auth/bearer github.com/aws/aws-sdk-go/aws/auth/bearer
@ -204,7 +204,7 @@ github.com/ceph/ceph-csi/api/deploy/kubernetes/cephfs
github.com/ceph/ceph-csi/api/deploy/kubernetes/nfs github.com/ceph/ceph-csi/api/deploy/kubernetes/nfs
github.com/ceph/ceph-csi/api/deploy/kubernetes/rbd github.com/ceph/ceph-csi/api/deploy/kubernetes/rbd
github.com/ceph/ceph-csi/api/deploy/ocp github.com/ceph/ceph-csi/api/deploy/ocp
# github.com/ceph/go-ceph v0.27.0 # github.com/ceph/go-ceph v0.28.0
## explicit; go 1.19 ## explicit; go 1.19
github.com/ceph/go-ceph/cephfs github.com/ceph/go-ceph/cephfs
github.com/ceph/go-ceph/cephfs/admin github.com/ceph/go-ceph/cephfs/admin
@ -888,8 +888,8 @@ google.golang.org/grpc/serviceconfig
google.golang.org/grpc/stats google.golang.org/grpc/stats
google.golang.org/grpc/status google.golang.org/grpc/status
google.golang.org/grpc/tap google.golang.org/grpc/tap
# google.golang.org/protobuf v1.34.1 # google.golang.org/protobuf v1.34.2
## explicit; go 1.17 ## explicit; go 1.20
google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/protojson
google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/prototext
google.golang.org/protobuf/encoding/protowire google.golang.org/protobuf/encoding/protowire