1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-09 18:40:28 +08:00

feat(gen): add enum support & gofmt

This commit is contained in:
源文雨
2026-03-20 00:18:50 +08:00
parent 2117a59552
commit 20cf04b2e9
5 changed files with 451 additions and 12 deletions

View File

@@ -50,14 +50,20 @@ func get1sentence(firstln string, scan *bufio.Scanner, ln int) (string, int) {
if strings.Contains(firstln, ";") {
return firstln, ln
}
bracedepth := 0
sb := strings.Builder{}
sb.WriteString(firstln)
for scan.Scan() {
sb.WriteString("\n")
t := scan.Text()
ln++
if strings.Contains(t, "{") {
bracedepth++
} else if strings.Contains(t, "}") {
bracedepth--
}
sb.WriteString(t)
if strings.Contains(t, ";") {
if strings.Contains(t, ";") && bracedepth == 0 {
return sb.String(), ln
}
}