Commit a0aef4bd authored by Boris Mühmer's avatar Boris Mühmer
Browse files

added version module

parent 8be42d7b
Loading
Loading
Loading
Loading

version/version.go

0 → 100644
+46 −0
Original line number Diff line number Diff line
package version

import "fmt"

// Type specivies the version type
type Type uint

// Type values
const (
	Unspecified Type = iota
	Development
	Production
)

const (
	txtUnspecified = "unspecified"
	txtDevelopment = "development"
	txtProduction  = "production"
)

// String returns the type in textual form
func (t Type) String() string {
	switch t {
	case Development:
		return txtDevelopment
	case Production:
		return txtProduction
	default:
		return txtUnspecified
	}
}

// Version describes the version
type Version struct {
	Major, Minor, Release uint
	Type                  Type
}

const (
	fmtVersion = "%d.%d.%d"
)

// String returns the version in textual form
func (v *Version) String() string {
	return fmt.Sprintf(fmtVersion, v.Major, v.Minor, v.Release)
}
+7 −0
Original line number Diff line number Diff line
package version

import "testing"

func TestDummy(t *testing.T) {
	t.Skip("dummy test not implemented")
}