Monthly rubric about the curious things I have learnt / discovered
Golang stdlib can't unmarshal the whole JSON from the stream
I believe that stdlib should dictate the standards of high-quality, efficient software development. Generally, I don't expect much from Go, but recently I came across unmarshalling of a large JSON blob. Apparently, there is no way to deserialise from the stream – the only single method json.Unmarshal
exists – it reads from a byte[]
. Indeed, that would occupy about 2x the original size in memory for the structure, where less than the size of the JSON input could be used.
Obviously, there is a stream json.Decoder
that allows processing of the input stream io.Reader
, but it's essentially semi-manual processing.
No surprise at the very stereotypical answers from the Golang community: "you don't need it":
Someone prohibited the use of JSON for that – tell your company that the project can't be implemented because a Golang developer shouldn't want to stream-parse the response efficiently.
Impersonate Web3 EVM wallet
That's a life-saver. Regardless of how comfy I feel about Foundry tools or ethers.js, nothing will replace proper user experience – especially while researching other accounts. impersonator.xyz allows spoofing of a wallet address via the WalletConnect protocol. Highly recommended for DeFi degens, analysts and builders.