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

+3 -1
View File
@@ -9,6 +9,8 @@ import (
"path/filepath"
"testing"
"gitea.dev/modules/consts"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -182,7 +184,7 @@ func TestCleanPath(t *testing.T) {
}
// for POSIX only, but the result is similar on Windows, because the first element must be an absolute path
if isOSWindows {
if consts.IsWindows {
cases = []struct {
elems []string
expected string