Go doesn't compile “hello world”

Hi,

Please, after installing Go, it is not possible to compile “hello world”, help me solve it?

My operating system is Ubuntu 18.04.3 LTS.

‘Launchinglamundo-olamundo’ has encountered a problem.
The executable file (/ home / daniele / eclipse-workspace / olamundo / bin / olamundo) does not exist.

Opens this dialog.

I’m not sure you have the compiler installed right. Did you follow the oficial documentation? For Unix/Linux machines you can also use this installer.

It’s also possible to have a misconfiguration in your IDE (I saw an Eclipse there…)

I think, who are missing packages in this installation, were just giving me the coordinates, and I was installing, I don’t know, if you have the official documentation.

GitHub, I think that’s the problem, because it was tried to put the site, several times, and gave error, I opened a GitHub account.

I do not know, if there is, but I went to upgrade Ubuntu, and appeared error in Potstifix, had to be configured, were missing packages, only had 2 installed, so I uninstalled.

Ok, I’m a little lost… Did you install the compiler? If yes, then in a Terminal you must be able to execute go command, eg:

go version

If this command works try to execute in your project folder the command

go build

Doing this in the project folder you must find the executable. Going forward if you use and IDE on that machine you must see if you have some settings around Go compiler.

go version go1.10.4 linux/amd64
can’t load package: package .: no Go files in /home/daniele

I saw you already have an answer in the other topic you opened.

I couldn’t answer yesterday because I ran out of replies for the first day in the forum.

I still haven’t solved the problem.

Isn’t the same problem like in this topic?

Then he explained to me, which has to be package main, to execute, the file name was wrong, now compiled.

It is the same problem.
It’s just that I had put one in Portuguese, and the other in English, after you and he suggested to me in English. Thank you for helping me.

Thank you

I was able to compile hello world, I was putting package olamundo, instead of package main, in the executable.
I did not understand, the tests, that presented me. I do not understand programming, I want to learn the language Go.

I couldn’t understand, would these utilities have an easier way of understanding them?

As a beginner don’t start with the tests. Instead of this use a good book to learn the language and some basic techniques. Because you mention you are looking for an easy one I can recommend you this one

https://www.golang-book.com/books/intro

Well depends, but unfortunately you can’t avoid using them for seriously things. Start with the simplest first.

1 Like

Okay, I’ll read yes, thanks.

Hi Daniele,

I’m fairly new to Go, and I initially wanted to use Eclipse as my IDE. Don’t! The plugin for Go in Eclipse has not been maintained for quite some time and has many, many bugs. Instead, might I suggest using “Codium”. It is the best free editor on the market for Golang. This is the free and “untethered” version of Visual Studio Code, and is available for Windows and Linux.

Also, if you have a choice of platform, stick with a Linux based platform. It will save you from having to deal with the aggravations of dealing with Windows and all it’s idiosyncrasies.

Hi Ken,
I installed VS Code, how do I install Go, the one you mentioned?Captura%20de%20tela%20de%202019-12-19%2019-38-01|690x387