MCPcopy
hub / github.com/pterm/pterm / WithBoolean

Function WithBoolean

internal/with_boolean.go:4–9  ·  view source on GitHub ↗

WithBoolean helps an option setter (WithXXX(b ...bool) to return true, if no boolean is set, but false if it's explicitly set to false.

(b []bool)

Source from the content-addressed store, hash-verified

2
3// WithBoolean helps an option setter (WithXXX(b ...bool) to return true, if no boolean is set, but false if it's explicitly set to false.
4func WithBoolean(b []bool) bool {
5 if len(b) == 0 {
6 b = append(b, true)
7 }
8 return b[0]
9}

Callers 15

WithFatalMethod · 0.92
WithShowLineNumberMethod · 0.92
WithDebuggerMethod · 0.92
WithRemoveWhenDoneMethod · 0.92
WithShowTimerMethod · 0.92
WithFullWidthMethod · 0.92
WithRemoveWhenDoneMethod · 0.92
WithFullscreenMethod · 0.92
WithCenterMethod · 0.92
WithTitleTopLeftMethod · 0.92
WithTitleTopRightMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…