Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The reflect package specifies a "convention" which it uses to extract key-value pairs from a struct tag using the Get method:

https://golang.org/pkg/reflect/#StructTag

There's no need to parse the entire tag string yourself and it's safe to assume other libraries will work with the convention. If they don't, that's not your fault and it would break with other tags like "json" and "xml" anyway.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: