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