Sync/CorrectPath.go
2017-07-02 22:05:55 +02:00

13 lines
261 B
Go

package main
func correctPath(path string) string {
if path[len(path)-1:] == `/` || path[len(path)-1:] == `\` {
// Case: E.g. remote dir = /myfiles/
return path[:len(path)-1]
} else {
// Case: E.g. remote dir = /myfiles
return path
}
}