Friday Fun
Wayne Witzel
wayne.witzel at canonical.com
Tue Jul 15 12:20:44 UTC 2014
Along the same lines, I've been using goimports (
https://github.com/bradfitz/goimports).
Micheal pointed to it. It wraps go fmt and supports the same flags, but
also adds a layer that removes and adds imports that are unused or needed
respectively. I've had good luck with it running on save with my editor.
On Fri, Jul 11, 2014 at 9:07 AM, roger peppe <roger.peppe at canonical.com>
wrote:
> That's funny - I also have a little Go program that does the same thing.
> I call it "sortimports", and it actually does the sorting rather
> than just reporting that they're not sorted correctly.
>
> http://paste.ubuntu.com/7778940/
>
> I haven't published it because it doesn't *always* work
> in the presence of comments in the import block (it
> doesn't go wrong, just refuses to touch the block in
> that case). Luckily that only applies to about three
> files in juju-core.
>
> cheers,
> rog.
>
> On 11 July 2014 06:19, Jesse Meek <jesse.meek at canonical.com> wrote:
> > I polished off a script this afternoon to check that imports are group
> > correctly. It deals with comments, if the groups are in the wrong order,
> if
> > there are too many groups and several other edge cases. I *think* I don't
> > have any false positives.
> >
> > Here is the output: http://pastebin.ubuntu.com/7778556/ (Found 31
> errors in
> > 26 files)
> >
> > And the PR fixing them: https://github.com/juju/juju/pull/292
> >
> > Cheers!
> >
> > --
> > Juju-dev mailing list
> > Juju-dev at lists.ubuntu.com
> > Modify settings or unsubscribe at:
> > https://lists.ubuntu.com/mailman/listinfo/juju-dev
> >
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
--
Wayne Witzel III
wayne.witzel at canonical.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140715/37f1d5db/attachment.html>
More information about the Juju-dev
mailing list