[cross language demo]go language deserialize demo#128
Open
helintongh wants to merge 2 commits intoalibaba:mainfrom
Open
[cross language demo]go language deserialize demo#128helintongh wants to merge 2 commits intoalibaba:mainfrom
helintongh wants to merge 2 commits intoalibaba:mainfrom
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 |
Collaborator
|
please sign CLA |
PikachuHyA
reviewed
Dec 19, 2022
| @@ -0,0 +1,80 @@ | |||
| package main | |||
Collaborator
There was a problem hiding this comment.
add ci for this demo is better
Contributor
Author
There was a problem hiding this comment.
ok,I will change package name and add test for this demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.