Skip to content

Commit

Permalink
remove problematic unused func.
Browse files Browse the repository at this point in the history
  • Loading branch information
maracko committed Feb 25, 2022
1 parent 07ff01b commit af05c19
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions database/helpers/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,27 @@ package helpers
import (
"encoding/json"
"os"
"runtime"
"syscall"
)

func FileExists(f string) bool {
_, err := os.Stat(f)
return err == nil
}

func FileWriteable(f string) bool {
var err error
switch runtime.GOOS {
case "linux":
err = syscall.Access(f, syscall.O_RDWR)
case "windows":
info, _ := os.Stat(f)
m := info.Mode()
return m.IsRegular()
// func FileWriteable(f string) bool {
// var err error
// switch runtime.GOOS {
// case "linux":
// err = syscall.Access(f, syscall.O_RDWR)
// case "windows":
// info, _ := os.Stat(f)
// m := info.Mode()
// return m.IsRegular()

}
return err == nil
// }
// return err == nil

}
// }

func ReadJsonToMap(f string) (map[string]interface{}, error) {
bytes, err := os.ReadFile(f)
Expand Down

0 comments on commit af05c19

Please sign in to comment.