MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / filePathJoin

Function filePathJoin

cli/pkg/common/path.go:77–86  ·  view source on GitHub ↗

路径组合,参数 os 可以是windows

(osType OSType, paths ...string)

Source from the content-addressed store, hash-verified

75
76// 路径组合,参数 os 可以是windows
77func filePathJoin(osType OSType, paths ...string) string {
78 result := filepath.Join(paths...)
79 switch osType {
80 case OS_Windows:
81 result = strings.ReplaceAll(result, "/", "\\")
82 case OS_Linux:
83 result = strings.ReplaceAll(result, "\\", "/")
84 }
85 return result
86}
87
88// 路径组合 for linux
89func FilePahtJoin4Linux(paths ...string) string {

Callers 1

FilePahtJoin4LinuxFunction · 0.85

Calls 1

JoinMethod · 0.45

Tested by

no test coverage detected