Files

12 lines
261 B
Go
Raw Permalink Normal View History

2017-02-19 16:20:43 +01:00
package main
func correctPath(path string) string {
2017-07-02 22:05:55 +02:00
2017-02-19 16:20:43 +01:00
if path[len(path)-1:] == `/` || path[len(path)-1:] == `\` {
2017-07-02 22:05:55 +02:00
// Case: E.g. remote dir = /myfiles/
2017-02-19 16:20:43 +01:00
return path[:len(path)-1]
} else {
2017-07-02 22:05:55 +02:00
// Case: E.g. remote dir = /myfiles
2017-02-19 16:20:43 +01:00
return path
}
}