func (i *ipset) List(prefix string) ([]Name, error) {
	output, err := exec.Command("ipset", "list", "-name", "-output", "plain").Output()
	if err != nil {
		return nil, err
	}

	var selected []Name
	sets := strings.Split(string(output), "\n")
	for _, v := range sets {
		if strings.HasPrefix(v, prefix) {
			selected = append(selected, Name(v))
		}
	}

	return selected, err
}
// Fetch a list of all existing sets with a given prefix
Fetch a list of all existing sets with a given prefix
// Fetch a list of all existing sets with a given prefix
func (i *ipset) List(prefix string) ([]Name, error) {
	output, err := exec.Command("ipset", "list", "-name", "-output", "plain").Output()
	if err != nil {
		return nil, err
	}
	var selected []Name
	sets := strings.Split(string(output), "\n")
	for _, v := range sets {
		if strings.HasPrefix(v, prefix) {
			selected = append(selected, Name(v))
		}
	}
	return selected, err
}
func ( i * ipset ) List ( prefix string ) ( [ ] Name , error ) { output , err := exec . Command ( " " , " " , " " , " " , " " ) . Output ( ) if err != nil { return nil , err } var selected [ ] Name sets := strings . Split ( string ( output ) , " \n " ) for _ , v := range sets { if strings . HasPrefix ( v , prefix ) { selected = append ( selected , Name ( v ) ) } } return selected , err }
Fetch a list of all existing sets with a given prefix
Fetch a list of all existing sets with a given prefix