github.com/smallnest/gid@v1.2.0/README.md (about)

     1  # gid
     2  
     3  Package gid provides functions that will return the runtime's
     4  ID number for the calling goroutine or its creator.
     5  
     6  The implementation is derived from Laevus Dexter's comment in Gophers' Slack
     7  #darkarts, https://gophers.slack.com/archives/C1C1YSQBT/p1593885226448300
     8  post which linked to this playground snippet https://play.golang.org/p/CSOp9wyzydP.
     9  
    10  The code here is an exercise in minimalism, doing as little as possible by
    11  deferring nearly all of the logic to runtime functions co-opted via
    12  `//go:linkname` comments.