【问题标题】:How to unmarshal Golang Viper snake_case values如何解组 Golang Viper snake_case 值
【发布时间】:2021-11-13 05:40:24
【问题描述】:

如何用 Golang 和 Viper 库 viper.unmarshal(&c) 一个snake_case 字段:

CryptoId string `json:"crypto_id"`

目前我得到“”空值。

【问题讨论】:

    标签: go viper-go


    【解决方案1】:

    解决了这个

    CryptoId string `mapstructure:"crypto_id"`
    

    Reading a slice of maps with Golang Viper

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-24
      • 2021-03-03
      • 2020-12-21
      • 1970-01-01
      • 1970-01-01
      • 2016-12-21
      相关资源
      最近更新 更多