code: func putSpentTxOut(target []byte, stxo *SpentTxOut) int {
  	headerCode := spentTxOutHeaderCode(stxo)
  	offset := putVLQ(target, headerCode)
  	if stxo.Height > 0 {
  		// The legacy v1 spend journal format conditionally tracked the
  		// containing transaction version when the height was non-zero,
  		// so this is required for backwards compat.
  		offset += putVLQ(target[offset:], 0)
  	}
  	return offset + putCompressedTxOut(target[offset:], uint64(stxo.Amount),
  		stxo.PkScript)
  }
docs: // putSpentTxOut serializes the passed stxo according to the format described
  // above directly into the passed target byte slice.  The target byte slice must
  // be at least large enough to handle the number of bytes returned by the
  // SpentTxOutSerializeSize function or it will panic.