If we say that we have fellowship with him and walk in the darkness, we lie, and don't tell the truth.

 Then John says a surprising thing. He says that we can depend on God in his righteousness to forgive us if we confess our sins. On the face of it, we might well have thought that God in his righteousness would have been much more likely to condemn than to forgive. But the point is that God, because he is righteous, never breaks his word; and Scripture is full of the promise of mercy to the man who comes to him with penitent heart. God has promised that he will never despise the contrite heart and he will not break his word. If we humbly and sorrowfully confess our sins, he will forgive. The very fact of making excuses and seeking for self-justification debars us from forgiveness, because it debars us from penitence; the very fact of humble confession opens the door to forgiveness, for the man with the penitent heart can claim the promises of God. 