if err != nil {
logger.Log.Printf("DEBUG:1 GetStockComments : s%", err.Error())
return []Comment{}, err
}
var records []Comment
comment := Comment{}
for result.Next() {
record := result.Record()
if value, ok := record.Get("c"); ok {
node := value.(neo4j.Node)
props := node.Props()
err := mapstructure.Decode(props, &comment)
if err != nil {
logger.Log.Printf("DEBUG:2 GetStockComments : s%", err.Error())
return []Comment{}, err
}
records = append(records, comment)
}
}
在 Session.run 上的某个时间,邮递员上未显示 result.Next() 错误,当我尝试使用代码按顺序运行 API 时,它会发生
runtime error: invalid memory address or nil pointer dereference
goroutine 122 [running]:
net/http.(*conn).serve.func1(0xc0002ba500)
/usr/lib/go-1.13/src/net/http/server.go:1767 +0x139
panic(0x964400, 0xf64c70)
/usr/lib/go-1.13/src/runtime/panic.go:679 +0x1b2
github.com/neo4j/neo4j-go-driver/neo4j.(*result).doFetch(0xc0001f7b00, 0x0)
/root/go/pkg/mod/github.com/neo4j/neo4j-go-driver@v1.8.3/neo4j/result.go:73 +0x32
github.com/neo4j/neo4j-go-driver/neo4j.(*result).fetchAll(0xc0001f7b00)
/root/go/pkg/mod/github.com/neo4j/neo4j-go-driver@v1.8.3/neo4j/result.go:134 +0x31
github.com/neo4j/neo4j-go-driver/neo4j.(*session).consumeCurrent(0xc00020e000, 0x1, 0x0)
/root/go/pkg/mod/github.com/neo4j/neo4j-go-driver@v1.8.3/neo4j/session.go:433 +0x34
github.com/neo4j/neo4j-go-driver/neo4j.(*session).Run(0xc00020e000, 0xa1ec6a, 0x8b, 0xc000703860, 0x0, 0x0, 0x0, 0xc0002d6a80, 0x7f8ecca62008, 0x0, ...)
/root/go/pkg/mod/github.com/neo4j/neo4j-go-driver@v1.8.3/neo4j/session.go:450 +0x4a
一只名叫tom的猫
相关分类