diff --git a/src/internal/common/common.go b/src/internal/common/common.go index 648c197..1191888 100644 --- a/src/internal/common/common.go +++ b/src/internal/common/common.go @@ -7,7 +7,10 @@ import ( ) func AppendFile(source string, destination string) error { - createDirectoryIfNotPresent(filepath.Dir(destination)) + err := createDirectoryIfNotPresent(filepath.Dir(destination)) + if err != nil { + return err + } in, err := os.Open(source) if err != nil { return err @@ -34,7 +37,10 @@ func AppendFile(source string, destination string) error { } func CopyFile(source string, destination string) error { - createDirectoryIfNotPresent(filepath.Dir(destination)) + err := createDirectoryIfNotPresent(filepath.Dir(destination)) + if err != nil { + return err + } in, err := os.Open(source) if err != nil { return err @@ -61,7 +67,10 @@ func CopyFile(source string, destination string) error { } func MoveFile(source string, destination string) error { - createDirectoryIfNotPresent(filepath.Dir(destination)) + err := createDirectoryIfNotPresent(filepath.Dir(destination)) + if err != nil { + return err + } return os.Rename(source, destination) } diff --git a/src/internal/logging/logger.go b/src/internal/logging/logger.go index 6459764..5b0bcdd 100644 --- a/src/internal/logging/logger.go +++ b/src/internal/logging/logger.go @@ -42,7 +42,7 @@ func DebugLazy(getLine func() string) { func Debug(format string, a ...any) { if logger.Debug { - logger.wrapped.Println(fmt.Sprintf(format, a...)) + logger.wrapped.Printf(format, a...) } } @@ -53,5 +53,5 @@ func Fatal(err error) { func Fatalf(format string, a ...any) { fmt.Fprintf(os.Stderr, format+"\n", a...) - logger.wrapped.Fatal(fmt.Sprintf(format, a...)) + logger.wrapped.Fatalf(format, a...) }