From 9173fce6aecf239fd4136ceb5a13103f2d0ea36b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 22:05:08 +0000 Subject: [PATCH 01/10] Bump golang.org/x/sync from 0.7.0 to 0.19.0 Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.7.0 to 0.19.0. - [Commits](https://github.com/golang/sync/compare/v0.7.0...v0.19.0) --- updated-dependencies: - dependency-name: golang.org/x/sync dependency-version: 0.19.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 88b2dcf..a2a5ace 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/github/go-pipe -go 1.19 +go 1.24.0 require ( github.com/stretchr/testify v1.11.1 go.uber.org/goleak v1.2.1 - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.19.0 ) require ( diff --git a/go.sum b/go.sum index 0539d10..ac3e65c 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,7 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -10,9 +11,10 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 06bc0353f9fceec123a5cf9bde07771b7bacab45 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:23:26 +0000 Subject: [PATCH 02/10] Initial plan From 8e61fa1efb8550778631dab02e8be7defa9cbcb6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:27:36 +0000 Subject: [PATCH 03/10] Fix invalid Go version format in go.mod Change go version from '1.24.0' to '1.24' to fix compatibility with Go 1.19 used in CI workflow. The three-part version format (1.24.0) is only supported in Go 1.21+, but the golangci-lint workflow uses Go 1.19.13 which requires the two-part format (1.24). Co-authored-by: migue <135139+migue@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a2a5ace..ff93061 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/github/go-pipe -go 1.24.0 +go 1.24 require ( github.com/stretchr/testify v1.11.1 From 2055d4cee5779e7f913bd9ea54f05c954b4f8686 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:29:26 +0000 Subject: [PATCH 04/10] Update golangci-lint workflow to use Go 1.24 The code requires Go 1.24 features, so the workflow needs to use Go 1.24 instead of Go 1.19. Also updated go.mod to include the toolchain directive which is standard for Go 1.21+. Co-authored-by: migue <135139+migue@users.noreply.github.com> --- .github/workflows/golangci-lint.yml | 2 +- go.mod | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index bba389a..65aaf4f 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: "1.19" + go-version: "1.24" - name: Vendor modules for later steps. run: | go mod vendor diff --git a/go.mod b/go.mod index ff93061..75f74b6 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/github/go-pipe -go 1.24 +go 1.24.0 + +toolchain go1.24.11 require ( github.com/stretchr/testify v1.11.1 From 10679d7dfffc6471e9b57d80aea110e098bb1dcc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:33:58 +0000 Subject: [PATCH 05/10] Initial plan From 69d79de6894cd9593be716d55ba77d81d7f49d1e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:40:12 +0000 Subject: [PATCH 06/10] Upgrade golangci-lint to v2.8 for Go 1.24 compatibility Co-authored-by: migue <135139+migue@users.noreply.github.com> --- .github/workflows/golangci-lint.yml | 2 +- .golangci.yml | 98 ++++++++++++++++------------- 2 files changed, 57 insertions(+), 43 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 65aaf4f..3b6aab6 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -21,6 +21,6 @@ jobs: - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.55 + version: v2.8 args: -v diff --git a/.golangci.yml b/.golangci.yml index 7d1be7d..5cefef7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,47 +2,61 @@ # The Go Language Working Group is currently working on a finalized version # of this configuration file to share with all Hubbers. -linters: - enable: - - depguard - - errcheck - - exportloopref - - gocritic - - gocyclo - - gofmt - - goimports - - gosec - - gosimple - - govet - - ineffassign - - misspell - - nakedret - - prealloc - - revive - - staticcheck - - typecheck - - unconvert - - unused - disable: - - gochecknoglobals # we allow global variables in packages - - gochecknoinits # we allow inits in packages - - goconst # we allow repeated values to go un-const'd - - lll # we allow any line length - - unparam # we allow function calls to name unused parameters - - maligned # clear structs are more important than saving a few bytes. +version: "2" -linters-settings: - depguard: - rules: - main: - files: - - "$all" - - "!$test" - deny: - - pkg: io/ioutil - desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil +linters: + enable: + - copyloopvar + - depguard + - errcheck + - gocritic + - gocyclo + - gosec + - govet + - ineffassign + - misspell + - nakedret + - prealloc + - revive + - staticcheck + - unconvert + - unused + disable: + - gochecknoglobals # we allow global variables in packages + - gochecknoinits # we allow inits in packages + - goconst # we allow repeated values to go un-const'd + - lll # we allow any line length + - unparam # we allow function calls to name unused parameters + settings: + depguard: + rules: + main: + files: + - $all + - '!$test' + deny: + - pkg: io/ioutil + desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ + - internal/deprecated$ -run: - timeout: 5m - skip-dirs: - - internal/deprecated +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ From c85d7bfe7593d1350f6993ae713423e46be6a688 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:50:01 +0000 Subject: [PATCH 07/10] Update golangci-lint-action to v9.2.0 and use full version v2.8.0 Co-authored-by: migue <135139+migue@users.noreply.github.com> --- .github/workflows/golangci-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 3b6aab6..cc06767 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,9 +18,9 @@ jobs: - name: Vendor modules for later steps. run: | go mod vendor - - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 + - uses: golangci/golangci-lint-action@v9.2.0 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v2.8 + version: v2.8.0 args: -v From 3fbda0d39442fa270400e38774f8555c6a16ff91 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:50:59 +0000 Subject: [PATCH 08/10] Update comment to reflect full version requirement Co-authored-by: migue <135139+migue@users.noreply.github.com> --- .github/workflows/golangci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index cc06767..e04d556 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -20,7 +20,7 @@ jobs: go mod vendor - uses: golangci/golangci-lint-action@v9.2.0 with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + # The version of golangci-lint to use (full version with patch number) version: v2.8.0 args: -v From 4e3b1a17372727ab3d8c5b3e3963e6f179a6b53b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 10:41:46 +0000 Subject: [PATCH 09/10] Initial plan From ee5d8b33602f351c45792475418d5cfff9862a18 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 12 Jan 2026 10:46:47 +0000 Subject: [PATCH 10/10] Fix all golangci-lint issues Co-authored-by: migue <135139+migue@users.noreply.github.com> --- internal/ptree/ptree_test.go | 2 +- pipe/command.go | 2 +- pipe/command_test.go | 1 - pipe/pipeline.go | 3 ++- pipe/pipeline_test.go | 3 +-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/ptree/ptree_test.go b/internal/ptree/ptree_test.go index 178e16e..9a6d1e2 100644 --- a/internal/ptree/ptree_test.go +++ b/internal/ptree/ptree_test.go @@ -77,7 +77,7 @@ func TestWalkChildren(t *testing.T) { require.Equal(t, "ready", string(ready[:])) var numChildren int - ptree.WalkChildren(cmd.Process.Pid, func(pid int) { + ptree.WalkChildren(cmd.Process.Pid, func(_ int) { numChildren++ }) assert.Equal(t, depth, numChildren) diff --git a/pipe/command.go b/pipe/command.go index 2c465e9..5bbbce5 100644 --- a/pipe/command.go +++ b/pipe/command.go @@ -201,7 +201,7 @@ func (s *commandStage) filterCmdError(err error) error { // doesn't do anything on Windows, where the `Signaled()` // method isn't implemented (it is hardcoded to return // `false`). - ps, ok := eErr.ProcessState.Sys().(syscall.WaitStatus) + ps, ok := eErr.Sys().(syscall.WaitStatus) if ok && ps.Signaled() && (ps.Signal() == syscall.SIGTERM || ps.Signal() == syscall.SIGKILL) { return ctxErr diff --git a/pipe/command_test.go b/pipe/command_test.go index 92fd37a..ca5a8c0 100644 --- a/pipe/command_test.go +++ b/pipe/command_test.go @@ -76,7 +76,6 @@ func TestCopyEnvWithOverride(t *testing.T) { } for _, ex := range examples { - ex := ex t.Run(ex.label, func(t *testing.T) { assert.ElementsMatch(t, ex.expectedResult, copyEnvWithOverrides(ex.env, ex.overrides)) diff --git a/pipe/pipeline.go b/pipe/pipeline.go index 9df1b51..8bc3a37 100644 --- a/pipe/pipeline.go +++ b/pipe/pipeline.go @@ -28,6 +28,7 @@ type Env struct { // and is not reported to the caller. // //revive:disable:error-naming +//nolint:staticcheck // ST1012: FinishEarly is the intentional name for this sentinel error var FinishEarly = errors.New("finish stage early") //revive:enable:error-naming @@ -67,7 +68,7 @@ type Pipeline struct { panicHandler StagePanicHandler } -var emptyEventHandler = func(e *Event) {} +var emptyEventHandler = func(_ *Event) {} type nopWriteCloser struct { io.Writer diff --git a/pipe/pipeline_test.go b/pipe/pipeline_test.go index ddb16c4..bebc931 100644 --- a/pipe/pipeline_test.go +++ b/pipe/pipeline_test.go @@ -473,7 +473,7 @@ func TestFunction(t *testing.T) { pipe.Print("hello world"), pipe.Function( "farewell", - func(_ context.Context, _ pipe.Env, stdin io.Reader, stdout io.Writer) error { + func(_ context.Context, _ pipe.Env, _ io.Reader, _ io.Writer) error { panic("this is a panic") }, ), @@ -886,7 +886,6 @@ func TestErrors(t *testing.T) { expectedErr: err1, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel()