- Remove StartTime initialization from globals.New() - Add setupGlobals function in app.go to set StartTime during fx OnStart - Simplify globals package to be just a key/value store - Remove fx dependencies from globals test
28 lines
415 B
Go
28 lines
415 B
Go
package globals
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// these get populated from main() and copied into the Globals object.
|
|
var (
|
|
Appname string = "vaultik"
|
|
Version string = "dev"
|
|
Commit string = "unknown"
|
|
)
|
|
|
|
type Globals struct {
|
|
Appname string
|
|
Version string
|
|
Commit string
|
|
StartTime time.Time
|
|
}
|
|
|
|
func New() (*Globals, error) {
|
|
return &Globals{
|
|
Appname: Appname,
|
|
Version: Version,
|
|
Commit: Commit,
|
|
}, nil
|
|
}
|