Fix a linter issue

Signed-off-by: Ian Howell <ian.howell0@gmail.com>
pull/5350/head
Ian Howell 7 years ago
parent d869d22110
commit 449823c838

@ -202,7 +202,7 @@ func parsePropertiesFromValues(values Values) map[string]map[string]interface{}
properties[k] = make(map[string]interface{}) properties[k] = make(map[string]interface{})
// the following types are the only types possible from unmarshalling // the following types are the only types possible from unmarshalling
switch v.(type) { switch v := v.(type) {
case bool: case bool:
properties[k]["type"] = "bool" properties[k]["type"] = "bool"
case float64: case float64:
@ -211,10 +211,10 @@ func parsePropertiesFromValues(values Values) map[string]map[string]interface{}
properties[k]["type"] = "string" properties[k]["type"] = "string"
case []interface{}: case []interface{}:
properties[k]["type"] = "array" properties[k]["type"] = "array"
properties[k]["items"] = parseItemsFromValues(v.([]interface{})) properties[k]["items"] = parseItemsFromValues(v)
case map[string]interface{}: case map[string]interface{}:
properties[k]["type"] = "object" properties[k]["type"] = "object"
object := parsePropertiesFromValues(v.(map[string]interface{})) object := parsePropertiesFromValues(v)
if len(object) > 0 { if len(object) > 0 {
properties[k]["object"] = object properties[k]["object"] = object
} }
@ -227,7 +227,7 @@ func parseItemsFromValues(items []interface{}) map[string]interface{} {
properties := make(map[string]interface{}) properties := make(map[string]interface{})
v := items[0] v := items[0]
// the following types are the only types possible from unmarshalling // the following types are the only types possible from unmarshalling
switch v.(type) { switch v := v.(type) {
case bool: case bool:
properties["type"] = "bool" properties["type"] = "bool"
case float64: case float64:
@ -236,10 +236,10 @@ func parseItemsFromValues(items []interface{}) map[string]interface{} {
properties["type"] = "string" properties["type"] = "string"
case []interface{}: case []interface{}:
properties["type"] = "array" properties["type"] = "array"
properties["items"] = parseItemsFromValues(v.([]interface{})) properties["items"] = parseItemsFromValues(v)
case map[string]interface{}: case map[string]interface{}:
properties["type"] = "object" properties["type"] = "object"
object := parsePropertiesFromValues(v.(map[string]interface{})) object := parsePropertiesFromValues(v)
if len(object) > 0 { if len(object) > 0 {
properties["object"] = object properties["object"] = object
} }

Loading…
Cancel
Save