diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-10-22 19:07:14 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-10-22 19:07:14 +0300 |
| commit | d963c3f40f075c05d70af32f44ed2bec8e00bc37 (patch) | |
| tree | 33a362746201ebec46e7c741e40a530d5f32e38b /backend/controllers/funcs.go | |
| download | lphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.tar.gz lphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.tar.bz2 lphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.zip | |
init
Diffstat (limited to 'backend/controllers/funcs.go')
| -rw-r--r-- | backend/controllers/funcs.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/backend/controllers/funcs.go b/backend/controllers/funcs.go new file mode 100644 index 0000000..6d0f854 --- /dev/null +++ b/backend/controllers/funcs.go | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | package controllers | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "log" | ||
| 5 | "os" | ||
| 6 | |||
| 7 | "github.com/joho/godotenv" | ||
| 8 | ) | ||
| 9 | |||
| 10 | func GetEnvKey(key string) string { | ||
| 11 | err := godotenv.Load() | ||
| 12 | if err != nil { | ||
| 13 | log.Fatal("Error loading .env file") | ||
| 14 | } | ||
| 15 | return os.Getenv(key) | ||
| 16 | } | ||