Go Style Guide

Nate Finch nate.finch at canonical.com
Thu Feb 20 21:00:07 UTC 2014


Ahh, yes, hmm, I didn't really think about it, and figured import . was
giving them access to unexported symbols (since I've never used import .,
since it always seemed like a Bad Idea).  However, it doesn't do that, you
still only have access to exported symbols.

Well, nevermind.  That's just terrible.  It's just black box testing the
same as any external tests, except obfuscated because you're not using the
package name.  I don't know why you'd ever want to do that.


On Thu, Feb 20, 2014 at 3:48 PM, Gustavo Niemeyer <gustavo at niemeyer.net>wrote:

> On Thu, Feb 20, 2014 at 5:31 PM, Nate Finch <nate.finch at canonical.com>
> wrote:
> > One thing that I thought was very interesting was using import dot to get
> > around circular references for tests.  I actually hit this exact problem
> > just yesterday.
> >
> > https://code.google.com/p/go-wiki/wiki/Style#Import_Dot
>
> I prefer to import the package by its own name, even when there are no
> circular dependencies.
>
>
> gustavo @ http://niemeyer.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140220/d26bef95/attachment.html>


More information about the Juju-dev mailing list