Added support for optional cop-over struct tags in schema #16

wants to merge 1 commit into


None yet

1 participant

knadh commented Jan 5, 2017 edited

In a reasonably large codebase, structs generated by gencode from schema may be shared by various parts. A simple example would first populating a struct with a json.Unmarshal and then marshalling with struct.EncodeMsg. Here, the first step may require json tags.

This PR adds support for optional, copy-over struct tags in the schema definitions.


struct Person {
	Name    string   `json:"name" redis:"name"`
	Age     int

Generated struct in x.gen.go

struct Person type {
	Name    string   `json:"name" redis:"name"`
	Age     int

fixes #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment