Sunday, 16 August 2015

Basic Go: Functions

A function can take zero or more arguments.
In this example, add takes two parameters of type int.
Notice that the type comes after the variable name.


When two or more consecutive named function parameters share a type, you can omit the type from all but the last.
In this example, we shortened
x int, y int
to
x, y int



Do comment if it Worked/Not Worked for you.

No comments:

Post a Comment