INNER CODE UNIT · Go

mergeMaps

moleculer-go/moleculer · broker/broker.go:23

func mergeMaps(base, new map[string]interface{}) map[string]interface{} {
	if base == nil {
		base = map[string]interface{}{}
	}
	for key, value := range new {
		base[key] = value
	}
	return base
}

func mergeConfigs(baseConfig moleculer.Config, userConfig []*moleculer.Config) moleculer.Config {
	if len(userConfig) > 0 {
		for _, config := range userConfig {
			if config.Services != nil {
				baseConfig.Services = mergeMaps(baseConfig.Services, config.Services)
			}

			if config.LogLevel != "" {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…