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

Function trackGoID

internal/sqlutil/trace.go:83–94  ·  view source on GitHub ↗
(query string)

Source from the content-addressed store, hash-verified

81}
82
83func trackGoID(query string) {
84 thisGoID := goid()
85 if _, ok := goidToWriter.Load(thisGoID); ok {
86 return // we're on a writer goroutine
87 }
88
89 q := strings.TrimSpace(query)
90 if strings.HasPrefix(q, "SELECT") {
91 return // SELECTs can go on other goroutines
92 }
93 logrus.Warnf("unsafe goid %d: SQL executed not on an ExclusiveWriter: %s", thisGoID, q)
94}
95
96func init() {
97 registerDrivers()

Callers 2

StmtQueryContextMethod · 0.85
StmtExecContextMethod · 0.85

Calls 2

goidFunction · 0.85
LoadMethod · 0.80

Tested by

no test coverage detected