MCPcopy Create free account
hub / github.com/daodst/chat / goid

Function goid

internal/sqlutil/trace.go:100–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100func goid() int {
101 var buf [64]byte
102 n := runtime.Stack(buf[:], false)
103 idField := strings.Fields(strings.TrimPrefix(string(buf[:n]), "goroutine "))[0]
104 id, err := strconv.Atoi(idField)
105 if err != nil {
106 panic(fmt.Sprintf("cannot get goroutine id: %v", err))
107 }
108 return id
109}

Callers 2

runMethod · 0.85
trackGoIDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected