Fixed lint issues and missing documentation
This commit is contained in:
1 parent
7fd321df97
commit
6e6dec68c0
34 files changed
+346
-156
No files matched your search
@@ -154,12 +154,7 @@ func AwaitTask[T any](ctx context.Context, fn func() (T, error)) (T, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// AwaitTask runs fn in its own goroutine and returns its result, or ctx.Err()
|
||||
// if ctx is cancelled first. This lets a Task stop waiting on a call that does
|
||||
// not respond promptly to cancellation.
|
||||
//
|
||||
// The result channel is buffered, so if ctx wins the race the goroutine can
|
||||
// still deliver its result and exit instead of blocking forever.
|
||||
// AwaitTaskE is AwaitTask for a function that returns only an error.
|
||||
func AwaitTaskE(ctx context.Context, fn func() error) error {
|
||||
ch := make(chan error, 1)
|
||||
go func() {
|
||||
|
||||
Reference in new issue
Block a user