From f484ad6a29cfb5ce0812b50872bc141b3c3095c4 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Thu, 7 Dec 2023 01:22:18 +0800 Subject: [PATCH] Use `filepath` instead of `path` to create SQLite3 database file (#28374) (#28378) Co-authored-by: wxiaoguang Fix #28300 (cherry picked from commit 5eaf91e91983d860e2b21b11c82a4d8f2db1e39f) --- modules/setting/database.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/setting/database.go b/modules/setting/database.go index fc7a982ff9..063c854c7e 100644 --- a/modules/setting/database.go +++ b/modules/setting/database.go @@ -9,7 +9,6 @@ import ( "net" "net/url" "os" - "path" "path/filepath" "strings" "time" @@ -119,7 +118,7 @@ func DBConnStr() (string, error) { if !EnableSQLite3 { return "", errors.New("this Gitea binary was not built with SQLite3 support") } - if err := os.MkdirAll(path.Dir(Database.Path), os.ModePerm); err != nil { + if err := os.MkdirAll(filepath.Dir(Database.Path), os.ModePerm); err != nil { return "", fmt.Errorf("Failed to create directories: %w", err) } journalMode := ""