Sync/CorrectPath.go

13 lines
261 B
Go
Raw Permalink Normal View History

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