I have the following project structure:
proj
---| folder1
------------| stuff1
--------------------| stuff1.go
------------| stuff2
--------------------| stuff2.go
---| folder2
------------| stuff1
--------------------| stuff1.go
------------| stuff2
--------------------| stuff2.go
....
---| app.go
Which ends up generating import paths like:
import folderOneStuff github.com/username/proj/folder1/stuff1
import folderTwoStuff github.com/username/proj/folder2/stuff1
...
Now I try to use bazel gazelle to generate build files for me. Therefor I followed this: https://github.com/bazelbuild/bazel-gazelle#running-gazelle-with-bazel
If I now run $ bazel run //:gazelle
, I get an error stating that "go prefix is not set, so importpath can't be determined for rules." even though my BUILD file has this as the first line:
# gazelle:prefix github.com/username/proj
I assume at this point that gazelle is having problems with my folder structure, can I fix this for automated build files or do I have to manually create build files?
Is this a problem that is only solvable by changing my project structure, so rather a go project structure problem rather than a problem with me using bazel (wrong)?