tridentli / pitchfork

Golang framework for secure communication platforms.
Apache License 2.0
5 stars 3 forks source link

Use StructDetails instead of direct reflection #106

Open massar opened 7 years ago

massar commented 7 years ago

In:

https://github.com/tridentli/pitchfork/commit/e4787a3417bf5abb124cf72c75ed112708fc4782

we introduced the use of reflection to fetch a field value; no error checking is being done, no default is being fallen back on.

Instead call:

_, _, value, err := StructDetails(ctx, pf.Config, fieldname, SD_Perms_Ignore, SD_Tags_Ignore)

and voila, we got the field value, including error checking etc.

Also take the moment to document this magic CFG_ behavior.