Skip to content

Commit

Permalink
encoding/text: use TextBytes in Encode
Browse files Browse the repository at this point in the history
  • Loading branch information
zombiezen committed Jun 19, 2016
1 parent 0b0bf63 commit df19bac
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions encoding/text/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,7 @@ func (enc *Encoder) marshalFieldValue(s capnp.Struct, f schema.Field) error {
enc.marshalText(b)
return nil
}
b := p.Data()
if len(b) > 0 {
// Trim NUL byte
b = b[:len(b)-1]
}
enc.marshalText(b)
enc.marshalText(p.TextBytes())
case schema.Type_Which_list:
elem, err := typ.List().ElementType()
if err != nil {
Expand Down

0 comments on commit df19bac

Please sign in to comment.