fix golint issues in core/contextx (#477)
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// ShrinkDeadline returns a new Context with proper deadline base on the given ctx and timeout.
|
||||
// And returns a cancel function as well.
|
||||
func ShrinkDeadline(ctx context.Context, timeout time.Duration) (context.Context, func()) {
|
||||
if deadline, ok := ctx.Deadline(); ok {
|
||||
leftTime := time.Until(deadline)
|
||||
|
||||
Reference in New Issue
Block a user