From 6c7775781041df5c29588c6070bd6781add92fdf Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Thu, 9 May 2024 12:06:16 -0400 Subject: [PATCH] Upgrade to go 1.21 (#22) * Upgrade to go 1.21 * Add codecov token * Satisfy linter * Fix warnings * cleanup --- .github/workflows/build.yml | 4 +++- .github/workflows/golangci-lint.yml | 6 +++--- .golangci-warnings.yml | 3 --- abi/doc.go | 3 +-- abi/type.go | 1 + abi/type_test.go | 2 -- address/address.go | 4 ++++ apps/box.go | 3 +++ go.mod | 4 +++- 9 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f14be69..ab118df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version-file: 'go.mod' @@ -26,6 +26,8 @@ jobs: - name: Upload code coverage uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: fail_ci_if_error: true files: coverage.out diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 57704d0..55f2cba 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -11,18 +11,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: go-version-file: 'go.mod' - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.41.1 + version: v1.58.0 - name: golangci-lint warnings uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.41.1 + version: v1.58.0 # Optional: golangci-lint command line arguments. args: -c .golangci-warnings.yml diff --git a/.golangci-warnings.yml b/.golangci-warnings.yml index 598c897..fb9c7b3 100644 --- a/.golangci-warnings.yml +++ b/.golangci-warnings.yml @@ -6,10 +6,7 @@ linters: disable-all: true enable: - staticcheck - - structcheck - typecheck - - varcheck - - deadcode - gosimple - unused diff --git a/abi/doc.go b/abi/doc.go index da680ab..0ace627 100644 --- a/abi/doc.go +++ b/abi/doc.go @@ -3,8 +3,7 @@ Package abi provides an implementation of the Algorand ARC-4 ABI type system. See https://arc.algorand.foundation/ARCs/arc-0004 for the corresponding specification. - -Basic Operations +# Basic Operations This package can parse ABI type names using the `abi.TypeOf()` function. diff --git a/abi/type.go b/abi/type.go index 4ebf6e2..8a3c6d2 100644 --- a/abi/type.go +++ b/abi/type.go @@ -187,6 +187,7 @@ type segment struct{ left, right int } // Each sub-string represents a content type of the tuple type. // The argument str is the content between parentheses of tuple, i.e. // (...... str ......) +// // ^ ^ func parseTupleContent(str string) ([]string, error) { // if the tuple type content is empty (which is also allowed) diff --git a/abi/type_test.go b/abi/type_test.go index fa19035..51affb0 100644 --- a/abi/type_test.go +++ b/abi/type_test.go @@ -6,7 +6,6 @@ import ( "strconv" "strings" "testing" - "time" "github.com/stretchr/testify/require" ) @@ -564,7 +563,6 @@ func generateTupleType(baseTypes []Type, tupleTypes []Type) Type { func TestTypeMISC(t *testing.T) { t.Parallel() - rand.Seed(time.Now().Unix()) var testpool = []Type{ boolType, diff --git a/address/address.go b/address/address.go index 67efa93..a7d655f 100644 --- a/address/address.go +++ b/address/address.go @@ -1,3 +1,7 @@ +/* +Package address provides the ability to convert between 32 byte Algorand addresses and their base32 +string form. +*/ package address import ( diff --git a/apps/box.go b/apps/box.go index c627ce3..1f5e3e0 100644 --- a/apps/box.go +++ b/apps/box.go @@ -1,3 +1,6 @@ +/* +Package apps provides parsing utilities related to application arguments and box keys. +*/ package apps import ( diff --git a/go.mod b/go.mod index f7d8e2d..79d1562 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/algorand/avm-abi -go 1.20 +go 1.21 + +toolchain go1.21.10 require ( github.com/chrismcguire/gobberish v0.0.0-20150821175641-1d8adb509a0e