MCPcopy
hub / github.com/flosch/pongo2 / Bool

Method Bool

value.go:185–193  ·  view source on GitHub ↗

Bool returns the underlying value as bool. If the value is not bool, false will always be returned. If you're looking for true/false-evaluation of the underlying value, have a look on the IsTrue()-function.

()

Source from the content-addressed store, hash-verified

183// will always be returned. If you're looking for true/false-evaluation of the
184// underlying value, have a look on the IsTrue()-function.
185func (v *Value) Bool() bool {
186 switch v.getResolvedValue().Kind() {
187 case reflect.Bool:
188 return v.getResolvedValue().Bool()
189 default:
190 logf("Value.Bool() not available for type: %s\n", v.getResolvedValue().Kind().String())
191 return false
192 }
193}
194
195// Time returns the underlying value as time.Time.
196// If the underlying value is not a time.Time, it returns the zero value of time.Time.

Callers 4

StringMethod · 0.95
IsTrueMethod · 0.80
NegateMethod · 0.80
filterUrlizeFunction · 0.80

Calls 3

getResolvedValueMethod · 0.95
logfFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected