diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-22 18:29:37 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-22 18:29:37 +0200 |
| commit | 374ed5e1a4dc635c42e33e4133729d40cf3e0e35 (patch) | |
| tree | 01f12ca3eea0154b61afde3d1ee27df2094644e1 /paths | |
| parent | ee481fa406bb685a16d8b568fca0c9f592c06180 (diff) | |
work on tests
also replace the annoying search return with a struct
Diffstat (limited to 'paths')
| -rw-r--r-- | paths/paths.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/paths/paths.go b/paths/paths.go index 9721fa1..80928df 100644 --- a/paths/paths.go +++ b/paths/paths.go @@ -4,7 +4,6 @@ import ( "github.com/adrg/xdg" "os" "path/filepath" - "pik/spool" "strings" ) @@ -16,18 +15,24 @@ var ( Ifs = os.Getenv("IFS") ) -func init() { +type paths struct { +} + +var Paths = &paths{} + +func (p paths) Init() error { err := os.MkdirAll(Cache, 0700) if err != nil { - spool.Warn("%v\n", err) + return err } err = os.MkdirAll(Config, 0700) if err != nil { - spool.Warn("%v\n", err) + return err } if Ifs == "" { Ifs = "\n" } + return nil } func ReplaceHome(input string) string { |
