Skip to content

Commit 2c2905d

Browse files
authored
Fix comment counts (#48)
1 parent 5513af0 commit 2c2905d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cmd/pkg/template/template.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ var (
2626
special = regexp.MustCompile("[^a-zA-Z0-9]+")
2727
)
2828

29+
func resetCounters() {
30+
newStart = 1
31+
newEnd = 1
32+
savedStart = 1
33+
savedEnd = 1
34+
cursor = 1
35+
}
36+
2937
func getTemplateFuncs() template.FuncMap {
3038
return template.FuncMap{
3139
"goType": goType,
@@ -70,8 +78,7 @@ type {{ .Root.Name }} struct {
7078
}
7179

7280
func Copybook() *template.Template {
73-
newStart = 1
74-
newEnd = 1
81+
resetCounters()
7582
structs = make([]string, 0)
7683

7784
return getTemplate()

0 commit comments

Comments
 (0)