Skip to content

Commit

Permalink
dev: Remove raw interface - merge 7d76aa1a8129e37aae7c421a64e04a4ced5…
Browse files Browse the repository at this point in the history
…ef1ac from golang/protobuf
  • Loading branch information
awalterschulze committed Apr 6, 2018
1 parent 5f21c7a commit 54b14bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
9 changes: 0 additions & 9 deletions proto/equal.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,6 @@ func equalStruct(v1, v2 reflect.Value) bool {
// set/unset mismatch
return false
}
b1, ok := f1.Interface().(raw)
if ok {
b2 := f2.Interface().(raw)
// RawMessage
if !bytes.Equal(b1.Bytes(), b2.Bytes()) {
return false
}
continue
}
f1, f2 = f1.Elem(), f2.Elem()
}
if !equalAny(f1, f2, sprop.Prop[i]) {
Expand Down
11 changes: 0 additions & 11 deletions proto/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,6 @@ func writeName(w *textWriter, props *Properties) error {
return nil
}

// raw is the interface satisfied by RawMessage.
type raw interface {
Bytes() []byte
}

func requiresQuotes(u string) bool {
// When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.
for _, ch := range u {
Expand Down Expand Up @@ -450,12 +445,6 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
return err
}
}
if b, ok := fv.Interface().(raw); ok {
if err := writeRaw(w, b.Bytes()); err != nil {
return err
}
continue
}

if len(props.Enum) > 0 {
if err := tm.writeEnum(w, fv, props); err != nil {
Expand Down

0 comments on commit 54b14bf

Please sign in to comment.