Go Packages
Jump to navigation
Jump to search
Internal
Overview
A Go package is a collection of variables, functions and type definitions, such as structs, and interfaces.
Go modularization is build upon the concept of package. Packages provide a namespace for their names, and also the mechanisms to encapsulate code, hide implementation details and only expose features, such as variables, types or functions that are meant to be publicly consumed.
Package are declared by writing multiple code files annotated with the same package
name, and are consumed in other packages by importing them with the import
keyword.