Skip to content

Commit 9bee5cb

Browse files
matthewdalekevinAlbsbenjirewis
committed
Apply suggestions from code review
Co-authored-by: Kevin Albertson <[email protected]> Co-authored-by: Benjamin Rewis <[email protected]>
1 parent af3b1e9 commit 9bee5cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

x/mongo/driver/topology/pool.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type pool struct {
6767

6868
maintainInterval time.Duration // maintainInterval is the maintain() loop interval.
6969
cancelBackground context.CancelFunc // cancelBackground is called to signal background goroutines to stop.
70-
backgroundDone *sync.WaitGroup // stopDone waits for all background goroutines to return.
70+
backgroundDone *sync.WaitGroup // backgroundDone waits for all background goroutines to return.
7171

7272
connsCond *sync.Cond // connsCond guards conns, newConnWait.
7373
conns map[uint64]*connection // conns holds all currently open connections.
@@ -94,7 +94,7 @@ func connectionPerished(conn *connection) (string, bool) {
9494
return "", false
9595
}
9696

97-
// newPool creates a new pool that will hold size number of idle connections. It will use the
97+
// newPool creates a new pool. It will use the
9898
// provided options when creating connections.
9999
func newPool(config poolConfig, connOpts ...ConnectionOption) (*pool, error) {
100100
opts := connOpts
@@ -148,7 +148,7 @@ func (p *pool) connect() error {
148148
p.generation.connect()
149149

150150
// Create a Context with cancellation that's used to signal the createConnections() and
151-
// maintain() background goroutines to stop. Also create a "disconnectDone" WaitGroup that is
151+
// maintain() background goroutines to stop. Also create a "backgroundDone" WaitGroup that is
152152
// used to wait for the background goroutines to return. Always create a new Context and
153153
// WaitGroup each time we start new set of background goroutines to prevent interaction between
154154
// current and previous sets of background goroutines.
@@ -804,7 +804,7 @@ func (w *wantConn) waiting() bool {
804804
}
805805
}
806806

807-
// tryDeliver attempts to deliver pc, err to w and reports whether it succeeded.
807+
// tryDeliver attempts to deliver conn, err to w and reports whether it succeeded.
808808
func (w *wantConn) tryDeliver(conn *connection, err error) bool {
809809
w.mu.Lock()
810810
defer w.mu.Unlock()

x/mongo/driver/topology/pool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestPool(t *testing.T) {
2727
err = p.connect()
2828
noerr(t, err)
2929

30-
assert.Equal(t, connected, p.connected, "Expected new pool to be connected")
30+
assert.Equal(t, connected, p.connected, "expected new pool to be connected")
3131

3232
err = p.disconnect(context.Background())
3333
noerr(t, err)
@@ -52,7 +52,7 @@ func TestPool(t *testing.T) {
5252
noerr(t, err)
5353

5454
err = p2.closeConnection(&connection{pool: p1})
55-
assert.Equal(t, ErrWrongPool, err, "Expected ErrWrongPool error")
55+
assert.Equal(t, ErrWrongPool, err, "expected ErrWrongPool error")
5656

5757
err = p1.disconnect(context.Background())
5858
noerr(t, err)

0 commit comments

Comments
 (0)