Goldman Sachs reported quarterly earnings and revenue that topped analysts’ expectations on Wednesday.