Get the latest version of a Go module
Determine the latest available version of a module from proxy.golang.org.
Useful for tools that plan to check available upgrades.
$ go get github.com/joshuabezaleel/latest-version
import (
latestver "github.com/joshuabezaleel/latest-version
)
func main() {
latestVersion, _ := latestver.LatestVersion("github.com/hashicorp/raft")
log.Println(latestVersion)
// 1.1.2
}
Highly inspired by sindesorhus’ latest-version
MIT License