Skip to content

Instantly share code, notes, and snippets.

@webRat
Last active July 9, 2019 13:29
Show Gist options
  • Save webRat/83038b27644027ec741e9cb8bee37e61 to your computer and use it in GitHub Desktop.
Save webRat/83038b27644027ec741e9cb8bee37e61 to your computer and use it in GitHub Desktop.
fixed. :P
// Things I don't want to see.
func (r *loadCmdReader) Next() (cmd loadCmd, err error) {
try(
r.offset = r.next
r.f.Seek(r.offset, 0)
binary.Read(r.f, r.order, &cmd)
)
}
// And, believe me, if I don't see the above because it's illegal or something, then we'll definitely see this:
func (r *loadCmdReader) Next() (cmd loadCmd, err error) {
try(func() err {
r.offset = r.next
r.f.Seek(r.offset, 0)
binary.Read(r.f, r.order, &cmd)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment