Welcome & Hello World
Go (often called Golang) is a statically-typed, compiled programming language designed at Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. Known for its simplicity, lightning-fast compilation, and first-class concurrency features, it is the backend language of choice for cloud infrastructure (Docker, Kubernetes) and microservices.
Unlike languages that require virtual machine layers (like Java's JVM) or interpreted runtimes (like Python), Go compiles directly into **a single, self-contained static binary** containing all standard libraries. This eliminates environment dependency issues on target servers and allows Go applications to start up instantly with minimal memory footprints.
Let's write a standard Hello World code template in Go. Write and compile this in the editor:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
fmt.Print("Welcome to Our Go Compiler!")
}
Let's analyze the syntax components:
- package main: Declares that this source file belongs to the `main` package, telling the Go compiler to generate an executable binary rather than a shared library.
- import "fmt": Injects the standard formatting package, housing output utilities like `Println()`.
- func main(): The mandatory entry point function for every executable Go program.
- fmt.Println(): Prints text to the screen and appends a trailing newline.