chore: drop the wait_pipe lint exclusion and use gomodguard_v2

Assigning the two pipe halves before returning them removes the gofumpt and
gofmt disagreement that needed a permanent formatter exclusion. gomodguard is
deprecated in golangci-lint v2.12; the v2 linter takes the same configuration.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PvgysXDmhPBBimCReYtA8q
Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-09-02 14:06:56 +08:00
parent 5594d284fc
commit d9766d7378
2 changed files with 4 additions and 11 deletions
+1 -4
View File
@@ -5,7 +5,7 @@ linters:
- durationcheck - durationcheck
- forcetypeassert - forcetypeassert
- gocritic - gocritic
- gomodguard - gomodguard_v2
- govet - govet
- ineffassign - ineffassign
- misspell - misspell
@@ -59,9 +59,6 @@ formatters:
exclusions: exclusions:
generated: lax generated: lax
paths: paths:
# gofumpt v0.11.0 and Go 1.27's gofmt disagree on the indentation of
# multiple composite literals returned from a single statement.
- internal/ioutil/wait_pipe\.go$
- third_party$ - third_party$
- builtin$ - builtin$
- examples$ - examples$
+3 -7
View File
@@ -57,11 +57,7 @@ func WaitPipe() (*PipeReader, *PipeWriter) {
r, w := io.Pipe() r, w := io.Pipe()
var wg sync.WaitGroup var wg sync.WaitGroup
wg.Add(1) wg.Add(1)
return &PipeReader{ pr := &PipeReader{PipeReader: r, wait: wg.Wait}
PipeReader: r, pw := &PipeWriter{PipeWriter: w, done: wg.Done}
wait: wg.Wait, return pr, pw
}, &PipeWriter{
PipeWriter: w,
done: wg.Done,
}
} }