We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1d5b1c commit 1ff9f8cCopy full SHA for 1ff9f8c
1 file changed
internal/lockfile/lockfile.go
@@ -210,9 +210,13 @@ func (lf *LockFile) Save() error {
210
}
211
212
213
+ // Ensure exactly one trailing newline
214
+ out := bytes.TrimRight(buf.Bytes(), "\n")
215
+ out = append(out, '\n')
216
+
217
// Atomic write: temp file → rename.
218
tmp := lf.path + ".tmp"
- if err := os.WriteFile(tmp, buf.Bytes(), 0644); err != nil {
219
+ if err := os.WriteFile(tmp, out, 0644); err != nil {
220
return fmt.Errorf("lockfile: write temp: %w", err)
221
222
if err := os.Rename(tmp, lf.path); err != nil {
0 commit comments