dream5694 2018-05-25 20:22
浏览 12
已采纳

大猩猩/架构本身是否支持`json`反射标签?

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

  • 写回答

1条回答 默认 最新

  • dosi8657 2018-05-25 20:41
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥35 MIMO天线稀疏阵列排布问题
  • ¥60 用visual studio编写程序,利用间接平差求解水准网
  • ¥15 Llama如何调用shell或者Python
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?
  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?