Skip to content
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

util/gconv: Why do gconv.Int64s and gconv.Float64s handle string types inconsistently? #4139

Open
ivothgle opened this issue Jan 23, 2025 · 0 comments
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@ivothgle
Copy link
Contributor

Go version

go1.20.3

GoFrame version

2.7.0

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

	g.Dump(gconv.Int64s("[1,2,3]"))
	g.Dump(gconv.Float64s("[1,2,3]"))

What did you see happen?

结果

[
    1,
    2,
    3,
]
[
    0,
]

What did you expect to see?

为啥他们表现不一致呢?

https://github.com/gogf/gf/blob/master/util/gconv/gconv_slice_float.go#L170-L179

https://github.com/gogf/gf/blob/master/util/gconv/gconv_slice_int.go#L169-L174

@ivothgle ivothgle added the bug It is confirmed a bug, but don't worry, we'll handle it. label Jan 23, 2025
@Issues-translate-bot Issues-translate-bot changed the title util/gconv: 为什么 gconv.Int64s 与 gconv.Float64s 对 string 类型处理不一致呢? util/gconv: Why do gconv.Int64s and gconv.Float64s handle string types inconsistently? Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
Development

No branches or pull requests

1 participant