impl ledger.Files.TempGet/SetLastNLines
This commit is contained in:
@@ -3,7 +3,6 @@ package ledger
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
@@ -56,7 +55,7 @@ func (files Files) TempSetLastNLines(n int, lines []string) error {
|
||||
fmt.Fprintln(w, lines[i])
|
||||
}
|
||||
|
||||
return errors.New(w.Name())
|
||||
return os.Rename(w.Name(), p)
|
||||
}
|
||||
|
||||
func peekLastNLines(w io.Writer, r *bufio.Reader, n int) ([]string, error) {
|
||||
|
||||
Reference in New Issue
Block a user