Skip to content

Commit 27e5e37

Browse files
committed
fix format
1 parent de8a96f commit 27e5e37

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/cmd/params_validation.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ func isJSONParams(input string) bool {
8484
if input == "" {
8585
return false
8686
}
87-
if !((strings.HasPrefix(input, "{") && strings.HasSuffix(input, "}")) ||
88-
(strings.HasPrefix(input, "[") && strings.HasSuffix(input, "]"))) {
87+
isJSONObject := strings.HasPrefix(input, "{") && strings.HasSuffix(input, "}")
88+
isJSONArray := strings.HasPrefix(input, "[") && strings.HasSuffix(input, "]")
89+
if !isJSONObject && !isJSONArray {
8990
return false
9091
}
9192
return json.Valid([]byte(input))

0 commit comments

Comments
 (0)