Skip to content

Commit d554a8c

Browse files
committed
fix(configs): follow golang type naming conv.
1 parent f515f77 commit d554a8c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

configs/db.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
)
1010

1111
type DBConfig struct {
12-
host string
13-
port string
14-
user string
15-
password string
16-
address string
17-
name string
12+
Host string
13+
Port string
14+
User string
15+
Password string
16+
Address string
17+
Name string
1818
JWTSecret string
1919
JWTExpirationInSeconds int64
2020
}
@@ -25,12 +25,12 @@ func initializeConfig() DBConfig {
2525
godotenv.Load()
2626

2727
return DBConfig{
28-
host: getEnv("PUBLIC_HOST", "http://localhost"),
29-
port: getEnv("PORT", "4001"),
30-
user: getEnv("DB_USER", "root"),
31-
password: getEnv("DB_PASSWORD", "password"),
32-
address: fmt.Sprintf("%s:%s", getEnv("DB_HOST", "127.0.0.1"), getEnv("DB_PORT", "3306")),
33-
name: getEnv("DB_NAME", "gostore-api"),
28+
Host: getEnv("PUBLIC_HOST", "http://localhost"),
29+
Port: getEnv("PORT", "4001"),
30+
User: getEnv("DB_USER", "root"),
31+
Password: getEnv("DB_PASSWORD", "password"),
32+
Address: fmt.Sprintf("%s:%s", getEnv("DB_HOST", "127.0.0.1"), getEnv("DB_PORT", "3306")),
33+
Name: getEnv("DB_NAME", "gostore-api"),
3434
JWTSecret: getEnv("JWT_SECRET", "not_a_secret_but_it_should"),
3535
JWTExpirationInSeconds: getEnvAsInt("JWT_EXPIRATION_IN_SECONDS", 3600*24*7),
3636
}

0 commit comments

Comments
 (0)