Thuta Learning
BasicProgrammingbeginner

What is Go?

Relax. We'll talk through this in plain words — no textbook voice.

Go is a compiled programming language created by Google, and it's popular for being simple, fast, and easy to write concurrent programs with. When you run a Go file, it compiles down to machine code before running, which is why it's fast and stable for server-side applications.

go
package main

import "fmt"

func main() {
    fmt.Println("Hello, Go!")
}

In this code, package main marks this as an executable program. import "fmt" imports the package used to print messages to the screen, and func main() is where the program starts running.

You should see
Hello, Go!

Info

In Go, an unused import or unused variable will cause a compile error. It might feel a bit strict at first, but it helps keep your code clean in real projects.

Easy traps

  • If you don't save the file with a .go extension, like hello.go, the Go tool won't recognize it as a source file.