Skip to content

Parse and increment version based on calver.org strategy.

Notifications You must be signed in to change notification settings

loadsmart/calver-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calver-go - The Calendar Versioner for go

Parse and increment version based on calver.org strategy.

CircleCI

Install

go get github.com/loadsmart/calver-go

Usage

import "github.com/loadsmart/calver-go/calver"

latest, err := calver.Parse("YYYY.MM.DD.MICRO", "2019.11.27.1")
micro := latest.Next() // if today is 11/27/2019 then version == 2019.11.27.2
major := latest.Next() // if today is 11/28/2019 then version == 2019.11.28.1

brandNewVersion := calver.NewVersion('YYYY.MM.DD.MICRO', 0) // if today is 11/28/2019 then version == 2019.11.28.1
brandNewVersion.String() // "2019.11.28.1"

Caveats

  • support only the conventions below:
    • YYYY
    • YY
    • 0Y
    • MM
    • M0
    • 0M
    • DD
    • D0
    • 0D
    • MICRO (a.k.a build)

TODO

  • export as command-line tool
  • add support to other conventions

License

MIT

About

Parse and increment version based on calver.org strategy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •