Skip to content

Commit

Permalink
minor: solved full path error on logging (part II)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralvarezdev committed Feb 1, 2025
1 parent cb791f3 commit e6db3d1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions http/route/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ func SplitPattern(pattern string) (string, string, error) {
return "", "", ErrEmptyPattern
}

// Split the pattern by the first space
spaceIndex := 0
// Iterate over the pattern
var method string
path := pattern
for i, char := range pattern {
// Split the pattern by the first space
if char == ' ' {
spaceIndex = i
// Get the method and the path
method = pattern[:i]
path = pattern[i+1:]
break
}
}

// Get the method and the path
method := pattern[:spaceIndex]
path := pattern[spaceIndex+1:]

// Trim the path
strings.Trim(path, " ")

Expand Down

0 comments on commit e6db3d1

Please sign in to comment.