Skip to content

Commit 8381c5a

Browse files
committed
File formatting now does not add an additional newline at EOF
1 parent ee66b10 commit 8381c5a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gen/file_info.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ type FileInfo struct {
66

77
func (i *FileInfo) String() string {
88
s := ""
9-
for _, function := range i.Functions {
9+
10+
if len(i.Functions) == 0 {
11+
return s
12+
}
13+
14+
for _, function := range i.Functions[:len(i.Functions)-1] {
1015
s += function.String() + "\n"
1116
}
17+
18+
s += i.Functions[len(i.Functions)-1].String()
19+
1220
return s
1321
}
1422

0 commit comments

Comments
 (0)