Go doesn't compile “hello world”

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

To download Golang use this url : https://golang.org/dl/

To install on VS Code, have to download?

You can install VS Code alone, separet from Golang. There is no depedencies. Just do this

  1. Download Go and install. Check it is running OK by issuing any go command in your terminal
  2. Dowonload VSCode and install it
  3. Download Go plugin for VSCode (inside VSCode)
  4. Just edit your hello world and try to compile and execute from VSCode

In graphic form, from ubuntu, comes the VS Code, the one that I installed, the Go, is installed, in Eclipse, was by the terminal, then you have to download again, to install in VS Code?

If you had already installed go and vscode just install the go plugin for vscode