X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/f5c601f1801aaa276f8c335fcb51c373edc0b50c..9346d20fe4297dce1aa16171749a7ef3e41ce7bd:/records.go?ds=inline diff --git a/records.go b/records.go index 52824cb..dbfafe2 100644 --- a/records.go +++ b/records.go @@ -65,6 +65,11 @@ func (r *Records) Read(n int) ([]byte, bool, error) { return record, true, nil } +// Append writes the record after the last one. +func (r *Records) Append(record []byte) error { + return r.Write(r.count, record) +} + // Write writes record n. func (r *Records) Write(n int, record []byte) error { _, err := r.file.WriteAt(record, int64(n*r.size)) @@ -77,11 +82,6 @@ func (r *Records) Write(n int, record []byte) error { return nil } -// Append writes the record after the last one. -func (r *Records) Append(record []byte) error { - return r.Write(r.count, record) -} - // Close closes the file. func (r *Records) Close() error { return r.file.Close()