tmpfix
alex wennerberg alex@alexwennerberg.com
Wed, 18 Nov 2020 19:03:51 -0800
1 files changed,
3 insertions(+),
2 deletions(-)
jump to
M
main.go
→
main.go
@@ -85,12 +85,13 @@ // get the user-reltaive local path from the filespath
// NOTE -- dont use on unsafe input ( I think ) func getLocalPath(filesPath string) string { l := len(strings.Split(c.FilesDirectory, "/")) - return strings.Join(strings.Split(filesPath, "/")[l:], "/") + return strings.Join(strings.Split(filesPath, "/")[l+1:], "/") } func getCreator(filePath string) string { l := len(strings.Split(c.FilesDirectory, "/")) - r := strings.Split(filePath, "/")[l-1] + r := strings.Split(filePath, "/")[l] + fmt.Println(filePath, c.FilesDirectory, r) return r }