what is going on

This commit is contained in:
bronkuu 2026-05-27 17:11:44 +02:00
parent 7fdf2fc4c1
commit 45c9005c92
157 changed files with 5187 additions and 186 deletions

34
utils/file.go Normal file
View file

@ -0,0 +1,34 @@
package utils
import (
"io"
"log"
"os"
)
func CopyFile(src, dst string) (string, error) {
_, err := os.Stat(dst)
if err == nil {
return dst, nil
}
log.Printf("copying image: %s %s", src, dst)
srcFile, err := os.Open(src)
if err != nil {
return dst, err
}
defer srcFile.Close()
dstFile, err := os.Create(dst)
if err != nil {
return dst, err
}
defer dstFile.Close()
_, err = io.Copy(dstFile, srcFile)
if err != nil {
return dst, err
}
return dst, dstFile.Sync()
}