From bc4dacd9e51d8fbec09197fbd5b06e6cdf3038c9 Mon Sep 17 00:00:00 2001 From: verse91 Date: Sun, 10 May 2026 01:51:59 +0700 Subject: [PATCH] ci/cd(lint): bump to v2 --- .github/workflows/release.yml | 4 +++- .golangci.yml | 2 +- tests/root/update_test.go | 8 +++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ab5ea1..88cd452 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,9 @@ jobs: cache: true - name: Run Linter - run: go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run ./... + uses: golangci/golangci-lint-action@v8 + with: + version: v2.1.6 - name: Run Tests run: go test -v ./... diff --git a/.golangci.yml b/.golangci.yml index 002aa5d..75d886d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,4 @@ - +version: 2 run: timeout: 5m diff --git a/tests/root/update_test.go b/tests/root/update_test.go index 898f7e1..7a32314 100644 --- a/tests/root/update_test.go +++ b/tests/root/update_test.go @@ -37,12 +37,14 @@ func TestUpdateState(t *testing.T) { if err != nil { t.Fatal(err) } - defer os.RemoveAll(tmpDir) + defer func() { _ = os.RemoveAll(tmpDir) }() // Override home dir for testing homeBackup := os.Getenv("HOME") - os.Setenv("HOME", tmpDir) - defer os.Setenv("HOME", homeBackup) + if err := os.Setenv("HOME", tmpDir); err != nil { + t.Fatal(err) + } + defer func() { _ = os.Setenv("HOME", homeBackup) }() // Ensure .iris directory exists _ = os.MkdirAll(filepath.Join(tmpDir, ".iris"), 0755)