zlacker

[parent] [thread] 1 comments
1. zwnow+(OP)[view] [source] 2025-08-22 12:47:47
Why does the lifetime even matter?
replies(1): >>thomas+l5
2. thomas+l5[view] [source] 2025-08-22 13:15:14
>>zwnow+(OP)
I gave an example in the post, but to spell it out: Because a typo variable is not caught, e.g. as an unused variable.

The example from the blog post would fail, because `return err` referred to an `err` that was no longer in scope. It would syntactically prevent accidentally writing `foo99()` instead of `err := foo99()`.

[go to top]