2 bookmarks for 2023-10-21

Reposted 370.

banging errors in go

flak.tedunangst.com/post/bango

Tedu wrote a tool that lets you handle errors in Go like this:

func decomp(filename string) ([]byte, error) {
        fd := ^os.Open(filename)
        defer fd.Close()
        zd := ^gzip.NewReader(fd)
        data := ^io.ReadAll(zd)
        return data, nil
}

Funky!

369.

Text Rendering Hates You

faultlore.com/blah/text-hates-you

Rendering text, how hard could it be? As it turns out, incredibly hard! To my knowledge, literally no system renders text “perfectly”. It’s all best-effort, although some efforts are more important than others.