diff --git a/doc/go_spec.html b/doc/go_spec.html index 5f640fb4b8..cf31cd3063 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1065,8 +1065,11 @@ ParameterDecl = [ IdentifierList ] [ "..." ] Type .

Within a list of parameters or results, the names (IdentifierList) must either all be present or all be absent. If present, each name -stands for one item (parameter or result) of the specified type; if absent, each -type stands for one item of that type. Parameter and result +stands for one item (parameter or result) of the specified type and +all non-blank names in the signature +must be unique. +If absent, each type stands for one item of that type. +Parameter and result lists are always parenthesized except that if there is exactly one unnamed result it may be written as an unparenthesized type.

@@ -1532,8 +1535,8 @@ Go is lexically scoped using blocks:
  • The scope of the package name of an imported package is the file block of the file containing the import declaration.
  • -
  • The scope of an identifier denoting a function parameter or - result variable is the function body.
  • +
  • The scope of an identifier denoting a method receiver, function parameter, + or result variable is the function body.
  • The scope of a constant or variable identifier declared inside a function begins at the end of the ConstSpec or VarSpec @@ -1988,8 +1991,15 @@ is visible only within selectors for that type.

    -For a base type, the non-blank names of -methods bound to it must be unique. +A non-blank receiver identifier must be +unique in the method signature. +If the receiver's value is not referenced inside the body of the method, +its identifier may be omitted in the declaration. The same applies in +general to parameters of functions and methods. +

    + +

    +For a base type, the non-blank names of methods bound to it must be unique. If the base type is a struct type, the non-blank method and field names must be distinct.

    @@ -2015,12 +2025,6 @@ with receiver type *Point, to the base type Point.

    -

    -If the receiver's value is not referenced inside the body of the method, -its identifier may be omitted in the declaration. The same applies in -general to parameters of functions and methods. -

    -

    The type of a method is the type of a function with the receiver as first argument. For instance, the method Scale has type @@ -4599,7 +4603,7 @@ func complexF2() (re float64, im float64) {

  • The expression list may be empty if the function's result - type specifies names for its result parameters (§Function Types). + type specifies names for its result parameters (§Function types). The result parameters act as ordinary local variables and the function may assign values to them as necessary. The "return" statement returns the values of these variables.