Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add map support #15

Merged
merged 1 commit into from
Jun 23, 2016
Merged

add map support #15

merged 1 commit into from
Jun 23, 2016

Conversation

ljfuyuan
Copy link
Contributor

@ljfuyuan ljfuyuan commented Jun 23, 2016

之前有和你讨论过在recordfile的时候,对于下标有意义,而又不能确认下标的情况,使用MAP方式可以解决,而目前的版本的配置表读取并不支持MAP类型,所以添加了一下MAP支持

比如 {"aaa":1,"bbb":2},在aaa和bbb无法确定的情况下,不方便设计出struct来读取,这个时候可以使用map[string]int,而下标可以从其他数据源获取,做一些判断,比如从数据库拿出来,if v,ok:=map[k]

此PR解决这样的需求。

@name5566 name5566 merged commit a870d54 into name5566:master Jun 23, 2016
@name5566
Copy link
Owner

我做了点修改,增加了 map 类型不能作为索引的判断:d2661b7#diff-dbd1c4150fed4f6b1d56ccab6ec0689f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants