Q:

Confused about pointer and value parameter neoism

I am writing a web application in Go and use Neo4j database for storing data. As Neo4j api to Go, i choose neoism.  
However, look at the following code snippet.
db, _ := neoism.Connect("http://localhost:7474/db/data")
// Create a node with a Cypher quer
// Issue a query
//
res1 := []struct {
    A string `json:"n.email"`
}{}
cq1 := neoism.CypherQuery{
    //Use backticks for long statements - Cypher is whitespace indifferent
    Statement: `
        MATCH (n:Account {email: {email}})
        RETURN n.email
    `,
    Parameters: neoism.Props{"email": "hans@ueli.com"},
    Result:     &res1,
}
db.Cypher(&cq1)
fmt.Println(res1)

I query here data from node Account and got a result return, everything works fine here.
The second code almost the same, but I am creating here directly(variable res2) a pointer slice.
// Validate, if email already available in db
res2 := []*struct {
    A string `json:"n.email"`
}{}
cq := &neoism.CypherQuery{
    Statement: `
        MATCH (n:Account {email: {email}})
        RETURN n.email
    `,
    Parameters: neoism.Props{"email": "hans@ueli.com"},
    Result:     res2,
}
db.Cypher(cq)
fmt.Println(res2)

The difference between them are, I've got by the first sample a result but second not.
Result:
[{hans@ueli.com}]
[]

What do I wrong with pointer res2 here?

A:

From the neoism documentation:

Result must be a pointer to a slice of structs - e.g. &[]someStruct{}

Nothing is said about slices of struct pointers, so I assume that your slice is empty because the function is not expecting pointers, so it couldn't put anything in the slice.
I encountered the same behavior when giving sqlx.Query the wrong type of slice. The lacks of error is quite frustrating the first times, but it quickly becomes a reflex.

