...

/

Transforming multi-git to a Self-Updateable Program

Transforming multi-git to a Self-Updateable Program

In this lesson, we'll use the `go-github-update` third party library to make multi-git self-updateable by checking the latest release and fetch it if it is newer than the running program.

Using go-github-selfupdate

The go-github-selfupdate library has many things going for it:

  • It automatically detects the latest version of the released binary on GitHub
  • It retrieves the proper binary for the OS and arch where the binary is running
  • It updates the binary with rollback support on failure
  • It is tested on Linux, macOS and Windows (using Travis CI and AppVeyor)
  • It supports many archive and compression formats (zip, tar, gzip, xzip)
  • It supports private repositories
  • It supports GitHub Enterprise
  • It supports hash and signature validation

To detect the latest version, it requires a semantic versioning scheme. Let’s see how we can implement an auto-update functionality ...