MCPcopy Create free account
hub / github.com/UiPath/uipathcli / ToString

Method ToString

utils/converter/string_converter.go:19–35  ·  view source on GitHub ↗
(value interface{})

Source from the content-addressed store, hash-verified

17type StringConverter struct{}
18
19func (c StringConverter) ToString(value interface{}) string {
20 switch value := value.(type) {
21 case []int, []float64, []bool, []string:
22 array := c.ToStringArray(value)
23 return strings.Join(array, ",")
24 case int:
25 return strconv.Itoa(value)
26 case float64:
27 return strconv.FormatFloat(value, 'f', -1, 64)
28 case bool:
29 return strconv.FormatBool(value)
30 case string:
31 return value
32 default:
33 return fmt.Sprint(value)
34 }
35}
36
37func (c StringConverter) ToStringArray(value interface{}) []string {
38 switch value := value.(type) {

Callers 2

addHeadersMethod · 0.95
formatPathValueMethod · 0.80

Calls 1

ToStringArrayMethod · 0.95

Tested by

no test coverage detected