Julia Evans on Nostr: this is extremely silly but somehow I never noticed that `range` in Go makes a copy ...
Published at
2024-08-01 17:26:01Event JSON
{
"id": "93410577ceca99471da8f89aa7ae12134dd1f17bfceeb77b443411bd71555e6d",
"pubkey": "26cad6f140bf86de9c26b7c15419cab1aebdd7086358d26aa2d750e21cf3bf2e",
"created_at": 1722533161,
"kind": 1,
"tags": [
[
"proxy",
"https://social.jvns.ca/users/b0rk/statuses/112887933265551077",
"activitypub"
]
],
"content": "this is extremely silly but somehow I never noticed that `range` in Go makes a copy (https://go.dev/tour/moretypes/16) and I may or may not have spent 2 hours of my life debugging a bug caused by this\n\nhttps://go.dev/play/p/tXGGz4syZ-f\n\nhttps://cdn.masto.host/socialjvnsca/media_attachments/files/112/887/933/002/646/895/original/fc9d560cfd8eed9b.png",
"sig": "bde83a9f3bb4320903611e01e215971596bc19f4c37509c03c7ba6823e8a191491328d630a74a2bb0694c6f2dbf2240bb98896c579e53b728057b3ab82aedafa"
}