This package allow to read configurations an a easy and fast way from a yaml
file
This mini tool have the follow actions:
- Read a config file
To install config package, you need to install Go and set your Go workspace first.
1.The first need Go installed(version 1.14+ is required), then you can use the below Go command to install config.
go get -u github.com/pablotrianda/config
2.Import it in your code:
import "github.com/pablotrianda/config"
Having a yaml
file with this data:
some: thing
here: goes
import "github.com/pablotrianda/config"
func main(){
// Load the configuration file
cfg := config.Load("to/yaml/file/conf.yaml")
// Get values
cfg.Get("some")
}
You can reach me on Twitter @pablotrianda