On Fri, Nov 30, 2018 at 12:07 AM robert engels <reng...@ix.netcom.com>
wrote:

> The dot imports are useful, and others feel the same
https://github.com/golang/lint/issues/179.

Not all others do feel the same. Actually, most others do not. From Go Code
Review Comments
<https://github.com/golang/go/wiki/CodeReviewComments#go-code-review-comments>
:

        This page collects common comments made during reviews of Go code,
so that a single detailed
        explanation can be referred to by shorthands. This is a laundry
list of common mistakes, not a
        comprehensive style guide.

And in particular: Import Dot
<https://github.com/golang/go/wiki/CodeReviewComments#import-dot>

""""
The import . form can be useful in tests that, due to circular
dependencies, cannot be made part of
the package being tested:

        package foo_test
        import (
                "bar/testutil" // also imports "foo"
                 . "foo"
        )

In this case, the test file cannot be in package foo because it uses
bar/testutil, which imports foo.
So we use the 'import .' form to let the file pretend to be part of package
foo even though it is not. Except
for this one case, do not use import . in your programs. It makes the
programs much harder to read
because it is unclear whether a name like Quux is a top-level identifier in
the current package or in
an imported package.
""""

-- 

-j

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to