Skip to content

Commit

Permalink
code health: fix all typos
Browse files Browse the repository at this point in the history
Fixed all typos detected by codespell.
  • Loading branch information
vr009 authored and oleg-jukovec committed Sep 16, 2022
1 parent cc0a376 commit 8b58928
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ CI and documentation.

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

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ There are also changes in the logic that can lead to errors in the old code,
`msgpack.v5` some functions for the logic tuning were added (see
[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
to achieve full compliance of behavior between `msgpack.v5` and `msgpack.v2`. So
we don't go this way. We use standart settings if it possible.
we don't go this way. We use standard settings if it possible.

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ type Opts struct {
// See RLimitAction for possible actions when RateLimit.reached.
RateLimit uint
// RLimitAction tells what to do when RateLimit reached:
// RLimitDrop - immediatly abort request,
// RLimitDrop - immediately abort request,
// RLimitWait - wait during timeout period for some request to be answered.
// If no request answered during timeout period, this request
// is aborted.
Expand All @@ -249,7 +249,7 @@ type Opts struct {
RLimitAction uint
// Concurrency is amount of separate mutexes for request
// queues and buffers inside of connection.
// It is rounded upto nearest power of 2.
// It is rounded up to nearest power of 2.
// By default it is runtime.GOMAXPROCS(-1) * 4
Concurrency uint32
// SkipSchema disables schema loading. Without disabling schema loading,
Expand All @@ -273,7 +273,7 @@ type Opts struct {
type SslOpts struct {
// KeyFile is a path to a private SSL key file.
KeyFile string
// CertFile is a path to an SSL sertificate file.
// CertFile is a path to an SSL certificate file.
CertFile string
// CaFile is a path to a trusted certificate authorities (CA) file.
CaFile string
Expand Down Expand Up @@ -1060,7 +1060,7 @@ func (conn *Connection) read(r io.Reader) (response []byte, err error) {
return
}
if conn.lenbuf[0] != 0xce {
err = errors.New("Wrong reponse header")
err = errors.New("Wrong response header")
return
}
length = (int(conn.lenbuf[1]) << 24) +
Expand Down
4 changes: 2 additions & 2 deletions connection_pool/connection_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1686,10 +1686,10 @@ func TestDoWithStrangerConn(t *testing.T) {

_, err = connPool.Do(req, connection_pool.ANY).Get()
if err == nil {
t.Fatalf("nil error catched")
t.Fatalf("nil error caught")
}
if err.Error() != expectedErr.Error() {
t.Fatalf("Unexpected error catched")
t.Fatalf("Unexpected error caught")
}
}

Expand Down
6 changes: 3 additions & 3 deletions connection_pool/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ func ExampleCommitRequest() {
fmt.Printf("Insert in stream: response is %#v\n", resp.Code)

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

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

// Select not related to the transaction
// while transaction is not commited
// while transaction is not committed
// result of select is empty
selectReq := tarantool.NewSelectRequest(spaceNo).
Index(indexNo).
Expand Down
2 changes: 1 addition & 1 deletion datetime/datetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func daysInMonth(year int64, month int64) int64 {
return int64(time.Date(int(year), time.Month(month), 0, 0, 0, 0, 0, time.UTC).Day())
}

// C imlementation:
// C implementation:
// https://github.com/tarantool/c-dt/blob/cec6acebb54d9e73ea0b99c63898732abd7683a6/dt_arithmetic.c#L74-L98
func addMonth(ival *Interval, delta int64, adjust Adjust) {
oldYear := ival.Year
Expand Down
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (clierr ClientError) Error() string {
return fmt.Sprintf("%s (0x%x)", clierr.Msg, clierr.Code)
}

// Temporary returns true if next attempt to perform request may succeeed.
// Temporary returns true if next attempt to perform request may succeeded.
//
// Currently it returns true when:
//
Expand Down
6 changes: 3 additions & 3 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func ExampleCommitRequest() {
fmt.Printf("Insert in stream: response is %#v\n", resp.Code)

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

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

// Select not related to the transaction
// while transaction is not commited
// while transaction is not committed
// result of select is empty
selectReq := tarantool.NewSelectRequest(spaceNo).
Index(indexNo).
Expand Down
4 changes: 2 additions & 2 deletions future.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (fut *Future) SetError(err error) {
// Get waits for Future to be filled and returns Response and error.
//
// Response will contain deserialized result in Data field.
// It will be []interface{}, so if you want more performace, use GetTyped method.
// It will be []interface{}, so if you want more performance, use GetTyped method.
//
// Note: Response could be equal to nil if ClientError is returned in error.
//
Expand Down Expand Up @@ -226,7 +226,7 @@ func init() {
close(closedChan)
}

// WaitChan returns channel which becomes closed when response arrived or error occured.
// WaitChan returns channel which becomes closed when response arrived or error occurred.
func (fut *Future) WaitChan() <-chan struct{} {
if fut.done == nil {
return closedChan
Expand Down
14 changes: 7 additions & 7 deletions multi/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ func TestReconnect(t *testing.T) {
t.Errorf("conn has incorrect addr: %s after disconnect server1", multiConn.getCurrentConnection().Addr())
}
if !multiConn.ConnectedNow() {
t.Errorf("incorrect multiConn status after reconecting")
t.Errorf("incorrect multiConn status after reconnecting")
}

timer = time.NewTimer(100 * time.Millisecond)
<-timer.C
conn, _ = multiConn.getConnectionFromPool(server1)
if !conn.ConnectedNow() {
t.Errorf("incorrect conn status after reconecting")
t.Errorf("incorrect conn status after reconnecting")
}
}

Expand All @@ -139,15 +139,15 @@ func TestDisconnectAll(t *testing.T) {
timer = time.NewTimer(100 * time.Millisecond)
<-timer.C
if !multiConn.ConnectedNow() {
t.Errorf("incorrect multiConn status after reconecting")
t.Errorf("incorrect multiConn status after reconnecting")
}
conn, _ = multiConn.getConnectionFromPool(server1)
if !conn.ConnectedNow() {
t.Errorf("incorrect server1 conn status after reconecting")
t.Errorf("incorrect server1 conn status after reconnecting")
}
conn, _ = multiConn.getConnectionFromPool(server2)
if !conn.ConnectedNow() {
t.Errorf("incorrect server2 conn status after reconecting")
t.Errorf("incorrect server2 conn status after reconnecting")
}
}

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

_, err = multiConn.Do(req).Get()
if err == nil {
t.Fatalf("nil error catched")
t.Fatalf("nil error caught")
}
if err.Error() != expectedErr.Error() {
t.Fatalf("Unexpected error catched")
t.Fatalf("Unexpected error caught")
}
}

Expand Down
2 changes: 1 addition & 1 deletion prepared.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func fillExecutePrepared(enc *encoder, stmt Prepared, args interface{}) error {
// NewPreparedFromResponse constructs a Prepared object.
func NewPreparedFromResponse(conn *Connection, resp *Response) (*Prepared, error) {
if resp == nil {
return nil, fmt.Errorf("pased nil response")
return nil, fmt.Errorf("passed nil response")
}
if resp.Data == nil {
return nil, fmt.Errorf("response Data is nil")
Expand Down
2 changes: 1 addition & 1 deletion queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (q *queue) Cfg(opts CfgOpts) error {
return err
}

// Exists checks existance of a tube.
// Exists checks existence of a tube.
func (q *queue) Exists() (bool, error) {
cmd := "local name = ... ; return queue.tube[name] ~= nil"
resp, err := q.conn.Eval(cmd, []string{q.name})
Expand Down
4 changes: 2 additions & 2 deletions queue/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func TestFifoQueue_TakeTyped(t *testing.T) {
} else {
typedData, ok := task.Data().(*customData)
if !ok {
t.Errorf("Task data after put has diferent type. %#v != %#v", task.Data(), putData)
t.Errorf("Task data after put has different type. %#v != %#v", task.Data(), putData)
}
if *typedData != *putData {
t.Errorf("Task data after put not equal with example. %s != %s", task.Data(), putData)
Expand All @@ -353,7 +353,7 @@ func TestFifoQueue_TakeTyped(t *testing.T) {
} else {
typedData, ok := task.Data().(*customData)
if !ok {
t.Errorf("Task data after put has diferent type. %#v != %#v", task.Data(), putData)
t.Errorf("Task data after put has different type. %#v != %#v", task.Data(), putData)
}
if *typedData != *putData {
t.Errorf("Task data after take not equal with example. %#v != %#v", task.Data(), putData)
Expand Down
2 changes: 1 addition & 1 deletion queue/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (t *Task) Bury() error {
}

// Release returns task back in the queue without making it complete.
// In outher words, this worker failed to complete the task, and
// In other words, this worker failed to complete the task, and
// it, so other worker could try to do that again.
func (t *Task) Release() error {
return t.accept(t.q._release(t.id, Opts{}))
Expand Down
2 changes: 1 addition & 1 deletion request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func assertBodyCall(t testing.TB, requests []Request, errorMsg string) {
t.Errorf(errBegin+"error %q", err.Error())
}
if err == nil && errorMsg != "" {
t.Errorf(errBegin+"result, expexted error %q", errorMsg)
t.Errorf(errBegin+"result, expected error %q", errorMsg)
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions tarantool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1626,16 +1626,16 @@ func TestConnection_DoWithStrangerConn(t *testing.T) {

_, err := conn1.Do(req).Get()
if err == nil {
t.Fatalf("nil error catched")
t.Fatalf("nil error caught")
}
if err.Error() != expectedErr.Error() {
t.Fatalf("Unexpected error catched")
t.Fatalf("Unexpected error caught")
}
}

func TestNewPreparedFromResponse(t *testing.T) {
var (
ErrNilResponsePassed = fmt.Errorf("pased nil response")
ErrNilResponsePassed = fmt.Errorf("passed nil response")
ErrNilResponseData = fmt.Errorf("response Data is nil")
ErrWrongDataFormat = fmt.Errorf("response Data format is wrong")
)
Expand Down Expand Up @@ -2293,7 +2293,7 @@ func TestClientRequestObjectsWithPassedCanceledContext(t *testing.T) {
t.Fatalf("Failed to catch an error from done context")
}
if resp != nil {
t.Fatalf("Response is not nil after the occured error")
t.Fatalf("Response is not nil after the occurred error")
}
}

Expand All @@ -2311,10 +2311,10 @@ func TestClientRequestObjectsWithContext(t *testing.T) {
t.Fatalf("response must be nil")
}
if err == nil {
t.Fatalf("catched nil error")
t.Fatalf("caught nil error")
}
if err.Error() != "context is done" {
t.Fatalf("wrong error catched: %v", err)
t.Fatalf("wrong error caught: %v", err)
}
}

Expand Down

0 comments on commit 8b58928

Please sign in to comment.