func Add(namespace, env string) error {
	if len(env) == 0 {
		return errors.New("Missing env value")
	}
	if len(namespace) == 0 {
		return errors.New("Missing namespace value")
	}
	existing, err := List(env)
	if err != nil {
		return err
	}
	for _, ns := range existing {
		if ns == namespace {
			return nil
		}
	}
	values, _ := config.Get(config.Path("namespaces", env, "all"))
	if len(values) > 0 {
		values = strings.Join([]string{values, namespace}, seperator)
	} else {
		values = namespace
	}
	return config.Set(config.Path("namespaces", env, "all"), values)
}
Add a namespace to an environment
package namespace
import (
	"errors"
	"strings"
	"github.com/micro/micro/v3/service/registry"
	"github.com/micro/micro/v3/util/config"
)
const seperator = ","
func List(env string) ([]string, error) {
	if len(env) == 0 {
		return nil, errors.New("Missing env value")
	}
	values, err := config.Get(config.Path("namespaces", env, "all"))
	if err != nil {
		return nil, err
	}
	if len(values) == 0 {
		return []string{registry.DefaultDomain}, nil
	}
	namespaces := strings.Split(values, seperator)
	return append([]string{registry.DefaultDomain}, namespaces...), nil
}