-
Notifications
You must be signed in to change notification settings - Fork 259
修复transformer不识别DATA类型只识别map[string]interface的问题 #681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
transforms/ip/ip.go
Outdated
@@ -4,9 +4,10 @@ import ( | |||
"errors" | |||
"fmt" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
空格去掉
utils/models/utils.go
Outdated
val = val.(Data)[k] | ||
} else { | ||
return nil, false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数重构下
utils/models/utils.go
Outdated
} else { | ||
return nil, false | ||
} | ||
} | ||
return nil, false | ||
} | ||
|
||
func Data2Map(m map[string]interface{}) interface{} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数看看是不是没有必要
utils/models/utils.go
Outdated
@@ -848,6 +878,9 @@ func DeepConvertKeyWithCache(data map[string]interface{}, cache map[string]KeyIn | |||
if nv, ok := v.(map[string]interface{}); ok { | |||
v = DeepConvertKeyWithCache(nv, cache) | |||
} | |||
if nv, ok := v.(Data); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
紧接着上面做else if比较好
加点单测 |
LGTM |
Fixes [issue number]
Changes
Reviewers
Wiki Changes
Checklist