I am looking at the replace directive for go.mod:
https://thewebivore.com/using-replace-in-go-mod-to-point-to-your-local-module/
module github.com/pselle/foo
replace github.com/pselle/bar => /Users/pselle/Projects/bar
require (
github.com/pselle/bar v1.0.0
)
when working in teams this is pretty dumb since the url is absolute and will break for any machine but your own.
Is there a way to use an env variable or relative path to designate the replace directive? Something like this:
replace github.com/pselle/bar => $GOPATH/src/github.com/pselle/bar
or
replace github.com/pselle/bar => ./github.com/pselle/bar
using the relative path is pretty horrible when PWD changes, an absolute path with an env var would be much better.