title: How to configure go mod to have a require version based on environment variable?
body: <p>I have two internal projects.</p>
  <p>Project1 - <code>go.mod</code> file</p>
  <pre><code>go github.com/company/project1
   
  go 1.16
  
  require github.com/company/project2 v1.1.0 // indirect
  </code></pre>
  <p>Project2 - <code>go.mod</code> file</p>
  <pre><code>go github.com/company/project2
   
  go 1.16
  </code></pre>
  <p>Project1 is dependent on Project2 based on the above go.mod file.</p>
  <p>When Project2 moves across multiple environments it needs to be dependent upon different version of Project1.<br />
  For instance, based on environment variable:</p>
  <ul>
  <li><p>If ENVIRONMENT = LOAD</p>
  <pre><code>Project1 depends on 1.1.0-&lt;ENVIRONMENT&gt; version of Project2
  </code></pre>
  </li>
  <li><p>If ENVIRONMENT = TEST</p>
  <pre><code>Project1 depends on 1.1.0-&lt;ENVIRONMENT&gt;.&lt;DATE&gt; version of Project2
  </code></pre>
  </li>
  </ul>
  <p>Can this be done dynamically without modifying the <code>go.mod</code> file everytime ?</p>