Compare commits
1 Commits
d38e5c9f3c
...
4b71fa248a
Author | SHA1 | Date | |
---|---|---|---|
4b71fa248a |
5
main.go
5
main.go
@ -542,7 +542,10 @@ type emptyEveryWrite struct {
|
||||
func (w emptyEveryWrite) Write(p []byte) (n int, err error) {
|
||||
n = len(p)
|
||||
// Set new size in case previous data was longer and would leave garbage at the end of the file.
|
||||
w.file.Truncate(int64(n))
|
||||
err = w.file.Truncate(int64(n))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
offset, err := w.file.Seek(0, 0)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
Loading…
Reference in New Issue
Block a user