I have a package named "foo" because it defines the Foo structure and related things like methods.
The package has a New method that returns the Foo struct selected by the heap.
Can the structure type be called Foo when the package name is "foo"? I'm not sure because it stutters.
var f foo.Foo
On the other hand, itβs natural to write
f := foo.New(...)
source
share