go get github.com/zekroTJA/configoration
configoration (yeah, it's no typo) is another configuration interface library which provides a similar API to the Configuration Extension of .NET Platform Extensions 3.1 providing a ConfigurationBuilder
like builder struct which produces a Section instance which is inspired by the IConfiguration
interface of .NET.
c, err := configoration.NewBuilder().
SetBasePath("./testdata").
AddJsonFile("config.json", true).
AddJsonFile("config.Development.json", true).
AddYamlFile("config.yaml", true).
AddEnvironmentVariables("APP_", false).
Build()
if err != nil {
panic(err)
}
tls := c.GetSection("WebServer:TLS")
enable, ok := tls.GetBool("enable")