8000 sync up · coder/coder@f59b194 · GitHub
[go: up one dir, main page]

Skip to content

Commit f59b194

Browse files
committed
sync up
1 parent a93fadc commit f59b194

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testutil/chan.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
"testing"
66
)
77

8-
// TryRecvCtx will attempt to receive a value from the chan and return it. If
8+
// TryReceive will attempt to receive a value from the chan and return it. If
99
// the context expires before a value can be received, it will fail the test. If
1010
// the channel is closed, the zero value of the channel type will be returned.
1111
//
1212
// Safety: Must only be called from the Go routine that created `t`.
13-
func TryRecvCtx[A any](ctx context.Context, t testing.TB, c <-chan A) A {
13+
func TryReceive[A any](ctx context.Context, t testing.TB, c <-chan A) A {
1414
t.Helper()
1515
select {
1616
case <-ctx.Done():
@@ -22,12 +22,12 @@ func TryRecvCtx[A any](ctx context.Context, t testing.TB, c <-chan A) A {
2222
}
2323
}
2424

25-
// RequireRecvCtx will receive a value from the chan and return it. If the
25+
// RequireReceive will receive a value from the chan and return it. If the
2626
// context expires or the channel is closed before a value can be received,
2727
// it will fail the test.
2828
//
2929
// Safety: Must only be called from the Go routine that created `t`.
30-
func RequireRecvCtx[A any](ctx context.Context, t testing.TB, c <-chan A) A {
30+
func RequireReceive[A any](ctx context.Context, t testing.TB, c <-chan A) A {
3131
t.Helper()
3232
select {
3333
case <-ctx.Done():
@@ -42,11 +42,11 @@ func RequireRecvCtx[A any](ctx context.Context, t testing.TB, c <-chan A) A {
4242
}
4343
}
4444

45-
// RequireSendCtx will send the given value over the chan and then return. If
45+
// RequireSend will send the given value over the chan and then return. If
4646
// the context expires before the send succeeds, it will fail the test.
4747
//
4848
// Safety: Must only be called from the Go routine that created `t`.
49-
func RequireSendCtx[A any](ctx context.Context, t testing.TB, c chan<- A, a A) {
49+
func RequireSend[A any](ctx context.Context, t testing.TB, c chan<- A, a A) {
5050
t.Helper()
5151
select {
5252
case <-ctx.Done():

0 commit comments

Comments
 (0)
0