Fix errcheck in clean
@@ -92,15 +92,18 @@ func CleanConfig() {
for _, f := range files {
fname := filepath.Join(config.ConfigDir, "buffers", f.Name())
file, e := os.Open(fname)
+
+ if e == nil {
defer file.Close()
decoder := gob.NewDecoder(file)
err = decoder.Decode(&buffer)
- if e != nil && f.Name() != "history" {
+ if err != nil && f.Name() != "history" {
badFiles = append(badFiles, fname)
}
}
+ }
if len(badFiles) > 0 {
fmt.Printf("Detected %d files with an invalid format in %s\n", len(badFiles), filepath.Join(config.ConfigDir, "buffers"))
