]> Cypherpunks repositories - gostls13.git/commitdiff
spec: every type has a method set (minor clarification)
authorRobert Griesemer <gri@golang.org>
Wed, 17 Feb 2021 05:05:08 +0000 (21:05 -0800)
committerRobert Griesemer <gri@golang.org>
Sat, 20 Feb 2021 00:01:22 +0000 (00:01 +0000)
The spec states that a type "may" have a method set associated with it.
Yet every type has a method set, which may be empty. This is clarified
later in the same paragraph. Be clear in the first sentence as well.

Per the suggestion from https://github.com/DQNEO.

Fixes #44318.

Change-Id: I6097b1c7062853e404b7fead56d18a7f9c576fc3
Reviewed-on: https://go-review.googlesource.com/c/go/+/292853
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc/go_spec.html

index 59c9ce3c434e67614bf3e906f820a854e57b1f0b..e22fabd699ed4f2a89adf50fd1df184d02545105 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of Feb 10, 2021",
+       "Subtitle": "Version of Feb 19, 2021",
        "Path": "/ref/spec"
 }-->
 
@@ -830,7 +830,7 @@ The underlying type of <code>[]B1</code>, <code>B3</code>, and <code>B4</code> i
 
 <h3 id="Method_sets">Method sets</h3>
 <p>
-A type may have a <i>method set</i> associated with it.
+A type has a (possibly empty) <i>method set</i> associated with it.
 The method set of an <a href="#Interface_types">interface type</a> is its interface.
 The method set of any other type <code>T</code> consists of all
 <a href="#Method_declarations">methods</a> declared with receiver type <code>T</code>.