context.go 227 B

12345678910111213141516171819
  1. package presets
  2. import (
  3. "context"
  4. )
  5. type presetsCtx int
  6. const (
  7. ctxInDialog presetsCtx = iota
  8. )
  9. func IsInDialog(ctx context.Context) bool {
  10. v, ok := ctx.Value(ctxInDialog).(bool)
  11. if !ok {
  12. return false
  13. }
  14. return v
  15. }