func (d *DMI) FindBin(binary string) (string, error) {
	locations := []string{"/sbin", "/usr/sbin", "/usr/local/sbin"}
	for _, path := range locations {
		lookup := path + "/" + binary
		fileInfo, err := os.Stat(path + "/" + binary)
		if err != nil {
			continue
		}
		if !fileInfo.IsDir() {
			return lookup, nil
		}
	}
	return "", fmt.Errorf("Unable to find the '%v' binary", binary)
}
FindBin will attempt to find a given binary in common bin paths.
package dmidecode
import (
	"fmt"
	"os"
	"os/exec"
	"regexp"
	"strconv"
	"strings"
)
const (
	DMIDecodeBinary = "dmidecode"
)
type Record map[string]string
type DMI struct {
	Data   map[string][]Record
	Binary string
}
func New() *DMI {
	return &DMI{
		Data:   make(map[string][]Record, 0),
		Binary: DMIDecodeBinary,
	}
}
func (d *DMI) Run() error {
	bin, err := d.FindBin(d.Binary)
	if err != nil {
		return err
	}
	output, err := d.ExecDmidecode(bin)
	if err != nil {
		return err
	}
	return d.ParseDmidecode(output)
}