title: How to point Go module dependency in go.mod to a latest commit in a repo?
body: <p>Starting with v1.11 Go added support for modules. Commands</p>
  
  <pre><code>go mod init &lt;package name&gt;
  go build
  </code></pre>
  
  <p>would generate <code>go.mod</code> and <code>go.sum</code> files that contain all found versions for the package dependencies. </p>
  
  <p>If a module does not have any releases, the latest commit of that module is used. If a module does have releases, the latest one is picked as a dependency.</p>
  
  <p>However sometimes I would need functionality that is not in a published release yet, but from a commit made after that release. How do I set <code>go.mod</code> to point not to a release of a module, but to a specific commit in the module's repository?</p>
  
  <p>It looks like I can do it by hand in go.mod with</p>
  
  <pre><code>module /my/module
  
  require (
  ...
  github.com/someone/some_module v0.0.0-20181121201909-af044c0995fe
  ...
  )
  </code></pre>
  
  <p>where <code>v0.0.0</code> does not correspond to the last published release tag, <code>20181121201909</code> would be a commit timestamp and <code>af044c0995fe</code> would be the commit hash? Should such information to be found and entered by hand, or there is a better way?</p>