aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting/config_env.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-06-02 17:27:30 +0800
committerGitHub <noreply@github.com>2023-06-02 17:27:30 +0800
commitde4a21fcb4476772c69c36d086549e89ed4dcf6c (patch)
treea8952b92bc6382daffc34178f5d6cc32cfea2efd /modules/setting/config_env.go
parent7a5873335afb00dda5fa123fb023c88278e79deb (diff)
downloadgitea-de4a21fcb4476772c69c36d086549e89ed4dcf6c.tar.gz
gitea-de4a21fcb4476772c69c36d086549e89ed4dcf6c.zip
Refactor INI package (first step) (#25024)
The INI package has many bugs and quirks, and in fact it is unmaintained. This PR is the first step for the INI package refactoring: * Use Gitea's "config_provider" to provide INI access * Deprecate the INI package by golangci.yml rule
Diffstat (limited to 'modules/setting/config_env.go')
-rw-r--r--modules/setting/config_env.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/setting/config_env.go b/modules/setting/config_env.go
index dca9f2bb47..6348803705 100644
--- a/modules/setting/config_env.go
+++ b/modules/setting/config_env.go
@@ -10,8 +10,6 @@ import (
"strings"
"code.gitea.io/gitea/modules/log"
-
- "gopkg.in/ini.v1"
)
const escapeRegexpString = "_0[xX](([0-9a-fA-F][0-9a-fA-F])+)_"
@@ -89,7 +87,7 @@ func decodeEnvironmentKey(prefixGitea, suffixFile, envKey string) (ok bool, sect
return ok, section, key, useFileValue
}
-func EnvironmentToConfig(cfg *ini.File, prefixGitea, suffixFile string, envs []string) (changed bool) {
+func EnvironmentToConfig(cfg ConfigProvider, prefixGitea, suffixFile string, envs []string) (changed bool) {
for _, kv := range envs {
idx := strings.IndexByte(kv, '=')
if idx < 0 {