Skip to content

Check for new github releases of your Golang application 🎊

License

Notifications You must be signed in to change notification settings

jbowes/whatsnew

Repository files navigation

whatsnew

Check for new github releases of your Golang application 🎊

Go Reference Enterprise Ready GitHub tag Build Status BSD license codecov Go Report Card



whatsnew provides a simple way to check GitHub for new releases of your Go application. It saves results between runs, uses etags to speed up responses, and tries to minimize the overhead it adds to an otherwise fast application CLI run.

If caching to disk or reading from GitHub don't work for you, you can customize the behaviour.

Quick start

import (
  "context"
  "github.com/jbowes/whatsnew"
)

func main() {
	ctx := context.Background()

	// Start a whatsnew Check
	fut := whatsnew.Check(ctx, &whatsnew.Options{
		Slug:    "you/your-app",
		Cache:   "testdata/update-cache.json",
		Version: "v0.0.1",
	})

	// Run your CLI code and whatnot

	// Wait for the Check to complete, and show the results
	if v, _ := fut.Get(); v != "" {
		fmt.Printf("new release available: %s\n", v)
	}
}

For more usage and examples, see the GoDoc Reference

Alternatives

whatsnew only checks for releases. If you're looking for a package that will let your application update itself, or you prefer packages that start with go-, consider one of these:

Contributing

I would love your help!

whatsnew is still a work in progress. You can help by:

  • Opening a pull request to resolve an open issue.
  • Adding a feature or enhancement of your own! If it might be big, please open an issue first so we can discuss it.
  • Improving this README or adding other documentation to whatsnew.
  • Letting me know if you're using whatsnew.