code: func extractUpstreamVersion(version string) string {
  	// The full version is in the format of
  	// "[epoch:]upstream_version[-debian_revision]". See
  	// https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version.
  	version = strings.Trim(version, " '")
  	if i := strings.Index(version, ":"); i != -1 {
  		version = version[i+1:]
  	}
  	if i := strings.Index(version, "-"); i != -1 {
  		version = version[:i]
  	}
  	return version
  }
docs: // extractUpstreamVersion returns the upstream version of the given full
  // version in dpkg format. E.g., "1:1.0.6-2ubuntu2.1" -> "1.0.6".