Remove unwanted trailing slash in key
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
parent
32d88a977d
commit
ef9b79f85c
2 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,7 @@ func DecodeToNode(pairs []*store.KVPair, rootName string, filters ...string) (*p
|
|||
return nil, fmt.Errorf("invalid label root %s", rootName)
|
||||
}
|
||||
|
||||
split := strings.Split(pair.Key[len(rootName)+1:], "/")
|
||||
split := strings.FieldsFunc(pair.Key[len(rootName)+1:], func(c rune) bool { return c == '/' })
|
||||
|
||||
parts := []string{rootName}
|
||||
for _, fragment := range split {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue