Directories ¶
Path | Synopsis |
---|---|
Anonymous self executing functions
|
Anonymous self executing functions |
Call function is a function that's passed into another function as an argument.
|
Call function is a function that's passed into another function as an argument. |
Go functions may be closures.
|
Go functions may be closures. |
A "defer" statement invokes a function whose execution is deferred to the moment the surrounding function returns, either because the surrounding function executed a return statement, reached the end of its function body, or because the corresponding goroutine is panicking.
|
A "defer" statement invokes a function whose execution is deferred to the moment the surrounding function returns, either because the surrounding function executed a return statement, reached the end of its function body, or because the corresponding goroutine is panicking. |
Functions are first class types in Go.
|
Functions are first class types in Go. |
In other words, what an interface tells a type is, "If you have methods that match my functions, then you are my type"
|
In other words, what an interface tells a type is, "If you have methods that match my functions, then you are my type" |
Recursion happens when a function calls itself.
|
Recursion happens when a function calls itself. |
Functions are first class types in Go and hence can be returned from a function just like any other type
|
Functions are first class types in Go and hence can be returned from a function just like any other type |
When we have a slice of some type, we can pass in the individual values in a slice by using the “...” operator.
|
When we have a slice of some type, we can pass in the individual values in a slice by using the “...” operator. |
We can create a function which takes an unlimited number of arguments Parameter that can accept unlimited number of arguments is known as a “variadic parameter.” We use the lexical element operator ...T to specify variadic parameter of type T
|
We can create a function which takes an unlimited number of arguments Parameter that can accept unlimited number of arguments is known as a “variadic parameter.” We use the lexical element operator ...T to specify variadic parameter of type T |
Click to show internal directories.
Click to hide internal directories.