Your First Program and Output
Your first Go program: package main, import and fmt.Println.
Go is a simple and fast language from Google: as strict as Java but noticeably more concise. It compiles instantly and runs at nearly C++ speed.
Every Go program starts with a package declaration. An executable program lives in the main package and starts from the main function. Press "Run".
Go
Your first Go program
Let's break down the structure:
• package main — the package declaration: for an executable it is always main;
• import "fmt" — imports the formatted input/output package;
• func main() { ... } — the entry point;
• fmt.Println(...) — prints with a trailing newline; several values are separated by commas, and Go inserts the space between them itself.
A Go peculiarity: an unused import or variable is a compilation error, not a warning. The language forces you to keep the code clean.
Go
Println can print text and calculations
Task: print three lines — your name, your city and the result of 7 * 6.
Once it works, mark the lesson as completed and move on to variables.