Content deleted Content added
No edit summary |
→Syntax: not sure this is useful, but give examples of returning both or neither of value+error, and change phrasing from "empty" since an "empty" int is 0 |
||
Line 54:
===Syntax===
Go's syntax includes changes from C aimed at keeping code concise and readable. The programmer needn't specify the types of expressions, allowing just <code>i := 3</code> or <code>s := "some words"</code> to replace C's <code>int i = 3;</code> or <code>char* s = "some words";</code>. Semicolons at the end of lines aren't required. Functions may return multiple, named values, and returning a <code>result, err</code> pair is the conventional way a function indicates an error to its caller in Go.{{efn|1=Usually, exactly one of the result and error values
===Types===
|