Jesus never said He wasn't good. The rich young ruler approached Jesus and addressed Him as, "Good Teacher". Jesus replied, "Why do you call me good, there is none good but God."
What Jesus did was basically to challenge the man to make a decision about who Jesus was.
There are only two ways to take that verse. Either Jesus was claiming to be God. Or Jesus really meant that He wasn't good. But if Jesus wasn't good, then He wasn't a fit sacrifice for our sins. He would be in need of a Savior Himself.
The young man who spoke to Jesus was convinced he was "good". His adherence to the commandments was the definition of "good" in human eyes. Jesus is saying "No one this side of Heaven is good".
...and, if He was denying His own goodness, He was contradicting what He said as quoted in John 8:46.
(In other words, "Right on.")
Dan
For every verse there are alternate understandings it seems sometimes.