Skip to content

Commit 119f785

Browse files
committed
chore: define local-prefix from goimports
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent 6ec6dd3 commit 119f785

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+115
-69
lines changed

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ formatters:
6363
settings:
6464
gofumpt:
6565
extra-rules: true
66+
goimports:
67+
local-prefixes:
68+
- github.com/grpc-ecosystem/go-grpc-middleware
6669

6770
issues:
6871
# Maximum issues count per one linter.

examples/client/main.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ import (
1111
"syscall"
1212
"time"
1313

14-
grpcprom "github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus"
15-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
16-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/timeout"
17-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata"
18-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
1914
"github.com/oklog/run"
2015
"github.com/prometheus/client_golang/prometheus"
2116
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -28,6 +23,12 @@ import (
2823
"google.golang.org/grpc"
2924
"google.golang.org/grpc/credentials/insecure"
3025
grpcMetadata "google.golang.org/grpc/metadata"
26+
27+
grpcprom "github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus"
28+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
29+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/timeout"
30+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata"
31+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
3132
)
3233

3334
const (

examples/server/main.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ import (
1212
"runtime/debug"
1313
"syscall"
1414

15-
grpcprom "github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus"
16-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors"
17-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth"
18-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
19-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/recovery"
20-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/selector"
21-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata"
22-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
2315
"github.com/oklog/run"
2416
"github.com/prometheus/client_golang/prometheus"
2517
"github.com/prometheus/client_golang/prometheus/promauto"
@@ -34,6 +26,15 @@ import (
3426
"google.golang.org/grpc/codes"
3527
healthpb "google.golang.org/grpc/health/grpc_health_v1"
3628
"google.golang.org/grpc/status"
29+
30+
grpcprom "github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus"
31+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors"
32+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth"
33+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
34+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/recovery"
35+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/selector"
36+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata"
37+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
3738
)
3839

3940
const (

interceptors/auth/auth.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ package auth
66
import (
77
"context"
88

9-
middleware "github.com/grpc-ecosystem/go-grpc-middleware/v2"
109
"google.golang.org/grpc"
10+
11+
middleware "github.com/grpc-ecosystem/go-grpc-middleware/v2"
1112
)
1213

1314
// AuthFunc is the pluggable function that performs authentication.

interceptors/auth/auth_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import (
99
"testing"
1010
"time"
1111

12-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth"
13-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata"
14-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
1512
"github.com/stretchr/testify/assert"
1613
"github.com/stretchr/testify/suite"
1714
"golang.org/x/oauth2"
@@ -20,6 +17,10 @@ import (
2017
"google.golang.org/grpc/credentials/oauth"
2118
grpcMetadata "google.golang.org/grpc/metadata"
2219
"google.golang.org/grpc/status"
20+
21+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth"
22+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata"
23+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
2324
)
2425

2526
type authedMarker struct{}

interceptors/auth/examples_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import (
77
"context"
88
"log"
99

10-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth"
11-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
12-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
1310
"google.golang.org/grpc"
1411
"google.golang.org/grpc/codes"
1512
"google.golang.org/grpc/status"
13+
14+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth"
15+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
16+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
1617
)
1718

1819
type tokenInfoKey struct{}

interceptors/auth/metadata_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import (
77
"context"
88
"testing"
99

10-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata"
1110
"github.com/stretchr/testify/assert"
1211
"github.com/stretchr/testify/require"
1312
"google.golang.org/grpc/codes"
1413
grpcMetadata "google.golang.org/grpc/metadata"
1514
"google.golang.org/grpc/status"
15+
16+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/metadata"
1617
)
1718

1819
func TestAuthFromMD(t *testing.T) {

interceptors/client_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import (
1212
"testing"
1313
"time"
1414

15-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
1615
"github.com/stretchr/testify/require"
1716
"github.com/stretchr/testify/suite"
1817
"google.golang.org/grpc"
1918
"google.golang.org/grpc/codes"
2019
"google.golang.org/grpc/credentials/insecure"
2120
"google.golang.org/grpc/status"
21+
22+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/testing/testpb"
2223
)
2324

2425
type mockReport struct {

interceptors/logging/examples/kit/example_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import (
99

1010
"github.com/go-kit/log"
1111
"github.com/go-kit/log/level"
12-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
1312
"google.golang.org/grpc"
13+
14+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
1415
)
1516

1617
// InterceptorLogger adapts go-kit logger to interceptor logger.

interceptors/logging/examples/log/example_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import (
99
"log"
1010
"os"
1111

12-
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
1312
"google.golang.org/grpc"
13+
14+
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
1415
)
1516

1617
// InterceptorLogger adapts standard Go logger to interceptor logger.

0 commit comments

Comments
 (0)