diff options
Diffstat (limited to 'vendor/github.com/go-asn1-ber/asn1-ber/header.go')
-rw-r--r-- | vendor/github.com/go-asn1-ber/asn1-ber/header.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/vendor/github.com/go-asn1-ber/asn1-ber/header.go b/vendor/github.com/go-asn1-ber/asn1-ber/header.go index 71615621..7dfa6b9a 100644 --- a/vendor/github.com/go-asn1-ber/asn1-ber/header.go +++ b/vendor/github.com/go-asn1-ber/asn1-ber/header.go @@ -7,19 +7,22 @@ import ( ) func readHeader(reader io.Reader) (identifier Identifier, length int, read int, err error) { - if i, c, err := readIdentifier(reader); err != nil { + var ( + c, l int + i Identifier + ) + + if i, c, err = readIdentifier(reader); err != nil { return Identifier{}, 0, read, err - } else { - identifier = i - read += c } + identifier = i + read += c - if l, c, err := readLength(reader); err != nil { + if l, c, err = readLength(reader); err != nil { return Identifier{}, 0, read, err - } else { - length = l - read += c } + length = l + read += c // Validate length type with identifier (x.600, 8.1.3.2.a) if length == LengthIndefinite && identifier.TagType == TypePrimitive { |