1. 24
  1.  

  2. 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 {
            return
        }
        if err := munmap(f); err != nil {
            // Report non-fatal error to whatever
            // observability system you are using.
            span.ReportError(err)
        }
    }()
    

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