Added Flags

This commit is contained in:
Pablu23
2024-05-22 23:00:50 +02:00
parent f905d482a5
commit a2232026a0
4 changed files with 38 additions and 22 deletions

View File

@@ -7,21 +7,19 @@ import (
"path/filepath"
)
const port = 80
func getSecret() string {
func getSecret() (string, error) {
dir, err := os.UserCacheDir()
if err != nil {
panic(err)
return "", err
}
dirPath := filepath.Join(dir, "MangaGetter")
filePath := filepath.Join(dirPath, "secret.secret")
buf, err := os.ReadFile(filePath)
if err != nil {
panic(err)
return "", err
}
return string(buf)
return string(buf), nil
}
func getDbPath() string {