func RetrieveIPs(conn *ssh.Client) ([]map[string]string, string, error) {
	var listPeers []map[string]string
	var serverPubKey string
	key := ""
	command := "sudo wg"
	stdOut, err := RunCommand(conn, command)
	if err != nil {
		return nil, serverPubKey, errors.Wrapf(err, "failed to run the command: %s", command)
	}
	for _, line := range strings.Split(strings.TrimSuffix(stdOut, "\n"), "\n") {
		peerIPs := make(map[string]string)
		ipAddress := regexFindIP.FindStringSubmatch(line)
		peerKey := findPeerKey.FindStringSubmatch(line)
		if len(peerKey) > 0 || len(peerKey) > 0 {
			if len(peerKey) > 0 {
				key = peerKey[2]
			}
			if len(ipAddress) > 0 {
				for _, v := range ipAddress {
					if strings.Contains(v, cidrTwentyfourBit) || strings.Contains(v, cidrTwentyBit) || strings.Contains(v, cidrSixteenBit) {
						peerIPs[key] = v
						key = ""
					}
				}
			}
		}
		if len(peerKey) > 0 {
			if peerKey[1] == "public key:" {
				serverPubKey = peerKey[2]
			} else {
				key = peerKey[2]
			}
		}
		if len(ipAddress) > 0 {
			for _, v := range ipAddress {
				if strings.Contains(v, "10.0") || strings.Contains(v, "172.16") || strings.Contains(v, "192.168") {
					peerIPs[key] = v
					key = ""
				}
			}
		}
		if len(peerIPs) > 0 {
			listPeers = append(listPeers, peerIPs)
		}
	}
	return listPeers, serverPubKey, nil
}
RetrieveIPs run the command to show all WG IPs setup on the server
package network
import (
	"bytes"
	"io"
	"os"
	"regexp"
	"strings"
	"github.com/olekukonko/tablewriter"
	"github.com/pkg/errors"
	"golang.org/x/crypto/ssh"
)
var (
	regexFindIP = regexp.MustCompile(`(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}`)
	findPeerKey = regexp.MustCompile(`(peer:|public\ key:)\s(\W.+|\w.+)`)
	cidrTwentyfourBit = "10."
	cidrTwentyBit = "172.16"
	cidrSixteenBit = "192.168"
)
func ShowListIPs(listPeers []map[string]string) {
	var data [][]string
	var row []string
	table := tablewriter.NewWriter(os.Stdout)
	table.SetHeader([]string{"Peer", "Local IP"})
	for _, v := range listPeers {
		for x, y := range v {
			row := []string{x, y}
			data = append(data, row)
		}
		data = append(data, row)
	}
	for _, v := range data {
		table.Append(v)
	}
	table.Render()
}
func CheckForDouble(listPeer []map[string]string, IPAddress string) bool {
	cleanIP := IPAddress[:len(IPAddress)-3]
	for _, v := range listPeer {
		for _, ip := range v {
			if ip == cleanIP {
				return true
			}
		}
	}
	return false
}
func readerToString(cmdReader io.Reader) (string, error) {
	buf := new(bytes.Buffer)
	_, err := buf.ReadFrom(cmdReader)
	if err != nil {
		return "", err
	}
	s := buf.String()
	return s, nil
}