Repository: census-instrumentation/opencensus-go (go)

Issue:
remove golang.org/x/net/context from all non gRPC packages

Pull request:
Use stdlib context package for all non gRPC packages
For all non gRPC packages, import
  "context"
instead of
  "golang.org/x/net/context"

Fixes #199

Patch:
diff --git a/exporter/trace/stackdriver/stackdriver.go b/exporter/trace/stackdriver/stackdriver.go
index d0e8a80..dfd92be 100644
--- a/exporter/trace/stackdriver/stackdriver.go
+++ b/exporter/trace/stackdriver/stackdriver.go
@@ -30,6 +30,7 @@
 package stackdriver
 
 import (
+	"context"
 	"fmt"
 	"log"
 	"sync"
@@ -39,7 +40,6 @@ import (
 
 	tracingclient "cloud.google.com/go/trace/apiv2"
 	"go.opencensus.io/trace"
-	"golang.org/x/net/context"
 	"google.golang.org/api/option"
 	"google.golang.org/api/support/bundler"
 	tracepb "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2"
diff --git a/tag/context.go b/tag/context.go
index 8add6d8..9fe32e4 100644
--- a/tag/context.go
+++ b/tag/context.go
@@ -15,7 +15,7 @@
 
 package tag
 
-import "golang.org/x/net/context"
+import "context"
 
 // FromContext returns the tag map stored in the context.
 func FromContext(ctx context.Context) *Map {
diff --git a/tag/map.go b/tag/map.go
index 06b10ef..a07d230 100644
--- a/tag/map.go
+++ b/tag/map.go
@@ -17,10 +17,9 @@ package tag
 
 import (
 	"bytes"
+	"context"
 	"fmt"
 	"sort"
-
-	"golang.org/x/net/context"
 )
 
 // Tag is a key value pair that can be propagated on wire.


Test patch:
diff --git a/stats/collector_test.go b/stats/collector_test.go
index bf56ee7..8382b59 100644
--- a/stats/collector_test.go
+++ b/stats/collector_test.go
@@ -15,10 +15,9 @@
 package stats
 
 import (
+	"context"
 	"testing"
 
-	"golang.org/x/net/context"
-
 	"go.opencensus.io/tag"
 )
 
diff --git a/stats/example_test.go b/stats/example_test.go
index 07938c9..f403389 100644
--- a/stats/example_test.go
+++ b/stats/example_test.go
@@ -15,11 +15,10 @@
 package stats_test
 
 import (
+	"context"
 	"log"
 	"time"
 
-	"golang.org/x/net/context"
-
 	"go.opencensus.io/stats"
 )
 
diff --git a/stats/view_test.go b/stats/view_test.go
index 4351e6f..8698b8a 100644
--- a/stats/view_test.go
+++ b/stats/view_test.go
@@ -16,11 +16,10 @@
 package stats
 
 import (
+	"context"
 	"testing"
 	"time"
 
-	"golang.org/x/net/context"
-
 	"go.opencensus.io/tag"
 )
 
diff --git a/stats/worker_test.go b/stats/worker_test.go
index 223a05d..a2d0595 100644
--- a/stats/worker_test.go
+++ b/stats/worker_test.go
@@ -16,6 +16,7 @@
 package stats
 
 import (
+	"context"
 	"errors"
 	"fmt"
 	"sync"
@@ -23,8 +24,6 @@ import (
 	"time"
 
 	"go.opencensus.io/tag"
-
-	"golang.org/x/net/context"
 )
 
 func Test_Worker_MeasureCreation(t *testing.T) {