Last active
October 7, 2022 14:38
-
-
Save RobinThrift/b4f5ede313877ed6ef8f6ef15b5ac042 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func createTestContext(t *testing.T) (context.Context, context.CancelFunc) { | |
if deadline, ok := t.Deadline(); ok { | |
return context.WithDeadline(context.Background(), deadline) | |
} | |
return context.WithTimeout(context.Background(), 10*time.Second) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment