func (cli *ConfigCLI) Exec(action, channelID, mspID, peerID, appName, appVersion, compName, compVersion string) (string, error) {
	cmdArgs := []string{action, "--clientconfig", cli.clientconfig, "--cid", channelID, "--mspid", mspID,
		"--user", cli.user, "--peerid", peerID, "--appname", appName, "--appver", appVersion, "--componentname", compName, "--componentver", compVersion}
	if action == "delete" {
		cmdArgs = append(cmdArgs, "--noprompt")
	}
	cmd := exec.Command("../build/configcli", cmdArgs...)
	var out bytes.Buffer
	cmd.Stdout = &out
	var stderr bytes.Buffer
	cmd.Stderr = &stderr
	err := cmd.Start()
	if err != nil {
		return "", fmt.Errorf(err.Error() + ": " + stderr.String())
	}
	err = cmd.Wait()
	if err != nil {
		return "", fmt.Errorf(err.Error() + ": " + stderr.String())
	}
	return out.String(), nil
}
Exec executes the config-cli action with the given args and returns a response
package bddtests
import (
	"bytes"
	"fmt"
	"os/exec"
)
type ConfigCLI struct {
	clientconfig string
	user         string
	binaryPath   string
}
func NewConfigCLI(binaryPath, clientconfig, user string) *ConfigCLI {
	return &ConfigCLI{clientconfig, user, binaryPath}
}
func (cli *ConfigCLI) ExecUpdate(channelID, mspID, org, configFile, peers string) (string, error) {
	cmdArgs := []string{"update", "--clientconfig", cli.clientconfig, "--cid", channelID, "--mspid", mspID,
		"--user", cli.user, "--configfile", configFile, "--noprompt", "--orgid", org, "--timeout", "120000"}
	if peers != "" {
		cmdArgs = append(cmdArgs, "--peerurl", peers)
	}
	cmd := exec.Command(cli.binaryPath, cmdArgs...)
	var out bytes.Buffer
	cmd.Stdout = &out
	var stderr bytes.Buffer
	cmd.Stderr = &stderr
	err := cmd.Start()
	if err != nil {
		return "", fmt.Errorf(err.Error() + ": " + stderr.String())
	}
	err = cmd.Wait()
	if err != nil {
		return "", fmt.Errorf(err.Error() + ": " + stderr.String())
	}
	return out.String(), nil
}