For this particular case, the Go 1.18 Workspaces could be what you are looking for.
In a nutshell, you can create a file that lists all modules you want to use locally, and if the main module (that is, the one that you run the go commands against) imports a module that is listed in the workspace file, the compiler fetches the replacement from the local module, rather than reaching out to the remote repository that the import path would point to.