mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
14 lines
220 B
Go
14 lines
220 B
Go
package testutil
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func Context(t *testing.T, dur time.Duration) context.Context {
|
|
ctx, cancel := context.WithTimeout(context.Background(), dur)
|
|
t.Cleanup(cancel)
|
|
return ctx
|
|
}
|