路径组合,参数 os 可以是windows
(osType OSType, paths ...string)
| 75 | |
| 76 | // 路径组合,参数 os 可以是windows |
| 77 | func 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 |
| 89 | func FilePahtJoin4Linux(paths ...string) string { |
no test coverage detected