aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol
diff options
context:
space:
mode:
authorOleksandr Redko <oleksandr.red+github@gmail.com>2019-10-24 23:33:57 +0300
committerOleksandr Redko <oleksandr.red+github@gmail.com>2019-10-24 23:37:27 +0300
commit81627ab53e269a762b769b47c004cb4309452492 (patch)
treecc7274d6f63f02112d407f9d0da5ddbc5ea2eaa1 /plumbing/protocol
parentaac20cc0e86f9f563bc74c42e9b9c598dfe271da (diff)
downloadgo-git-81627ab53e269a762b769b47c004cb4309452492.tar.gz
Fix typos in comments, variables and function names
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Diffstat (limited to 'plumbing/protocol')
-rw-r--r--plumbing/protocol/packp/advrefs_decode.go4
-rw-r--r--plumbing/protocol/packp/capability/list.go6
-rw-r--r--plumbing/protocol/packp/capability/list_test.go2
-rw-r--r--plumbing/protocol/packp/ulreq.go4
-rw-r--r--plumbing/protocol/packp/ulreq_encode.go4
-rw-r--r--plumbing/protocol/packp/updreq_decode.go10
-rw-r--r--plumbing/protocol/packp/uppackreq.go4
7 files changed, 17 insertions, 17 deletions
diff --git a/plumbing/protocol/packp/advrefs_decode.go b/plumbing/protocol/packp/advrefs_decode.go
index 1b4c62c..80f5b4e 100644
--- a/plumbing/protocol/packp/advrefs_decode.go
+++ b/plumbing/protocol/packp/advrefs_decode.go
@@ -53,7 +53,7 @@ func (d *advRefsDecoder) Decode(v *AdvRefs) error {
type decoderStateFn func(*advRefsDecoder) decoderStateFn
-// fills out the parser stiky error
+// fills out the parser sticky error
func (d *advRefsDecoder) error(format string, a ...interface{}) {
msg := fmt.Sprintf(
"pkt-line %d: %s", d.nLine,
@@ -281,7 +281,7 @@ func decodeShallow(p *advRefsDecoder) decoderStateFn {
}
if len(p.line) == 0 {
- return nil // succesfull parse of the advertised-refs message
+ return nil // successful parse of the advertised-refs message
}
return decodeShallow
diff --git a/plumbing/protocol/packp/capability/list.go b/plumbing/protocol/packp/capability/list.go
index 26a79b6..9609211 100644
--- a/plumbing/protocol/packp/capability/list.go
+++ b/plumbing/protocol/packp/capability/list.go
@@ -14,8 +14,8 @@ var (
// ErrArguments is returned if arguments are given with a capabilities that
// not supports arguments
ErrArguments = errors.New("arguments not allowed")
- // ErrEmtpyArgument is returned when an empty value is given
- ErrEmtpyArgument = errors.New("empty argument")
+ // ErrEmptyArgument is returned when an empty value is given
+ ErrEmptyArgument = errors.New("empty argument")
// ErrMultipleArguments multiple argument given to a capabilities that not
// support it
ErrMultipleArguments = errors.New("multiple arguments not allowed")
@@ -119,7 +119,7 @@ func (l *List) Add(c Capability, values ...string) error {
func (l *List) validateNoEmptyArgs(values []string) error {
for _, v := range values {
if v == "" {
- return ErrEmtpyArgument
+ return ErrEmptyArgument
}
}
return nil
diff --git a/plumbing/protocol/packp/capability/list_test.go b/plumbing/protocol/packp/capability/list_test.go
index 82dd63f..61b0b13 100644
--- a/plumbing/protocol/packp/capability/list_test.go
+++ b/plumbing/protocol/packp/capability/list_test.go
@@ -176,7 +176,7 @@ func (s *SuiteCapabilities) TestAddErrArgumentsNotAllowed(c *check.C) {
func (s *SuiteCapabilities) TestAddErrArguments(c *check.C) {
cap := NewList()
err := cap.Add(SymRef, "")
- c.Assert(err, check.Equals, ErrEmtpyArgument)
+ c.Assert(err, check.Equals, ErrEmptyArgument)
}
func (s *SuiteCapabilities) TestAddErrMultipleArguments(c *check.C) {
diff --git a/plumbing/protocol/packp/ulreq.go b/plumbing/protocol/packp/ulreq.go
index 74109d8..72895e3 100644
--- a/plumbing/protocol/packp/ulreq.go
+++ b/plumbing/protocol/packp/ulreq.go
@@ -68,8 +68,8 @@ func NewUploadRequest() *UploadRequest {
}
// NewUploadRequestFromCapabilities returns a pointer to a new UploadRequest
-// value, the request capabilities are filled with the most optiomal ones, based
-// on the adv value (advertaised capabilities), the UploadRequest generated it
+// value, the request capabilities are filled with the most optimal ones, based
+// on the adv value (advertised capabilities), the UploadRequest generated it
// has no wants or shallows and an infinite depth.
func NewUploadRequestFromCapabilities(adv *capability.List) *UploadRequest {
r := NewUploadRequest()
diff --git a/plumbing/protocol/packp/ulreq_encode.go b/plumbing/protocol/packp/ulreq_encode.go
index 89a5986..dcfeb83 100644
--- a/plumbing/protocol/packp/ulreq_encode.go
+++ b/plumbing/protocol/packp/ulreq_encode.go
@@ -64,10 +64,10 @@ func (e *ulReqEncoder) encodeFirstWant() stateFn {
return nil
}
- return e.encodeAditionalWants
+ return e.encodeAdditionalWants
}
-func (e *ulReqEncoder) encodeAditionalWants() stateFn {
+func (e *ulReqEncoder) encodeAdditionalWants() stateFn {
last := e.data.Wants[0]
for _, w := range e.data.Wants[1:] {
if bytes.Equal(last[:], w[:]) {
diff --git a/plumbing/protocol/packp/updreq_decode.go b/plumbing/protocol/packp/updreq_decode.go
index 51e8183..59f095f 100644
--- a/plumbing/protocol/packp/updreq_decode.go
+++ b/plumbing/protocol/packp/updreq_decode.go
@@ -13,9 +13,9 @@ import (
)
var (
- shallowLineLength = len(shallow) + hashSize
- minCommandLength = hashSize*2 + 2 + 1
- minCommandAndCapsLenth = minCommandLength + 1
+ shallowLineLength = len(shallow) + hashSize
+ minCommandLength = hashSize*2 + 2 + 1
+ minCommandAndCapsLength = minCommandLength + 1
)
var (
@@ -46,7 +46,7 @@ func errInvalidShallowLineLength(got int) error {
func errInvalidCommandCapabilitiesLineLength(got int) error {
return errMalformedRequest(fmt.Sprintf(
"invalid command and capabilities line length: expected at least %d, got %d",
- minCommandAndCapsLenth, got))
+ minCommandAndCapsLength, got))
}
func errInvalidCommandLineLength(got int) error {
@@ -174,7 +174,7 @@ func (d *updReqDecoder) decodeCommandAndCapabilities() error {
return errMissingCapabilitiesDelimiter
}
- if len(b) < minCommandAndCapsLenth {
+ if len(b) < minCommandAndCapsLength {
return errInvalidCommandCapabilitiesLineLength(len(b))
}
diff --git a/plumbing/protocol/packp/uppackreq.go b/plumbing/protocol/packp/uppackreq.go
index 1144139..831ef8f 100644
--- a/plumbing/protocol/packp/uppackreq.go
+++ b/plumbing/protocol/packp/uppackreq.go
@@ -27,8 +27,8 @@ func NewUploadPackRequest() *UploadPackRequest {
}
// NewUploadPackRequestFromCapabilities creates a new UploadPackRequest and
-// returns a pointer. The request capabilities are filled with the most optiomal
-// ones, based on the adv value (advertaised capabilities), the UploadPackRequest
+// returns a pointer. The request capabilities are filled with the most optimal
+// ones, based on the adv value (advertised capabilities), the UploadPackRequest
// it has no wants, haves or shallows and an infinite depth
func NewUploadPackRequestFromCapabilities(adv *capability.List) *UploadPackRequest {
ur := NewUploadRequestFromCapabilities(adv)