Thanks for answering me.

Now I have a curious problem.  Most of the code I've written is compiling.  I'm using go 1.15.8 under ubuntu.  I did

    I'm logged into ~/go/src

    export GO111MODULE=on

    cd multack            This is my code

    go mod init multack

    cd ..

    Now I'm back in ~/go/src

    go install multack

I get an error saying that "package multack is not in GOROOT (usr/local/go/src/multack)"

If I do

    go run multack/multack.go

That works.

What does this error message mean?

Thanks again.

--rob solomon


On 2/24/21 10:23 PM, Ian Lance Taylor wrote:
On Wed, Feb 24, 2021 at 5:24 PM rob <drrob...@fastmail.com> wrote:
I was unclear.

My directories are structured so that each is its own program. For
example, I have programs w/ these names, and the code is in that
directory.  That's how I understood GOPATH was supposed to be organized

~/go/src/dsrt

~/go/src/regex

~/go/src/comparehashes

There are at least 20 of these.  I have compiled these from within
~/go/src using

    go install dsrt

    go install regex

and so on


Additionally, I would like more explanation and/or documentation as to
the replace command in a go.mod file.
Most likely you should run "go mod init" in each directory.

Am I expected to run

go mod init <module name>

on all of my code, or only those that are imported by package main code?
In each directory.

Ian

--
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/d2814a01-1512-b170-e2ba-c384e029f4a6%40fastmail.com.

Reply via email to