- Implement NewJSONSource* functions for returning an InputSource from
various JSON data sources.
- Copy and modify YAML tests for the JSON InputSource
Changes:
* Reverted the method calls and structs to match the v1 interface
Was previously attempting to cast directly from []interface{} to
[]string or []int which Go doesn't support. Instead, we iterate over and
cast each value (error'ing if the value is not the correct format).
Fixes#580
Sorry, forgot to add imports correctly, needed to edit the file and make the commit using the github online editor, since I can't access from my current location from git.
The funtion `loadDataFrom` does not take care of Windows users since any of the conditions met and it returns an error.
The change looks for the runtime where it's running and then if the filePath contains a `\`
When assigning values to flags (also when interogatting via
`context.(Global)IsSet`.
For boolean flags, consider empty as `false`.
Using `syscall.Getenv` rather than `os.LookupEnv` in order to support
older Golang versions.
Previously, defaults specified as nested keys in a yaml file would not
be recognized, i.e. `top: \n bottom: key` would not be accessible using
the name `top.bottom`, but `top.bottom: key` would. These changes
support using nested keys by traversing the configuration tree if the
key name uses '.' as a delimiter.
* fix typo (yamlSourceLoader -> yamlSourceContext)
* fix function return type (NewYamlSourceFromFlagFunc)
Also fixed build tags to properly build on >=go1.2
Signed-off-by: Jesse Szwedko <jesse.szwedko@gmail.com>