diff options
author | techknowlogick <techknowlogick@gitea.io> | 2020-03-20 10:29:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-20 10:29:31 -0400 |
commit | 2fa1078911af920172f5fca73d01d113262ed1bb (patch) | |
tree | 62f6c14ea1662f3d507022d069447307debd70d3 /vendor/github.com/golang | |
parent | e5a008f7b2298977405fdbd806d3fa5ff4fd837e (diff) | |
download | gitea-2fa1078911af920172f5fca73d01d113262ed1bb.tar.gz gitea-2fa1078911af920172f5fca73d01d113262ed1bb.zip |
go 1.14 (#10467)
Diffstat (limited to 'vendor/github.com/golang')
-rw-r--r-- | vendor/github.com/golang/protobuf/proto/lib.go | 2 | ||||
-rw-r--r-- | vendor/github.com/golang/protobuf/proto/text.go | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/vendor/github.com/golang/protobuf/proto/lib.go b/vendor/github.com/golang/protobuf/proto/lib.go index fdd328bb7f..70fbda5329 100644 --- a/vendor/github.com/golang/protobuf/proto/lib.go +++ b/vendor/github.com/golang/protobuf/proto/lib.go @@ -393,7 +393,7 @@ func (p *Buffer) Bytes() []byte { return p.buf } // than relying on this API. // // If deterministic serialization is requested, map entries will be sorted -// by keys in lexographical order. This is an implementation detail and +// by keys in lexicographical order. This is an implementation detail and // subject to change. func (p *Buffer) SetDeterministic(deterministic bool) { p.deterministic = deterministic diff --git a/vendor/github.com/golang/protobuf/proto/text.go b/vendor/github.com/golang/protobuf/proto/text.go index 1aaee725b4..d97f9b3563 100644 --- a/vendor/github.com/golang/protobuf/proto/text.go +++ b/vendor/github.com/golang/protobuf/proto/text.go @@ -456,6 +456,8 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error { return nil } +var textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() + // writeAny writes an arbitrary field. func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error { v = reflect.Indirect(v) @@ -519,8 +521,8 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert // mutating this value. v = v.Addr() } - if etm, ok := v.Interface().(encoding.TextMarshaler); ok { - text, err := etm.MarshalText() + if v.Type().Implements(textMarshalerType) { + text, err := v.Interface().(encoding.TextMarshaler).MarshalText() if err != nil { return err } |