Nicolas Martyanoff on Nostr: Careful, do not use the url.URL #Go type in structures if you expect to encode them ...
Careful, do not use the url.URL #Go type in structures if you expect to encode them in JSON. For some incredibly stupid reason, it will be serialized as a JSON object and not as the expected string representation. Forces you to use strings everywhere. So much for type safety…
Published at
2024-02-06 15:11:14Event JSON
{
"id": "b81c7974e40bc950658c563eb62b9d157344a4022fb42dad7c6ae8320009badf",
"pubkey": "f320bdda416aa99f2ae0949dca56c3bf58a9815c9de7ba950ad1fa568da2b816",
"created_at": 1707232274,
"kind": 1,
"tags": [
[
"t",
"go"
],
[
"proxy",
"https://emacs.ch/users/galdor/statuses/111885174357736202",
"activitypub"
]
],
"content": "Careful, do not use the url.URL #Go type in structures if you expect to encode them in JSON. For some incredibly stupid reason, it will be serialized as a JSON object and not as the expected string representation. Forces you to use strings everywhere. So much for type safety…",
"sig": "af8ea3bbcba18bc8c5378302d1177748953a18439b36c2cd887961f1ee580365de76e09f0ce5681d9fad6591f369b32a8f86f0027642aa01d274dac3b3b8faf3"
}