What do I have:
- private repository
- sub-module in the repository
submodule/
submodule.go
go.mod
go.sum
main.go
go.mod
go.sum
go.mod contains
module github.com/username/privaterepo
go 1.16
require github.com/username/privaterepo/submodule latest
replace (
github.com/username/privaterepo/submodule latest => target ./submodule
)
submodule/go.mod contains
module github.com/username/privaterepo/submodule
go 1.16
I didn't push anything to the repository yet. I'm trying to go mod tidy in the root of my app:
$ env GIT_TERMINAL_PROMPT=1 go mod tidy
Username for 'https://github.com': username
Password for 'https://[email protected]':
go: errors parsing go.mod:
<...>/go.mod:5: no matching versions for query "latest"
<...>/go.mod:8:2: no matching versions for query "latest"
Which version should I use for my local submodule which is not pushed to the repository yet? Is it even possible to use such local submodule when it's not pushed to the repository (I thought that go mod wouldn't even go to remote source when it sees replace)?