Learning GO / Very First Post /

Any recommendations on where to learn the basics in order to get started with the Go programming language?

My brother recommended that I learn to Go - so thought I’d dedicate the next month to learning the basics.

https://golang.org/doc/install#testing

Create a file named hello.go that looks like:

package main import “fmt” func main() { fmt.Printf(“hello, world\n”)

How do I create a file? No idea. I’m on an Apple. Do I create it via Textedit and rename file “hello.go” ?

Any direction would be appreciated.

Cheers

John

Once you have installed Go, you can read the basic article How to Write Go Code.

The Go Tour is also available for an interactive tour.

1 Like

I normally read books and performs all examples hands on. Please keep in mind that I have computer science and mechatronics engineering background that allows me to speed-read these technical books.

The first book that allows me to program Go is:

  1. https://astaxie.gitbooks.io/build-web-application-with-golang/en/

About Go Module

I’m not sure whether the Astaxie has updated the book with Go module yet. It had been 5 years already. If he has not done it, you MUST ask questions about Go module after reading this: https://blog.golang.org/using-go-modules

This is because no one uses the old GOPATH way to implement Go package anymore aside maintaining legacy packages.

The rest of the books are merely to show how Go is used in different approaches and implementations. Astaxie integrates some 3rd-party packages and I would suggest you read the codes rather than blindly use it.

More Computer Science and Engineering Knowledge

If you need to ramp up your Computer Science and Engineering domain knowledge, feel free to check out more books (some are free) here: https://github.com/dariubs/GoBookshttps://github.com/dariubs/GoBooks

1 Like

Yes, that is possible. Make sure you save the file as plain text.

1 Like

Oh yeah, if you are a daredevil, try vim: https://www.openvim.com/.

1 Like

so what will the file be Hello.Go or hello.go.txt?

You already quoted from the official docs what the expected name is.

Go searches for *.go files to compile.

2 Likes

i used this for starters. Shouldnt take too long.

after that there’s a youtube channel
https://www.youtube.com/channel/UCx9QVEApa5BKLw9r8cnOFEA

Should be relatively easy to get all best practices and tricks from them

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.