Structs contains various utilities to work with Go (Golang) structs. It was initially used by me to convert a struct into a map[string]interface{}. With time I've added other utilities for structs. It's basically a high-level package based on primitives from the reflect package. Feel free to add new functions or improve the existing code. Just like the standard lib strings, bytes and co packages, structs has many global functions to manipulate or organize your struct data. Lets define and declare a struct. The structs functions can be also used as independent methods by creating a new *structs.Struct. This is handy if you want to have more control over the structs (such as retrieving a single Field). Structs containPackage structs contains various utilities functions to work with structs various utilities to work with Go (Golang) structs. It was initially used by me to convert a struct into a map[string]interface{}. With time I've added other utilities for structs.
Features
- Package structs contains various utilities functions to work with structs
- Nested structs are supported
- We can also get a slice of Fields from the Struct type to iterate over all fields
- We can easily examine a single Field for more detail
- The structs functions can be also used as independent methods
- structs has many global functions to manipulate or organize your struct data