Skip to content

No-longer necessary to import context package #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions dag/dagctx.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package ctxext

import (
"context"
"sync"
"time"

context "golang.org/x/net/context"
)

// WithParents returns a Context that listens to all given
Expand Down
3 changes: 1 addition & 2 deletions dag/dagctx_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package ctxext

import (
"context"
"math/rand"
"testing"
"time"

context "golang.org/x/net/context"
)

func TestWithParentsSingle(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions frac/fracctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
package ctxext

import (
"context"
"time"

context "golang.org/x/net/context"
)

// WithDeadlineFraction returns a Context with a fraction of the
Expand Down
12 changes: 7 additions & 5 deletions frac/fracctx_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package ctxext

import (
"context"
"os"
"testing"
"time"

context "golang.org/x/net/context"
)

// this test is on the context tool itself, not our stuff. it's for sanity on ours.
Expand All @@ -14,7 +13,8 @@ func TestDeadline(t *testing.T) {
t.Skip("timeouts don't work reliably on travis")
}

ctx, _ := context.WithTimeout(context.Background(), 5*time.Millisecond)
ctx, cncl := context.WithTimeout(context.Background(), 5*time.Millisecond)
defer cncl()

select {
case <-ctx.Done():
Expand Down Expand Up @@ -46,8 +46,10 @@ func TestDeadlineFractionHalf(t *testing.T) {
t.Skip("timeouts don't work reliably on travis")
}

ctx1, _ := context.WithTimeout(context.Background(), 10*time.Millisecond)
ctx2, _ := WithDeadlineFraction(ctx1, 0.5)
ctx1, cncl1 := context.WithTimeout(context.Background(), 10*time.Millisecond)
defer cncl1()
ctx2, cncl2 := WithDeadlineFraction(ctx1, 0.5)
defer cncl2()

select {
case <-ctx1.Done():
Expand Down
3 changes: 1 addition & 2 deletions io/ctxio.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
package ctxio

import (
"context"
"io"

context "golang.org/x/net/context"
)

type ioret struct {
Expand Down
3 changes: 1 addition & 2 deletions io/ctxio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package ctxio

import (
"bytes"
"context"
"io"
"testing"
"time"

context "golang.org/x/net/context"
)

func TestReader(t *testing.T) {
Expand Down