Ah yes, my fault, I didn't look at the style guide before
replying - I assumed the nomenclature used by Chris.

As for canonical import path comments, I have mixed feelings.

They are useful because even if a repository exists
in your filesystem, it may contain imports that are intended are
internal to itself, and if you've imported it from the wrong
place, they might be broken. If it *doesn't* contain local
imports, then there might be no way to tell what the canonical
import path is intended to be.

But having a package comment in every file seems redundant
and somewhat annoying. FWIW I have a tool that updates
them automatically.


On 1 August 2017 at 18:30, Chris Hines <ggro...@cs-guy.com> wrote:
> This discussion points out another nomenclature problem in the list. What
> the list refers to as a "Package comment" is actually a "Canonical import
> path" comment. See https://golang.org/doc/go1.4#canonicalimports
>
> Package comments (as defined in this blog post:
> https://blog.golang.org/godoc-documenting-go-code) are for documenting a
> package, not restricting where it can be imported from.
>
> On Tuesday, August 1, 2017 at 1:24:44 PM UTC-4, Peter Bourgon wrote:
>>
>> I think it's cost without much benefit. By definition, if a package
>> exists on your filesystem, you know where it came from: you put it
>> there, and you can inspect the path.
>>
>> On Tue, Aug 1, 2017 at 7:19 PM, roger peppe <rogp...@gmail.com> wrote:
>> > On 1 August 2017 at 18:04, Peter Bourgon <pe...@bourgon.org> wrote:
>> >> Generally nice list. I find these items controversial i.e. shorthand
>> >> for I don't agree with them ;)
>> > [...]
>> >> - Use package comment
>> >
>> > This puzzles me. Why don't you think that having a package comment
>> > is a good idea?
>> >
>> >   rog.

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