diff options
author | 2025-03-09 17:47:56 +0100 | |
---|---|---|
committer | 2025-03-10 01:59:49 +0100 | |
commit | 3ac1ee16f377d31a0fb80c8dae28b6239ac4229e (patch) | |
tree | f61faa581feaaeaba2542b9f2b8234a590684413 /vendor/google.golang.org/protobuf/internal/impl/message_opaque_gen.go | |
parent | [chore] update URLs to forked source (diff) | |
download | gotosocial-3ac1ee16f377d31a0fb80c8dae28b6239ac4229e.tar.xz |
[chore] remove vendor
Diffstat (limited to 'vendor/google.golang.org/protobuf/internal/impl/message_opaque_gen.go')
-rw-r--r-- | vendor/google.golang.org/protobuf/internal/impl/message_opaque_gen.go | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/vendor/google.golang.org/protobuf/internal/impl/message_opaque_gen.go b/vendor/google.golang.org/protobuf/internal/impl/message_opaque_gen.go deleted file mode 100644 index a69825699..000000000 --- a/vendor/google.golang.org/protobuf/internal/impl/message_opaque_gen.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by generate-types. DO NOT EDIT. - -package impl - -import ( - "reflect" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -func getterForOpaqueNullableScalar(mi *MessageInfo, index uint32, fd protoreflect.FieldDescriptor, fs reflect.StructField, conv Converter, fieldOffset offset) func(p pointer) protoreflect.Value { - ft := fs.Type - if ft.Kind() == reflect.Ptr { - ft = ft.Elem() - } - if fd.Kind() == protoreflect.EnumKind { - // Enums for nullable opaque types. - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() - return conv.PBValueOf(rv) - } - } - switch ft.Kind() { - case reflect.Bool: - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Bool() - return protoreflect.ValueOfBool(*x) - } - case reflect.Int32: - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Int32() - return protoreflect.ValueOfInt32(*x) - } - case reflect.Uint32: - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Uint32() - return protoreflect.ValueOfUint32(*x) - } - case reflect.Int64: - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Int64() - return protoreflect.ValueOfInt64(*x) - } - case reflect.Uint64: - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Uint64() - return protoreflect.ValueOfUint64(*x) - } - case reflect.Float32: - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Float32() - return protoreflect.ValueOfFloat32(*x) - } - case reflect.Float64: - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Float64() - return protoreflect.ValueOfFloat64(*x) - } - case reflect.String: - if fd.Kind() == protoreflect.BytesKind { - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).StringPtr() - if *x == nil { - return conv.Zero() - } - if len(**x) == 0 { - return protoreflect.ValueOfBytes(nil) - } - return protoreflect.ValueOfBytes([]byte(**x)) - } - } - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).StringPtr() - if *x == nil { - return conv.Zero() - } - return protoreflect.ValueOfString(**x) - } - case reflect.Slice: - if fd.Kind() == protoreflect.StringKind { - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Bytes() - return protoreflect.ValueOfString(string(*x)) - } - } - return func(p pointer) protoreflect.Value { - if p.IsNil() || !mi.present(p, index) { - return conv.Zero() - } - x := p.Apply(fieldOffset).Bytes() - return protoreflect.ValueOfBytes(*x) - } - } - panic("unexpected protobuf kind: " + ft.Kind().String()) -} |