init - add project files
This commit is contained in:
13
tools/jet-2.12.0/generator/template/format.go
Normal file
13
tools/jet-2.12.0/generator/template/format.go
Normal file
@@ -0,0 +1,13 @@
|
||||
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, "")
|
||||
}
|
||||
Reference in New Issue
Block a user