mirror of
https://github.com/sajari/docconv.git
synced 2026-10-18 22:51:09 +08:00
16 lines
222 B
Go
16 lines
222 B
Go
package debug
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type debugEnabledKey struct{}
|
|
|
|
func debugEnabledInContext(ctx context.Context) bool {
|
|
enabled, ok := ctx.Value(debugEnabledKey{}).(bool)
|
|
if !ok {
|
|
return false
|
|
}
|
|
return enabled
|
|
}
|