Commit f91cb610 authored by Miek Gieben's avatar Miek Gieben Committed by John Belamaric

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
parent 449bb1ac
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
package etcd package etcd
import ( import (
"context"
"encoding/json" "encoding/json"
"testing" "testing"
"time" "time"
...@@ -16,6 +15,7 @@ import ( ...@@ -16,6 +15,7 @@ import (
etcdc "github.com/coreos/etcd/client" etcdc "github.com/coreos/etcd/client"
"github.com/miekg/dns" "github.com/miekg/dns"
"golang.org/x/net/context"
) )
func init() { func init() {
......
package proxy package proxy
import ( import (
"context"
"net" "net"
"time" "time"
"github.com/coredns/coredns/request" "github.com/coredns/coredns/request"
"github.com/miekg/dns" "github.com/miekg/dns"
"golang.org/x/net/context"
) )
type dnsEx struct { type dnsEx struct {
......
package proxy package proxy
import ( import (
"context"
"github.com/coredns/coredns/request" "github.com/coredns/coredns/request"
"github.com/miekg/dns" "github.com/miekg/dns"
"golang.org/x/net/context"
) )
// Exchanger is an interface that specifies a type implementing a DNS resolver that // Exchanger is an interface that specifies a type implementing a DNS resolver that
......
package proxy package proxy
import ( import (
"context"
"crypto/tls" "crypto/tls"
"encoding/json" "encoding/json"
"fmt" "fmt"
...@@ -16,6 +15,7 @@ import ( ...@@ -16,6 +15,7 @@ import (
"github.com/coredns/coredns/request" "github.com/coredns/coredns/request"
"github.com/miekg/dns" "github.com/miekg/dns"
"golang.org/x/net/context"
) )
type google struct { type google struct {
......
package proxy package proxy
import ( import (
"context"
"crypto/tls" "crypto/tls"
"log" "log"
...@@ -12,6 +11,7 @@ import ( ...@@ -12,6 +11,7 @@ import (
"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
"github.com/miekg/dns" "github.com/miekg/dns"
opentracing "github.com/opentracing/opentracing-go" opentracing "github.com/opentracing/opentracing-go"
"golang.org/x/net/context"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials"
) )
......
...@@ -3,7 +3,6 @@ package proxy ...@@ -3,7 +3,6 @@ package proxy
// functions other plugin might want to use to do lookup in the same style as the proxy. // functions other plugin might want to use to do lookup in the same style as the proxy.
import ( import (
"context"
"fmt" "fmt"
"net" "net"
"sync/atomic" "sync/atomic"
...@@ -13,6 +12,7 @@ import ( ...@@ -13,6 +12,7 @@ import (
"github.com/coredns/coredns/request" "github.com/coredns/coredns/request"
"github.com/miekg/dns" "github.com/miekg/dns"
"golang.org/x/net/context"
) )
// NewLookup create a new proxy with the hosts in host and a Random policy. // NewLookup create a new proxy with the hosts in host and a Random policy.
......
...@@ -2,7 +2,6 @@ package template ...@@ -2,7 +2,6 @@ package template
import ( import (
"bytes" "bytes"
"context"
"regexp" "regexp"
"strconv" "strconv"
gotmpl "text/template" gotmpl "text/template"
...@@ -12,6 +11,7 @@ import ( ...@@ -12,6 +11,7 @@ import (
"github.com/coredns/coredns/request" "github.com/coredns/coredns/request"
"github.com/miekg/dns" "github.com/miekg/dns"
"golang.org/x/net/context"
) )
// Handler is a plugin handler that takes a query and templates a response. // Handler is a plugin handler that takes a query and templates a response.
......
package template package template
import ( import (
"context"
"fmt" "fmt"
"regexp" "regexp"
"testing" "testing"
...@@ -13,6 +12,7 @@ import ( ...@@ -13,6 +12,7 @@ import (
"github.com/mholt/caddy" "github.com/mholt/caddy"
"github.com/miekg/dns" "github.com/miekg/dns"
"golang.org/x/net/context"
) )
func TestHandler(t *testing.T) { func TestHandler(t *testing.T) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment