the only risk if the gov of your country get bankrupt
First of all the bakruptcy of a country is very much different than a bankruptcy of a business. Critically one of the major difference will be that there isnt any international court to settle this kind of defaults. Basically the government will restruct their debt by either asking for more time to pay or rather lend more to pay (whichever is better).
Truly it will be hard to imagine that a country "shut down" immediately after announcing a bankruptcy. For bondholders, this situation is indeed risky however with the country going into default then the bondholder will be allowed to hedge their risk with their bonds