From d9766d7378ae0aedfea6b8eb8e26a2bdb8472dbb Mon Sep 17 00:00:00 2001 From: Feng Ruohang Date: Wed, 2 Sep 2026 14:06:56 +0800 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01PvgysXDmhPBBimCReYtA8q Signed-off-by: Feng Ruohang --- .golangci.yml | 5 +---- internal/ioutil/wait_pipe.go | 10 +++------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2f5cfc6aa..90ce14bf4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,7 @@ linters: - durationcheck - forcetypeassert - gocritic - - gomodguard + - gomodguard_v2 - govet - ineffassign - misspell @@ -59,9 +59,6 @@ formatters: exclusions: generated: lax 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$ - builtin$ - examples$ diff --git a/internal/ioutil/wait_pipe.go b/internal/ioutil/wait_pipe.go index d8e3eab68..ce1620929 100644 --- a/internal/ioutil/wait_pipe.go +++ b/internal/ioutil/wait_pipe.go @@ -57,11 +57,7 @@ func WaitPipe() (*PipeReader, *PipeWriter) { r, w := io.Pipe() var wg sync.WaitGroup wg.Add(1) - return &PipeReader{ - PipeReader: r, - wait: wg.Wait, - }, &PipeWriter{ - PipeWriter: w, - done: wg.Done, - } + pr := &PipeReader{PipeReader: r, wait: wg.Wait} + pw := &PipeWriter{PipeWriter: w, done: wg.Done} + return pr, pw }