- go ( golang )
You have a config.ini file which define configuration values as follows and you want to load it with go.
We can easily do this using package ini. If you have not installed ini, you can install it as follow.
$ go get gopkg.in/ini.v1
The config/config.go and main.go has a structure as follows.
$ tree sample ├── config │ └── config.go ├── config.ini └── main.go
Now let's show to config.go and main.go.
Note that in order to load config.go in main.go, the import statement should say
sample is directory name which main.go belongs to.