code: func CalcSignatureHash(script []byte, hashType SigHashType, tx *wire.MsgTx, idx int) ([]byte, error) {
  	parsedScript, err := parseScript(script)
  	if err != nil {
  		return nil, fmt.Errorf("cannot parse output script: %v", err)
  	}
  	return calcSignatureHash(parsedScript, hashType, tx, idx), nil
  }
docs: // CalcSignatureHash will, given a script and hash type for the current script
  // engine instance, calculate the signature hash to be used for signing and
  // verification.