On Windows Go is normally installed to C:\Program Files\Go. You should not put your source code inside that directory. Put the source for your projects somewhere else such as %HOME%/go.
On Wed, Nov 23, 2022 at 3:26 PM pat2...@gmail.com <pat22...@gmail.com> wrote: > I've separated my code into separate subdirectories, added a go.mod > ran go mod tidy on each. > > I'm mostly back where I started, which a better source file tree > > I'm trying to test the "treesort" package from the "Donovan and Kernigan" > The Go programing language book. > > When I connect into the treesort subdirectory, you can see the files, but > I get a bad GOROOT error trying to do a "go test ." > > treesort$ ls > go.mod treesort.go treesort_test.go > > > pfarrell@Alien15:~/whome/sandbox/gows/treesort$ cat go.mod > module github.com/pfarrell51/gows/treesort > > go 1.19 > > pfarrell@Alien15:~/whome/sandbox/gows/treesort$ go test . > # github.com/pfarrell51/gows/treesort > treesort_test.go:11:2: package treesort is not in GOROOT (C:\Program > Files\Go\src\treesort) > FAIL github.com/pfarrell51/gows/treesort [setup failed] > FAIL > > How can I get past this? > Thanks > Pat > > -- > 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/4b365c67-6f3d-4edc-97d5-dbe505604818n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/4b365c67-6f3d-4edc-97d5-dbe505604818n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- 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/CABx2%3DD9U5vGq7O%3DZdf_t8BugwnJQwPud2jWzYGw4q02dKZmU5A%40mail.gmail.com.