-
Notifications
You must be signed in to change notification settings - Fork 0
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
Handle simple values #13
Conversation
if err != nil { | ||
return nil, err | ||
} | ||
return linkMap, nil | ||
} | ||
|
||
func decodeEnv(linkMap LinkMap, env CfgMap) error { | ||
// baseContext is the struct that maps to the TOML table's ctx name | ||
type baseContext struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a different name other than context
? This makes me think of go's standard context.Context
type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that a lot but I really think that the inherent meaning of the word here supersedes the namespace confusion it might cause. "Context" in terms of what you want the output of key value store to be is really important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
This PR adds "simple" primitive types as defined in
IsSimpleValue
to the "flat map" output:Previously only
map[string]string
were considered to be "flat" associative arraysSo the presence of the integer
12
would mean that fetching the value forkey1
necessitated declaring the read type as complex for all keys found in the map:This is no longer the case and flat values can also be mixed complex values without both needing the complex read type declaration: