pathJoin - like path.Join() but retains trailing SlashSeparator of the last element
(elem ...string)
| 229 | |
| 230 | // pathJoin - like path.Join() but retains trailing SlashSeparator of the last element |
| 231 | func pathJoin(elem ...string) string { |
| 232 | trailingSlash := "" |
| 233 | if len(elem) > 0 { |
| 234 | if HasSuffix(elem[len(elem)-1], SlashSeparator) { |
| 235 | trailingSlash = SlashSeparator |
| 236 | } |
| 237 | } |
| 238 | return path.Join(elem...) + trailingSlash |
| 239 | } |
| 240 | |
| 241 | // mustGetUUID - get a random UUID. |
| 242 | func mustGetUUID() string { |