Need team agreement on testing imports

Frank Mueller frank.mueller at canonical.com
Fri Jun 28 07:22:02 UTC 2013


I've got the same problems with local imports like Roger and Dave. Surely
it's a bit less typing and the full package names would be no fun, but
thankfully go allows aliases. So I prefer the convention proposed by
William and John. This btw helps my editor with code completion. ;)

mue


On Fri, Jun 28, 2013 at 8:14 AM, John Meinel <john at arbash-meinel.com> wrote:

> If you troll through code reviews where this was brought up, William
> proposed possibly using a common short name. So
>
> import (
>     gc "launchpad.net/gocheck"
>     jc "launchpad.net/juju-core/testing/checkers"
> )
>
> That helps with the typing and stuttering, gives us namespaced imports,
> and we can use it consistently across the codebase.
>
> These imports will be use a lot, (50% of lines in test suites will have
> one of them). To me it seems a reasonable compromise.
>
> To be fair, I'm ok with import .  in the test suite (never in actual code)
> given how much it is referenced. However I do like namespacing as it gives
> an easier way to figure out where this symbol comes from.
>
> John
> =:->
> On Jun 28, 2013 6:08 AM, "David Cheney" <david.cheney at canonical.com>
> wrote:
>
>>
>> If we are forced to import checkers "normally", then we should do the
>>> same for
>>> gocheck also.
>>>
>>>
>> I have no objection to that, based on the reasons outlined above.
>>
>> --
>> 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
>
>


-- 
** Frank Mueller <frank.mueller at canonical.com>
** Software Engineer - Juju Development
** Canonical
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20130628/b17d18cd/attachment-0001.html>


More information about the Juju-dev mailing list