2 ms·
This particular code would benefit greatly from named return values. For example, BuildStats is defined as returning (* stats, int, error), when it could name
by fancy_pantser 10y ago
This particular code would benefit greatly from named return values.
For example, BuildStats is defined as returning (* stats, int, error), when it could name those and just use naked returns. In buildInstancesStats, they name the return values but then repeat them again on all 3 return lines instead of just using a naked "return".
Quick intro form the tour with a good example: https://tour.golang.org/basics/7 https://tour.golang.org/basics/7