Re: [go-nuts] Importing a package declared in the root directory of a module

2023-04-15 Thread Victor Giordano
*Thanks again!* El sáb, 15 abr 2023 a las 16:50, 'Sean Liao' via golang-nuts (< golang-nuts@googlegroups.com>) escribió: > the import path specifies the location to find a package, but the actual > identifier used is the one in the package declaration, so > > import "a_module_path" > > var foo =

Re: [go-nuts] Importing a package declared in the root directory of a module

2023-04-15 Thread 'Sean Liao' via golang-nuts
the import path specifies the location to find a package, but the actual identifier used is the one in the package declaration, so import "a_module_path" var foo = util.Foo - sean On Sat, Apr 15, 2023, 20:40 Victor Giordano wrote: > Thanks *Sean!!* > That makes sense for me! > > But i guess

Re: [go-nuts] Importing a package declared in the root directory of a module

2023-04-15 Thread Victor Giordano
Thanks *Sean!!* That makes sense for me! But i guess I must import with an alias as import without an alias doesn't works, right? @:/cmd$ go build . # a_module_path/cmd ./main.go:4:2: imported and not used: "a_module_path" as util ./main.go:9:14: undefined: a_module_path main.go package main

Re: [go-nuts] Importing a package declared in the root directory of a module

2023-04-15 Thread 'Sean Liao' via golang-nuts
import "a_module_path" optionally rename it to make it clearer import util "a_module_path" - sean On Sat, Apr 15, 2023, 20:31 Victor Giordano wrote: > Hi there! > > I was playing a little bit with modules and packages, regarding making > projects. > And I'm struggling to use a package

[go-nuts] Importing a package declared in the root directory of a module

2023-04-15 Thread Victor Giordano
Hi there! I was playing a little bit with modules and packages, regarding making projects. And I'm struggling to use a package (non-main) declared in the root directory.. allow me to show an example: This scenario, I have project somewhere on my file system . ├── cmd │ └── main.go ├──