-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
gdb查询结果json转换丢失精度 #1747
Comments
gqcn
added
bug
It is confirmed a bug, but don't worry, we'll handle it.
done
This issue is done, which may be release in next version.
labels
Apr 11, 2022
补充gdb操作 数据库 CREATE TABLE test_json (
"data" json NOT NULL
);
INSERT INTO test_json ("data") VALUES('[1, 2, 336371793314971759]'); 代码 package main
import (
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
_ "github.com/lib/pq"
"context"
"github.com/gogf/gf/v2/encoding/gjson"
"github.com/gogf/gf/v2/frame/g"
)
type TestJson struct {
Data *gjson.Json `json:"data"`
}
func main() {
var res *TestJson
if err := g.DB().Model("test_json").Scan(&res); err != nil {
g.Log().Debug(context.Background(), "err:", err)
}
g.DumpWithType(res)
} 输出
|
qinyuguang
pushed a commit
to qinyuguang/gf
that referenced
this issue
Apr 11, 2022
qinyuguang
pushed a commit
to qinyuguang/gf
that referenced
this issue
Apr 12, 2022
qinyuguang
pushed a commit
to qinyuguang/gf
that referenced
this issue
Apr 12, 2022
gqcn
added a commit
that referenced
this issue
Apr 18, 2022
houseme
pushed a commit
to houseme/gf
that referenced
this issue
Apr 18, 2022
houseme
pushed a commit
to houseme/gf
that referenced
this issue
Apr 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
go 1.17
gf v2.0.6
生成gjson.Json类型的entity,查询结果会丢失精度。实际是在gconv.Struct时丢失的
下面用gconv.Struct复现
输出丢失精度
*gjson.Json(24) "[1,2,336371793314971800]"
@gqcn
The text was updated successfully, but these errors were encountered: