diff --git a/runtime_go1.23.go b/runtime_go1.23.go new file mode 100644 index 0000000..146d817 --- /dev/null +++ b/runtime_go1.23.go @@ -0,0 +1,38 @@ +//go:build gc && go1.23 +// +build gc,go1.23 + +package goid + +type stack struct { + lo uintptr + hi uintptr +} + +type gobuf struct { + sp uintptr + pc uintptr + g uintptr + ctxt uintptr + ret uintptr + lr uintptr + bp uintptr +} + +type g struct { + stack stack + stackguard0 uintptr + stackguard1 uintptr + + _panic uintptr + _defer uintptr + m uintptr + sched gobuf + syscallsp uintptr + syscallpc uintptr + syscallbp uintptr + stktopsp uintptr + param uintptr + atomicstatus uint32 + stackLock uint32 + goid int64 // Here it is! +} diff --git a/runtime_go1.9.go b/runtime_go1.9.go index 5283ae0..f9ef8f5 100644 --- a/runtime_go1.9.go +++ b/runtime_go1.9.go @@ -1,5 +1,5 @@ -//go:build gc && go1.9 -// +build gc,go1.9 +//go:build gc && go1.9 && !go1.23 +// +build gc,go1.9,!go1.23 package goid