-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion.go
32 lines (25 loc) · 1.03 KB
/
version.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package tomo
import "fmt"
// Version represents a semantic version number.
type Version [3]int
// TODO: when 1.0 is released, remove the notices. remember to update
// CurrentVersion too!
// CurrentVersion returns the current Tomo/Nasin version. Note that until 1.0 is
// released, this does not mean much.
func CurrentVersion () Version {
return Version { 0, 0, 0 }
}
// CompatibleABI returns whether or not two versions are compatible on a binary
// level. Note that until 1.0 is released, this does not mean much.
func (version Version) CompatibleABI (other Version) bool {
return version[0] == other[0] && version[1] == other[1]
}
// CompatibleAPI returns whether or not two versions are compatible on a source
// code level. Note that until 1.0 is released, this does not mean much.
func (version Version) CompatibleAPI (other Version) bool {
return version[0] == other[0]
}
// String returns a string representation of the version.
func (version Version) String () string {
return fmt.Sprint(version[0], ".", version[1], ".", version[2])
}