Hello Srini,
There is a decent answer covering some points on how to structure your module, options on where to place your go.mod file, and how to arrange your packages within a module here:
https://stackoverflow.com/a/57314494
One thing to note is that it says in that answer that you cannot use relative import paths like `import "../pkg2"` or `import "./subpkg"` when using modules.
You seem to be using relative import paths in your example, which is not going to work.
You should instead import a package within your module using the full import path of that package, which starts with the module name, such as `import "
github.com/me/mymod/pkg1"`
Finally, if you haven’t already, I highly recommend reading the official “How to Write Go Code” document, which has recently been updated to cover modules:
https://golang.org/doc/code.html
And of course, please don’t hesitate to post any follow-up questions here, or in a new thread.
Best,
thepudds