Skip to content

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

@ivothgle

Description

@ivothgle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIt is confirmed a bug, but don't worry, we'll handle it.doneThis issue is done, which may be release in next version.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions