Skip to content

Commit 2c9c48f

Browse files
fix typos
1 parent 545effe commit 2c9c48f

File tree

12 files changed

+33
-33
lines changed

12 files changed

+33
-33
lines changed

bson/array_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestArray(t *testing.T) {
3434
defer func() {
3535
r := recover()
3636
if r != nil {
37-
t.Errorf("Recieved unexpected panic from nil insert. got %#v; want %#v", r, nil)
37+
t.Errorf("Received unexpected panic from nil insert. got %#v; want %#v", r, nil)
3838
}
3939
}()
4040
want := NewArray()

bson/document_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func TestDocument(t *testing.T) {
106106
defer func() {
107107
r := recover()
108108
if r != nil {
109-
t.Errorf("Recieved unexpected panic from nil insert. got %#v; want %#v", r, nil)
109+
t.Errorf("Received unexpected panic from nil insert. got %#v; want %#v", r, nil)
110110
}
111111
}()
112112
want := NewDocument()
@@ -964,7 +964,7 @@ func TestDocument(t *testing.T) {
964964
t.Errorf("Unexpected error while converting document to extended json: %v", err)
965965
}
966966
if got != want {
967-
t.Errorf("Did not recieve expected result. got %s; want %s", got, want)
967+
t.Errorf("Did not receive expected result. got %s; want %s", got, want)
968968
}
969969
})
970970
t.Run("Relaxed", func(t *testing.T) {
@@ -975,7 +975,7 @@ func TestDocument(t *testing.T) {
975975
t.Errorf("Unexpected error while converting document to extended json: %v", err)
976976
}
977977
if got != want {
978-
t.Errorf("Did not recieve expected result. got %s; want %s", got, want)
978+
t.Errorf("Did not receive expected result. got %s; want %s", got, want)
979979
}
980980
})
981981
})

bson/objectid/objectid.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func processUniqueBytes() [5]byte {
109109
var b [5]byte
110110
_, err := io.ReadFull(rand.Reader, b[:])
111111
if err != nil {
112-
panic(fmt.Errorf("cannot initialize objectid pacakge with crypto.rand.Reader: %v", err))
112+
panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %v", err))
113113
}
114114

115115
return b
@@ -119,7 +119,7 @@ func readRandomUint32() uint32 {
119119
var b [4]byte
120120
_, err := io.ReadFull(rand.Reader, b[:])
121121
if err != nil {
122-
panic(fmt.Errorf("cannot initialize objectid pacakge with crypto.rand.Reader: %v", err))
122+
panic(fmt.Errorf("cannot initialize objectid package with crypto.rand.Reader: %v", err))
123123
}
124124

125125
return (uint32(b[0]) << 0) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)

core/connection/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (e Error) Error() string {
2424
return fmt.Sprintf("connection(%s) %s", e.ConnectionID, e.message)
2525
}
2626

27-
// NetworkError represents an error that ocurred while reading from or writing
27+
// NetworkError represents an error that occurred while reading from or writing
2828
// to a network socket.
2929
type NetworkError struct {
3030
ConnectionID string

core/connection/pool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestPool(t *testing.T) {
3535
t.Run("size cannot be larger than capcity", func(t *testing.T) {
3636
_, err := NewPool(address.Address(""), 5, 1)
3737
if err != ErrSizeLargerThanCapacity {
38-
t.Errorf("Should recieve error when size is larger than capacity. got %v; want %v", err, ErrSizeLargerThanCapacity)
38+
t.Errorf("Should receive error when size is larger than capacity. got %v; want %v", err, ErrSizeLargerThanCapacity)
3939
}
4040
})
4141
})
@@ -640,7 +640,7 @@ func TestPool(t *testing.T) {
640640
noerr(t, err)
641641
err = c1.Close()
642642
if err != nil {
643-
t.Errorf("Conneciton Close should not error after Pool is Disconnected, but got error: %v", err)
643+
t.Errorf("Connection Close should not error after Pool is Disconnected, but got error: %v", err)
644644
}
645645
})
646646
t.Run("Does not return to pool twice", func(t *testing.T) {

core/connstring/connstring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ type extractedDatabase struct {
751751
db string
752752
}
753753

754-
// extractDatabaseFromURI is a helper function to retreive information about
754+
// extractDatabaseFromURI is a helper function to retrieve information about
755755
// the database from the passed in URI. It accepts as an argument the currently
756756
// parsed URI and returns the remainder of the uri, the database it found,
757757
// and any error it encounters while parsing.

core/examples/workload/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func main() {
6666
}
6767

6868
<-done
69-
log.Println("interupt received: shutting down")
69+
log.Println("interrupt received: shutting down")
7070
_ = c.Disconnect(ctx)
7171
log.Println("finished")
7272
}

core/integration/pool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func TestPool(t *testing.T) {
9090
noerr(t, err)
9191
second := c2.ID()
9292
if c1 == c2 {
93-
t.Errorf("Pool does not expire connections. IDs of first and second conneciton match. first %s; second %s", first, second)
93+
t.Errorf("Pool does not expire connections. IDs of first and second connection match. first %s; second %s", first, second)
9494
}
9595
})
9696
t.Run("Get With Done Context", func(t *testing.T) {
@@ -150,7 +150,7 @@ func TestPool(t *testing.T) {
150150
noerr(t, err)
151151
err = c1.Close()
152152
if err != nil {
153-
t.Errorf("Conneciton Close should not error after Pool is closed, but got error: %v", err)
153+
t.Errorf("Connection Close should not error after Pool is closed, but got error: %v", err)
154154
}
155155
})
156156
t.Run("Connection Close Does Not Close Underlying Connection If Not Expired", func(t *testing.T) {

core/topology/topology_options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/mongodb/mongo-go-driver/core/connstring"
1919
)
2020

21-
// Option is a configuraiton option for a topology.
21+
// Option is a configuration option for a topology.
2222
type Option func(*config) error
2323

2424
type config struct {

mongo/collection_internal_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestCollection_InsertOne_WriteError(t *testing.T) {
132132
t.FailNow()
133133
}
134134
if got[0].Code != want.Code {
135-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got[0].Code, want.Code)
135+
t.Errorf("Did not receive the correct error code. got %d; want %d", got[0].Code, want.Code)
136136
}
137137

138138
}
@@ -158,7 +158,7 @@ func TestCollection_InsertOne_WriteConcernError(t *testing.T) {
158158
t.Errorf("Did not receive correct type of error. got %T; want %T", err, WriteConcernError{})
159159
}
160160
if got.Code != want.Code {
161-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.Code, want.Code)
161+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.Code, want.Code)
162162
}
163163
if got.Message != want.Message {
164164
t.Errorf("Did not receive the correct error message. got %s; want %s", got.Message, want.Message)
@@ -262,7 +262,7 @@ func TestCollection_InsertMany_ErrorCases(t *testing.T) {
262262
t.FailNow()
263263
}
264264
if got.WriteErrors[0].Code != want.Code {
265-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.WriteErrors[0].Code, want.Code)
265+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.WriteErrors[0].Code, want.Code)
266266
}
267267
})
268268
t.Run("insert_batch_ordered_write_error", func(t *testing.T) {
@@ -283,7 +283,7 @@ func TestCollection_InsertMany_ErrorCases(t *testing.T) {
283283
t.FailNow()
284284
}
285285
if got.WriteErrors[0].Code != want.Code {
286-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.WriteErrors[0].Code, want.Code)
286+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.WriteErrors[0].Code, want.Code)
287287
}
288288

289289
})
@@ -343,7 +343,7 @@ func TestCollection_InsertMany_WriteConcernError(t *testing.T) {
343343
t.Errorf("Did not receive correct type of error. got %T; want %T\nError message: %s", err, BulkWriteError{}, err)
344344
}
345345
if got.WriteConcernError.Code != want.Code {
346-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.WriteConcernError.Code, want.Code)
346+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.WriteConcernError.Code, want.Code)
347347
}
348348
if got.WriteConcernError.Message != want.Message {
349349
t.Errorf("Did not receive the correct error message. got %s; want %s", got.WriteConcernError.Message, want.Message)
@@ -430,7 +430,7 @@ func TestCollection_DeleteOne_WriteError(t *testing.T) {
430430
t.FailNow()
431431
}
432432
if got[0].Code != want.Code {
433-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got[0].Code, want.Code)
433+
t.Errorf("Did not receive the correct error code. got %d; want %d", got[0].Code, want.Code)
434434
}
435435
}
436436

@@ -455,7 +455,7 @@ func TestCollection_DeleteMany_WriteConcernError(t *testing.T) {
455455
t.Errorf("Did not receive correct type of error. got %T; want %T", err, WriteConcernError{})
456456
}
457457
if got.Code != want.Code {
458-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.Code, want.Code)
458+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.Code, want.Code)
459459
}
460460
if got.Message != want.Message {
461461
t.Errorf("Did not receive the correct error message. got %s; want %s", got.Message, want.Message)
@@ -547,7 +547,7 @@ func TestCollection_DeleteMany_WriteError(t *testing.T) {
547547
t.FailNow()
548548
}
549549
if got[0].Code != want.Code {
550-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got[0].Code, want.Code)
550+
t.Errorf("Did not receive the correct error code. got %d; want %d", got[0].Code, want.Code)
551551
}
552552
}
553553

@@ -572,7 +572,7 @@ func TestCollection_DeleteOne_WriteConcernError(t *testing.T) {
572572
t.Errorf("Did not receive correct type of error. got %T; want %T", err, WriteConcernError{})
573573
}
574574
if got.Code != want.Code {
575-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.Code, want.Code)
575+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.Code, want.Code)
576576
}
577577
if got.Message != want.Message {
578578
t.Errorf("Did not receive the correct error message. got %s; want %s", got.Message, want.Message)
@@ -673,7 +673,7 @@ func TestCollection_UpdateOne_WriteError(t *testing.T) {
673673
t.FailNow()
674674
}
675675
if got[0].Code != want.Code {
676-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got[0].Code, want.Code)
676+
t.Errorf("Did not receive the correct error code. got %d; want %d", got[0].Code, want.Code)
677677
}
678678
}
679679

@@ -704,7 +704,7 @@ func TestCollection_UpdateOne_WriteConcernError(t *testing.T) {
704704
t.Errorf("Did not receive correct type of error. got %T; want %T", err, WriteConcernError{})
705705
}
706706
if got.Code != want.Code {
707-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.Code, want.Code)
707+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.Code, want.Code)
708708
}
709709
if got.Message != want.Message {
710710
t.Errorf("Did not receive the correct error message. got %s; want %s", got.Message, want.Message)
@@ -810,7 +810,7 @@ func TestCollection_UpdateMany_WriteError(t *testing.T) {
810810
t.FailNow()
811811
}
812812
if got[0].Code != want.Code {
813-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got[0].Code, want.Code)
813+
t.Errorf("Did not receive the correct error code. got %d; want %d", got[0].Code, want.Code)
814814
}
815815

816816
}
@@ -842,7 +842,7 @@ func TestCollection_UpdateMany_WriteConcernError(t *testing.T) {
842842
t.Errorf("Did not receive correct type of error. got %T; want %T", err, WriteConcernError{})
843843
}
844844
if got.Code != want.Code {
845-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.Code, want.Code)
845+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.Code, want.Code)
846846
}
847847
if got.Message != want.Message {
848848
t.Errorf("Did not receive the correct error message. got %s; want %s", got.Message, want.Message)
@@ -937,7 +937,7 @@ func TestCollection_ReplaceOne_WriteError(t *testing.T) {
937937
case 66: // mongod v3.6
938938
case 16837: //mongod v3.4, mongod v3.2
939939
default:
940-
t.Errorf("Did not recieve the correct error code. got %d; want (one of) %d", got[0].Code, []int{66, 16837})
940+
t.Errorf("Did not receive the correct error code. got %d; want (one of) %d", got[0].Code, []int{66, 16837})
941941
fmt.Printf("%#v\n", got)
942942
}
943943
}
@@ -964,7 +964,7 @@ func TestCollection_ReplaceOne_WriteConcernError(t *testing.T) {
964964
t.Errorf("Did not receive correct type of error. got %T; want %T", err, WriteConcernError{})
965965
}
966966
if got.Code != want.Code {
967-
t.Errorf("Did not recieve the correct error code. got %d; want %d", got.Code, want.Code)
967+
t.Errorf("Did not receive the correct error code. got %d; want %d", got.Code, want.Code)
968968
}
969969
if got.Message != want.Message {
970970
t.Errorf("Did not receive the correct error message. got %s; want %s", got.Message, want.Message)

0 commit comments

Comments
 (0)