Files
maxwarden/tools/jet-2.12.0/generator/template/format.go
2025-03-06 23:54:11 -05:00

14 lines
367 B
Go

package template
import "regexp"
// Returns the provided string as golang comment without ascii control characters
func formatGolangComment(comment string) string {
if len(comment) == 0 {
return ""
}
// Format as colang comment and remove ascii control characters from string
return "// " + regexp.MustCompile(`[[:cntrl:]]+`).ReplaceAllString(comment, "")
}