Small detail: when you have this kind of situation (variable declaration only for `if` check, you can scope it within the if: `if err := fct(); err != nil { }`