code: func SignatureScript(tx *wire.MsgTx, idx int, subscript []byte, hashType SigHashType, privKey *btcec.PrivateKey, compress bool) ([]byte, error) {
  	sig, err := RawTxInSignature(tx, idx, subscript, hashType, privKey)
  	if err != nil {
  		return nil, err
  	}
  
  	pk := (*btcec.PublicKey)(&privKey.PublicKey)
  	var pkData []byte
  	if compress {
  		pkData = pk.SerializeCompressed()
  	} else {
  		pkData = pk.SerializeUncompressed()
  	}
  
  	return NewScriptBuilder().AddData(sig).AddData(pkData).Script()
  }
docs: // SignatureScript creates an input signature script for tx to spend BTC sent
  // from a previous output to the owner of privKey. tx must include all
  // transaction inputs and outputs, however txin scripts are allowed to be filled
  // or empty. The returned script is calculated to be used as the idx'th txin
  // sigscript for tx. subscript is the PkScript of the previous output being used
  // as the idx'th input. privKey is serialized in either a compressed or
  // uncompressed format based on compress. This format must match the same format
  // used to generate the payment address, or the script validation will fail.