Answer the question
In order to leave comments, you need to log in
Golang standard packages not defined?
Installed the programming language according to this instruction. When launching helloworld, it gives an error
./hw.go:4:2: undefined: fmt.
Answer the question
In order to leave comments, you need to log in
Instructions here: https://golang.org/doc/tutorial/getting-started
$ go mod init example.com/hello
This is an important step.
Secondly, it Println
is written with a capital letter.
Never install programs manually to the root of the system, as in your instructions. Almost always there are ready-made packages. It's better to install through the docker, climb into the system - an extreme case.
(and I advise you to return everything as it was before the manual installation)
Go is better to install via snap (but vscode is better via deb from the site):
sudo snap install go --channel=1.16/stable --classic
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question