strips trailing slash (if any) both unix and windows style
(file string)
| 124 | |
| 125 | // strips trailing slash (if any) both unix and windows style |
| 126 | func stripTrailingSlash(file string) string { |
| 127 | if len(file) == 0 { |
| 128 | return file |
| 129 | } |
| 130 | if file != "/" && strings.HasSuffix(string(file[len(file)-1]), "/") { |
| 131 | return file[:len(file)-1] |
| 132 | } |
| 133 | return file |
| 134 | } |
| 135 | |
| 136 | func stripLeadingSlash(file string) string { |
| 137 | // tar strips the leading '/' and '\' if it's there, so we will too |
no outgoing calls
no test coverage detected