OptionalBoolParamWithDefault is a helper function that can be used to fetch a requested parameter from the request similar to optionalBoolParam, but it also takes a default value.
(args map[string]any, p string, d bool)
| 227 | // OptionalBoolParamWithDefault is a helper function that can be used to fetch a requested parameter from the request |
| 228 | // similar to optionalBoolParam, but it also takes a default value. |
| 229 | func OptionalBoolParamWithDefault(args map[string]any, p string, d bool) (bool, error) { |
| 230 | _, ok := args[p] |
| 231 | v, err := OptionalParam[bool](args, p) |
| 232 | if err != nil { |
| 233 | return false, err |
| 234 | } |
| 235 | if !ok { |
| 236 | return d, nil |
| 237 | } |
| 238 | return v, nil |
| 239 | } |
| 240 | |
| 241 | // OptionalStringArrayParam is a helper function that can be used to fetch a requested parameter from the request. |
| 242 | // It does the following checks: |
no outgoing calls
no test coverage detected