当前位置:网站首页>go map转struct【mapstructure库】
go map转struct【mapstructure库】
2022-08-03 13:37:00 【给我一瓶冰阔洛】
package main
import (
"fmt"
"github.com/mitchellh/mapstructure"
)
type Cat struct {
Name string `mapstructure:"a"`
Breed string `mapstructure:"b"`
}
func main() {
m := map[string]string{
"a":"aaa",
"b":"bbb",
}
var c Cat
mapstructure.Decode(m, &c)
fmt.Println(c)
}边栏推荐
- The embassy in Iceland reminds Chinese citizens in Iceland to strengthen safety protection
- 鸿湖万联扬帆富设备开发板正式合入OpenHarmony主干
- 驻尼日利亚使馆发布阿布贾祖玛岩附近地区紧急安全预警
- PyTorch构建神经网络预测气温(数据集对比,CPU与GPU对比)
- Graphic animation and button animation of an animation basic component
- Nature, Cell都在用的Relia Tech 抗原亲和纯化LYVE1抗体
- 技术分享 | 接口自动化测试如何搞定 json 响应断言?
- Nanoprobes FluoroNanogold 偶联物的特色和应用
- d写二进制
- 15年软件架构师经验总结:在ML领域,初学者踩过的5个坑
猜你喜欢

函数在结构体中的应用练习

Nanoprobes金脂质偶联物的相关应用

Nature, Cell都在用的Relia Tech 抗原亲和纯化LYVE1抗体

The components of the basis of An animation movie clip animation between traditional filling
![[微服务]多级缓存](/img/58/72e01c789a862c058cba58b9113272.png)
[微服务]多级缓存

国产替代风潮下,电子元器件B2B商城系统如何助力企业突围市场竞争

MySQL知识总结 (十二) 数据库相关概念

An animation optimization of traditional guide layer animation

PyTorch builds a neural network to predict temperature (dataset comparison, CPU vs GPU comparison)

客户:我们系统太多,能不能实现多账号互通?
随机推荐
Notepad++ install jsonview plugin
MySQL知识总结 (十二) 数据库相关概念
Nanoprobes金脂质偶联物的相关应用
技术分享 | 接口自动化测试如何搞定 json 响应断言?
English语法_介词 - 概述
中国手机品牌争论谁是国内第一,而它已成为中国手机在海外的代表
Hanyuan Hi-Tech G8032 standard ERPS ring network switch Gigabit 4 optical 10 electrical industrial Ethernet switch ring network + WEB management + SNMP VLAN planning
15年软件架构师经验总结:在ML领域,初学者踩过的5个坑
厨卫电器行业数字化集采管理系统:优化产业供应结构,实现采购业务流程集中管控
PCL 点云按时间进行分段
数据分析(二)——numpy
The maximum number of sliding window
豪威集团发布新款5000万像素图像传感器OV50E
网络数据集-骨干网和校园网-IP流量
D the author: d new features
scala安装包
如何让history历史记录前带时间戳
细胞图像数据的主动学习
苹果终于认清现实,销量成为优先考虑,iPhone14将不涨价
leetcode 448. Find All Numbers Disappeared in an Array 找到所有数组中消失的数字(简单)