mirror of https://github.com/databricks/cli.git
some cleanup
This commit is contained in:
parent
0f67d7c0d7
commit
1538422d27
|
@ -119,16 +119,6 @@ func safeToProperty(golangType reflect.Type, traceSet map[reflect.Type]struct{},
|
||||||
return props, nil
|
return props, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func pop(q []reflect.StructField) reflect.StructField {
|
|
||||||
elem := q[0]
|
|
||||||
q = q[1:]
|
|
||||||
return elem
|
|
||||||
}
|
|
||||||
|
|
||||||
func push(q []reflect.StructField, r reflect.StructField) {
|
|
||||||
q = append(q, r)
|
|
||||||
}
|
|
||||||
|
|
||||||
// travels anonymous embedded fields in a bfs manner to give us a list of all
|
// travels anonymous embedded fields in a bfs manner to give us a list of all
|
||||||
// member fields of a struct
|
// member fields of a struct
|
||||||
// simple Tree based traversal will take place because embbedded fields cannot
|
// simple Tree based traversal will take place because embbedded fields cannot
|
||||||
|
|
|
@ -266,7 +266,7 @@ func TestMapOfObjectsSchema(t *testing.T) {
|
||||||
assert.Equal(t, expected, string(jsonSchema))
|
assert.Equal(t, expected, string(jsonSchema))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEmbeddedSchema(t *testing.T) {
|
func TestEmbeddedStructSchema(t *testing.T) {
|
||||||
type Person struct {
|
type Person struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Age int `json:"age,omitempty"`
|
Age int `json:"age,omitempty"`
|
||||||
|
@ -274,7 +274,7 @@ func TestEmbeddedSchema(t *testing.T) {
|
||||||
|
|
||||||
type Location struct {
|
type Location struct {
|
||||||
Country string `json:"country"`
|
Country string `json:"country"`
|
||||||
State string `json:"state,omitempty"`
|
State string `json:"state,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Plot struct {
|
type Plot struct {
|
||||||
|
|
Loading…
Reference in New Issue