In the documentation, Gorilla/schema says that you must specify the schema
reflection tag to unpack the struct. I've seen it unpack when I don't have the schema tag, for example when I just am using the json
tag.
When the schema
tag isn't specified what does Gorilla do under the covers? Does it look at other tags or does it do a case-insensitive match? Is there a huge performance hit as a result of not specifying the schema
tag?
EDIT: Specified/linked package
For others searching for this answer -
This package has the ability to use any tag. The default is schema
(which is initialized here). To change the tag it's searching for, use decoder.SetAliasTag("json")
. While I think the fallback logic is around this function, I'm not totally certain what the performance hit really is from not explicitly setting a different tag.