initial app
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
JSON []byte
|
||||
|
||||
Commit string
|
||||
CommitTime time.Time
|
||||
Tag string
|
||||
|
||||
commitTime string
|
||||
repoUrl string
|
||||
)
|
||||
|
||||
func init() {
|
||||
t, _ := time.Parse(time.RFC3339, commitTime)
|
||||
CommitTime = t.In(time.UTC)
|
||||
|
||||
type v struct {
|
||||
Source string `json:"source,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Commit string `json:"commit,omitempty"`
|
||||
CommitTime time.Time `json:"commitTime,omitempty"`
|
||||
}
|
||||
|
||||
JSON, _ = json.Marshal(v{
|
||||
Source: repoUrl,
|
||||
Version: Tag,
|
||||
Commit: Commit,
|
||||
CommitTime: CommitTime,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user