github.com/choleraehyq/piD@v0.0.11/runtime_go1.6.go (about) 1 // +build gc,go1.6,!go1.9 2 3 package goid 4 5 // Just enough of the structs from runtime/runtime2.go to get the offset to goid. 6 // See https://github.com/golang/go/blob/release-branch.go1.6/src/runtime/runtime2.go 7 8 type stack struct { 9 lo uintptr 10 hi uintptr 11 } 12 13 type gobuf struct { 14 sp uintptr 15 pc uintptr 16 g uintptr 17 ctxt uintptr 18 ret uintptr 19 lr uintptr 20 bp uintptr 21 } 22 23 type g struct { 24 stack stack 25 stackguard0 uintptr 26 stackguard1 uintptr 27 28 _panic uintptr 29 _defer uintptr 30 m uintptr 31 stackAlloc uintptr 32 sched gobuf 33 syscallsp uintptr 34 syscallpc uintptr 35 stkbar []uintptr 36 stkbarPos uintptr 37 stktopsp uintptr 38 param uintptr 39 atomicstatus uint32 40 stackLock uint32 41 goid int64 // Here it is! 42 }