13 lines
261 B
Go
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
|
|
}
|
|
}
|