Is this idomatic use of errdefer / defer?

Yes, it is fine.
Also consider extracting the 3 lines to a locked_read function.

1 Like