精简后的项目:仅保留 api/ui 源码、文档、构建依赖

This commit is contained in:
gallery
2026-09-11 16:11:09 +08:00
commit 490e85634e
457 changed files with 86862 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package test_utils
import (
"path/filepath"
"runtime"
)
// PathFromAPIRoot returns the real path in the API project root.
func PathFromAPIRoot(rootRelatedPaths ...string) string {
_, file, _, ok := runtime.Caller(0)
if !ok {
panic("Can't get the path of current function. It should not happen.")
}
base := filepath.Dir(file)
args := make([]string, 0, len(rootRelatedPaths)+2)
args = append(args, []string{base, ".."}...)
args = append(args, rootRelatedPaths...)
return filepath.Join(args...)
}