1
0
Fork 0

🐛 Fixed invalid comprassion in path.Shift util

This commit is contained in:
Maxim Lebedev 2024-02-11 00:20:24 +06:00
parent 8ce87b8603
commit d6c3fff610
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ import (
//nolint:nonamedreturns // contains multiple same typed returns
func Shift(raw string) (head, tail string) {
raw = path.Clean("/" + raw)
if i := strings.Index(raw[1:], "/") + 1; i <= 0 {
if i := strings.Index(raw[1:], "/") + 1; 0 < i {
return raw[1:i], raw[i:]
}