Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Oct 22, 2024
1 parent 4a1c0bb commit 86b4fbd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tm2/pkg/sdk/params/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func abciResult(err error) sdk.Result {

// returns the second component of a path.
func secondPart(path string) string {
parts := strings.Split(path, "/")
parts := strings.SplitN(path, "/", 3)
if len(parts) < 2 {
return ""

Check warning on line 69 in tm2/pkg/sdk/params/handler.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/sdk/params/handler.go#L69

Added line #L69 was not covered by tests
} else {
Expand All @@ -74,9 +74,6 @@ func secondPart(path string) string {

// returns the third component of a path, including other slashes.
func thirdPartWithSlashes(path string) string {
secondSlash := strings.Index(path[strings.Index(path, "/")+1:], "/")
if secondSlash == -1 {
return "" // Return original if less than two slashes
}
return path[strings.Index(path, "/")+secondSlash+2:]
split := strings.SplitN(path, "/", 3)
return split[2]
}

0 comments on commit 86b4fbd

Please sign in to comment.