MCPcopy Create free account
hub / github.com/github/gh-aw / formatMultiLineComment

Function formatMultiLineComment

pkg/workflow/mcp_scripts_generator.go:180–182  ·  view source on GitHub ↗

formatMultiLineComment formats a description as comment lines using the given prefix (e.g., "# " or "// "). Trailing newlines from YAML block scalars are trimmed so no empty comment line is emitted.

(description, prefix string)

Source from the content-addressed store, hash-verified

178// formatMultiLineComment formats a description as comment lines using the given prefix (e.g., "# " or "// ").
179// Trailing newlines from YAML block scalars are trimmed so no empty comment line is emitted.
180func formatMultiLineComment(description, prefix string) string {
181 return prefix + strings.ReplaceAll(strings.TrimRight(description, "\n"), "\n", "\n"+prefix) + "\n"
182}
183
184// GenerateMCPScriptJavaScriptToolScript generates the JavaScript tool file for a mcp-script tool
185// The user's script code is automatically wrapped in a function with module.exports,

Calls

no outgoing calls

Tested by

no test coverage detected