Notes for a Java developer
Go is C with a garbage collector, cheap threads, and a package manager.
No VM. No JIT. No classes, no inheritance, no exceptions. Eleven sections, every example editable and compiled by the real Go toolchain — break them and read the error.
Functions & syntax
Types come after names. No void. Multiple return values.
02Methods & receivers
A method is a function with an extra parameter list glued on the front.
03Implicit interfaces
The biggest idea in Go. Interfaces are declared by the consumer, not the producer.
04Closures
Functions are values, they capture variables, and they replace most small classes.
05Errors are values
No exceptions, no stack unwinding. You return errors and the caller checks them.
06Memory & escape analysis
The compiler decides stack vs heap. Perf work in Go means "make this not allocate".
07Goroutines & channels
go f() costs ~2KB. A million of them is normal.
08defer
finally, but attached to a statement and scoped to the function.
09Packages, imports & layout
A package is a directory. Capitalization is the access modifier.
10Debugging & profiling
No JFR, no heap dump. Profiles instead — and they are good.
11Gotchas
The list worth flashcarding. Each one has bitten everybody.