code: func (p *Process) Open() error {
  	if err := func() error {
  		// Generate temporary path to run script from.
  		path, err := ioutil.TempDir("", "phantomjs-")
  		if err != nil {
  			return err
  		}
  		p.path = path
  
  		// Write shim script.
  		scriptPath := filepath.Join(path, "shim.js")
  		if err := ioutil.WriteFile(scriptPath, []byte(shim), 0600); err != nil {
  			return err
  		}
  
  		// Start external process.
  		cmd := exec.Command(p.BinPath, scriptPath)
  		cmd.Env = []string{fmt.Sprintf("PORT=%d", p.Port)}
  		cmd.Stdout = p.Stdout
  		cmd.Stderr = p.Stderr
  		if err := cmd.Start(); err != nil {
  			return err
  		}
  		p.cmd = cmd
  
  		// Wait until process is available.
  		if err := p.wait(); err != nil {
  			return err
  		}
  		return nil
  
  	}(); err != nil {
  		p.Close()
  		return err
  	}
  
  	return nil
  }
docs: // Open start the phantomjs process with the shim script.