diff options
author | Karthik Nayak <knayak@gitlab.com> | 2022-10-04 10:50:30 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-10-10 16:46:35 +0300 |
commit | 58fe50f7aeedd388d8990f2835cf42f485bebf21 (patch) | |
tree | 6c85593742dc0c5e5182d4123e6e32997b3b194c | |
parent | 884ce282aac6ca811a541f3ab2debfc5b8b357c1 (diff) |
lint: Remove space after `nolint:`
With recent changes `gofmt` [1] started reformatting godoc comments.
This causes a problem wherein it reformats `//nolint: staticcheck` to
`// nolint: staticcheck`.
But it does ignore directives [2]. So let's change all our nolint to
directive format. This avoids the conflict with `gofmt`.
This fix was done by running `grep -r --include="*.go" -E "//nolint:
.*"` and manually fixing the issues.
[1]:
https://github.com/golangci/golangci-lint/issues/1658#issuecomment-1183148066
[2]:
https://github.com/golangci/golangci-lint/issues/3098#issuecomment-1214364533
-rw-r--r-- | auth/token.go | 2 | ||||
-rw-r--r-- | internal/middleware/featureflag/featureflag_handler_test.go | 4 | ||||
-rw-r--r-- | internal/praefect/service/checks.go | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/auth/token.go b/auth/token.go index d38f3ccee..7a32b8c78 100644 --- a/auth/token.go +++ b/auth/token.go @@ -18,7 +18,7 @@ import ( ) var ( - //nolint: gochecknoglobals + //nolint:gochecknoglobals // This infrastructure is required for testing purposes and there is no // proper place to put it instead. While we could move it into the // config, we certainly don't want to make it configurable for now, so diff --git a/internal/middleware/featureflag/featureflag_handler_test.go b/internal/middleware/featureflag/featureflag_handler_test.go index 8d1a4ec8f..649506cc8 100644 --- a/internal/middleware/featureflag/featureflag_handler_test.go +++ b/internal/middleware/featureflag/featureflag_handler_test.go @@ -47,7 +47,7 @@ func TestStreamInterceptor(t *testing.T) { } func callUnary(ctx context.Context) { - //nolint: errcheck + //nolint:errcheck UnaryInterceptor(ctx, nil, nil, func(context.Context, interface{}) (interface{}, error) { ctxlogrus.Extract(ctx).Info("verify") return nil, nil @@ -55,7 +55,7 @@ func callUnary(ctx context.Context) { } func callStream(ctx context.Context) { - //nolint: errcheck + //nolint:errcheck StreamInterceptor(ctx, &grpcmw.WrappedServerStream{WrappedContext: ctx}, nil, func(interface{}, grpc.ServerStream) error { ctxlogrus.Extract(ctx).Info("verify") return nil diff --git a/internal/praefect/service/checks.go b/internal/praefect/service/checks.go index 41fd44de1..6085acc8a 100644 --- a/internal/praefect/service/checks.go +++ b/internal/praefect/service/checks.go @@ -130,7 +130,7 @@ func NewPostgresReadWriteCheck(conf config.Config, w io.Writer, quiet bool) *Che if err != nil { return fmt.Errorf("error starting transaction: %w", err) } - //nolint: errcheck + //nolint:errcheck defer tx.Rollback() var id int |