neo4j/neo4j-go-driver

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:
1_Project_Startup

Total Number of files in project + their location:
2__Project_Files_Location

GOPATH on my machine:
3__GoPath

Neo4J Driver Version used (note how it's the same path as my GOPATH, so I assume this is the one it's using):
4__Neo4j_version

Steps to reproduce

  1. Download the code : https://github.com/d1no93/neo4j_demo
  2. Load up the project into GoLand / IntelliJ
  3. Create a run config of the following:
  • Package path: neo4j_demo
  • Working directory: PATH_TO_NEO4J_DEMO
  • Module: neo4j_demo
  1. Run the program

Expected behavior

Program expected to compile and run given the following is true:

Please see the following 2 images as proof that the file versions in my GOPATH are correct.
NewSession_Single_Return
Single_Exists

Actual behavior

  1. See the message in
    5_Compile_Message

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/.