Assuming your repository is “
github.com/user/package1”, your module is already on v3.1.9, you have a single go.mod file, and the go.mod file is in the root of the repository, then that would mean the first line in your go.mod file typically would be:
module
github.com/user/package1/v3
To import package2 from code in package1, it would then be the following import statement:
import "
github.com/user/package1/v3/package2"
In other words, your middle option, I think.
You can see more here, for example:
https://golang.org/cmd/go/#hdr-Module_compatibility_and_semantic_versioning
...which includes:
“In semantic versioning, changing the major version number indicates a lack of backwards compatibility with earlier versions. To preserve import compatibility, the go command requires that modules with major version v2 or later use a module path with that major version as the final element. For example, version v2.0.0 of
example.com/m must instead use module path
example.com/m/v2, and packages in that module would use that path as their import path prefix, as in
example.com/m/v2/sub/pkg. Including the major version number in the module path and import paths in this way is called semantic import versioning”