God is not wholly good. Shocking sentiment I know but I believe it to be true. Good is largely a human-centric term defined as much by its being in opposition to what is evil as it is to its innate nature, which is often subjective.
Since god could not be described as evil then we cannot say that God is good either. Rather we should understand God as the Old Testament fathers understood God, that is to say as wholly righteous, wholly perfect and wholly self-sustaining.
God’s righteousness is key to human understanding because it is the one element to HIS personality that humans can begin to approach and apply to their own lives. No human can be self-sustaining or perfect, indeed we can never even come close to these traits, but we can be righteous and in being righteous we can approach the righteousness of God. This is what was meant when God described King David as a man after his own heart (the book of Samuel). God was certainly not wholly good. In fact he was murderer and adulterer, two broken commandments. Not to mention a liar, another commandment broken. But when in the presence of God David was always righteous. This is why he so fully repented when confronted with his sins before God. David could deceive himself and in deceiving himself, others but before God David was always righteous. What David, and we forget is that God is ever-present. When speaking of His omniscience, we forget that he is also omnipresent. This is more than a theological concept. When we speak of Gods omnipresence we are saying that God is always present to us, always front and center, ever-attentive to his creation of which we are a part. Now as God is omni-present and omniscient God is also fully present and attentive to every facet of his creation and all times. Every stone or cloud, every man and woman and animal has Gods full and undivided attention every moment of every day. Whats more Before you were born, God was attentive to you as an individual (See Job).
Now when we speak of Righteousness we are speaking of two separate but connected things.
First: To be righteous is to morally right, to be perfectly in line with what is right in the universe in absolute terms.
Second: Toe be righteous is to be justifiable. In biblical terms to be justified is to be made straight in accord with what is righteous. It also means to be warranted in your actions. This is the same meaning we apply when we seek justice against a crime. In publishing justified means to shift the body of a text to the right in perfect alignment. This is an apt metaphor for what it means to be justified in a biblical sense.