On Friday, May 7, 2021 at 3:34:14 PM UTC+2 Jan Mercl wrote:
> On Fri, May 7, 2021 at 3:21 PM natxo....@gmail.com > <natxo....@gmail.com> wrote: > > > I do not want to write a module, I just want to use a module. So how do > I do this? I am reading all the tutorials listed on the go help modules > output, but at this point I do not need to write a module. > > I don't know what "write a module" means, but to use a module (import > a package from within a module) your program needs the go.mod file. > Without it the build system does not and can not know where to get the > required module(s) from. > > In the directory with your program do `$ go mod init example.com/foo` > <http://example.com/foo> > (or whatever else) and `$ go mod tidy`. The last command figures out > the imported modules and writes them into the go.mod file with some > more info in the go.sum file. Then just `$ go build` should be able to > produce the executable. > > Not tested, but that's what I recall. > aha, so now we always need to do this to track the dependencies. Yes, it works, it will take a few tries to get used to ;-), muscle memory. Thanks to you and to Alex for a prompt, accurate response. Regards, Natxo -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/020bfbd9-ceba-43fc-940f-8412a9bd7267n%40googlegroups.com.