8000 Map shadow key to structure · Issue #92 · go-ini/ini · GitHub
[go: up one dir, main page]

Skip to content

Map shadow key to structure #92

Closed
Closed

Description

@fastfading

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

Activity

  1. changed the title [-][feature request]map shadow key to structure[/-] [+]Map shadow key to structure[/+] on Mar 9, 2017
  2. added a commit that references this issue on Mar 11, 2017
  3. unknwon commented on M 8000 ar 11, 2017

    @unknwon
    Member

    OK, shadows currently only work with []string.

    type MyStruct struct {
        ...
        Numbers [] string `ini:",,allowshadow"`
        ...
    }
    Numbers = 1,2
    Numbers = 3,4

    Result:

    MyStruct.Numbers: []string{"1", "2", "3", "4"}
    
  4. fastfading commented on Mar 13, 2017

    @fastfading
    Author
  5. unknwon commented on Mar 13, 2017

    @unknwon
    Member

    No,

    image

  6. fastfading commented on Mar 13, 2017

    @fastfading
    Author
  7. unknwon commented on Mar 13, 2017

    @unknwon
    Member

    I'm just lazy... won't do it until you asked. :trollface:

  8. unknwon commented on Mar 13, 2017

    @unknwon
    Member

    []int and []int64 should work now!

  9. fastfading commented on Mar 14, 2017

    @fastfading
    Author
  10. unknwon commented on Mar 14, 2017

    @unknwon
    Member

    OK... working on it.

  11. unknwon commented on Mar 14, 2017

    @unknwon
    Member

    OK, added all...

  12. fastfading commented on Mar 14, 2017

    @fastfading
    Author
  13. unknwon commented on Mar 14, 2017

    @unknwon
    Member

    ini:"numbers,omitempty,allowshadow", if you don't need first two, then you end up with ini:",,allowshadow"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0