Skip to content

Commit

Permalink
golang.org/x/net/context => context (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
houz42 authored and devnev committed Jul 23, 2019
1 parent 606c733 commit e0797f4
Show file tree
Hide file tree
Showing 50 changed files with 227 additions and 139 deletions.
3 changes: 2 additions & 1 deletion auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
package grpc_auth

import (
"context"

"github.com/grpc-ecosystem/go-grpc-middleware"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

Expand Down
11 changes: 4 additions & 7 deletions auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
package grpc_auth_test

import (
"testing"

"github.com/stretchr/testify/suite"
"google.golang.org/grpc"

"context"
"fmt"

"testing"
"time"

"github.com/grpc-ecosystem/go-grpc-middleware/auth"
Expand All @@ -19,8 +15,9 @@ import (
"github.com/grpc-ecosystem/go-grpc-middleware/util/metautils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
"github.com/stretchr/testify/suite"
"golang.org/x/oauth2"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/oauth"
"google.golang.org/grpc/metadata"
Expand Down
3 changes: 2 additions & 1 deletion auth/examples_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package grpc_auth_test

import (
"context"

"github.com/grpc-ecosystem/go-grpc-middleware/auth"
"github.com/grpc-ecosystem/go-grpc-middleware/tags"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
Expand Down
2 changes: 1 addition & 1 deletion auth/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
package grpc_auth

import (
"context"
"strings"

"github.com/grpc-ecosystem/go-grpc-middleware/util/metautils"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
Expand Down
2 changes: 1 addition & 1 deletion auth/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package grpc_auth

import (
"context"
"testing"

"github.com/grpc-ecosystem/go-grpc-middleware/util/metautils"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
Expand Down
3 changes: 2 additions & 1 deletion chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
package grpc_middleware

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

"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package grpc_middleware

import (
"context"
"fmt"
"testing"

"github.com/stretchr/testify/require"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
Expand Down
3 changes: 2 additions & 1 deletion logging/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
package grpc_logging

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

"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
Expand Down
2 changes: 1 addition & 1 deletion logging/logrus/client_interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package grpc_logrus

import (
"context"
"path"
"time"

"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

Expand Down
3 changes: 2 additions & 1 deletion logging/logrus/context.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package grpc_logrus

import (
"context"

"github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)

// AddFields adds logrus fields to the logger.
Expand Down
3 changes: 2 additions & 1 deletion logging/logrus/ctxlogrus/context.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package ctxlogrus

import (
"context"

"github.com/grpc-ecosystem/go-grpc-middleware/tags"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)

type ctxLoggerMarker struct{}
Expand Down
3 changes: 2 additions & 1 deletion logging/logrus/ctxlogrus/examples_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package ctxlogrus_test

import (
"context"

"github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus"
"github.com/grpc-ecosystem/go-grpc-middleware/tags"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)

var logrusLogger *logrus.Logger
Expand Down
2 changes: 1 addition & 1 deletion logging/logrus/examples_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package grpc_logrus_test

import (
"context"
"time"

"github.com/grpc-ecosystem/go-grpc-middleware"
Expand All @@ -9,7 +10,6 @@ import (
"github.com/grpc-ecosystem/go-grpc-middleware/tags/logrus"
pb_testproto "github.com/grpc-ecosystem/go-grpc-middleware/testing/testproto"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

Expand Down
3 changes: 2 additions & 1 deletion logging/logrus/options_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package grpc_logrus

import (
"github.com/stretchr/testify/assert"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

func TestDurationToTimeMillisField(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion logging/logrus/payload_interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package grpc_logrus

import (
"bytes"
"context"
"fmt"

"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/go-grpc-middleware/logging"
"github.com/grpc-ecosystem/go-grpc-middleware/tags/logrus"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

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

import (
"context"
"io"
"io/ioutil"
"runtime"
Expand All @@ -15,7 +16,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion logging/logrus/server_interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
package grpc_logrus

import (
"context"
"path"
"time"

"github.com/grpc-ecosystem/go-grpc-middleware"
"github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus"
"github.com/grpc-ecosystem/go-grpc-middleware/tags/logrus"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion logging/logrus/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package grpc_logrus_test

import (
"bytes"
"context"
"encoding/json"
"io"
"testing"
Expand All @@ -12,7 +13,6 @@ import (
"github.com/grpc-ecosystem/go-grpc-middleware/testing"
pb_testproto "github.com/grpc-ecosystem/go-grpc-middleware/testing/testproto"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
)

Expand Down
2 changes: 1 addition & 1 deletion logging/zap/client_interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
package grpc_zap

import (
"context"
"path"
"time"

"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

Expand Down
3 changes: 2 additions & 1 deletion logging/zap/context.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package grpc_zap

import (
"context"

"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/net/context"
)

// AddFields adds zap fields to the logger.
Expand Down
3 changes: 2 additions & 1 deletion logging/zap/ctxzap/context.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package ctxzap

import (
"context"

"github.com/grpc-ecosystem/go-grpc-middleware/tags"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/net/context"
)

type ctxMarker struct{}
Expand Down
5 changes: 3 additions & 2 deletions logging/zap/options_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package grpc_zap

import (
"github.com/stretchr/testify/assert"
"go.uber.org/zap/zapcore"
"math"
"testing"
"time"

"github.com/stretchr/testify/assert"
"go.uber.org/zap/zapcore"
)

func TestDurationToTimeMillisField(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion logging/zap/payload_interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package grpc_zap

import (
"bytes"
"context"
"fmt"

"github.com/golang/protobuf/jsonpb"
Expand All @@ -10,7 +11,6 @@ import (
"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

Expand Down
8 changes: 3 additions & 5 deletions logging/zap/payload_interceptors_test.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package grpc_zap_test

import (
"context"
"io"
"runtime"
"testing"

"strings"
"testing"

"github.com/stretchr/testify/suite"
"google.golang.org/grpc"

"io"

"github.com/grpc-ecosystem/go-grpc-middleware"
"github.com/grpc-ecosystem/go-grpc-middleware/tags"
pb_testproto "github.com/grpc-ecosystem/go-grpc-middleware/testing/testproto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"

"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
"go.uber.org/zap"
Expand Down
2 changes: 1 addition & 1 deletion logging/zap/server_interceptors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package grpc_zap

import (
"context"
"path"
"time"

Expand All @@ -9,7 +10,6 @@ import (
"github.com/grpc-ecosystem/go-grpc-middleware/tags/zap"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/net/context"
"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion logging/zap/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package grpc_zap_test

import (
"bytes"
"context"
"encoding/json"
"io"
"testing"
Expand All @@ -12,7 +13,6 @@ import (
pb_testproto "github.com/grpc-ecosystem/go-grpc-middleware/testing/testproto"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/net/context"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ fmt:
go fmt $(GOFILES_NOVENDOR)

vet:
go vet $(GOFILES_NOVENDOR)
# do not check lostcancel, they are intentional.
go vet -lostcancel=false $(GOFILES_NOVENDOR)

test: vet
./scripts/test_all.sh
Expand Down
3 changes: 2 additions & 1 deletion recovery/interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
package grpc_recovery

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

"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
Expand Down
Loading

0 comments on commit e0797f4

Please sign in to comment.