aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-12-07 00:57:52 +0800
committerGitHub <noreply@github.com>2023-12-06 16:57:52 +0000
commit1e512b800c0d6ed3fb4ae7ecc8f5ef45d11d7aad (patch)
tree057d84c69a297f66e2ee66aa541d7d297999fd9a /modules
parentc1b86ecdab20d741e3d494680196ddd4c8402f76 (diff)
downloadgitea-1e512b800c0d6ed3fb4ae7ecc8f5ef45d11d7aad.tar.gz
gitea-1e512b800c0d6ed3fb4ae7ecc8f5ef45d11d7aad.zip
Use `filepath` instead of `path` to create SQLite3 database file (#28374)
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/database.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/setting/database.go b/modules/setting/database.go
index 761e767e8f..b68f250f78 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 := ""