Mysterious Compile time issues re: Minimum Viable Snippet
mantis-sa opened this issue · 1 comments
Hi Neo4J Team,
Not sure whether the following is a bug in the code, or something is wrong with my setup. I thought I would report here and try to solve it in parallel in case anyone spots something I am missing.
The code example is lifted exactly as is (bar the username and password change) from the Minimum Viable Snippet section of https://github.com/neo4j/neo4j-go-driver/tree/v4.3.0
Neo4j Version: 4.3.0 Community
Neo4j Mode: Single instance
Driver version: Go driver v4.3.0
Golang version: Go SDK 1.13.5
Operating System: Windows 10 Pro
How I initialised this demo project:
Total Number of files in project + their location:
Neo4J Driver Version used (note how it's the same path as my GOPATH, so I assume this is the one it's using):
Steps to reproduce
- Download the code : https://github.com/d1no93/neo4j_demo
- Load up the project into GoLand / IntelliJ
- Create a run config of the following:
- Package path: neo4j_demo
- Working directory: PATH_TO_NEO4J_DEMO
- Module: neo4j_demo
- Run the program
Expected behavior
Program expected to compile and run given the following is true:
- NewSession returns a Session (See https://github.com/neo4j/neo4j-go-driver/blob/4.3/neo4j/driver.go)
- Result has a method on the interface called Single (See https://github.com/neo4j/neo4j-go-driver/blob/4.3/neo4j/result.go)
Please see the following 2 images as proof that the file versions in my GOPATH are correct.
Actual behavior
Like I said above, not sure whether something has gone awry in my setup, or whether this is legitimately a bug in the driver. Either way, if someone could replicate the setup I have on their machine and report back whether they face the same issue / notice something wrong in my setup, that would be super helpful.
Hello @d1no93, the problem is that the import for the driver was wrong: "github.com/neo4j/neo4j-go-driver/neo4j"
instead of the documented "github.com/neo4j/neo4j-go-driver/v4/neo4j"
.
I sent a PR to your project to fix it: https://github.com/d1no93/neo4j_demo/pull/1/.