github.com/xg0n/routine@v0.0.0-20240119033701-c364deb94aee/api_get_routine_ids.go (about)

     1  package routine
     2  
     3  // GetRoutineIds return current and parent go routine ids in one call.
     4  func GetRoutineIds() (int64, uint64) {
     5  	runtime_g := getg()
     6  	return runtime_g.goid, runtime_g.parentGoid
     7  }