Skip to content

An Example to show an efficient way of using .env [Enviroment file] in golang project.

Notifications You must be signed in to change notification settings

02amanag/getcongif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getcongif

I found this method of using .env variable more suitable , fast and protective. unlike before accessing enviroment with os package at every file and location, but here with power of using multiple ENVIROMENT file with hand in dependencies injection is much more convinent and redable.

We can use different-different .env fie at the time of initializing object and then smoothly access the varable.

Directly use config.go and look into main.go file for how to work with this.

Makefile

use command make run to run file and see the value SECRET_KEY which is "secret" from .env file.

About

An Example to show an efficient way of using .env [Enviroment file] in golang project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published