module: basic module.Version type and support

Copied from cmd/go/internal/module and added Version.String method.

For golang/go#31761.

Change-Id: I2fbe224843378e68f0e5890dbc36766936a7e3ed
Reviewed-on: https://go-review.googlesource.com/c/mod/+/176461
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2 files changed
tree: 6d626cab2cca271faea857fa2dcf91d12f601b0e
  1. LICENSE
  2. PATENTS
  3. README
  4. codereview.cfg
  5. go.mod
  6. module/
  7. semver/