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