func GetMappedName(name string, mapRules string) string {
	if mapRules == "" {
		return name
	}
	kvLines := strings.Split(mapRules, ",")
	for _, kvLine := range kvLines {
		kvLine = strings.TrimSpace(kvLine)
		if strings.HasPrefix(kvLine, "#") {
			//skip comment line
			continue
		}
		kvs := strings.Split(kvLine, "=")

		if len(kvs) != 2 {
			// not kv line
			continue
		}
		k := kvs[0]
		v := kvs[1]
		// found
		if k == name {
			return v
		}
	}
	// not found, means not define
	return name
}
// GetMappedName return mapped name with mapRules
GetMappedName return mapped name with mapRules
// GetMappedName return mapped name with mapRules
func GetMappedName(name string, mapRules string) string {
	if mapRules == "" {
		return name
	}
	kvLines := strings.Split(mapRules, ",")
	for _, kvLine := range kvLines {
		kvLine = strings.TrimSpace(kvLine)
		if strings.HasPrefix(kvLine, "#") {
			continue
		}
		kvs := strings.Split(kvLine, "=")
		if len(kvs) != 2 {
			continue
		}
		k := kvs[0]
		v := kvs[1]
		if k == name {
			return v
		}
	}
	return name
}
func GetMappedName ( name string , mapRules string ) string { if mapRules == " " { return name } kvLines := strings . Split ( mapRules , " " ) for _ , kvLine := range kvLines { kvLine = strings . TrimSpace ( kvLine ) if strings . HasPrefix ( kvLine , " " ) { continue } kvs := strings . Split ( kvLine , " " ) if len ( kvs ) != 2 { continue } k := kvs [ 0 ] v := kvs [ 1 ] if k == name { return v } } return name }
GetMappedName return mapped name with mapRules
GetMappedName return mapped name with mapRules
//skip comment line // not kv line // found // not found, means not define