NOTE

Go Functions

First-class functions, multiple returns, closures, methods, variadics, and value semantics.

GoCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

Functions are first-class values in Go: they can be assigned, passed, returned, and captured by closures. Functions may return multiple values and accept variadic arguments.

Arguments are passed by value; slices, maps, channels, pointers, interfaces, and function values contain references/descriptors whose copied values can still refer to shared underlying state. Methods are functions with a receiver and participate in method sets/interface satisfaction.

Loading helpful count