-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version.go
58 lines (52 loc) · 1.54 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* -----------------------------------------------------------------
* L o r d O f S c r i p t s (tm)
* Copyright (C)2023 Dídimo Grimaldo T.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* PACKAGE VERSION
*-----------------------------------------------------------------*/
package govee
import "fmt"
/* ----------------------------------------------------------------
* G l o b a l s
*-----------------------------------------------------------------*/
const (
// Change these values accordingly
NAME string = "GoveeLux"
DESC string = "Govee Device Control"
// don't change
statusAlpha status = "Alpha"
statusBeta status = "Beta"
statusRC status = "RC" // Release Candidate
statusReleased status = ""
)
// NOTE: Change these values accordingly
var Version string = version{NAME, "1.2", statusReleased, 0}.String()
/* ----------------------------------------------------------------
* T y p e s
*-----------------------------------------------------------------*/
type status = string
type version struct {
n string
v string
s status
sv int
}
/* ----------------------------------------------------------------
* M e t h o d s
*-----------------------------------------------------------------*/
func (v version) String() string {
var ver string
switch v.s {
case statusAlpha:
fallthrough
case statusBeta:
fallthrough
case statusRC:
ver = fmt.Sprintf("%s v%s-%s-%d", v.n, v.v, v.s, v.sv)
break
default:
ver = fmt.Sprintf("%s v%s", v.n, v.v)
break
}
return ver
}