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

Support more types for default values when unmarshaling #391

Closed
x-hgg-x opened this issue May 1, 2020 · 0 comments · Fixed by #392
Closed

Support more types for default values when unmarshaling #391

x-hgg-x opened this issue May 1, 2020 · 0 comments · Fixed by #392

Comments

@x-hgg-x
Copy link
Contributor

x-hgg-x commented May 1, 2020

Is your feature request related to a problem? Please describe.
I would like more supported types for default values, so that the following code works:

type color struct {
	R, G, B uint `default:"128"`
}

tree, _ := toml.Load("")
var c color
err := tree.Unmarshal(&c)
if err != nil {
	fmt.Println("unmarshal error:", err)
}

Now it only produces this error:

unmarshal error: unsupported field type for default option

Describe the solution you'd like
Add more supported types.

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 a pull request may close this issue.

1 participant