func doSelfUpdate() { v := semver.MustParse(current) latest, err := selfupdate.UpdateSelf(v, "myname/myrepo") if err != nil { log.Panicln("Binary update failed:", err) } if latest.Version.Equals(v) { log.Println("Current binary is the latest", current) } else { log.Println( "Updated to", latest.Version, "Release note:\n", latest.ReleaseNotes, ) } }