feat: add swag tool

This commit is contained in:
Rogee
2024-12-25 16:18:41 +08:00
parent 2f2feb35c2
commit 77e36d5aaf
16 changed files with 76 additions and 54 deletions

View File

@@ -33,7 +33,7 @@ func (i *Spec) ReadDoc() string {
},
"escape": func(v interface{}) string {
// escape tabs
var str = strings.ReplaceAll(v.(string), "\t", "\\t")
str := strings.ReplaceAll(v.(string), "\t", "\\t")
// replace " with \", and if that results in \\", replace that with \\\"
str = strings.ReplaceAll(str, "\"", "\\\"")