Gorilla/schema 本身是否支持 `json` 反射标签?
Does Gorilla/schema support the `json` reflection tag natively?
在文档中,Gorilla/schema 说您必须指定 schema
反射标记才能解压结构。当我没有模式标签时,我已经看到它解压,例如当我只是使用 json
标签时。
如果未指定 schema
标记,Gorilla 会在幕后做什么?它会查看其他标签还是进行不区分大小写的匹配?是否由于未指定 schema
标记而对性能造成巨大影响?
编辑:Specified/linked 包
对于搜索此答案的其他人 -
这个包可以使用任何标签。默认值为 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,我不完全确定没有明确设置不同的标签对性能的真正影响是什么。
在文档中,Gorilla/schema 说您必须指定 schema
反射标记才能解压结构。当我没有模式标签时,我已经看到它解压,例如当我只是使用 json
标签时。
如果未指定 schema
标记,Gorilla 会在幕后做什么?它会查看其他标签还是进行不区分大小写的匹配?是否由于未指定 schema
标记而对性能造成巨大影响?
编辑:Specified/linked 包
对于搜索此答案的其他人 -
这个包可以使用任何标签。默认值为 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,我不完全确定没有明确设置不同的标签对性能的真正影响是什么。