support type def without struct token (#210)
* add comment support * add comment support * 1. group support multi level folder 2. remove force flag * bug fix * refactor parser and remove deprecated code * refactor parser and remove deprecated code * refactor parser and remove deprecated code * refactor parser and remove deprecated code * refactor parser and remove deprecated code * refactor parser and remove deprecated code * refactor parser and remove deprecated code * support type def without struct token * support type def without struct token * support type def without struct token * support type def without struct token * support type def without struct token * support type def without struct token * support type def without struct token * optimized * optimized * optimized Co-authored-by: kim <xutao@xiaoheiban.cn>
This commit is contained in:
@@ -81,3 +81,11 @@ func WriteIndent(writer io.Writer, indent int) {
|
||||
fmt.Fprint(writer, "\t")
|
||||
}
|
||||
}
|
||||
|
||||
func RemoveComment(line string) string {
|
||||
var commentIdx = strings.Index(line, "//")
|
||||
if commentIdx >= 0 {
|
||||
return strings.TrimSpace(line[:commentIdx])
|
||||
}
|
||||
return strings.TrimSpace(line)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user