gitee.com/zhongguo168a/gocodes@v0.0.0-20230609140523-e1828349603f/datax/jsonmap/readme.md (about) 1 ### jsonmap 2 3 * 以通用的json为标准,对map进行约束,这里称为jsonmap。例如key必须为string。 4 * 进行约束的目的是为了降低cachez,modifyz的复杂度 5 * struct to jsonmap 6 * jsonmap to struct 7 8 #### struct支持的tag 9 10 ```go 11 package example 12 13 type Class struct { 14 // 忽视该字段 15 IgnoreField interface{} `jsonz:"_"` 16 // 别名 17 Alias interface{} `jsonz:"--name=alias"` 18 // 数组采用map形式保存,用于创建便于继承的json配置文件。 19 // 例如,子配置需要修改父配置的数组,只需要通过 {"index":value} 替换父配置的值 20 ArrayToMap []interface{} `jsonz:"--tomap"` 21 } 22 ``` 23