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. :)

--
Juju-dev mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev

Reply via email to