MCPcopy Index your code
hub / github.com/coder/coder / Boolean

Method Boolean

coderd/httpapi/queryparams.go:165–174  ·  view source on GitHub ↗
(vals url.Values, def bool, queryParam string)

Source from the content-addressed store, hash-verified

163}
164
165func (p *QueryParamParser) Boolean(vals url.Values, def bool, queryParam string) bool {
166 v, err := parseQueryParam(p, vals, strconv.ParseBool, def, queryParam)
167 if err != nil {
168 p.Errors = append(p.Errors, codersdk.ValidationError{
169 Field: queryParam,
170 Detail: fmt.Sprintf("Query param %q must be a valid boolean: %s", queryParam, err.Error()),
171 })
172 }
173 return v
174}
175
176func (p *QueryParamParser) RequiredNotEmpty(queryParam ...string) *QueryParamParser {
177 for _, q := range queryParam {

Callers 4

MembersFunction · 0.95
WorkspacesFunction · 0.95
TemplatesFunction · 0.95

Calls 2

parseQueryParamFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected