Skip to content

Commit

Permalink
add test for go1.23rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
xhd2015 committed Jul 11, 2024
1 parent b2c1918 commit c86dc13
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/go-next.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions cmd/xgo/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 11 additions & 1 deletion support/goinfo/goinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit c86dc13

Please sign in to comment.