3 ms·
I don't consider req a long variable name. What I'm trying to communicate is that req is better than request, and res better than response, since they communica
by thirsteh 14y ago
I don't consider req a long variable name. What I'm trying to communicate is that req is better than request, and res better than response, since they communicate the same thing and are easier to read and write. When it makes sense, i.e. when it can't lead to confusion, the variables have one-letter names--oftentimes this is e.g. i, j for loop variables or n for a number, and so on. Also, it is very common for a method on a type Bar to bind the Bar to a variable b, i.e. func (b Bar) Foo() { ... }
This is how the entire Go stdlib is written, and how most packages are written.