MCPcopy Index your code
hub / github.com/github/github-mcp-server / OptionalBoolParamWithDefault

Function OptionalBoolParamWithDefault

pkg/github/params.go:229–239  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
229func 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:

Callers 3

CreateRepositoryFunction · 0.85
GetRepositoryTreeFunction · 0.85
SearchRepositoriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected