From 01d3da47da85d68f33a1e0aa4e4efb389e0ec0fe Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 7 Dec 2023 00:57:52 +0800 Subject: [PATCH] Use `filepath` instead of `path` to create SQLite3 database file (#28374) --- 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 761e767e8f5f..b68f250f787e 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" @@ -117,7 +116,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 := ""