In Galatians 1:11-12, we learn that Paul did not learn the gospel that he taught from anyone else, believing that he learnt it by divine revelation:
Galatians 1:11-12: But I certify you, brethren, that the gospel which was preached of me is not after man. For I neither received it of man, neither was I taught it, but by the revelation of Jesus Christ.
He had begun concerned that what he taught was at variance with what was being taught in Jerusalem, possibly because missionaries claiming to come from Jerusalem were contradicting him. Wanting to teach the same message as was taught in Jerusalem, Paul felt a revelation that he should talk to James, Peter and John in Jerusalem.
John Gill says:
Commentary: ... for as the Gospel he preached was all of a piece, uniform and consistent, so he did not preach one sort of doctrine to the Gentiles, and another to the Jews; but the very self-same truths which were the subject of his ministry in the Gentile world, which were a crucified Christ, and salvation alone by him, these he communicated, laid before, and exposed unto the consideration of the elders and apostles at Jerusalem; not with a view either to give or receive instructions, but to compare their sentiments and principles together; that so it might appear that there, was an entire harmony and agreement between them ...
Gill goes on to say that it was
not that Paul had entertained any doubt of the doctrines he had preached, and needed any confirmation in them from them; for he was fully assured of the truth of them.
Paul talked to them privately, concerned that he had run in vain. If Paul was concerned that he had run in vain, he was not concerned about the false teachers, because nothing said between him and the pillars of the Jerusalem church would affect any false teachers who may have been opposing him. You don't "run in vain" by teaching correct doctrine that is opposed by false teachers. This can only really mean that he was, after all, worried that his teachings were inconsistent with those of the Jerusalem church.
In part, the outcome was that Titus was not compelled to be circumcised (2:3), but it was more than just this. The pillars of the Jerusalem church changed nothing of what Paul taught (2:6), with his relief evident in 2:5:
... that the truth of the gospel might continue with you. James, Peter and John agreed to give Paul a free hand in proselytising to gentiles, while they they, including Peter, would preach to Jews (2:7-9).
Perhaps Paul drove a hard bargain, realising that by keeping Peter and the others away from the gentiles there would be less opportunity for mixed messages going out.