diff options
author | Samuel Marks <samuelmarks@gmail.com> | 2015-04-22 23:54:16 +1000 |
---|---|---|
committer | Samuel Marks <samuelmarks@gmail.com> | 2015-04-22 23:54:16 +1000 |
commit | 3bf74b3ddae006353069218563cbcd370c88aaaa (patch) | |
tree | 8534260c658b44571aa0575be7d2304fa1f3d471 | |
parent | 8071dd3f6bac3ad4cb37b0d585067ca323f0d109 (diff) |
Fixed grammar, added explanation of function signature and arguments
-rw-r--r-- | go.html.markdown | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/go.html.markdown b/go.html.markdown index 9b9758b4..9fce7a9b 100644 --- a/go.html.markdown +++ b/go.html.markdown @@ -64,7 +64,11 @@ func beyondHello() { learnTypes() // < y minutes, learn more! } -// Functions can have parameters and (multiple!) return values. +/* <- multiline comment +Functions can have parameters and (multiple!) return values. +Here `x`, `y` are the arguments and `sum`, `prod` is the signature (what's returned). +Note that `x` and `sum` receive the type `int`. +*/ func learnMultiple(x, y int) (sum, prod int) { return x + y, x * y // Return two values. } @@ -83,7 +87,7 @@ can include line breaks.` // Same string type. f := 3.14195 // float64, an IEEE-754 64-bit floating point number. c := 3 + 4i // complex128, represented internally with two float64's. - // Var syntax with an initializers. + // var syntax with initializers. var u uint = 7 // Unsigned, but implementation dependent size as with int. var pi float32 = 22. / 7 |