]> source.dussan.org Git - gitea.git/commitdiff
Use `filepath` instead of `path` to create SQLite3 database file (#28374)
authorwxiaoguang <wxiaoguang@gmail.com>
Wed, 6 Dec 2023 16:57:52 +0000 (00:57 +0800)
committerGitHub <noreply@github.com>
Wed, 6 Dec 2023 16:57:52 +0000 (16:57 +0000)
modules/setting/database.go

index 761e767e8f5f74b77b1b2b0b4141672bbcaaa7f0..b68f250f787efb4958fb5d20e91c2d03f9552607 100644 (file)
@@ -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 := ""