Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9e649148
authored
Aug 16, 2025
by
Nekohy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feats:the error of gjson.True and gjson.False
parent
7323dcf9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
relay/common/override.go
+6
-0
No files found.
relay/common/override.go
View file @
9e649148
...
@@ -202,6 +202,12 @@ func compareGjsonValues(jsonValue, targetValue gjson.Result, mode string) (bool,
...
@@ -202,6 +202,12 @@ func compareGjsonValues(jsonValue, targetValue gjson.Result, mode string) (bool,
}
}
func
compareEqual
(
jsonValue
,
targetValue
gjson
.
Result
)
(
bool
,
error
)
{
func
compareEqual
(
jsonValue
,
targetValue
gjson
.
Result
)
(
bool
,
error
)
{
// 对布尔值特殊处理
if
(
jsonValue
.
Type
==
gjson
.
True
||
jsonValue
.
Type
==
gjson
.
False
)
&&
(
targetValue
.
Type
==
gjson
.
True
||
targetValue
.
Type
==
gjson
.
False
)
{
return
jsonValue
.
Bool
()
==
targetValue
.
Bool
(),
nil
}
// 如果类型不同,报错
// 如果类型不同,报错
if
jsonValue
.
Type
!=
targetValue
.
Type
{
if
jsonValue
.
Type
!=
targetValue
.
Type
{
return
false
,
fmt
.
Errorf
(
"compare for different types, got %v and %v"
,
jsonValue
.
Type
,
targetValue
.
Type
)
return
false
,
fmt
.
Errorf
(
"compare for different types, got %v and %v"
,
jsonValue
.
Type
,
targetValue
.
Type
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment