since go-ini already support {AllowShadows: true}
I wish to could map to structure directly
example {AllowShadows: true}
[Note]
typ = normal
Number=1,2
Number=3,4
Number = []string{"1,2","3,4"} or Number = []string{"1","2","3","4"}
I could accept these 2 above
and if I define like blew
type MyStruct struct {
...
Numbers [] int `ini:",,allowshadow"`
...
}
result would be MyStruct.Numbers: []int{1, 2, 3, 4}
right?
2017-03-11 10:51 GMT+08:00 无闻 <notifications@github.com>:
will this be improved later
is this need a new issue to track ?
or it will be done and closed with this issue
2017-03-13 10:32 GMT+08:00 无闻 <notifications@github.com>:
thank you very much , you are coding leifeng
just one more question , what should I use this `ini:",,allowshadow"`
there are many usage as I see. how can I combine them
for example Number []int `int:"number, , allowshadow"` ????? what is the
parameter mean in para1 *,* para2 *,* para3
Age int `ini:"age"`
Created time.Time `ini:"-"`
Number []string `ini:",,allowshadow"`
type MyStruct struct {
...
Numbers [] string `ini:",,allowshadow"`
...
}
Numbers = 1,2Numbers = 3,4
Result:
MyStruct.Numbers: []string{"1", "2", "3", "4"}
2017-03-14 9:38 GMT+08:00 无闻 <notifications@github.com>:
Activity
[-][feature request]map shadow key to structure[/-][+]Map shadow key to structure[/+]struct: support shadows for MapTo (#92)
unknwon commentedon M
8000
ar 11, 2017
OK, shadows currently only work with
[]string.Result:
fastfading commentedon Mar 13, 2017
unknwon commentedon Mar 13, 2017
No,
fastfading commentedon Mar 13, 2017
unknwon commentedon Mar 13, 2017
I'm just lazy... won't do it until you asked.
struct: support map to []int and []int64 (#92)
unknwon commentedon Mar 13, 2017
[]intand[]int64should work now!fastfading commentedon Mar 14, 2017
unknwon commentedon Mar 14, 2017
OK... working on it.
struct: add more map to types with shadow (#92)
unknwon commentedon Mar 14, 2017
OK, added all...
fastfading commentedon Mar 14, 2017
unknwon commentedon Mar 14, 2017
ini:"numbers,omitempty,allowshadow", if you don't need first two, then you end up withini:",,allowshadow"