Naming Conventions for Golang Functions
- A name must begin with a letter, and can have any number of additional letters and numbers.
- A function name cannot start with a number.
- A function name cannot contain spaces.
- If the functions with names that start with an uppercase letter will be exported to other packages. If the function name starts with a lowercase letter, it won't be exported to other packages, but you can call this function within the same package.
- If a name consists of multiple words, each word after the first should be capitalized like this: empName, EmpAddress, etc.
- function names are case-sensitive (car, Car and CAR are three different variables).
Most Helpful This Week
Anonymous Functions in Golang
Golang Functions Returning Multiple Values
Creating a Function in Golang
User Defined Function Types in Golang
Simple function with parameters in Golang
Closures Functions in Golang
Golang Passing Address to a Function
What is Function in Golang
Simple function with return value in Golang
Higher Order Functions in Golang
The return values of a function can be named in Golang