1. 25
  1. 2

    Consider how you would write this code without errdefer. I would have to add the “close the map” portion to both places where I want to return an error.

    Consider how you’ll that that in Odin or Go, […]

    Uh, in Go I’d have err defined beforehand and

    defer func() {
        if err == nil {
        if err := munmap(f); err != nil {
            // Report non-fatal error to whatever
            // observability system you are using.

    Sure, errdefer is a nice shorthand that I wish Go had, but that doesn’t make the code as messy as the author implies.