Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
CI:
strategy:
matrix:
go-version: [ "1.24.0" ]
go-version: [ "1.24.0", "1.25.0" ]
fail-fast: true
runs-on: ubuntu-latest
steps:
Expand All @@ -26,4 +26,4 @@ jobs:

- name: Upload coverage
uses: coverallsapp/github-action@v2
if: ${{ contains(matrix.go-version, '1.24.0') }}
if: ${{ contains(matrix.go-version, '1.25.0') }}
4 changes: 3 additions & 1 deletion fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"unsafe"
)

var ctxOffset int

type Fixture[V any] interface {
Value(t *testing.T) V
}
Expand All @@ -26,7 +28,7 @@ func (f *fixture[V]) Value(t *testing.T) V {
value := f.createValue(t)

// Look away
ctx := (*context.Context)(unsafe.Add(unsafe.Pointer(t), 400))
ctx := (*context.Context)(unsafe.Add(unsafe.Pointer(t), ctxOffset))
*ctx = context.WithValue(t.Context(), f, value)

return value
Expand Down
7 changes: 7 additions & 0 deletions version_1_24.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build go1.24

package fix

func init() {
ctxOffset = 400
}
7 changes: 7 additions & 0 deletions version_1_25.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//go:build go1.25

package fix

func init() {
ctxOffset = 408
}