by jspthrowaway2 · 13y ago · 0 comments
Follow convention:
type Foo struct {
Thing string `json:"thinger,omitempty" hood:"pk"`
}
Or, even, get bold and claim sql: type Foo struct {
Thing string `json:"thinger,omitempty" sql:"size(128)"`
}
You can then use stuff built in to reflect to get the information for you, rather than parsing yourself:http://golang.org/pkg/reflect/#StructTag
That aside, great work! I've been waiting for something like this.
(Edit: Someone already beat me to it: https://github.com/eaigner/hood/issues/1 -- Hacker Newsers think alike, I guess...)