can't you `n, err :=` here and remove the `var n int`?