use read file helper function everywhere

This commit is contained in:
Gregory Wells
2026-03-24 17:10:56 -04:00
parent 35ec6678f8
commit 8d0cd0fd1b
2 changed files with 18 additions and 9 deletions

17
src/main/helpers.go Normal file
View File

@@ -0,0 +1,17 @@
package main
import (
"os"
"astraltech.xyz/accountmanager/src/logging"
)
func ReadFile(path string) ([]byte, error) {
logging.Event(logging.ReadFile, "static/blank_profile.jpg")
data, err := os.ReadFile(path)
if err != nil {
logging.Infof("Could not read file at %s", path)
}
logging.Infof("Successfully read file at %s", path)
return data, err
}