Fixed Lint errors

This commit is contained in:
Andrew Walsh 2023-12-10 14:34:54 -08:00
parent 297ef0180d
commit de2c363a4f
2 changed files with 14 additions and 5 deletions

View file

@ -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)
}

View file

@ -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...)
}