From 403ad7053f8f7fb434adaad21faae3f3609132e6 Mon Sep 17 00:00:00 2001 From: Janne Sinivirta Date: Fri, 9 Jan 2026 09:38:38 +0200 Subject: [PATCH 1/2] Update golangci-lint to 2.8.0 --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 75a6ffc..18ecb92 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25" -golangci-lint = "2.7.2" +golangci-lint = "2.8.0" dprint = "0.51.1" hk = "1.29.0" just = "1.46.0" From 681ab49f561113af37295fa2ddec24846bc1c20a Mon Sep 17 00:00:00 2001 From: Janne Sinivirta Date: Fri, 9 Jan 2026 09:44:56 +0200 Subject: [PATCH 2/2] Fix modernize lint: use strings.Cut instead of strings.Index --- pkg/httpcheck/check.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/httpcheck/check.go b/pkg/httpcheck/check.go index d0ae91d..28a1cc8 100644 --- a/pkg/httpcheck/check.go +++ b/pkg/httpcheck/check.go @@ -210,7 +210,7 @@ func (c *Check) Run() check.Result { // Check --json-path if c.JSONPath != "" { - path, expectedValue, hasExpectedValue := parseJSONPath(c.JSONPath) + path, expectedValue, hasExpectedValue := strings.Cut(c.JSONPath, "=") jsonResult := jsonpath.Get(respBody, path) if !jsonResult.Exists() { lastErr = fmt.Errorf("JSON path %q not found", path) @@ -248,11 +248,3 @@ func (c *Check) Run() check.Result { // Should not reach here, but handle edge case return result.Failf("unexpected error: %v", lastErr) } - -// parseJSONPath parses "path=value" or "path" format. -func parseJSONPath(jsonPath string) (path, expectedValue string, hasExpectedValue bool) { - if idx := strings.Index(jsonPath, "="); idx != -1 { - return jsonPath[:idx], jsonPath[idx+1:], true - } - return jsonPath, "", false -}