-
-
Save gotwarlost/6cf38fc5f554ff1ec06aa4b045912060 to your computer and use it in GitHub Desktop.
This file contains 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
rdl -ps generate -o ./ go-model model.rdl | |
This file contains 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
package main | |
import ( | |
"encoding/json" | |
"log" | |
) | |
type ExtendedPerson struct { | |
*Person | |
Title string | |
} | |
func main() { | |
ep := &ExtendedPerson{ | |
Person: &Person{ | |
Id: "me", | |
Name: "Krishnan", | |
}, | |
Title: "Mr.", | |
} | |
b, err := json.MarshalIndent(ep, "", " ") | |
if err != nil { | |
log.Fatalln(err) | |
} | |
log.Println(string(b)) | |
var ep2 ExtendedPerson | |
json.Unmarshal(b, &ep2) | |
log.Println("OK") | |
} |
This file contains 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
namespace test; | |
name main; | |
version 1; | |
type Person Struct { | |
String id; | |
String name; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment