MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / toString

Function toString

internal/artifact/encode.go:94–103  ·  view source on GitHub ↗

toString coerces a scalar frontmatter value to string. Values originate as strings in practice; non-strings are rendered defensively.

(v any)

Source from the content-addressed store, hash-verified

92// toString coerces a scalar frontmatter value to string. Values originate as
93// strings in practice; non-strings are rendered defensively.
94func toString(v any) string {
95 switch s := v.(type) {
96 case string:
97 return s
98 case nil:
99 return ""
100 default:
101 return fmt.Sprintf("%v", v)
102 }
103}
104
105// normalizeArguments coerces the arguments value into []map[string]any so it
106// serializes as a stable YAML sequence of maps. Accepts []map[string]any or

Callers 1

EncodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected