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

Open
wants to merge 1 commit into
from

Projects

None yet

1 participant

@knadh
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.

eg:

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