You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by "longbai (via GitHub)" <gi...@apache.org> on 2024/03/06 10:07:58 UTC
Re: [I] [Golang] unmarshal to struct [incubator-fury]
longbai commented on issue #1359:
URL: https://github.com/apache/incubator-fury/issues/1359#issuecomment-1980512960
val := event.Query{
Nat: 1,
Ip: "193.1.2.3",
Url: "http://baidu.com",
Status: 0,
}
fury_ := fury.NewFury(true)
if err := fury_.RegisterTagType("example.SomeClass", event.Query{}); err != nil {
panic(err)
}
bt, err := fury_.Marshal(&val)
if err != nil {
b.Log(err)
return
}
_ = fury_.Unmarshal(bt, &newval)
}
报错
panic: reflect.Set: value of type *event.Query is not assignable to type event.Query
而且Readme里的文档 是用interface{}, 不是结构体。
测试无论是序列化反序列化 比Go标准库的json 的时间都不如
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org