MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / GetBool

Method GetBool

pkg/event/param.go:351–361  ·  view source on GitHub ↗

GetBool returns the underlying boolean value from the parameter.

(name string)

Source from the content-addressed store, hash-verified

349
350// GetBool returns the underlying boolean value from the parameter.
351func (pars Params) GetBool(name string) (bool, error) {
352 par, err := pars.findParam(name)
353 if err != nil {
354 return false, err
355 }
356 v, ok := par.Value.(bool)
357 if !ok {
358 return false, fmt.Errorf("unable to type cast %q parameter to bool value", name)
359 }
360 return v, nil
361}
362
363// MustGetBool returns the underlying boolean value from the parameter or
364// panics if the parameter can't be retrieved.

Callers 12

MustGetBoolMethod · 0.95
TryGetBoolMethod · 0.95
getFileInfoFunction · 0.80
GetMethod · 0.80
GetMethod · 0.80
InitFromViperMethod · 0.80
InitFromViperMethod · 0.80
InitMethod · 0.80
initFromViperMethod · 0.80
initFromViperMethod · 0.80
InitFromViperMethod · 0.80
InitFromViperMethod · 0.80

Calls 1

findParamMethod · 0.95

Tested by

no test coverage detected