From f3a4ee2c80ba24320243bc23b5ea6d0042369e4f Mon Sep 17 00:00:00 2001 From: Komu Wairagu Date: Fri, 1 Mar 2024 20:08:10 +0300 Subject: [PATCH] issues/70: Support older versions of Go (#71) - Fixes: https://github.com/komuw/kama/issues/70 - Updates: https://github.com/komuw/kama/issues/72 --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- CHANGELOG.md | 2 ++ dump.go | 2 +- go.mod | 7 +++++-- go.sum | 7 ++----- packages.go | 2 +- 6 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77f5e0c..6159bea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,28 @@ jobs: esac fi + check_go_compatibility: + name: check_go_compatibility + timeout-minutes: 7 + strategy: + matrix: + go-version: [1.20.x, 1.21.x, 1.22.x] + platform: [ubuntu-22.04] + runs-on: ${{ matrix.platform }} + steps: + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + + - name: tests and benchmarks + run: | + go test -count=1 -timeout 1m --exec=/bin/true ./... + + run_tests: name: run_tests timeout-minutes: 7 @@ -99,7 +121,6 @@ jobs: go tool cover -html=coverage.out -o coverage.html go tool cover -func=coverage.out - run_analysis: name: run_analysis timeout-minutes: 5 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3183e33..d3cd530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ Most recent version is listed first. +# v0.0.20 +- Support older Go versions: https://github.com/komuw/kama/pull/71 # v0.0.19 - Update docs: https://github.com/komuw/kama/commit/3dfdef76fbdd55a8ebed2d01dfb1cbb7c1cf2fc2 diff --git a/dump.go b/dump.go index a2f72ae..c756e34 100644 --- a/dump.go +++ b/dump.go @@ -2,9 +2,9 @@ package kama import ( "fmt" + "golang.org/x/exp/slices" "math" "reflect" - "slices" "sort" "strings" "unicode" diff --git a/go.mod b/go.mod index 00b9a21..2768c71 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,11 @@ module github.com/komuw/kama -go 1.22 +go 1.20 -require golang.org/x/tools v0.18.0 +require ( + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 + golang.org/x/tools v0.18.0 +) require ( github.com/google/go-cmp v0.6.0 // indirect diff --git a/go.sum b/go.sum index 2eb779c..dacbf6d 100644 --- a/go.sum +++ b/go.sum @@ -1,22 +1,19 @@ 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/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= go.akshayshah.org/attest v1.0.2 h1:qOv9PXCG2mwnph3g0I3yZj0rLAwLyUITs8nhxP+wS44= go.akshayshah.org/attest v1.0.2/go.mod h1:PnWzcW5j9dkyGwTlBmUsYpPnHG0AUPrs1RQ+HrldWO0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/packages.go b/packages.go index 95b8f12..ec1964b 100644 --- a/packages.go +++ b/packages.go @@ -3,7 +3,7 @@ package kama import ( "fmt" "go/types" - "slices" + "golang.org/x/exp/slices" "strings" "golang.org/x/tools/go/packages"