I'm working on some Go AST code, and the compiler is choking on this line:
var call ast.Expr = ast.CallExpr{Fun: ast.NewIdent("foo"), Args: []ast.Expr{ast.NewIdent("api")}}
The error it's giving me is:
cannot use ast.CallExpr literal (type ast.CallExpr) as type ast.Expr in assignment:
ast.CallExpr does not implement ast.Expr (End method has pointer receiver)
I have no idea what this is saying; according to the documentation, everything looks fine. What do I have to do to make this work?