For JSON I just marshall to/from:
{
"value": "value",
"exists: true,
}
For nil, that's interesting. I've never ran into issues there, so I never considered it.