Skip to content

修复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

Merged
merged 4 commits into from
Aug 1, 2018

Conversation

wangqiang-qiniu
Copy link
Contributor

Fixes [issue number]

Changes

  • feature1
  • feature2
  • fixbug1
  • fixbug2

Reviewers

Wiki Changes

  • options1...
  • options2...

Checklist

  • Rebased/mergeable
  • Tests pass
  • Wiki updated

@@ -4,9 +4,10 @@ import (
"errors"
"fmt"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空格去掉

val = val.(Data)[k]
} else {
return nil, false
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数重构下

} else {
return nil, false
}
}
return nil, false
}

func Data2Map(m map[string]interface{}) interface{} {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数看看是不是没有必要

@@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

紧接着上面做else if比较好

@wonderflow
Copy link
Contributor

加点单测

@wonderflow wonderflow changed the title Data 修复transformer不识别DATA类型只识别map[string]interface的问题 Aug 1, 2018
@wonderflow
Copy link
Contributor

LGTM

@wonderflow wonderflow merged commit f1891f3 into qiniu:master Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants