G
G
German2018-10-04 19:54:33
linux
German, 2018-10-04 19:54:33

.go program won't start?

[email protected]:~/software/MyUtils/HERCULES$ ./Setup.go 
./Setup.go: строка 1: package: команда не найдена
import: unable to open image `os/exec': Это не каталог @ error/blob.c/OpenBlob/2712.
import: unable to open image `github.com/fatih/color': Нет такого файла или каталога @ error/blob.c/OpenBlob/2712.
./Setup.go: строка 13: ошибка синтаксиса около неожиданной лексемы `('
./Setup.go: строка 13: `func main() {'

Go installed
[email protected]:~/software/MyUtils/HERCULES$ go version
go version go1.8 linux/amd64

So what's the problem here?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Pavlyuk, 2018-10-04
@pav5000

That you are trying to run the source file of the program as if it were an executable file.
You first need to compile the program using go build, and then run the resulting binary.
If the program is simple and consists of a single file, you can simply do:
go run Setup.go

V
Vladislav Lyskov, 2018-10-04
@Vlatqa

go run?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question