My structure is like this
type A struct{
B struct{
C interface{} `json:"c"`
}
}
type C struct{
D string `json:"d"`
E string `json:"e"`
}
use of this struct is like this way,
func someFunc(){
var x A
anotherFunc(&x)
}
func anotherFunc(obj interface{}){
// resp.Body has this {D: "123", E: "xyx"}
return json.NewDecoder(resp.Body).Decode(obj)
}
and i have to initialise it for the unit testing and i am doing this,
x := &A{
B: {
C : map[string]interface{}{
D: 123,
E: xyx,
},
},
}
but getting error missing type in composite literal
, what am i doing wrong?