ipld-eth-beacon-indexer/pkg/version/version.go
Abdul Rabbani 3d46a029f1
Feature/11 testing add tests for boot (#12)
* Utilize Versioning

* Update Testing and CI/CD

* Update Testing

* Add Linting and Remove timeout

* Update Lint

* handle errors to make the linter happy
2022-04-22 12:27:54 -04:00

26 lines
752 B
Go

package version
import "fmt"
// A reusable structure to allow developers to set their application versions.
type Version struct {
Major int // Major version component of the current release
Minor int // Minor version component of the current release
Patch int // Patch version component of the current release
Meta string // Version metadata to append to the version string
}
// Provides a string with the version
func (version *Version) GetVersion() string {
return fmt.Sprintf("%d.%d.%d", version.Major, version.Minor, version.Patch)
}
// Provides a string with the version and Meta.
func (version *Version) GetVersionWithMeta() string {
v := version.GetVersion()
if version.Meta != "" {
v += "-" + version.Meta
}
return v
}