mleku on Nostr: yeah, i'm now currently being reminded of why the general idiom of APIs in #golang ...
yeah, i'm now currently being reminded of why the general idiom of APIs in #golang every function has a final return parameter of `error` type
in this case, i add a nil check and skip the item and log an error... there was three other cases where errors were not being handled
- first rule of #golang #fightclub - you do not fail to handle the error case first
- second rule of #golang #fightclub - you do not fail to handle the error case first
Published at
2024-05-03 15:10:52Event JSON
{
"id": "07227b943338e4291ed83a61f7377646dbc8f00c8a86acc31e425d228c45b390",
"pubkey": "4c800257a588a82849d049817c2bdaad984b25a45ad9f6dad66e47d3b47e3b2f",
"created_at": 1714749052,
"kind": 1,
"tags": [
[
"t",
"golang"
],
[
"t",
"fightclub"
],
[
"e",
"6d22d72541c82c325f9cf8087b8b20d4a6b602fb991ff24b7b01905dd4b767ce",
"wss://eden.nostr.land/",
"root"
],
[
"e",
"7dc2814c59ff7a641c98dc66820c95ff9f734cf29a90a9b9599f0605492d2d3e",
"wss://eden.nostr.land/",
"reply"
]
],
"content": "yeah, i'm now currently being reminded of why the general idiom of APIs in #golang every function has a final return parameter of `error` type\n\nin this case, i add a nil check and skip the item and log an error... there was three other cases where errors were not being handled\n\n- first rule of #golang #fightclub - you do not fail to handle the error case first\n- second rule of #golang #fightclub - you do not fail to handle the error case first",
"sig": "6b14bdcca3dc2c8d5dfcfbcb49720e60e4dae168ad31e53fea7b3d44a607ba2337efc58661c841ed534701dd60a5cc96526381f5b0fe3af2d2c73cbe6083a3d5"
}