-
Notifications
You must be signed in to change notification settings - Fork 246
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
[cross language demo]go language deserialize demo #128
base: main
Are you sure you want to change the base?
[cross language demo]go language deserialize demo #128
Conversation
File use: simple_serialize.cpp will serialize struct person and create a file which content is serialized string and it's name is example.txt.It also a demo which deserialize string to c language. go_deserialize.go is a demo that reads this file(example.txt) , which deserializes the string assignment into the struct.
Code Coverage Report
|
…file deserialize to struct go_deserialize will create a file named golang_serialize.txt. read_from_other which source code is deserialize_from_other_language.cpp will read serialized string and deserialize string to cpp struct. the struct person meta json is following: { "hash_code": 2242444774, "struct_name": "person", "fileds": [ { "field_name": "age", "field_type": "int32" }, { "field_name": "name", "field_type": "string" } ] }
Code Coverage Report
|
please sign CLA |
@@ -0,0 +1,80 @@ | |||
package main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add ci for this demo is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,I will change package name and add test for this demo
Why
struct_pack support other language.
What is changing
simple_serialize.cpp will serialize a struct named person and create a file which content is serialized string and it's name is example.txt.It also a demo which deserialize string to c language.
go_deserialize.go is a demo that reads this file(example.txt) , which deserializes the string assignment into the struct.
Example
in build/example dirent, use bin cross_language_demo,generate a binary file example.txt. use go run o_deserialize.go.