func checkCommandLine(pid int, command string) error {
	cmdlineFile := fmt.Sprintf("/proc/%d/cmdline", pid)
	contents, err := ioutil.ReadFile(cmdlineFile)
	if err != nil {
		return err
	}
	arg1 := bytes.Split(contents, []byte{0})[0]
	if !bytes.Equal(arg1, []byte(command)) {
		return fmt.Errorf("Command line not correct: %s\n", string(contents))
	}
	return nil
}
Returns an error if the given command line doesn't match the expected
command line for the given process.
package goclone
import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path"
	"strconv"
	"strings"
	"syscall"
	"testing"
	"time"
)