Skip to content
/ tuna Public

Simple yet functional self updater written in GO.

License

Notifications You must be signed in to change notification settings

8ff/tuna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tuna

logo Simple yet functional self updater written in GO.

Functionality

It will update itself with the latest release from the given URL by deleting the old binary and downloading the new one in its place.

Example

package main

import (
	"github.com/8ff/tuna"
)

func main() {
	// Determine OS and ARCH
	osRelease := runtime.GOOS
	arch := runtime.GOARCH

	// Build URL
	e := tuna.SelfUpdate(fmt.Sprintf("https://github.com/myuser/myapp/releases/download/latest/myapp.%s.%s", osRelease, arch))
	if e != nil {
		log.Fatal(e.Error())
	} else {
		log.Println("Updated successfully!")
	}
}

About

Simple yet functional self updater written in GO.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages