Files
docker-updater/contextutil/contextutil.go
2026-02-08 22:29:45 +01:00

17 lines
342 B
Go

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"
}