Skip to content

MapTo cannot parse values as uint8 #302

Open
@rolandjitsu

Description

@rolandjitsu

Describe the bug
Parsing the following:

[mysection]
mykey=90

When using MapTo results in:

set field "mykey": unsupported type "uint8"

If the type is uint8:

type MySection struct {
	MeyKey uint8 `json:"mykey" ini:"mykey"`
}

To Reproduce
Just load the config and use MapTo:

cfg, _ := ini.Load([]byte(`
[mysection]
mykey=90
`))
mySec := &MySection{}
err := cfg.Section("mysection").MapTo(mySec)

Expected behavior
MapTo should be able to parse values as uint8.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here, or any suggestion to fix the problem.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions