aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/decode.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-03-07 19:37:53 +0800
committerFelix Lange <fjl@twurst.com>2017-03-07 19:45:12 +0800
commiteee96a5bb7439ccee583d23e53be018fe7c35cfb (patch)
tree93e027d5c6456eb87b8d2e1e13977251bc500b2f /rlp/decode.go
parent667cd518ceada7084698c8ea11d966db9f9e674a (diff)
downloaddexon-eee96a5bb7439ccee583d23e53be018fe7c35cfb.tar
dexon-eee96a5bb7439ccee583d23e53be018fe7c35cfb.tar.gz
dexon-eee96a5bb7439ccee583d23e53be018fe7c35cfb.tar.bz2
dexon-eee96a5bb7439ccee583d23e53be018fe7c35cfb.tar.lz
dexon-eee96a5bb7439ccee583d23e53be018fe7c35cfb.tar.xz
dexon-eee96a5bb7439ccee583d23e53be018fe7c35cfb.tar.zst
dexon-eee96a5bb7439ccee583d23e53be018fe7c35cfb.zip
rlp: add support for "-" struct tag
Diffstat (limited to 'rlp/decode.go')
-rw-r--r--rlp/decode.go16
1 files changed, 10 insertions, 6 deletions
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"`