Skip to content

Commit

Permalink
Use Time.UTC instead of Time.In(time.UTC)
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Jan 24, 2022
1 parent 0ab012c commit c9992d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jctx/jctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func Encode(ctx context.Context, method string, params json.RawMessage) (json.Ra
v := wireVersion
c := wireContext{V: &v, Payload: params}
if dl, ok := ctx.Deadline(); ok {
utcdl := dl.In(time.UTC)
utcdl := dl.UTC()
c.Deadline = &utcdl
}

Expand Down Expand Up @@ -104,7 +104,7 @@ func Decode(ctx context.Context, method string, req json.RawMessage) (context.Co
}
if c.Deadline != nil && !c.Deadline.IsZero() {
var ignored context.CancelFunc
ctx, ignored = context.WithDeadline(ctx, (*c.Deadline).In(time.UTC))
ctx, ignored = context.WithDeadline(ctx, (*c.Deadline).UTC())
_ = ignored // the caller cannot use this value
}

Expand Down

0 comments on commit c9992d9

Please sign in to comment.