File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
x/mongo/driver/drivertest Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 45
45
Max : driverutil .MaxWireVersion ,
46
46
},
47
47
}
48
+
49
+ // ErrNoResponsesRemaining is the error returned when the mocked connection is asked for a response and does not have
50
+ // any responses buffered.
51
+ ErrNoResponsesRemaining = errors .New ("no responses remaining" )
48
52
)
49
53
50
54
// connection implements the driver.Connection interface and responds to wire messages with pre-configured responses.
@@ -71,7 +75,7 @@ func (c *connection) SetOIDCTokenGenID(uint64) {
71
75
func (c * connection ) Read (_ context.Context ) ([]byte , error ) {
72
76
var dst []byte
73
77
if len (c .responses ) == 0 {
74
- return dst , errors . New ( "no responses remaining" )
78
+ return dst , ErrNoResponsesRemaining
75
79
}
76
80
nextRes := c .responses [0 ]
77
81
c .responses = c .responses [1 :]
You can’t perform that action at this time.
0 commit comments