Adds timezone to config
This commit is contained in:
parent
0c6f686ce5
commit
b6a6c9375f
@ -1,7 +1,7 @@
|
||||
app:
|
||||
environment: "devel"
|
||||
port: 5151
|
||||
|
||||
timezone: Africa/Abidjan
|
||||
db:
|
||||
type: "aoeu"
|
||||
host: "aeihn"
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
type AppConfig struct {
|
||||
Environment string
|
||||
Port string
|
||||
Timezone string
|
||||
}
|
||||
|
||||
// DBConfig is the config for the DB connection.
|
||||
@ -33,6 +34,7 @@ func createDefaultConf() *Conf {
|
||||
App: AppConfig{
|
||||
Environment: "local",
|
||||
Port: "8080",
|
||||
Timezone: "America/New_York",
|
||||
},
|
||||
Db: DBConfig{
|
||||
Type: "postgres",
|
||||
|
@ -16,6 +16,7 @@ func TestSample(t *testing.T) {
|
||||
appConf := conf.App
|
||||
assert.Equal("devel", appConf.Environment)
|
||||
assert.Equal("5151", appConf.Port)
|
||||
assert.Equal("Africa/Abidjan", appConf.Timezone)
|
||||
|
||||
dbConf := conf.Db
|
||||
assert.Equal("aoeu", dbConf.Type)
|
||||
@ -35,6 +36,7 @@ func TestDefault(t *testing.T) {
|
||||
appConf := conf.App
|
||||
assert.Equal("missingfield", appConf.Environment)
|
||||
assert.Equal("8080", appConf.Port)
|
||||
assert.Equal("America/New_York", appConf.Timezone)
|
||||
|
||||
dbConf := conf.Db
|
||||
assert.Equal("typical", dbConf.Type)
|
||||
|
Loading…
x
Reference in New Issue
Block a user