Skip to content

Commit 8b58928

Browse files
vr009oleg-jukovec
authored andcommitted
code health: fix all typos
Fixed all typos detected by codespell.
1 parent cc0a376 commit 8b58928

16 files changed

+37
-37
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ CI and documentation.
8888

8989
- Handle everything with `go test` (#115)
9090
- Use plain package instead of module for UUID submodule (#134)
91-
- Reset buffer if its average use size smaller than quater of capacity (#95)
91+
- Reset buffer if its average use size smaller than quarter of capacity (#95)
9292
- Update API documentation: comments and examples (#123)
9393

9494
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ There are also changes in the logic that can lead to errors in the old code,
176176
`msgpack.v5` some functions for the logic tuning were added (see
177177
[UseLooseInterfaceDecoding](https://pkg.go.dev/github.com/vmihailenco/msgpack/v5#Decoder.UseLooseInterfaceDecoding), [UseCompactInts](https://pkg.go.dev/github.com/vmihailenco/msgpack/v5#Encoder.UseCompactInts) etc), it is still impossible
178178
to achieve full compliance of behavior between `msgpack.v5` and `msgpack.v2`. So
179-
we don't go this way. We use standart settings if it possible.
179+
we don't go this way. We use standard settings if it possible.
180180

181181
## Contributing
182182

connection.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ type Opts struct {
240240
// See RLimitAction for possible actions when RateLimit.reached.
241241
RateLimit uint
242242
// RLimitAction tells what to do when RateLimit reached:
243-
// RLimitDrop - immediatly abort request,
243+
// RLimitDrop - immediately abort request,
244244
// RLimitWait - wait during timeout period for some request to be answered.
245245
// If no request answered during timeout period, this request
246246
// is aborted.
@@ -249,7 +249,7 @@ type Opts struct {
249249
RLimitAction uint
250250
// Concurrency is amount of separate mutexes for request
251251
// queues and buffers inside of connection.
252-
// It is rounded upto nearest power of 2.
252+
// It is rounded up to nearest power of 2.
253253
// By default it is runtime.GOMAXPROCS(-1) * 4
254254
Concurrency uint32
255255
// SkipSchema disables schema loading. Without disabling schema loading,
@@ -273,7 +273,7 @@ type Opts struct {
273273
type SslOpts struct {
274274
// KeyFile is a path to a private SSL key file.
275275
KeyFile string
276-
// CertFile is a path to an SSL sertificate file.
276+
// CertFile is a path to an SSL certificate file.
277277
CertFile string
278278
// CaFile is a path to a trusted certificate authorities (CA) file.
279279
CaFile string
@@ -1060,7 +1060,7 @@ func (conn *Connection) read(r io.Reader) (response []byte, err error) {
10601060
return
10611061
}
10621062
if conn.lenbuf[0] != 0xce {
1063-
err = errors.New("Wrong reponse header")
1063+
err = errors.New("Wrong response header")
10641064
return
10651065
}
10661066
length = (int(conn.lenbuf[1]) << 24) +

connection_pool/connection_pool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,10 +1686,10 @@ func TestDoWithStrangerConn(t *testing.T) {
16861686

16871687
_, err = connPool.Do(req, connection_pool.ANY).Get()
16881688
if err == nil {
1689-
t.Fatalf("nil error catched")
1689+
t.Fatalf("nil error caught")
16901690
}
16911691
if err.Error() != expectedErr.Error() {
1692-
t.Fatalf("Unexpected error catched")
1692+
t.Fatalf("Unexpected error caught")
16931693
}
16941694
}
16951695

connection_pool/example_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ func ExampleCommitRequest() {
620620
fmt.Printf("Insert in stream: response is %#v\n", resp.Code)
621621

622622
// Select not related to the transaction
623-
// while transaction is not commited
623+
// while transaction is not committed
624624
// result of select is empty
625625
selectReq := tarantool.NewSelectRequest(spaceNo).
626626
Index(indexNo).
@@ -706,7 +706,7 @@ func ExampleRollbackRequest() {
706706
fmt.Printf("Insert in stream: response is %#v\n", resp.Code)
707707

708708
// Select not related to the transaction
709-
// while transaction is not commited
709+
// while transaction is not committed
710710
// result of select is empty
711711
selectReq := tarantool.NewSelectRequest(spaceNo).
712712
Index(indexNo).
@@ -794,7 +794,7 @@ func ExampleBeginRequest_TxnIsolation() {
794794
fmt.Printf("Insert in stream: response is %#v\n", resp.Code)
795795

796796
// Select not related to the transaction
797-
// while transaction is not commited
797+
// while transaction is not committed
798798
// result of select is empty
799799
selectReq := tarantool.NewSelectRequest(spaceNo).
800800
Index(indexNo).

datetime/datetime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func daysInMonth(year int64, month int64) int64 {
149149
return int64(time.Date(int(year), time.Month(month), 0, 0, 0, 0, 0, time.UTC).Day())
150150
}
151151

152-
// C imlementation:
152+
// C implementation:
153153
// https://github.com/tarantool/c-dt/blob/cec6acebb54d9e73ea0b99c63898732abd7683a6/dt_arithmetic.c#L74-L98
154154
func addMonth(ival *Interval, delta int64, adjust Adjust) {
155155
oldYear := ival.Year

errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (clierr ClientError) Error() string {
2525
return fmt.Sprintf("%s (0x%x)", clierr.Msg, clierr.Code)
2626
}
2727

28-
// Temporary returns true if next attempt to perform request may succeeed.
28+
// Temporary returns true if next attempt to perform request may succeeded.
2929
//
3030
// Currently it returns true when:
3131
//

example_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func ExampleCommitRequest() {
264264
fmt.Printf("Insert in stream: response is %#v\n", resp.Code)
265265

266266
// Select not related to the transaction
267-
// while transaction is not commited
267+
// while transaction is not committed
268268
// result of select is empty
269269
selectReq := tarantool.NewSelectRequest(spaceNo).
270270
Index(indexNo).
@@ -340,7 +340,7 @@ func ExampleRollbackRequest() {
340340
fmt.Printf("Insert in stream: response is %#v\n", resp.Code)
341341

342342
// Select not related to the transaction
343-
// while transaction is not commited
343+
// while transaction is not committed
344344
// result of select is empty
345345
selectReq := tarantool.NewSelectRequest(spaceNo).
346346
Index(indexNo).
@@ -418,7 +418,7 @@ func ExampleBeginRequest_TxnIsolation() {
418418
fmt.Printf("Insert in stream: response is %#v\n", resp.Code)
419419

420420
// Select not related to the transaction
421-
// while transaction is not commited
421+
// while transaction is not committed
422422
// result of select is empty
423423
selectReq := tarantool.NewSelectRequest(spaceNo).
424424
Index(indexNo).

future.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func (fut *Future) SetError(err error) {
172172
// Get waits for Future to be filled and returns Response and error.
173173
//
174174
// Response will contain deserialized result in Data field.
175-
// It will be []interface{}, so if you want more performace, use GetTyped method.
175+
// It will be []interface{}, so if you want more performance, use GetTyped method.
176176
//
177177
// Note: Response could be equal to nil if ClientError is returned in error.
178178
//
@@ -226,7 +226,7 @@ func init() {
226226
close(closedChan)
227227
}
228228

229-
// WaitChan returns channel which becomes closed when response arrived or error occured.
229+
// WaitChan returns channel which becomes closed when response arrived or error occurred.
230230
func (fut *Future) WaitChan() <-chan struct{} {
231231
if fut.done == nil {
232232
return closedChan

multi/multi_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ func TestReconnect(t *testing.T) {
106106
t.Errorf("conn has incorrect addr: %s after disconnect server1", multiConn.getCurrentConnection().Addr())
107107
}
108108
if !multiConn.ConnectedNow() {
109-
t.Errorf("incorrect multiConn status after reconecting")
109+
t.Errorf("incorrect multiConn status after reconnecting")
110110
}
111111

112112
timer = time.NewTimer(100 * time.Millisecond)
113113
<-timer.C
114114
conn, _ = multiConn.getConnectionFromPool(server1)
115115
if !conn.ConnectedNow() {
116-
t.Errorf("incorrect conn status after reconecting")
116+
t.Errorf("incorrect conn status after reconnecting")
117117
}
118118
}
119119

@@ -139,15 +139,15 @@ func TestDisconnectAll(t *testing.T) {
139139
timer = time.NewTimer(100 * time.Millisecond)
140140
<-timer.C
141141
if !multiConn.ConnectedNow() {
142-
t.Errorf("incorrect multiConn status after reconecting")
142+
t.Errorf("incorrect multiConn status after reconnecting")
143143
}
144144
conn, _ = multiConn.getConnectionFromPool(server1)
145145
if !conn.ConnectedNow() {
146-
t.Errorf("incorrect server1 conn status after reconecting")
146+
t.Errorf("incorrect server1 conn status after reconnecting")
147147
}
148148
conn, _ = multiConn.getConnectionFromPool(server2)
149149
if !conn.ConnectedNow() {
150-
t.Errorf("incorrect server2 conn status after reconecting")
150+
t.Errorf("incorrect server2 conn status after reconnecting")
151151
}
152152
}
153153

@@ -314,10 +314,10 @@ func TestDoWithStrangerConn(t *testing.T) {
314314

315315
_, err = multiConn.Do(req).Get()
316316
if err == nil {
317-
t.Fatalf("nil error catched")
317+
t.Fatalf("nil error caught")
318318
}
319319
if err.Error() != expectedErr.Error() {
320-
t.Fatalf("Unexpected error catched")
320+
t.Fatalf("Unexpected error caught")
321321
}
322322
}
323323

prepared.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func fillExecutePrepared(enc *encoder, stmt Prepared, args interface{}) error {
4141
// NewPreparedFromResponse constructs a Prepared object.
4242
func NewPreparedFromResponse(conn *Connection, resp *Response) (*Prepared, error) {
4343
if resp == nil {
44-
return nil, fmt.Errorf("pased nil response")
44+
return nil, fmt.Errorf("passed nil response")
4545
}
4646
if resp.Data == nil {
4747
return nil, fmt.Errorf("response Data is nil")

queue/queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func (q *queue) Cfg(opts CfgOpts) error {
205205
return err
206206
}
207207

208-
// Exists checks existance of a tube.
208+
// Exists checks existence of a tube.
209209
func (q *queue) Exists() (bool, error) {
210210
cmd := "local name = ... ; return queue.tube[name] ~= nil"
211211
resp, err := q.conn.Eval(cmd, []string{q.name})

queue/queue_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func TestFifoQueue_TakeTyped(t *testing.T) {
336336
} else {
337337
typedData, ok := task.Data().(*customData)
338338
if !ok {
339-
t.Errorf("Task data after put has diferent type. %#v != %#v", task.Data(), putData)
339+
t.Errorf("Task data after put has different type. %#v != %#v", task.Data(), putData)
340340
}
341341
if *typedData != *putData {
342342
t.Errorf("Task data after put not equal with example. %s != %s", task.Data(), putData)
@@ -353,7 +353,7 @@ func TestFifoQueue_TakeTyped(t *testing.T) {
353353
} else {
354354
typedData, ok := task.Data().(*customData)
355355
if !ok {
356-
t.Errorf("Task data after put has diferent type. %#v != %#v", task.Data(), putData)
356+
t.Errorf("Task data after put has different type. %#v != %#v", task.Data(), putData)
357357
}
358358
if *typedData != *putData {
359359
t.Errorf("Task data after take not equal with example. %#v != %#v", task.Data(), putData)

queue/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (t *Task) Bury() error {
7979
}
8080

8181
// Release returns task back in the queue without making it complete.
82-
// In outher words, this worker failed to complete the task, and
82+
// In other words, this worker failed to complete the task, and
8383
// it, so other worker could try to do that again.
8484
func (t *Task) Release() error {
8585
return t.accept(t.q._release(t.id, Opts{}))

request_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func assertBodyCall(t testing.TB, requests []Request, errorMsg string) {
7070
t.Errorf(errBegin+"error %q", err.Error())
7171
}
7272
if err == nil && errorMsg != "" {
73-
t.Errorf(errBegin+"result, expexted error %q", errorMsg)
73+
t.Errorf(errBegin+"result, expected error %q", errorMsg)
7474
}
7575
}
7676
}

tarantool_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,16 +1626,16 @@ func TestConnection_DoWithStrangerConn(t *testing.T) {
16261626

16271627
_, err := conn1.Do(req).Get()
16281628
if err == nil {
1629-
t.Fatalf("nil error catched")
1629+
t.Fatalf("nil error caught")
16301630
}
16311631
if err.Error() != expectedErr.Error() {
1632-
t.Fatalf("Unexpected error catched")
1632+
t.Fatalf("Unexpected error caught")
16331633
}
16341634
}
16351635

16361636
func TestNewPreparedFromResponse(t *testing.T) {
16371637
var (
1638-
ErrNilResponsePassed = fmt.Errorf("pased nil response")
1638+
ErrNilResponsePassed = fmt.Errorf("passed nil response")
16391639
ErrNilResponseData = fmt.Errorf("response Data is nil")
16401640
ErrWrongDataFormat = fmt.Errorf("response Data format is wrong")
16411641
)
@@ -2293,7 +2293,7 @@ func TestClientRequestObjectsWithPassedCanceledContext(t *testing.T) {
22932293
t.Fatalf("Failed to catch an error from done context")
22942294
}
22952295
if resp != nil {
2296-
t.Fatalf("Response is not nil after the occured error")
2296+
t.Fatalf("Response is not nil after the occurred error")
22972297
}
22982298
}
22992299

@@ -2311,10 +2311,10 @@ func TestClientRequestObjectsWithContext(t *testing.T) {
23112311
t.Fatalf("response must be nil")
23122312
}
23132313
if err == nil {
2314-
t.Fatalf("catched nil error")
2314+
t.Fatalf("caught nil error")
23152315
}
23162316
if err.Error() != "context is done" {
2317-
t.Fatalf("wrong error catched: %v", err)
2317+
t.Fatalf("wrong error caught: %v", err)
23182318
}
23192319
}
23202320

0 commit comments

Comments
 (0)