Use go modules.
In the top directory:
This creates go.mod in the top directory.
Put additional packages in their own subdirectories. But *don't* run "go mod init" for these. They all share the top one.
Example: foo/bar.go contains
package xyz
func Doit() {
...
}
Your users can then import it like this:
xyz.Doit()
The packages in other subdirectories of your module can refer to each other in the same way. They should *not* use relative imports. Forget that relative imports ever existed, and it will all work.