refactor: clarify GOOS detection (#39620)

Introduce `consts.IsWindows`, now it's clearer to see how Windows build works
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-10-06 08:22:36 +00:00
1 parent 052f660ba5
commit 1065f03454
16 files changed
+44 -37

No files matched your search

+2 -1
View File
@@ -12,6 +12,7 @@ import (
"strings"
"gitea.dev/modules/auth/password/hash"
"gitea.dev/modules/consts"
"gitea.dev/modules/log"
"gitea.dev/modules/util"
@@ -66,7 +67,7 @@ func SetupGiteaTestEnv() {
StaticRootPath = giteaRoot
// during testing, the AppPath must point to the pre-built Gitea binary in the source root
// it needs to be called by git hooks
AppPath = filepath.Join(giteaRoot, "gitea") + util.Iif(IsWindows, ".exe", "")
AppPath = filepath.Join(giteaRoot, "gitea") + util.Iif(consts.IsWindows, ".exe", "")
}
initGiteaConf := func() string {