On Fri, May 7, 2021 at 3:21 PM natxo....@gmail.com <natxo.ase...@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` (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. -- 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/CAA40n-Wohh%2BT-TMs8%3DABDrSKRxeoJEwMVABQcym-RZKpvwi2XA%40mail.gmail.com.