@@ -29,6 +29,23 @@ import (
29
29
)
30
30
31
31
var (
32
+ // EOL is returned when the end of the current list
33
+ // has been reached during streaming.
34
+ EOL = errors .New ("rlp: end of list" )
35
+
36
+ // Actual Errors
37
+ ErrExpectedString = errors .New ("rlp: expected String or Byte" )
38
+ ErrExpectedList = errors .New ("rlp: expected List" )
39
+ ErrCanonInt = errors .New ("rlp: non-canonical integer format" )
40
+ ErrCanonSize = errors .New ("rlp: non-canonical size information" )
41
+ ErrElemTooLarge = errors .New ("rlp: element is larger than containing list" )
42
+ ErrValueTooLarge = errors .New ("rlp: value size exceeds available input length" )
43
+ ErrMoreThanOneValue = errors .New ("rlp: input contains more than one value" )
44
+
45
+ // internal errors
46
+ errNotInList = errors .New ("rlp: call of ListEnd outside of any list" )
47
+ errNotAtEOL = errors .New ("rlp: call of ListEnd not positioned at EOL" )
48
+ errUintOverflow = errors .New ("rlp: uint overflow" )
32
49
errNoPointer = errors .New ("rlp: interface given to Decode must be a pointer" )
33
50
errDecodeIntoNil = errors .New ("rlp: pointer given to Decode must not be nil" )
34
51
)
@@ -274,9 +291,8 @@ func makeListDecoder(typ reflect.Type, tag tags) (decoder, error) {
274
291
if etype .Kind () == reflect .Uint8 && ! reflect .PtrTo (etype ).Implements (decoderInterface ) {
275
292
if typ .Kind () == reflect .Array {
276
293
return decodeByteArray , nil
277
- } else {
278
- return decodeByteSlice , nil
279
294
}
295
+ return decodeByteSlice , nil
280
296
}
281
297
etypeinfo , err := cachedTypeInfo1 (etype , tags {})
282
298
if err != nil {
@@ -555,29 +571,6 @@ func (k Kind) String() string {
555
571
}
556
572
}
557
573
558
- var (
559
- // EOL is returned when the end of the current list
560
- // has been reached during streaming.
561
- EOL = errors .New ("rlp: end of list" )
562
-
563
- // Actual Errors
564
- ErrExpectedString = errors .New ("rlp: expected String or Byte" )
565
- ErrExpectedList = errors .New ("rlp: expected List" )
566
- ErrCanonInt = errors .New ("rlp: non-canonical integer format" )
567
- ErrCanonSize = errors .New ("rlp: non-canonical size information" )
568
- ErrElemTooLarge = errors .New ("rlp: element is larger than containing list" )
569
- ErrValueTooLarge = errors .New ("rlp: value size exceeds available input length" )
570
-
571
- // This error is reported by DecodeBytes if the slice contains
572
- // additional data after the first RLP value.
573
- ErrMoreThanOneValue = errors .New ("rlp: input contains more than one value" )
574
-
575
- // internal errors
576
- errNotInList = errors .New ("rlp: call of ListEnd outside of any list" )
577
- errNotAtEOL = errors .New ("rlp: call of ListEnd not positioned at EOL" )
578
- errUintOverflow = errors .New ("rlp: uint overflow" )
579
- )
580
-
581
574
// ByteReader must be implemented by any input reader for a Stream. It
582
575
// is implemented by e.g. bufio.Reader and bytes.Reader.
583
576
type ByteReader interface {
0 commit comments