concept reflection in category go

This is an excerpt from Manning's book Go in Practice.
The first big difference you’ll notice from previous techniques is how flags are defined. In this instance, they’re defined as properties on a struct
. The property names provide access to the values in your application. Information about a flag, such as short name, long name, default value, and description, are gathered using reflection to parse the space-separated key-value pairs following a property on a struct. This key-value-pair parsing capability is provided by the reflect package in the standard library. For example, opts.Name is mapped to a flag that has a short name -n, a long name --name, a default value of World, and a description used for help text.
Taking a higher-level view, generators can be a useful way of writing repetitive code that would otherwise use reflection. Go’s reflection mechanism is useful, but it’s tedious to write and limited in capabilities, and the performance of your application will suffer. That’s not to say that reflection is bad. Rather, it’s a tool designed to solve a specific set of problems.
On the other hand, generating code isn’t always the best solution either. Metaprogramming can make debugging hard. It also adds steps to the development process. Just as with reflection, generation should be used when the situation calls for it. But it’s not a panacea or a workaround for Go’s strong typing.
. The property names provide access to the values in your application. Information about a flag, such as short name, long name, default value, and description, are gathered using reflection to parse the space-separated key-value pairs following a property on a struct. This key-value-pair parsing capability is provided by the reflect package in the standard library. For example, opts.Name is mapped to a flag that has a short name -n, a long name --name, a default value of World, and a description used for help text.