Skip to content

fix convert - #559

Merged
wonderflow merged 1 commit into
qiniu:masterfrom
wonderflow:fixconvert
Jun 19, 2018
Merged

wonderflow merged 1 commit into
qiniu:masterfrom
wonderflow:fixconvert

Conversation

@wonderflow

Copy link
Copy Markdown
Contributor

Fixes [issue number]

Changes

  • feature1
  • feature2
  • fixbug1
  • fixbug2

Reviewers

  • @[someone] please review
  • @[someotherone] please review

Wiki Changes

  • options1...
  • options2...

Checklist

  • Rebased/mergeable
  • Tests pass
  • Wiki updated

Comment thread transforms/mutate/convert.go Outdated
if converted, err = strconv.ParseInt(value.String(), 10, 64); err == nil {
return
val := value.String()
val = strings.TrimSpace(val)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

为什么不直接 strings.TrimSpace(value.String()) 呢

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

val下面还要用

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

我是指 val := strings.TrimSpace(value.String())

Comment thread transforms/mutate/convert.go Outdated
case reflect.String:
if converted, err = strconv.ParseFloat(value.String(), 10); err == nil {
val := value.String()
val = strings.TrimSpace(val)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

同上

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

同上

Comment thread transforms/mutate/convert.go Outdated
return nil, nil
}
if converted, err = strconv.ParseFloat(val, 10); err == nil {
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这里 return nil, err 吧

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这个是 err==nil的时候返回

@wonderflow
wonderflow merged commit 7af7b42 into qiniu:master Jun 19, 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