add templates media_links.html and media_detail.html for kontor-gin
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
Gitea Actions Demo / build-and-test (push) Failing after 12m17s

This commit is contained in:
Thomas Peetz
2026-10-28 18:39:34 +01:00
parent 4c681c33dc
commit ab166fc075
15 changed files with 369 additions and 86 deletions
+15 -1
View File
@@ -15,7 +15,21 @@ func WriteJson(data *ExportData, fileName string) error {
// Write bytes to file
err = os.WriteFile(fileName, jsonData, 0644)
if err != nil {
slog.Info("Error writing file:", "Error", err)
slog.Info("Error writing file:", "Error", err.Error())
return err
}
return nil
}
func ReadJson(data *ExportData, fileName string) error {
content, err := os.ReadFile(fileName)
if err != nil {
slog.Info("Error reading file", "Error", err.Error())
return err
}
if err := json.Unmarshal(content, data); err != nil {
slog.Info("Error unmarshal json", "Error", err.Error())
return err
}
return nil