func (p4 *P4) Run(args []string) ([]map[interface{}]interface{}, error) {
	opts := p4.getOptions()
	args = append(opts, args...)
	cmd := exec.Command("p4", args...)
	var stdout, stderr bytes.Buffer
	cmd.Stdout = &stdout
	cmd.Stderr = &stderr
	mainerr := cmd.Run()
	// May not be the correct place to do this
	// But we are ignoring the actual error otherwise
	if stderr.Len() > 0 {
		return nil, errors.New(stderr.String())
	}
	results := make([]map[interface{}]interface{}, 0)
	for {
		r, err := Unmarshal(&stdout)
		if err == io.EOF {
			break
		}
		if err == nil {
			if r == nil {
				// End of object
				break
			}
			results = append(results, r.(map[interface{}]interface{}))
		} else {
			if mainerr == nil {
				mainerr = err
			}
			break
		}
	}
	return results, mainerr
}
// Run - runs p4 command and returns map
runs p4 command and returns map
// Run - runs p4 command and returns map
func (p4 *P4) Run(args []string) ([]map[interface{}]interface{}, error) {
	opts := p4.getOptions()
	args = append(opts, args...)
	cmd := exec.Command("p4", args...)
	var stdout, stderr bytes.Buffer
	cmd.Stdout = &stdout
	cmd.Stderr = &stderr
	mainerr := cmd.Run()
	if stderr.Len() > 0 {
		return nil, errors.New(stderr.String())
	}
	results := make([]map[interface{}]interface{}, 0)
	for {
		r, err := Unmarshal(&stdout)
		if err == io.EOF {
			break
		}
		if err == nil {
			if r == nil {
				break
			}
			results = append(results, r.(map[interface{}]interface{}))
		} else {
			if mainerr == nil {
				mainerr = err
			}
			break
		}
	}
	return results, mainerr
}
func ( p4 * P4 ) Run ( args [ ] string ) ( [ ] map [ interface { } ] interface { } , error ) { opts := p4 . getOptions ( ) args = append ( opts , args ... ) cmd := exec . Command ( " " , args ... ) var stdout , stderr bytes . Buffer cmd . Stdout = & stdout cmd . Stderr = & stderr mainerr := cmd . Run ( ) if stderr . Len ( ) > 0 { return nil , errors . New ( stderr . String ( ) ) } results := make ( [ ] map [ interface { } ] interface { } , 0 ) for { r , err := Unmarshal ( & stdout ) if err == io . EOF { break } if err == nil { if r == nil { break } results = append ( results , r . ( map [ interface { } ] interface { } ) ) } else { if mainerr == nil { mainerr = err } break } } return results , mainerr }
runs p4 command and returns map
runs p4 command and returns map
// May not be the correct place to do this // But we are ignoring the actual error otherwise // End of object