title: go modules multiple main methods
body: <p>I have a project with mutliple main methods.
  When running <code>go build program1/main1.go</code> which has a different set of dependencies than <code>program2/main2.go</code>, my first <code>go build</code> seems to alter my <code>go.mod</code> file and removes the dependencies it <em>thinks</em> it does not need. Yet <code>main2</code> would need these dependencies.</p>
  
  <p>I've tried using <code>go build ...</code> but that also created a different set of dependencies. Specifically, it seems like all the <code>//indirect</code> dependencies get removed and cause program2 to fail.</p>
  
  <p>Is there a way of running <code>go build</code> or <code>go run</code> without updating the <code>go.mod</code> file? Using <code>go build -mod=readonly program1/main1.go</code> it tells me that it fails because the dependencies need to be updated..</p>