And Jesus said:
Matthew 19:17 - And he said unto him, Why callest thou me good? there is none good but one, that is, God: but if thou wilt enter into life, keep the commandments.
Please put that in context. Surely you don't believe that you receive salvation by keeping the commands found in the law.
Matthew 19 " 16And someone came to Him and said, "Teacher, what good thing shall I do that I may obtain eternal life?" 17And He said to him, "Why are you asking Me about what is good?
There is only One who is good; but if you wish to enter into life, keep the commandments."
18Then he said to Him, "Which ones?" And Jesus said, "YOU SHALL NOT COMMIT MURDER; YOU SHALL NOT COMMIT ADULTERY; YOU SHALL NOT STEAL; YOU SHALL NOT BEAR FALSE WITNESS;
19HONOR YOUR FATHER AND MOTHER; and YOU SHALL LOVE YOUR NEIGHBOR AS YOURSELF."
20The young man said to Him, "All these things I have kept; what am I still lacking?"
21Jesus said to him, "If you wish to be complete, go and sell your possessions and give to the poor, and you will have treasure in heaven; and come, follow Me."
22But when the young man heard this statement, he went away grieving; for he was one who owned much property.
23And Jesus said to His disciples, "Truly I say to you, it is hard for a rich man to enter the kingdom of heaven.
24"Again I say to you, it is easier for a camel to go through the eye of a needle, than for a rich man to enter the kingdom of God."
25
When the disciples heard this, they were very astonished and said, "Then who can be saved?"
26And looking at them Jesus said to them, "With people this is impossible, but with God all things are possible.""
Jesus was showing this rich man who thought he was righteous that he fell short. There is only One who is good - God! It is impossible to be saved by doing good, but salvation comes from God. Notice the commands listed here are not exclusive to the 10 commandments. Jesus quoted from the book of the law.