From 10d49d5ed8147af51dde9336af625e9a1c7f172b Mon Sep 17 00:00:00 2001 From: houseme Date: Wed, 10 Jan 2024 12:58:40 +0800 Subject: [PATCH 1/2] feat: Unify and update the `setup- go` and `checkout` in the `action` operation to the latest version --- .github/workflows/codecov.yml | 4 ++-- .github/workflows/goci.yml | 4 ++-- .github/workflows/golangci-lint.yml | 4 ++-- cmd/main.go | 10 +++++----- go.mod | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 97c4813..a8f932c 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,13 +18,13 @@ jobs: steps: - name: Set up Go 1.21 - uses: actions/setup-go@v1 + uses: actions/setup-go@v5 with: go-version: '1.21' id: go - name: Check out code into the Go module directory - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Get dependencies run: | diff --git a/.github/workflows/goci.yml b/.github/workflows/goci.yml index 7f575a8..ec4de54 100644 --- a/.github/workflows/goci.yml +++ b/.github/workflows/goci.yml @@ -16,10 +16,10 @@ jobs: name: run runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: '1.21' diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 5e7579d..4d913fb 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,11 +15,11 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: '1.21' cache: false - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/cmd/main.go b/cmd/main.go index ce23826..149d125 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -27,9 +27,9 @@ func main() { fmt.Println(ok) // true fmt.Println(root.GetData()) // 0.0 - node, ok := tr.Get(3) - fmt.Println(ok) // true - fmt.Println(node.GetData()) // 1.3 + found, ok := tr.Get(3) + fmt.Println(ok) // true + fmt.Println(found.GetData()) // 1.3 structure, ok := tr.GetStructure() fmt.Println(ok) // true @@ -37,7 +37,7 @@ func main() { nodes, ok := tr.Backtrack(6) fmt.Println(ok) // true - for _, node := range nodes { - fmt.Println(node.GetData()) // 2.6; 0.2; 0.0 + for _, n := range nodes { + fmt.Println(n.GetData()) // 2.6; 0.2; 0.0 } } diff --git a/go.mod b/go.mod index ec3fb8a..b5f0573 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/johnfercher/go-tree -go 1.21.1 +go 1.21 require github.com/stretchr/testify v1.8.4 From 0a2276aaedbc82aef681608c9151defaeed202f9 Mon Sep 17 00:00:00 2001 From: houseme Date: Wed, 10 Jan 2024 13:08:38 +0800 Subject: [PATCH 2/2] fix: revert go.mod version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b5f0573..ec3fb8a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/johnfercher/go-tree -go 1.21 +go 1.21.1 require github.com/stretchr/testify v1.8.4