From c86dc13a6309010db17b28e077247f62f918510b Mon Sep 17 00:00:00 2001 From: xhd2015 Date: Thu, 11 Jul 2024 20:54:18 +0800 Subject: [PATCH] add test for go1.23rc1 --- .github/workflows/go-next.yml | 32 ++++++++++++++++++++++++++++++++ cmd/xgo/version.go | 4 ++-- support/goinfo/goinfo.go | 12 +++++++++++- 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/go-next.yml diff --git a/.github/workflows/go-next.yml b/.github/workflows/go-next.yml new file mode 100644 index 00000000..31742e78 --- /dev/null +++ b/.github/workflows/go-next.yml @@ -0,0 +1,32 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go Next + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + tests-with-go-next: + strategy: + matrix: + os: [ ubuntu-latest] + go: [ '1.23rc1' ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + run: | + curl -fsSL -o go.tar.gz "https://go.dev/dl/go${{matrix.go}}.linux-amd64.tar.gz" + mkdir setup + tar -C setup -xzf go.tar.gz + ls setup + GOROOT=$PWD/setup/go PATH=$PWD/setup/go/bin:$PATH go version + + - name: Test + run: GOROOT=$PWD/setup/go PATH=$PWD/setup/go/bin:$PATH go run ./script/run-test --reset-instrument --debug -v \ No newline at end of file diff --git a/cmd/xgo/version.go b/cmd/xgo/version.go index fa541ce8..2eaae839 100644 --- a/cmd/xgo/version.go +++ b/cmd/xgo/version.go @@ -4,8 +4,8 @@ import "fmt" // auto updated const VERSION = "1.0.46" -const REVISION = "ab32ad121c57c321089d61906f2dd36898b7bcd1+1" -const NUMBER = 294 +const REVISION = "b2c1918871f0a8bc3ea4bb9cf46e297d21c5f433+1" +const NUMBER = 295 // manually updated const CORE_VERSION = "1.0.43" diff --git a/support/goinfo/goinfo.go b/support/goinfo/goinfo.go index ad068bdb..8e89463c 100644 --- a/support/goinfo/goinfo.go +++ b/support/goinfo/goinfo.go @@ -66,7 +66,17 @@ func ParseGoVersionNumber(version string) (*GoVersion, error) { verList := strings.Split(version, ".") for i := 0; i < 3; i++ { if i < len(verList) { - verInt, err := strconv.ParseInt(verList[i], 10, 64) + num := verList[i] + if i == 1 { + // 1.23rc1 + idx := strings.IndexFunc(num, func(r rune) bool { + return r < '0' || r > '9' + }) + if idx > 0 { + num = num[:idx] + } + } + verInt, err := strconv.ParseInt(num, 10, 64) if err != nil { return nil, fmt.Errorf("unrecognized version, expect number, found: %s", version) }