mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +00:00
Merge pull request #1601 from samoht/lint
better comment in converter for yaml validation
This commit is contained in:
commit
d239a7f101
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user