Also add logs when returning !ok.
For example, this snippet
func parseFileKey(path string) (*backend.FileKey, bool) {
elems := strings.Split(path, "/")
if len(elems) < 4 || elems[len(elems)-1] == "" {
return nil, false
}
should be transformed to this
func parseFileKey(path string) (*backend.FileKey, bool) {
elems := strings.Split(path, "/")
if len(elems) < 4 || elems[len(elems)-1] == "" {
log.WithFields(log.Fields{
"path": path,
"elems": elems,
}).Warn("parseFileKey failed")
return nil, false
}