Skip to content

A simple API on top of go-version to help you know when a dependency has changed

License

Notifications You must be signed in to change notification settings

StabbyCutyou/versioncheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VersionCheck

Version check uses the very convenient go-version library from Hashicorp. It provides a simple API for registering go library versions, and checking them against a constraint.

All the logic for checking lives in the go-version library, versioncheck is just a way to more easily integrate version dependency error detection into your application.

How to use it

Download the library

go get "github.com/StabbyCutyou/versioncheck"

Import the library

import "github.com/StabbyCutyou/versioncheck"

Wherever your app initially boots, you could integration VersionCheck possibly by defining an initialization section, where in you register your known dependencies, and the version you intend to use. You could use a function like so:

func checkRegistry(){
  versioncheck.Register("LibA",libA.VersionString, "= 1.4")
  versioncheck.Register("LibB", libB.VersionString, "<~ 2.5.2")
  versioncheck.Register("LibC", libC.VersionString, ">= 3.9")
  errs := versioncheck.Check()
  for err in range errs {
    log.Error(err) // or Fatal?
  }
}

You can decide if errors are an issue or not.

But Go libraries don't really have a convention for versioning!

I know, isn't that super annoying? Maybe one will arise. But a simple string based checker seemed the most flexible option of all.

LICENSE

Apache v2 - See LICENSE

About

A simple API on top of go-version to help you know when a dependency has changed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages