it seems that there is an issue with the split method in path/filepath
I have looked at the debugger and it seems like it does not split the path into sections
go version:1.19
debugger output:https://imgur.com/a/VqgQznh
case fsnotify.Rename:
dir, filename := path.Split(event.Name)
fileIndex := indexOfFile(filename, s.LoggedFiles[dir])
if fileIndex == -1 {
errChannel <- errors.New("file path does not exist in map")
break
}
s.LoggedFiles[dir] = append(s.LoggedFiles[dir], s.LoggedFiles[dir][fileIndex])
fmt.Println(s.LoggedFiles[dir])
}