golangci-lint run

This commit is contained in:
孟帅
2023-07-24 09:35:30 +08:00
parent 071b6224c9
commit 996ed818ee
61 changed files with 527 additions and 271 deletions

View File

@@ -117,8 +117,9 @@ func (r *reader) close() {
// sync index and offset
func (r *reader) sync() {
name := path.Join(r.config.Path, indexFile)
data, _ := json.Marshal(&r.checkpoint)
_ = os.WriteFile(name, data, filePerm)
if data, err := json.Marshal(&r.checkpoint); err == nil {
_ = os.WriteFile(name, data, filePerm)
}
}
// restore index and offset