Skip to content

Commit d9b8691

Browse files
committed
examples,plumbing,utils: typo fixes
1 parent dcec851 commit d9b8691

File tree

13 files changed

+20
-20
lines changed

13 files changed

+20
-20
lines changed

_examples/commit/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
"gopkg.in/src-d/go-git.v4/plumbing/object"
1313
)
1414

15-
// Basic example of how to commit changes to the current branch to an existant
15+
// Basic example of how to commit changes to the current branch to an existent
1616
// repository.
1717
func main() {
1818
CheckArgs("<directory>")
1919
directory := os.Args[1]
2020

21-
// Opens an already existant repository.
21+
// Opens an already existent repository.
2222
r, err := git.PlainOpen(directory)
2323
CheckIfError(err)
2424

_examples/context/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
. "gopkg.in/src-d/go-git.v4/_examples"
1010
)
1111

12-
// Gracefull cancellation example of a basic git operation such as Clone.
12+
// Graceful cancellation example of a basic git operation such as Clone.
1313
func main() {
1414
CheckArgs("<url>", "<directory>")
1515
url := os.Args[1]

plumbing/object/change_adaptor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"gopkg.in/src-d/go-git.v4/utils/merkletrie/noder"
99
)
1010

11-
// The folowing functions transform changes types form the merkletrie
11+
// The following functions transform changes types form the merkletrie
1212
// package to changes types from this package.
1313

1414
func newChange(c merkletrie.Change) (*Change, error) {

plumbing/object/tag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func (iter *TagIter) Next() (*Tag, error) {
252252
}
253253

254254
// ForEach call the cb function for each tag contained on this iter until
255-
// an error happends or the end of the iter is reached. If ErrStop is sent
255+
// an error happens or the end of the iter is reached. If ErrStop is sent
256256
// the iteration is stop but no error is returned. The iterator is closed.
257257
func (iter *TagIter) ForEach(cb func(*Tag) error) error {
258258
return iter.EncodedObjectIter.ForEach(func(obj plumbing.EncodedObject) error {

plumbing/protocol/packp/advrefs_decode.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func decodeSkipNoRefs(p *advRefsDecoder) decoderStateFn {
169169
return decodeCaps
170170
}
171171

172-
// decode the refname, expectes SP refname NULL
172+
// decode the refname, expects SP refname NULL
173173
func decodeFirstRef(l *advRefsDecoder) decoderStateFn {
174174
if len(l.line) < 3 {
175175
l.error("line too short after hash")

plumbing/protocol/packp/srvresp.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ func (r *ServerResponse) Decode(reader *bufio.Reader, isMultiACK bool) error {
3535
return err
3636
}
3737

38-
// we need to detect when the end of a response header and the begining
39-
// of a packfile header happend, some requests to the git daemon
38+
// we need to detect when the end of a response header and the beginning
39+
// of a packfile header happened, some requests to the git daemon
4040
// produces a duplicate ACK header even when multi_ack is not supported.
4141
stop, err := r.stopReading(reader)
4242
if err != nil {

plumbing/protocol/packp/ulreq.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Depth interface {
2828

2929
// DepthCommits values stores the maximum number of requested commits in
3030
// the packfile. Zero means infinite. A negative value will have
31-
// undefined consecuences.
31+
// undefined consequences.
3232
type DepthCommits int
3333

3434
func (d DepthCommits) isDepth() {}

plumbing/storer/object.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (iter *EncodedObjectLookupIter) Next() (plumbing.EncodedObject, error) {
123123
}
124124

125125
// ForEach call the cb function for each object contained on this iter until
126-
// an error happends or the end of the iter is reached. If ErrStop is sent
126+
// an error happens or the end of the iter is reached. If ErrStop is sent
127127
// the iteration is stop but no error is returned. The iterator is closed.
128128
func (iter *EncodedObjectLookupIter) ForEach(cb func(plumbing.EncodedObject) error) error {
129129
return ForEachIterator(iter, cb)
@@ -168,7 +168,7 @@ func (iter *EncodedObjectSliceIter) Next() (plumbing.EncodedObject, error) {
168168
}
169169

170170
// ForEach call the cb function for each object contained on this iter until
171-
// an error happends or the end of the iter is reached. If ErrStop is sent
171+
// an error happens or the end of the iter is reached. If ErrStop is sent
172172
// the iteration is stop but no error is returned. The iterator is closed.
173173
func (iter *EncodedObjectSliceIter) ForEach(cb func(plumbing.EncodedObject) error) error {
174174
return ForEachIterator(iter, cb)
@@ -213,7 +213,7 @@ func (iter *MultiEncodedObjectIter) Next() (plumbing.EncodedObject, error) {
213213
}
214214

215215
// ForEach call the cb function for each object contained on this iter until
216-
// an error happends or the end of the iter is reached. If ErrStop is sent
216+
// an error happens or the end of the iter is reached. If ErrStop is sent
217217
// the iteration is stop but no error is returned. The iterator is closed.
218218
func (iter *MultiEncodedObjectIter) ForEach(cb func(plumbing.EncodedObject) error) error {
219219
return ForEachIterator(iter, cb)

plumbing/storer/reference.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (iter *ReferenceSliceIter) Next() (*plumbing.Reference, error) {
121121
}
122122

123123
// ForEach call the cb function for each reference contained on this iter until
124-
// an error happends or the end of the iter is reached. If ErrStop is sent
124+
// an error happens or the end of the iter is reached. If ErrStop is sent
125125
// the iteration is stop but no error is returned. The iterator is closed.
126126
func (iter *ReferenceSliceIter) ForEach(cb func(*plumbing.Reference) error) error {
127127
defer iter.Close()

utils/ioutil/common.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ type readerOnError struct {
123123
}
124124

125125
// NewReaderOnError returns a io.Reader that call the notify function when an
126-
// unexpected (!io.EOF) error happends, after call Read function.
126+
// unexpected (!io.EOF) error happens, after call Read function.
127127
func NewReaderOnError(r io.Reader, notify func(error)) io.Reader {
128128
return &readerOnError{r, notify}
129129
}
130130

131131
// NewReadCloserOnError returns a io.ReadCloser that call the notify function
132-
// when an unexpected (!io.EOF) error happends, after call Read function.
132+
// when an unexpected (!io.EOF) error happens, after call Read function.
133133
func NewReadCloserOnError(r io.ReadCloser, notify func(error)) io.ReadCloser {
134134
return NewReadCloser(NewReaderOnError(r, notify), r)
135135
}
@@ -149,13 +149,13 @@ type writerOnError struct {
149149
}
150150

151151
// NewWriterOnError returns a io.Writer that call the notify function when an
152-
// unexpected (!io.EOF) error happends, after call Write function.
152+
// unexpected (!io.EOF) error happens, after call Write function.
153153
func NewWriterOnError(w io.Writer, notify func(error)) io.Writer {
154154
return &writerOnError{w, notify}
155155
}
156156

157157
// NewWriteCloserOnError returns a io.WriteCloser that call the notify function
158-
//when an unexpected (!io.EOF) error happends, after call Write function.
158+
//when an unexpected (!io.EOF) error happens, after call Write function.
159159
func NewWriteCloserOnError(w io.WriteCloser, notify func(error)) io.WriteCloser {
160160
return NewWriteCloser(NewWriterOnError(w, notify), w)
161161
}

utils/merkletrie/difftree.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ package merkletrie
5454
//
5555
// Here is a full list of all the cases that are similar and how to
5656
// merge them together into more general cases. Each general case
57-
// is labeled wiht an uppercase letter for further reference, and it
57+
// is labeled with an uppercase letter for further reference, and it
5858
// is followed by the pseudocode of the checks you have to perfrom
5959
// on both noders to see if you are in such a case, the actions to
6060
// perform (i.e. what changes to output) and how to advance the

utils/merkletrie/iter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func (iter *Iter) current() (noder.Path, error) {
198198
}
199199

200200
// removes the current node if any, and all the frames that become empty as a
201-
// consecuence of this action.
201+
// consequence of this action.
202202
func (iter *Iter) drop() {
203203
frame, ok := iter.top()
204204
if !ok {

utils/merkletrie/noder/path.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
// Path values represent a noder and its ancestors. The root goes first
11-
// and the actual final noder the path is refering to will be the last.
11+
// and the actual final noder the path is referring to will be the last.
1212
//
1313
// A path implements the Noder interface, redirecting all the interface
1414
// calls to its final noder.

0 commit comments

Comments
 (0)