func (e *environment) OverrideFromEnvironment(serviceName string, tree *toml.Tree) *toml.Tree {
	serviceName = strings.Replace(serviceName, "-", ".", -1) + "."
	for k, v := range e.env {
		switch {
		case tree.Has(k):
			// global key
			tree.Set(k, v)
		case strings.HasPrefix(k, serviceName):
			// service-specific key
			tree.Set(strings.TrimPrefix(k, serviceName), v)
		default:
			// do nothing
		}
	}
	return tree
}
// OverrideFromEnvironment method replaces values in the toml.Tree for matching environment variable keys.
OverrideFromEnvironment method replaces values in the toml.Tree for matching environment variable keys.
// OverrideFromEnvironment method replaces values in the toml . Tree for matching environment variable keys .
func (e *environment) OverrideFromEnvironment(serviceName string, tree *toml.Tree) *toml.Tree {
	serviceName = strings.Replace(serviceName, "-", ".", -1) + "."
	for k, v := range e.env {
		switch {
		case tree.Has(k):
			tree.Set(k, v)
		case strings.HasPrefix(k, serviceName):
			tree.Set(strings.TrimPrefix(k, serviceName), v)
		default:
		}
	}
	return tree
}
func ( e * environment ) OverrideFromEnvironment ( serviceName string , tree * toml . Tree ) * toml . Tree { serviceName = strings . Replace ( serviceName , " " , " " , - 1 ) + " " for k , v := range e . env { switch { case tree . Has ( k ) : tree . Set ( k , v ) case strings . HasPrefix ( k , serviceName ) : tree . Set ( strings . TrimPrefix ( k , serviceName ) , v ) default : } } return tree }
OverrideFromEnvironment method replaces values in the toml.Tree for matching environment variable keys.
OverrideFromEnvironment method replaces values in the toml . Tree for matching environment variable keys .
// global key // service-specific key // do nothing