11 lines
191 B
Go
11 lines
191 B
Go
package global
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
func TimeoutContext(timeout time.Duration) (context.Context, context.CancelFunc) {
|
|
return context.WithTimeout(context.Background(), timeout)
|
|
}
|