August 2019
Beginner to intermediate
798 pages
17h 2m
English
What differentiates private variables and functions from public ones is that private ones can be strictly used and called internally in a package. Controlling which functions, constants, and variables are public or not is also known as encapsulation.
Go follows a simple rule that states that functions, variables, types, and so forth that begin with an uppercase letter are public, whereas functions, variables, types, and so on that begin with a lowercase letter are private. This is the reason that fmt.Println() is named Println() instead of println(). However, this rule does not affect package names that are allowed to begin with uppercase and lowercase letters.
Read now
Unlock full access