#package {name} is not in std

24 messages · Page 1 of 1 (latest)

flint idol
#

Hi guys,

I am trying to run a golang API. When I "go run main.go", I get the output attached stating that package {name} is not in std as many third party packages are needed.

I have tried to look for answers in stackoverflow and even reddit or chatgpt but after hours trying to go build, go get and similar to get the missing third party packages but no matter what I do I get the same error that is attached.

Just in case you find it useful, the basic structure is the following:
/project-root
├── go.mod
├── cmd/
│ ├── main.go
│ └── other.go
└── other-package/
└── ...

I would really appreciate any help on this.

Thanks in advanced.

flint idol
#

Also please find an example of what I get when I try go install to manually install each third party

bold vigil
#

go run .

flint idol
#

When I "go run main.go" I get the txt attached to the mirst message

#

This is what I get with go get -u (Just in case it is useful to anyone)

scenic pendant
#

what is the output of go env

flint idol
scenic pendant
#

and how did you install go?

flint idol
#

Downloaded the compressed file from the website, uncompressed, moved it to /usr/local and then added the path to /etc/profile.d

scenic pendant
#

what's the output of ls -l /usr/local/go

flint idol
#

root@localhost:/var/golang/chatmental/myapp/cmd# ls -l /usr/local/go
total 60
drwxr-xr-x 2 root root 4096 Oct 14 14:48 api
drwxr-xr-x 2 root root 4096 Oct 14 14:48 bin
-rw-r--r-- 1 root root 52 Oct 14 14:48 codereview.cfg
-rw-r--r-- 1 root root 1337 Oct 14 14:48 CONTRIBUTING.md
drwxr-xr-x 2 root root 4096 Oct 14 14:48 doc
drwxr-xr-x 2 root root 4096 Oct 14 14:54 go
-rw-r--r-- 1 root root 505 Oct 14 14:48 go.env
drwxr-xr-x 3 root root 4096 Oct 14 14:48 lib
-rw-r--r-- 1 root root 1479 Oct 14 14:48 LICENSE
drwxr-xr-x 8 root root 4096 Oct 14 14:49 misc
-rw-r--r-- 1 root root 1303 Oct 14 14:49 PATENTS
drwxr-xr-x 4 root root 4096 Oct 14 14:49 pkg
-rw-r--r-- 1 root root 1455 Oct 14 14:49 README.md
-rw-r--r-- 1 root root 419 Oct 14 14:49 SECURITY.md
drwxr-xr-x 8 root root 4096 Oct 14 14:49 src
root@localhost:/var/golang/chatmental/myapp/cmd#

scenic pendant
#

can you show what your go.mod has?

flint idol
scenic pendant
#

okay, last thnig, what happens if you run ls -l /usrlocal/go/src ?

#

i think you might not have finished extracting everything

#

you might need to just reinstall go 😉

#

the test dir and VERSION is missing from your GOROOT at least

flint idol
#

root@localhost:/var/golang/chatmental# ls -l /usr/local/go/src
total 56
-rw-r--r-- 1 root root 375 Oct 14 14:49 all.bash
-rw-r--r-- 1 root root 543 Oct 14 14:49 all.bat
-rw-r--r-- 1 root root 388 Oct 14 14:49 all.rc
drwxr-xr-x 4 root root 4096 Oct 14 14:49 archive
drwxr-xr-x 2 root root 4096 Oct 14 14:49 arena
-rw-r--r-- 1 root root 2305 Oct 14 14:49 bootstrap.bash
drwxr-xr-x 2 root root 4096 Oct 14 14:49 bufio
-rw-r--r-- 1 root root 1948 Oct 14 14:49 buildall.bash
drwxr-xr-x 2 root root 4096 Oct 14 14:49 builtin
drwxr-xr-x 2 root root 4096 Oct 14 14:49 bytes
-rw-r--r-- 1 root root 518 Oct 14 14:49 clean.bash
-rw-r--r-- 1 root root 600 Oct 14 14:49 clean.bat
-rw-r--r-- 1 root root 380 Oct 14 14:49 clean.rc
drwxr-xr-x 7 root root 4096 Oct 14 14:49 cmd
root@localhost:/var/golang/chatmental#

scenic pendant
#

yea

#

you're missing like most of the stdlib

#

delete /usr/local/go and reinstall

flint idol
#

Ok, let me try. Thank you very much for everything so far, this is driving me mad

#

It's working now. Thank you so much, you just saved my day!