Files
site/utils/admin_hash.go
2022-03-02 07:42:14 -06:00

21 lines
358 B
Go

package utils
import (
"bufio"
"os"
)
func LoadAdminHash(path string) string {
file, err := os.Open(path)
if err != nil {
panic("Could not find DSN for database...")
}
defer file.Close()
reader := bufio.NewScanner(file)
// The dsn should be the first line of the file
if reader.Scan() {
return reader.Text()
}
panic(path + " is empty...")
}