MCPcopy Index your code
hub / github.com/yusing/godoxy / paramValueString

Function paramValueString

cmd/cli/cli.go:265–286  ·  view source on GitHub ↗
(p Param, raw any, wasSet bool)

Source from the content-addressed store, hash-verified

263}
264
265func paramValueString(p Param, raw any, wasSet bool) (string, error) {
266 if !wasSet {
267 return "", nil
268 }
269 switch v := raw.(type) {
270 case *string:
271 return *v, nil
272 case *int:
273 return strconv.Itoa(*v), nil
274 case *float64:
275 return strconv.FormatFloat(*v, 'f', -1, 64), nil
276 case *bool:
277 if *v {
278 return "true", nil
279 }
280 return "false", nil
281 case *stringSliceFlag:
282 return strings.Join(v.v, ","), nil
283 default:
284 return "", fmt.Errorf("unsupported flag value for %s", p.FlagName)
285 }
286}
287
288func paramQueryValues(p Param, raw any) ([]string, error) {
289 switch v := raw.(type) {

Callers 1

buildRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected