Skip to content

Commit

Permalink
Use stdlib context instead of golang.org/x/net/context
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbourgon committed Feb 4, 2017
1 parent 4eb1e49 commit 4a29204
Show file tree
Hide file tree
Showing 76 changed files with 90 additions and 105 deletions.
2 changes: 1 addition & 1 deletion auth/jwt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Example of use in a server:

```go
import (
"golang.org/x/net/context"
"context"

"github.com/go-kit/kit/auth/jwt"
"github.com/go-kit/kit/log"
Expand Down
2 changes: 1 addition & 1 deletion auth/jwt/middleware.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package jwt

import (
"context"
"errors"

jwt "github.com/dgrijalva/jwt-go"
"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"
)
Expand Down
3 changes: 1 addition & 2 deletions auth/jwt/middleware_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package jwt

import (
"context"
"testing"

jwt "github.com/dgrijalva/jwt-go"

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

var (
Expand Down
2 changes: 1 addition & 1 deletion auth/jwt/transport.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package jwt

import (
"context"
"fmt"
stdhttp "net/http"
"strings"

"golang.org/x/net/context"
"google.golang.org/grpc/metadata"

"github.com/go-kit/kit/transport/grpc"
Expand Down
3 changes: 1 addition & 2 deletions auth/jwt/transport_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package jwt

import (
"context"
"fmt"
"net/http"
"testing"

"google.golang.org/grpc/metadata"

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

func TestToHTTPContext(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion circuitbreaker/gobreaker.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package circuitbreaker

import (
"context"

"github.com/sony/gobreaker"
"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"
)
Expand Down
2 changes: 1 addition & 1 deletion circuitbreaker/handy_breaker.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package circuitbreaker

import (
"context"
"time"

"github.com/streadway/handy/breaker"
"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"
)
Expand Down
3 changes: 2 additions & 1 deletion circuitbreaker/hystrix.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package circuitbreaker

import (
"context"

"github.com/afex/hystrix-go/hystrix"
"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"
)
Expand Down
3 changes: 1 addition & 2 deletions circuitbreaker/util_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package circuitbreaker_test

import (
"context"
"errors"
"fmt"
"path/filepath"
"runtime"
"testing"
"time"

"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"
)

Expand Down
2 changes: 1 addition & 1 deletion endpoint/endpoint.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package endpoint

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

// Endpoint is the fundamental building block of servers and clients.
Expand Down
3 changes: 1 addition & 2 deletions endpoint/endpoint_example_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package endpoint_test

import (
"context"
"fmt"

"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/addsvc/cmd/addcli/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"flag"
"fmt"
"os"
Expand All @@ -12,7 +13,6 @@ import (
"github.com/lightstep/lightstep-tracer-go"
stdopentracing "github.com/opentracing/opentracing-go"
zipkin "github.com/openzipkin/zipkin-go-opentracing"
"golang.org/x/net/context"
"google.golang.org/grpc"
"sourcegraph.com/sourcegraph/appdash"
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
Expand Down
2 changes: 1 addition & 1 deletion examples/addsvc/cmd/addsvc/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"flag"
"fmt"
"net"
Expand All @@ -16,7 +17,6 @@ import (
stdopentracing "github.com/opentracing/opentracing-go"
zipkin "github.com/openzipkin/zipkin-go-opentracing"
stdprometheus "github.com/prometheus/client_golang/prometheus"
"golang.org/x/net/context"
"google.golang.org/grpc"
"sourcegraph.com/sourcegraph/appdash"
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
Expand Down
2 changes: 1 addition & 1 deletion examples/addsvc/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"fmt"
"time"

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

"github.com/go-kit/kit/endpoint"
"github.com/go-kit/kit/log"
Expand Down
2 changes: 1 addition & 1 deletion examples/addsvc/pb/addsvc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/addsvc/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"errors"
"time"

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

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/metrics"
Expand Down
2 changes: 1 addition & 1 deletion examples/addsvc/transport_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package addsvc
// It utilizes the transport/grpc.Server.

import (
"context"
stdopentracing "github.com/opentracing/opentracing-go"
"golang.org/x/net/context"

"github.com/go-kit/kit/examples/addsvc/pb"
"github.com/go-kit/kit/log"
Expand Down
2 changes: 1 addition & 1 deletion examples/addsvc/transport_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"io/ioutil"
"net/http"

"context"
stdopentracing "github.com/opentracing/opentracing-go"
"golang.org/x/net/context"

"github.com/go-kit/kit/log"
"github.com/go-kit/kit/tracing/opentracing"
Expand Down
2 changes: 1 addition & 1 deletion examples/addsvc/transport_thrift.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package addsvc
// yet. See https://github.com/go-kit/kit/issues/184.

import (
"golang.org/x/net/context"
"context"

"github.com/go-kit/kit/endpoint"
thriftadd "github.com/go-kit/kit/examples/addsvc/thrift/gen-go/addsvc"
Expand Down
2 changes: 1 addition & 1 deletion examples/apigateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"bytes"
"context"
"encoding/json"
"flag"
"fmt"
Expand All @@ -18,7 +19,6 @@ import (
"github.com/gorilla/mux"
"github.com/hashicorp/consul/api"
stdopentracing "github.com/opentracing/opentracing-go"
"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"
"github.com/go-kit/kit/examples/addsvc"
Expand Down
3 changes: 1 addition & 2 deletions examples/profilesvc/cmd/profilesvc/main.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package main

import (
"context"
"flag"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"

"golang.org/x/net/context"

"github.com/go-kit/kit/examples/profilesvc"
"github.com/go-kit/kit/log"
)
Expand Down
3 changes: 1 addition & 2 deletions examples/profilesvc/endpoints.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package profilesvc

import (
"context"
"net/url"
"strings"

"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"
httptransport "github.com/go-kit/kit/transport/http"
)
Expand Down
3 changes: 1 addition & 2 deletions examples/profilesvc/middlewares.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package profilesvc

import (
"context"
"time"

"golang.org/x/net/context"

"github.com/go-kit/kit/log"
)

Expand Down
3 changes: 1 addition & 2 deletions examples/profilesvc/service.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package profilesvc

import (
"context"
"errors"
"sync"

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

// Service is a simple CRUD interface for user profiles.
Expand Down
3 changes: 1 addition & 2 deletions examples/profilesvc/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ package profilesvc

import (
"bytes"
"context"
"encoding/json"
"errors"
"io/ioutil"
"net/http"

"net/url"

"github.com/gorilla/mux"
"golang.org/x/net/context"

"github.com/go-kit/kit/log"
httptransport "github.com/go-kit/kit/transport/http"
Expand Down
3 changes: 1 addition & 2 deletions examples/shipping/booking/endpoint.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package booking

import (
"context"
"time"

"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"

"github.com/go-kit/kit/examples/shipping/cargo"
Expand Down
2 changes: 1 addition & 1 deletion examples/shipping/booking/transport.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package booking

import (
"context"
"encoding/json"
"errors"
"net/http"
"time"

"github.com/gorilla/mux"
"golang.org/x/net/context"

kitlog "github.com/go-kit/kit/log"
kithttp "github.com/go-kit/kit/transport/http"
Expand Down
3 changes: 1 addition & 2 deletions examples/shipping/handling/endpoint.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package handling

import (
"context"
"time"

"golang.org/x/net/context"

"github.com/go-kit/kit/endpoint"

"github.com/go-kit/kit/examples/shipping/cargo"
Expand Down
2 changes: 1 addition & 1 deletion examples/shipping/handling/transport.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package handling

import (
"context"
"encoding/json"
"net/http"
"time"

"github.com/gorilla/mux"
"golang.org/x/net/context"

kitlog "github.com/go-kit/kit/log"
kithttp "github.com/go-kit/kit/transport/http"
Expand Down
4 changes: 3 additions & 1 deletion examples/shipping/inspection/inspection.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Package inspection provides means to inspect cargos.
package inspection

import "github.com/go-kit/kit/examples/shipping/cargo"
import (
"github.com/go-kit/kit/examples/shipping/cargo"
)

// EventHandler provides means of subscribing to inspection events.
type EventHandler interface {
Expand Down
4 changes: 3 additions & 1 deletion examples/shipping/location/location.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Package location provides the Location aggregate.
package location

import "errors"
import (
"errors"
)

// UNLocode is the United Nations location code that uniquely identifies a
// particular location.
Expand Down
2 changes: 1 addition & 1 deletion examples/shipping/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"flag"
"fmt"
"net/http"
Expand All @@ -11,7 +12,6 @@ import (
"time"

stdprometheus "github.com/prometheus/client_golang/prometheus"
"golang.org/x/net/context"

"github.com/go-kit/kit/log"
kitprometheus "github.com/go-kit/kit/metrics/prometheus"
Expand Down
Loading

0 comments on commit 4a29204

Please sign in to comment.