And now for my next trick ...
Jesse Meek
jesse.meek at canonical.com
Wed Jul 16 20:39:10 UTC 2014
After checking the import grouping I became curious as to what else I
could check. So, while on holiday, I wrote another script to check if
errors are being discarded. It uses the ast package to check for both
assignment statements, where a value of type "error" is being assigned
to a variable of name "_" and non-assignment expression statements that
return at least one value of type "error".
The results were disappointing, for me, but good for Juju. It only
picked up one case:
environs/config.go:48-51
p, _ := Provider(kind)
if p == nil {
return fmt.Errorf("environment %q has an unknown provider type
%q", rawEnviron["name"], kind)
}
So, not a huge revelation, but good to know we are not discarding errors
at least. :)
More information about the Juju-dev
mailing list