From d80c2189457f64bbd495ab03bc400935a43f984d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Erbsh=C3=A4u=C3=9Fer?= Date: Sun, 24 May 2026 09:22:27 +0200 Subject: [PATCH] fix article file id to be 64 bit wide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tobias Erbshäußer --- backend/blog.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/blog.go b/backend/blog.go index e70ee74..6c86dd7 100644 --- a/backend/blog.go +++ b/backend/blog.go @@ -37,7 +37,7 @@ type Article struct { } type ArticleFile struct { - Id int + Id int64 Data []byte } @@ -66,7 +66,7 @@ func ParseArticle(reader io.Reader, filePrefix string) (*Article, error) { } usedFiles := make(map[string]ArticleFile) - nextFileId := 0 + nextFileId := int64(0) pc, html, err := md.Parse(func(path string) (string, error) { content, ok := tarFiles[strings.TrimPrefix(path, "./")] @@ -77,7 +77,7 @@ func ParseArticle(reader io.Reader, filePrefix string) (*Article, error) { usedFiles[path] = ArticleFile{nextFileId, content} nextFileId++ - return filePrefix + strconv.Itoa(nextFileId), nil + return filePrefix + strconv.FormatInt(nextFileId, 10), nil }, readmeBytes) if err != nil { return nil, err