From 374ed5e1a4dc635c42e33e4133729d40cf3e0e35 Mon Sep 17 00:00:00 2001 From: ewy Date: Wed, 22 Apr 2026 18:29:37 +0200 Subject: work on tests also replace the annoying search return with a struct --- paths/paths.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'paths/paths.go') 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 { -- cgit v1.3.1