MCPcopy
hub / github.com/googleapis/mcp-toolbox / FormatYaml

Function FormatYaml

internal/testutils/testutils.go:38–44  ·  view source on GitHub ↗

formatYaml is a utility function for stripping out tabs in multiline strings

(in string)

Source from the content-addressed store, hash-verified

36
37// formatYaml is a utility function for stripping out tabs in multiline strings
38func FormatYaml(in string) []byte {
39 // removes any leading indentation(tabs)
40 in = strings.ReplaceAll(in, "\n\t", "\n ")
41 // converts remaining indentation
42 in = strings.ReplaceAll(in, "\t", " ")
43 return []byte(in)
44}
45
46// ContextWithNewLogger create a new context with new logger
47func ContextWithNewLogger() (context.Context, error) {

Calls

no outgoing calls