Minor cleanup and fixes

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2026-06-05 06:53:48 +08:00
parent c4f1686abb
commit acd9be627e
48 changed files with 4279 additions and 4245 deletions
+16
View File
@@ -0,0 +1,16 @@
package utils
import (
"encoding/json"
"honoka-chan/pkg/utils"
"path/filepath"
)
const serverDataPath = "assets/serverdata"
func LoadServerData[T any](fileName string) (T, error) {
var data T
filePath := filepath.Join(serverDataPath, fileName)
err := json.Unmarshal([]byte(utils.ReadAllText(filePath)), &data)
return data, err
}