aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-01-30 16:19:37 +0200
committerGravatar John Belamaric <jbelamaric@infoblox.com> 2018-01-30 09:19:37 -0500
commitf91cb61086211fe4a4b1b61672f127429b7cf4b9 (patch)
tree01bb2b3bfec25397d04b6d7e56c3935bf545bddf
parent449bb1ac6ce1b58cf14caa2daf7f9520a36901ef (diff)
downloadcoredns-f91cb61086211fe4a4b1b61672f127429b7cf4b9.tar.gz
coredns-f91cb61086211fe4a4b1b61672f127429b7cf4b9.tar.zst
coredns-f91cb61086211fe4a4b1b61672f127429b7cf4b9.zip
Don't use standard lib context package (#1468)
With Go 1.9 you *can* include the std lib's context package and nothing breaks. However we never officially made the move (and grpc also doesn't ues the std lib's one). Standardize all plugins on using the extern context package. Fixes #1466
-rw-r--r--plugin/etcd/lookup_test.go2
-rw-r--r--plugin/proxy/dns.go2
-rw-r--r--plugin/proxy/exchanger.go4
-rw-r--r--plugin/proxy/google.go2
-rw-r--r--plugin/proxy/grpc.go2
-rw-r--r--plugin/proxy/lookup.go2
-rw-r--r--plugin/template/template.go2
-rw-r--r--plugin/template/template_test.go2
8 files changed, 9 insertions, 9 deletions
diff --git a/plugin/etcd/lookup_test.go b/plugin/etcd/lookup_test.go
index adf079443..a44f0dcd7 100644
--- a/plugin/etcd/lookup_test.go
+++ b/plugin/etcd/lookup_test.go
@@ -3,7 +3,6 @@
package etcd
import (
- "context"
"encoding/json"
"testing"
"time"
@@ -16,6 +15,7 @@ import (
etcdc "github.com/coreos/etcd/client"
"github.com/miekg/dns"
+ "golang.org/x/net/context"
)
func init() {
diff --git a/plugin/proxy/dns.go b/plugin/proxy/dns.go
index 4d8038422..2bebae755 100644
--- a/plugin/proxy/dns.go
+++ b/plugin/proxy/dns.go
@@ -1,13 +1,13 @@
package proxy
import (
- "context"
"net"
"time"
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
+ "golang.org/x/net/context"
)
type dnsEx struct {
diff --git a/plugin/proxy/exchanger.go b/plugin/proxy/exchanger.go
index b98a687e7..283022dae 100644
--- a/plugin/proxy/exchanger.go
+++ b/plugin/proxy/exchanger.go
@@ -1,10 +1,10 @@
package proxy
import (
- "context"
-
"github.com/coredns/coredns/request"
+
"github.com/miekg/dns"
+ "golang.org/x/net/context"
)
// Exchanger is an interface that specifies a type implementing a DNS resolver that
diff --git a/plugin/proxy/google.go b/plugin/proxy/google.go
index cc91c60ec..0fa1356e1 100644
--- a/plugin/proxy/google.go
+++ b/plugin/proxy/google.go
@@ -1,7 +1,6 @@
package proxy
import (
- "context"
"crypto/tls"
"encoding/json"
"fmt"
@@ -16,6 +15,7 @@ import (
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
+ "golang.org/x/net/context"
)
type google struct {
diff --git a/plugin/proxy/grpc.go b/plugin/proxy/grpc.go
index f98fd2e91..b1ac1b1a8 100644
--- a/plugin/proxy/grpc.go
+++ b/plugin/proxy/grpc.go
@@ -1,7 +1,6 @@
package proxy
import (
- "context"
"crypto/tls"
"log"
@@ -12,6 +11,7 @@ import (
"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
"github.com/miekg/dns"
opentracing "github.com/opentracing/opentracing-go"
+ "golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)
diff --git a/plugin/proxy/lookup.go b/plugin/proxy/lookup.go
index 51b8c4690..01dd4b94a 100644
--- a/plugin/proxy/lookup.go
+++ b/plugin/proxy/lookup.go
@@ -3,7 +3,6 @@ package proxy
// functions other plugin might want to use to do lookup in the same style as the proxy.
import (
- "context"
"fmt"
"net"
"sync/atomic"
@@ -13,6 +12,7 @@ import (
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
+ "golang.org/x/net/context"
)
// NewLookup create a new proxy with the hosts in host and a Random policy.
diff --git a/plugin/template/template.go b/plugin/template/template.go
index a45ed0610..0d1d0c251 100644
--- a/plugin/template/template.go
+++ b/plugin/template/template.go
@@ -2,7 +2,6 @@ package template
import (
"bytes"
- "context"
"regexp"
"strconv"
gotmpl "text/template"
@@ -12,6 +11,7 @@ import (
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
+ "golang.org/x/net/context"
)
// Handler is a plugin handler that takes a query and templates a response.
diff --git a/plugin/template/template_test.go b/plugin/template/template_test.go
index 288d833ec..969cd6a27 100644
--- a/plugin/template/template_test.go
+++ b/plugin/template/template_test.go
@@ -1,7 +1,6 @@
package template
import (
- "context"
"fmt"
"regexp"
"testing"
@@ -13,6 +12,7 @@ import (
"github.com/mholt/caddy"
"github.com/miekg/dns"
+ "golang.org/x/net/context"
)
func TestHandler(t *testing.T) {