title: Go Modules: finding out right pseudo-version (vX.Y.Z-<timestamp>-<commit>) of required package
body: <p>I am trying out Go modules. My project requires the libarary <code>golang.org/x/net/html</code>, so I defined this <code>go.mod</code> file:</p>
  
  <pre><code>module github.com/patrickbucher/prettyprint
  
  require golang.org/x/net/html
  </code></pre>
  
  <p>And wrote this demo program to check if the dependency gets loaded upon compilation:</p>
  
  <pre><code>package main
  
  import (
          "fmt"
          "log"
          "os"
  
          "golang.org/x/net/html"
  )
  
  func main() {
          doc, err := html.Parse(os.Stdin)
          if err != nil {
                  log.Fatal(err)
          }
          fmt.Println(doc)
  }
  </code></pre>
  
  <p>When I run go build, I get this error message:</p>
  
  <pre><code>go: errors parsing go.mod:
  ~/prettyprint/go.mod:3: usage: require module/path v1.2.3
  </code></pre>
  
  <p>Obviously, I missed the version number. But which one to take? I stumbled an article called <a href="https://dave.cheney.net/2018/07/14/taking-go-modules-for-a-spin" rel="noreferrer">Takig Go Modules for a Spin</a>, where I found an example of a <code>go.mod</code> file containing references to <code>golang.org/x</code> packages:</p>
  
  <pre><code>module github.com/davecheney/httpstat
  
  require (
          github.com/fatih/color v1.5.0
          github.com/mattn/go-colorable v0.0.9
          github.com/mattn/go-isatty v0.0.3
          golang.org/x/net v0.0.0-20170922011244-0744d001aa84
          golang.org/x/sys v0.0.0-20170922123423-429f518978ab
          golang.org/x/text v0.0.0-20170915090833-1cbadb444a80
  )
  </code></pre>
  
  <p>The author is using version strings like <code>v0.0.0-20170922011244-0744d001aa84</code>, consisting of the semver indication v0.0.0, a timestamp and something that looks like a git commit ID.</p>
  
  <p>How do I figure out those version strings? I guess those <code>golang.org/x</code> packages will be versioned according to semantic versioning at some point, but to really trying out <code>go mod</code>, I need to figure out those <em>now</em>.</p>