aboutsummaryrefslogtreecommitdiffstats
path: root/formats/pktline
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-05-19 16:44:59 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-05-19 16:44:59 +0200
commit25077df01588b54ec097ce3f99db6672c5a59463 (patch)
tree49f7b64f4164d19260ba848c5faca366b75438d1 /formats/pktline
parent08f9e7015aad2ca768638b446fb8632f11601899 (diff)
downloadgo-git-25077df01588b54ec097ce3f99db6672c5a59463.tar.gz
documentation
Diffstat (limited to 'formats/pktline')
-rw-r--r--formats/pktline/decoder.go7
-rw-r--r--formats/pktline/doc.go4
-rw-r--r--formats/pktline/encoder.go1
3 files changed, 9 insertions, 3 deletions
diff --git a/formats/pktline/decoder.go b/formats/pktline/decoder.go
index c30be6b..34e6f51 100644
--- a/formats/pktline/decoder.go
+++ b/formats/pktline/decoder.go
@@ -7,9 +7,12 @@ import (
)
var (
- ErrUnderflow = errors.New("unexpected string length (underflow)")
+ // ErrUnderflow is triggered when a line is shorter than the described length
+ ErrUnderflow = errors.New("unexpected string length (underflow)")
+ // ErrInvalidHeader invalid pktline header
ErrInvalidHeader = errors.New("invalid header")
- ErrInvalidLen = errors.New("invalid length")
+ // ErrInvalidLen ivanlid line length found, < 0
+ ErrInvalidLen = errors.New("invalid length")
)
// Decoder implements a pkt-line format decoder
diff --git a/formats/pktline/doc.go b/formats/pktline/doc.go
index 0ae22e3..555a073 100644
--- a/formats/pktline/doc.go
+++ b/formats/pktline/doc.go
@@ -51,6 +51,8 @@ package pktline
// https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt
const (
+ // HeaderLength length of the pktline header
HeaderLength = 4
- MaxLength = 65524
+ // MaxLength max line length
+ MaxLength = 65524
)
diff --git a/formats/pktline/encoder.go b/formats/pktline/encoder.go
index dfa53e2..bd0ab75 100644
--- a/formats/pktline/encoder.go
+++ b/formats/pktline/encoder.go
@@ -7,6 +7,7 @@ import (
)
var (
+ //ErrOverflow happends when the line length exceed the MaxLength
ErrOverflow = errors.New("unexpected string length (overflow)")
)