Skip to content

Commit 41a1096

Browse files
Stopped nolintlint and gofmt from fighting each other
Nolintlint wants the //nolint directives without a leading space GoFmt wants them with a leading space, ... except if nolint has no space afterwards: // nolint:foo // <-- malformed //nolint :foo // <-- malformed //nolint: foo // <-- malformed //nolint:foo // <-- OK See golangci/golangci-lint#3110 (comment)
1 parent 5bb6f82 commit 41a1096

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

backend_mock.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ func selectBackend(ctx context.Context) backend.Backend {
2626
return windows.Backend{}
2727
}
2828

29-
//nolint: forcetypeassert // The panic is expected and welcome
29+
//nolint:forcetypeassert // The panic is expected and welcome
3030
return v.(backend.Backend)
3131
}

exec.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (c *Cmd) Start() (err error) {
145145
go func() {
146146
select {
147147
case <-c.ctx.Done():
148-
//nolint: errcheck // Mimicking behaviour from stdlib
148+
//nolint:errcheck // Mimicking behaviour from stdlib
149149
c.Process.Kill()
150150
// We deviate from the stdlib: "context cancelled" is more useful than "exit code 1"
151151
c.ctxErr = c.ctx.Err()
@@ -178,7 +178,7 @@ func (c *Cmd) Output() (out []byte, err error) {
178178
if err != nil && captureErr {
179179
target := &exec.ExitError{}
180180
if errors.As(err, &target) {
181-
//nolint: forcetypeassert
181+
//nolint:forcetypeassert
182182
// copied from stdlib. We know this to be true because it is set further up in this same function
183183
target.Stderr = c.Stderr.(*prefixSuffixSaver).Bytes()
184184
}

exec_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ print("Your text was", v)
612612
// - In the happy path (all checks pass) we'll have waited on the command already, so
613613
// this second wait is superfluous.
614614
// - If a check fails, we don't really care about any subsequent errors like this one.
615-
defer cmd.Wait() //nolint: errcheck
615+
defer cmd.Wait() //nolint:errcheck
616616

617617
buffer := make([]byte, 1024)
618618

@@ -642,7 +642,7 @@ print("Your text was", v)
642642
require.NoError(t, err, "Unexpected error on command wait")
643643

644644
if tc.readFrom == readFromPipe {
645-
err = stdin.(io.WriteCloser).Close() //nolint: forcetypeassert
645+
err = stdin.(io.WriteCloser).Close() //nolint:forcetypeassert
646646
require.NoError(t, err, "Failed to close stdin pipe multiple times")
647647
}
648648
})

registration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func TestUnregister(t *testing.T) {
165165
// called in order to deallocate resources. You can call cancel multiple times without
166166
// adverse effect.
167167
//
168-
//nolint: revive // No, I wont' put the context before the *testing.T.
168+
//nolint:revive // No, I wont' put the context before the *testing.T.
169169
func wslShutdownTimeout(t *testing.T, ctx context.Context, timeout time.Duration) (cancel func()) {
170170
t.Helper()
171171

0 commit comments

Comments
 (0)