mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-20 01:10:44 +00:00
Added some tests for sharedlibrary
This commit is contained in:
@@ -57,6 +57,18 @@ func (c *ServerConfig) PopulateCalculatedFields() {
|
||||
logger.EnableDebugOutput = c.Debug
|
||||
}
|
||||
|
||||
func (c *ServerConfig) ApplyDefaultsToEmptyFields() {
|
||||
if c.Host == "" {
|
||||
c.Host = "localhost"
|
||||
}
|
||||
if c.Port == 0 {
|
||||
c.Port = 8081
|
||||
}
|
||||
if c.AccountKey == "" {
|
||||
c.AccountKey = DefaultAccountKey
|
||||
}
|
||||
}
|
||||
|
||||
func setFlagsFromEnvironment() (err error) {
|
||||
flag.VisitAll(func(f *flag.Flag) {
|
||||
name := EnvPrefix + strings.ToUpper(strings.Replace(f.Name, "-", "_", -1))
|
||||
|
||||
Reference in New Issue
Block a user