mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-07 15:40:24 +09:00
bindings: Convert os.IsNotExist() into errors.Is()
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -24,7 +25,7 @@ var Binder = map[string]func(e Event, action string){
|
||||
}
|
||||
|
||||
func createBindingsIfNotExist(fname string) {
|
||||
if _, e := os.Stat(fname); os.IsNotExist(e) {
|
||||
if _, e := os.Stat(fname); errors.Is(e, fs.ErrNotExist) {
|
||||
ioutil.WriteFile(fname, []byte("{}"), 0644)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user