Merge pull request #5074 from kolyshkin/1.4-5072

[1.4] CI: fix modernize job failure
This commit is contained in:
Rodrigo Campos
2025-12-20 01:23:44 -03:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -57,7 +57,7 @@ jobs:
fetch-depth: 2
- uses: actions/setup-go@v6
with:
go-version: "${{ env.GO_VERSION }}"
go-version: stable # modernize@latest may require latest Go.
- name: install deps
run: |
sudo apt -q update
@@ -68,7 +68,7 @@ jobs:
git diff --exit-code
- name: run modernize
run: |
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest -fix ./...
git diff --exit-code
compile-buildtags:

View File

@@ -1067,15 +1067,16 @@ func TestHook(t *testing.T) {
ok(t, err)
// e.g: 'ls /prestart ...'
cmd := "ls "
var cmd strings.Builder
cmd.WriteString("ls ")
for _, hook := range hookFiles {
cmd += "/" + hook + " "
cmd.WriteString("/" + hook + " ")
}
var stdout bytes.Buffer
pconfig := libcontainer.Process{
Cwd: "/",
Args: []string{"sh", "-c", cmd},
Args: []string{"sh", "-c", cmd.String()},
Env: standardEnvironment,
Stdin: nil,
Stdout: &stdout,