From 40f25899c7add175cfce22f704c801adac34ad4c Mon Sep 17 00:00:00 2001 From: ovechkin-dm Date: Fri, 16 Feb 2024 09:52:12 +0100 Subject: [PATCH] 45 add support for go 122 (#46) --- .github/workflows/build.yml | 28 +++++----------------------- .gitignore | 1 + threadlocal/threadlocal.go | 2 +- 3 files changed, 7 insertions(+), 24 deletions(-) create mode 100644 .gitignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cdca2f..52c0d74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,16 +52,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ darwin, linux, windows ] + os: [linux] arch: [ amd64, arm64 ] - go: [ '1.20', '1.21' ] + go: [ '1.20', '1.21', '1.22' ] include: - - os: darwin - runs-on: macos-latest - os: linux runs-on: ubuntu-22.04 - - os: windows - runs-on: windows-latest steps: - name: Checkout scm uses: actions/checkout@v3 @@ -71,19 +67,12 @@ jobs: with: go-version: ${{ matrix.go }} - - name: 'Test on darwin' - if: ${{ matrix.os == 'darwin' && contains(fromJson('["amd64"]'), matrix.arch) && matrix.go == '1.21' }} - env: - GOOS: ${{ matrix.os }} - GOARCH: ${{ matrix.arch }} - run: go test -v -race -coverprofile="coverage.txt" -covermode=atomic -coverpkg=./mock/... ./... - - name: 'Test on linux [amd64]' if: ${{ matrix.os == 'linux' && contains(fromJson('["amd64"]'), matrix.arch) }} env: GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} - run: go test -v -race -coverprofile="coverage.txt" -covermode=atomic -coverpkg=./mock/... ./... + run: go test -v -coverprofile="coverage.txt" -coverpkg=./... ./... - name: 'Setup qemu-user-static on [linux] arch [arm64]' if: ${{ matrix.os == 'linux' && contains(fromJson('["arm64"]'), matrix.arch) }} @@ -91,19 +80,12 @@ jobs: sudo apt-get update sudo apt-get -y install qemu-user-static - - name: 'Test on [linux] arch [arm64] TODO' + - name: 'Test on [linux] arch [arm64]' if: ${{ matrix.os == 'linux' && contains(fromJson('["arm64"]'), matrix.arch) }} env: GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} - run: go test -coverpkg=./mock/... ./... - - - name: 'Test on windows' - if: ${{ matrix.os == 'windows' && contains(fromJson('["amd64"]'), matrix.arch) && matrix.go == '1.21' }} - env: - GOOS: ${{ matrix.os }} - GOARCH: ${{ matrix.arch }} - run: go test -v -race -coverprofile="coverage.txt" -covermode=atomic -coverpkg=./mock/... ./... + run: go test -coverpkg=./... ./... - name: Codecov uses: codecov/codecov-action@v3 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36946b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +coverage.txt \ No newline at end of file diff --git a/threadlocal/threadlocal.go b/threadlocal/threadlocal.go index 3c63e4e..df36316 100644 --- a/threadlocal/threadlocal.go +++ b/threadlocal/threadlocal.go @@ -46,4 +46,4 @@ func NewThreadLocal[T any](initFunc func() T) ThreadLocal[T] { func GoId() int64 { return goid.Get() -} \ No newline at end of file +}