update go mod, remove tls insecure skip verifies

This commit is contained in:
2026-05-28 20:02:54 +00:00
parent c177f7d45b
commit b0bcaf61a2
6 changed files with 33 additions and 24 deletions
+10 -4
View File
@@ -14,14 +14,20 @@ type DB struct {
func LoadDB(localDBPath string) (DB, error) {
db := DB{}
content, err := os.ReadFile(localDBPath)
root, err := os.OpenRoot(".")
if err != nil {
//log.Fatal("Error when opening file: ", err)
return db, err
}
defer root.Close()
content, err := root.ReadFile(localDBPath)
if err != nil {
return db, err
}
err = json.Unmarshal(content, &db.data)
if err != nil {
//log.Fatal("Error during Unmarshal(): ", err)
return db, err
}
return db, nil
@@ -32,7 +38,7 @@ func SaveDB(localDBPath string, db DB) error {
if err != nil {
return err
}
err = os.WriteFile(localDBPath, []byte(json), 0644)
err = os.WriteFile(localDBPath, []byte(json), 0600)
return err
}