Skip to content

Commit

Permalink
Fixed grammar, added explanation of function signature and arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelMarks committed Apr 22, 2015
1 parent 8071dd3 commit 3bf74b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions go.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand All @@ -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

Expand Down

0 comments on commit 3bf74b3

Please sign in to comment.