txn2 / txeh

Go library and CLI utility for /etc/hosts management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple blank lines at the end of the file

areYouLazy opened this issue · comments

I noticed that if I made 2+ consecutive Save() calls, the file ends up with a bunch of blank lines at the end.
I think this can be a point to look at

txeh/txeh.go

Line 278 in 09e2953

hf = hf + fmt.Sprintln(lineFormatter(hfl))

The use of Sprintln adds a "\n" at the end of every line, which can be ok except for the last line.