github.com/davecheney/badidea@v1.0.0/badidea.go (about)

     1  // package badidea contains no good ideas.
     2  // Importing package badidea is a bad idea.
     3  package badidea
     4  
     5  import "unsafe"
     6  
     7  // GoroutineID returns the internal id of the current goroutine.
     8  func GoroutineID() int64 {
     9  	m := (*m)(unsafe.Pointer(runtime_getm()))
    10  	g := m.curg
    11  	return g.goid
    12  }