On Thu, Sep 22, 2016 at 3:31 PM, Leandro Motta Barros <l...@stackedboxes.org>
wrote:

> Hi Sam,
>
> Looks like your response got truncated. :-/
>
> Anyway, there is a good deal of nice tips, there. I am updating my code to
> take your feedback into account. Thanks a lot!
>
> There is one point I still wondering about, however:
>
>
> On Thu, Sep 22, 2016 at 1:57 PM, Sam Whited <s...@samwhited.com> wrote:
>
>>
>> > github.com/lmbarros/sbxs_go_markydown/markydown
>>
>> The package would normally just live at the repo root in go; unless
>> you're expecting other subpackages to live in this repo. Right now I'd have
>> to:
>>
>>     import "github.com/lmbarros/sbxs_go_markydown/markydown"
>>
>> but it might read better if I could just import:
>>
>>     import "github.com/lmbarros/go_markydown"
>>
>> (you can also leave the go_ off if this will be the only thing called
>> markydown on your GitHub account)
>>
>>
> Yes, I think the directory structure I used sucks, and I'd like to improve
> it. I'll tell why did so, and would be glad to have some feedback about it:
>
> 1. The sbxs_ prefix is there just because I expect this package to be part
> of a set of related repositories and I wanted to give them some "unity"
> through naming. Arguably a bad idea, I am not sure about it.
>
> 2. I added "go" to the package name because I tend to experiment with
> different languages from time to time, and therefore I have a reasonable
> chance to have naming conflicts without it.
>
> 3. I added that extra "markydown" directory just because I read on
> Effective Go that it is a convention to give the package name the same name
> as the directory, and I thought that "markydown" was a better package name
> than "sbxs_go_markydown". Maybe I should just use the long package name and
> let users rename it when importing if they wish? Or is there  some better
> way?
>
>
To this point, it's probably better not expect users to rename your package
when importing it. Import paths can be gross, but it should not affect the
underlying package name. That is to say, you can keep the long import path
and just name the package "markydown". Given your other considerations, the
convention in Effective Go doesn't fit very well in this situation.


> Thanks again!
>
> LMB
>
> --
> 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.
>

-- 
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