mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-29 04:19:57 +00:00
TUN-9016: update go to 1.24
## Summary Update several moving parts of cloudflared build system: * use goboring 1.24.2 in cfsetup * update linter and fix lint issues * update packages namely **quic-go and net** * install script for macos * update docker files to use go 1.24.1 * remove usage of cloudflare-go * pin golang linter Closes TUN-9016
This commit is contained in:
43
vendor/google.golang.org/protobuf/internal/impl/message.go
generated
vendored
43
vendor/google.golang.org/protobuf/internal/impl/message.go
generated
vendored
@@ -14,7 +14,6 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
// MessageInfo provides protobuf related functionality for a given Go type
|
||||
@@ -30,12 +29,12 @@ type MessageInfo struct {
|
||||
// Desc is the underlying message descriptor type and must be populated.
|
||||
Desc protoreflect.MessageDescriptor
|
||||
|
||||
// Exporter must be provided in a purego environment in order to provide
|
||||
// access to unexported fields.
|
||||
// Deprecated: Exporter will be removed the next time we bump
|
||||
// protoimpl.GenVersion. See https://github.com/golang/protobuf/issues/1640
|
||||
Exporter exporter
|
||||
|
||||
// OneofWrappers is list of pointers to oneof wrapper struct types.
|
||||
OneofWrappers []interface{}
|
||||
OneofWrappers []any
|
||||
|
||||
initMu sync.Mutex // protects all unexported fields
|
||||
initDone uint32
|
||||
@@ -47,7 +46,7 @@ type MessageInfo struct {
|
||||
// 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
|
||||
// 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
|
||||
// is generated by our implementation of protoc-gen-go (for v2 and on).
|
||||
@@ -79,6 +78,9 @@ func (mi *MessageInfo) initOnce() {
|
||||
if mi.initDone == 1 {
|
||||
return
|
||||
}
|
||||
if opaqueInitHook(mi) {
|
||||
return
|
||||
}
|
||||
|
||||
t := mi.GoReflectType
|
||||
if t.Kind() != reflect.Ptr && t.Elem().Kind() != reflect.Struct {
|
||||
@@ -117,7 +119,6 @@ type (
|
||||
|
||||
var (
|
||||
sizecacheType = reflect.TypeOf(SizeCache(0))
|
||||
weakFieldsType = reflect.TypeOf(WeakFields(nil))
|
||||
unknownFieldsAType = reflect.TypeOf(unknownFieldsA(nil))
|
||||
unknownFieldsBType = reflect.TypeOf(unknownFieldsB(nil))
|
||||
extensionFieldsType = reflect.TypeOf(ExtensionFields(nil))
|
||||
@@ -126,13 +127,14 @@ var (
|
||||
type structInfo struct {
|
||||
sizecacheOffset offset
|
||||
sizecacheType reflect.Type
|
||||
weakOffset offset
|
||||
weakType reflect.Type
|
||||
unknownOffset offset
|
||||
unknownType reflect.Type
|
||||
extensionOffset offset
|
||||
extensionType reflect.Type
|
||||
|
||||
lazyOffset offset
|
||||
presenceOffset offset
|
||||
|
||||
fieldsByNumber map[protoreflect.FieldNumber]reflect.StructField
|
||||
oneofsByName map[protoreflect.Name]reflect.StructField
|
||||
oneofWrappersByType map[reflect.Type]protoreflect.FieldNumber
|
||||
@@ -142,9 +144,10 @@ type structInfo struct {
|
||||
func (mi *MessageInfo) makeStructInfo(t reflect.Type) structInfo {
|
||||
si := structInfo{
|
||||
sizecacheOffset: invalidOffset,
|
||||
weakOffset: invalidOffset,
|
||||
unknownOffset: invalidOffset,
|
||||
extensionOffset: invalidOffset,
|
||||
lazyOffset: invalidOffset,
|
||||
presenceOffset: invalidOffset,
|
||||
|
||||
fieldsByNumber: map[protoreflect.FieldNumber]reflect.StructField{},
|
||||
oneofsByName: map[protoreflect.Name]reflect.StructField{},
|
||||
@@ -157,24 +160,23 @@ fieldLoop:
|
||||
switch f := t.Field(i); f.Name {
|
||||
case genid.SizeCache_goname, genid.SizeCacheA_goname:
|
||||
if f.Type == sizecacheType {
|
||||
si.sizecacheOffset = offsetOf(f, mi.Exporter)
|
||||
si.sizecacheOffset = offsetOf(f)
|
||||
si.sizecacheType = f.Type
|
||||
}
|
||||
case genid.WeakFields_goname, genid.WeakFieldsA_goname:
|
||||
if f.Type == weakFieldsType {
|
||||
si.weakOffset = offsetOf(f, mi.Exporter)
|
||||
si.weakType = f.Type
|
||||
}
|
||||
case genid.UnknownFields_goname, genid.UnknownFieldsA_goname:
|
||||
if f.Type == unknownFieldsAType || f.Type == unknownFieldsBType {
|
||||
si.unknownOffset = offsetOf(f, mi.Exporter)
|
||||
si.unknownOffset = offsetOf(f)
|
||||
si.unknownType = f.Type
|
||||
}
|
||||
case genid.ExtensionFields_goname, genid.ExtensionFieldsA_goname, genid.ExtensionFieldsB_goname:
|
||||
if f.Type == extensionFieldsType {
|
||||
si.extensionOffset = offsetOf(f, mi.Exporter)
|
||||
si.extensionOffset = offsetOf(f)
|
||||
si.extensionType = f.Type
|
||||
}
|
||||
case "lazyFields", "XXX_lazyUnmarshalInfo":
|
||||
si.lazyOffset = offsetOf(f)
|
||||
case "XXX_presence":
|
||||
si.presenceOffset = offsetOf(f)
|
||||
default:
|
||||
for _, s := range strings.Split(f.Tag.Get("protobuf"), ",") {
|
||||
if len(s) > 0 && strings.Trim(s, "0123456789") == "" {
|
||||
@@ -201,7 +203,7 @@ fieldLoop:
|
||||
}
|
||||
for _, fn := range methods {
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -244,9 +246,6 @@ func (mi *MessageInfo) Message(i int) protoreflect.MessageType {
|
||||
mi.init()
|
||||
fd := mi.Desc.Fields().Get(i)
|
||||
switch {
|
||||
case fd.IsWeak():
|
||||
mt, _ := protoregistry.GlobalTypes.FindMessageByName(fd.Message().FullName())
|
||||
return mt
|
||||
case fd.IsMap():
|
||||
return mapEntryType{fd.Message(), mi.fieldTypes[fd.Number()]}
|
||||
default:
|
||||
@@ -256,7 +255,7 @@ func (mi *MessageInfo) Message(i int) protoreflect.MessageType {
|
||||
|
||||
type mapEntryType struct {
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user