Пример #1
0
func checkUI(c libkb.UIConsumer, ctx *Context) error {
	for _, ui := range c.RequiredUIs() {
		if !ctx.HasUI(ui) {
			return CheckError{fmt.Sprintf("requires ui %q", ui)}
		}
	}
	return nil
}
Пример #2
0
func requiresUI(c libkb.UIConsumer, ctx *Context, kind libkb.UIKind) bool {
	for _, ui := range c.RequiredUIs() {
		if ui == kind {
			return true
		}
	}

	for _, sub := range c.SubConsumers() {
		if requiresUI(sub, ctx, kind) {
			return true
		}
	}

	return false
}