Files
kurious/internal/common/xcontext/wait.go
2023-12-15 13:00:59 +03:00

16 lines
201 B
Go

package xcontext
import (
"context"
"time"
)
func Wait(ctx context.Context, wait time.Duration) error {
select {
case <-ctx.Done():
return ctx.Err()
case <-time.After(wait):
return nil
}
}