【发布时间】:2017-12-21 14:07:42
【问题描述】:
我有负责从 yaml 文件中解析数据的结构体 虽然这个结构有时会工作,但我会得到一些需要解析的新字段
这是有效的
- name: test1
type: type
path: path
这不是
- name: test1
type: type
path: path
build-parameters:
maven-opts:
defines:
skipTests: true
这是结构
type Modules struct {
Name string
Type string
Path string
Parameters Parameters `yaml:"build-parameters,omitempty"`
}
参数类型为:
type Parameters map[string]string
我应该如何构造我的结构来接受这个构建参数条目?
这是我使用的库
【问题讨论】:
标签: dictionary go struct hashmap yaml