first version

This commit is contained in:
2026-02-08 22:29:45 +01:00
commit d1e54774a7
15 changed files with 1355 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package contextutil
import "context"
func WithThreadName(ctx context.Context, threadName string) context.Context {
return context.WithValue(ctx, "context_thread", threadName)
}
func ThreadName(ctx context.Context) string {
value := ctx.Value("context_thread")
if value, ok := value.(string); ok {
return value
}
return "unknown"
}