Static Analysis tests
Andrew Wilkins
andrew.wilkins at canonical.com
Tue May 3 03:02:26 UTC 2016
On Tue, May 3, 2016 at 10:43 AM John Meinel <john at arbash-meinel.com> wrote:
>
> >
> > We should investigate using go/build.Context.UseAllFiles to ignore the
> build tags. As long as there are no "//+build ignore" files lurking, and as
> long as we're not trying to do type-checking, that should be fine.
> >
>
> I'm curious how this works. As often we use build flags to create a
> different version of a function for different platforms. (Eg for lxd we had
> a few functions that had real implementations with a "+build go1.3" flag
> and then stubs that returned false with the !go1.3 flag.) I believe we did
> the same thing for windows/osx support on some of the version code)
>
IIANM, Nate's test operates at the AST level, and doesn't really need to
operate on a package as a whole (it's checking for direct references to a
tls.Config I think?). If it doesn't need to be a valid package, then we can
analyse the individual files, thus platform-specific alternatives,
separately.
Having said that, we should not discount the possibility of higher level
analyses that do want valid packages. Those will probably need to be
per-platform, as Nate says.
Cheers,
Andrew
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20160503/79b6d741/attachment.html>
More information about the Juju-dev
mailing list