From eee96a5bb7439ccee583d23e53be018fe7c35cfb Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 7 Mar 2017 12:37:53 +0100 Subject: rlp: add support for "-" struct tag --- rlp/decode.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'rlp/decode.go') diff --git a/rlp/decode.go b/rlp/decode.go index c4e5869cc..ee0b7dbcd 100644 --- a/rlp/decode.go +++ b/rlp/decode.go @@ -63,12 +63,16 @@ type Decoder interface { // must contain an element for each decoded field. Decode returns an // error if there are too few or too many elements. // -// The decoding of struct fields honours two struct tags, "tail" and -// "nil". For an explanation of "tail", see the example. -// The "nil" tag applies to pointer-typed fields and changes the -// decoding rules for the field such that input values of size zero -// decode as a nil pointer. This tag can be useful when decoding -// recursive types. +// The decoding of struct fields honours certain struct tags, "tail", +// "nil" and "-". +// +// The "-" tag ignores fields. +// +// For an explanation of "tail", see the example. +// +// The "nil" tag applies to pointer-typed fields and changes the decoding +// rules for the field such that input values of size zero decode as a nil +// pointer. This tag can be useful when decoding recursive types. // // type StructWithEmptyOK struct { // Foo *[20]byte `rlp:"nil"` -- cgit