code: func WriteTxOut(w io.Writer, pver uint32, version int32, to *TxOut) error {
  	err := binarySerializer.PutUint64(w, littleEndian, uint64(to.Value))
  	if err != nil {
  		return err
  	}
  
  	return WriteVarBytes(w, pver, to.PkScript)
  }
docs: // WriteTxOut encodes to into the bitcoin protocol encoding for a transaction
  // output (TxOut) to w.
  //
  // NOTE: This function is exported in order to allow txscript to compute the
  // new sighashes for witness transactions (BIP0143).