Skip to content

Commit

Permalink
chore: update method isMakeComment
Browse files Browse the repository at this point in the history
  • Loading branch information
Bin-Huang committed Aug 16, 2022
1 parent 0913328 commit 64e6182
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ func ParseCodeFile(filename string) ([]StructInfo, []ImportInfo, error) {
// isMakeComment ...
func isMakeComment(s string) bool {
s = strings.TrimSpace(s)
return strings.HasPrefix(s, "//go:generate") && strings.Contains(s, "newc")
if !strings.HasPrefix(s, "//go:generate") {
return false
}
s = strings.TrimLeft(s, "//go:generate")
s = strings.TrimSpace(s)
return strings.HasPrefix(s, "newc ")
}

// isInitModeEnable check if this struct enable the init mode
Expand Down

0 comments on commit 64e6182

Please sign in to comment.