func (s *SwitchPortEntity) parseTrunkGroups(config string) string {
	trunkGroups := []string{}
	re := regexp.MustCompile(`(?m)switchport trunk group ([^\s]+)`)
	matches := re.FindAllStringSubmatch(config, -1)
	if matches == nil {
		return ""
	}
	for _, match := range matches {
		for idx, name := range match {
			if idx == 0 || name == "" {
				continue
			}
			trunkGroups = append(trunkGroups, name)
		}
	}
	return strings.Join(trunkGroups, ",")
}
paresTrunkGroup Scans the specified config and parses the trunk group values

Args:
config (string): The interface configuraiton blcok

Returns:
A comma delimitedd string with all trunk group values
package module
import (
	"regexp"
	"strings"
	"github.com/aristanetworks/goeapi"
)
type SwitchPortConfig map[string]string
type SwitchPortConfigMap map[string]SwitchPortConfig
type SwitchPortEntity struct {
	*AbstractBaseEntity
}
func (s SwitchPortConfig) Name() string {
	return s["name"]
}
func (s SwitchPortConfig) Mode() string {
	return s["mode"]
}
func (s SwitchPortConfig) AccessVlan() string {
	return s["access_vlan"]
}
func (s SwitchPortConfig) TrunkNativeVlan() string {
	return s["trunk_native_vlan"]
}
func (s SwitchPortConfig) TrunkAllowedVlans() string {
	return s["trunk_allowed_vlans"]
}
func (s SwitchPortConfig) TrunkGroups() string {
	return s["trunk_groups"]
}
func SwitchPort(node *goeapi.Node) *SwitchPortEntity {
	return &SwitchPortEntity{&AbstractBaseEntity{node}}
}
func (s *SwitchPortEntity) Get(name string) SwitchPortConfig {
	parent := "interface " + name
	config, err := s.GetBlock(parent)
	if err != nil {
		return nil
	}
	if matched, _ := regexp.MatchString(`no switchport\s*\n`, config); matched {
		return nil
	}
	return SwitchPortConfig{
		"name":                name,
		"mode":                s.parseMode(config),
		"access_vlan":         s.parseAccessVlan(config),
		"trunk_native_vlan":   s.parseTrunkNativeVlan(config),
		"trunk_allowed_vlans": s.parseTrunkAllowedVlans(config),
		"trunk_groups":        s.parseTrunkGroups(config),
	}
}
func (s *SwitchPortEntity) GetAll() SwitchPortConfigMap {
	config := s.Config()
	re := regexp.MustCompile(`(?m)^interface\s([Et|Po].+)$`)
	matches := re.FindAllStringSubmatch(config, -1)
	response := make(SwitchPortConfigMap)
	for _, line := range matches {
		name := line[1]
		intf := s.Get(name)
		if intf != nil {
			response[name] = intf
		}
	}
	return response
}
func (s *SwitchPortEntity) GetSection(name string) string {
	parent := "interface " + name
	config, err := s.GetBlock(parent)
	if err != nil {
		return ""
	}
	return config
}
func (s *SwitchPortEntity) parseMode(config string) string {
	re := regexp.MustCompile(`(?m)switchport mode (\w+)`)
	match := re.FindStringSubmatch(config)
	if match == nil {
		return ""
	}
	return match[1]
}