DriveLinked/pkg/global/global.go

19 lines
260 B
Go
Raw Normal View History

2022-04-03 12:30:50 +08:00
package global
import "fmt"
type Version struct {
Major int32
Minor int32
Patch int32
Tag string
}
func (v *Version) String() string {
vs := fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
if v.Tag == "" {
vs = vs + "-" + v.Tag
}
return vs
}