I have good credit, will a bankruptcy ruin it?
That depends on what you think your "good credit" is. If you are currently qualifying for low interest loans from most lenders, then bankruptcy will make that more difficult for a time. It may eliminate enough debt that this doesn't matter as much.
If by "good credit" you mean that you have a lot of debt but you still have credit available from somewhere. It may be higher interest and the terms are tough, but you are keeping on top of it right now. This type of "good credit" is basically qualifying for more of the same that made you visit our site in the first place.
In either case, think of your credit as if it is something you are paying for. If you are paying thousands per year on credit card balances that never seem to go down, then that is what you are paying for "good credit." The real question to consider: Can you live in this asset you are paying for? Can you drive it to work? Can your kids go to college on it? Does it cover your retirement?
"Credit" is not a sign of how good or bad a person you are. It is a measure of your riskiness to future lenders. Credit is not a measure of your value as a person. For lenders it is a business decision. It should be for you too.
Further reading: Is Your Credit An Asset?, How to Make a Debt Trap, Does Your Lender Report Your Good Credit?