Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Well known struct tags
Well-known struct tags
Go offers struct tags which are discoverable via reflection. These enjoy a wide range of use in the standard library in the JSON/XML and other encoding packages.
The community welcomed them and has built ORMs, further encodings, flag parsers and much more around them since, especially for these tasks, single-sourcing is beneficial for data structures.
Due to increased usage of Go and thus Go struct tags, clashes become inevitable.
The list below is a best effort to document well-known struct tags used by packages which are available to the public.
Format of the list
- Struct tag as extracted by calling https://godoc.org/reflect#StructTag.Get with this tag as the
- Documentation link of this package using https://godoc.org
List entries can be added by anyone who creates a public package where a new tag is used. List entries can be removed when the links to the package documentation stops working or the author(s) of that package requests it.