Merge pull request #1601 from samoht/lint

better comment in converter for yaml validation
This commit is contained in:
Thomas Gazagnaire 2017-04-12 14:29:03 +02:00 committed by GitHub
commit d239a7f101

View File

@ -81,8 +81,10 @@ type MobyImage struct {
Sysctl map[string]string
}
// recursively convert the map keys from `interface{}` to `string`
// this is needed to convert "yaml" interfaces to "JSON" interfaces
// github.com/go-yaml/yaml treats map keys as interface{} while encoding/json
// requires them to be strings, integers or to implement encoding.TextMarshaler.
// Fix this up by recursively mapping all map[interface{}]interface{} types into
// map[string]interface{}.
// see http://stackoverflow.com/questions/40737122/convert-yaml-to-json-without-struct-golang#answer-40737676
func convert(i interface{}) interface{} {
switch x := i.(type) {