spec: s/defined/declared/ in a handful of places (cleanup)

Use "declared" rather than "defined" where referring to a declaration
(rather than a type definition) is more appropriate.

Change-Id: I691b55e05fcdce489e45286c7a88cbd992e80e57
Reviewed-on: https://go-review.googlesource.com/c/go/+/757121
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
This commit is contained in:
Robert Griesemer
2026-03-19 16:37:21 -07:00
committed by Gopher Robot
parent 39267791a4
commit c7e151d8c4

View File

@@ -2989,7 +2989,7 @@ Its type must be a <a href="#Type_definitions">defined</a> type <code>T</code> o
pointer to a defined type <code>T</code>, possibly followed by a list of type parameter
names <code>[P1, P2, …]</code> enclosed in square brackets.
<code>T</code> is called the receiver <i>base type</i>. A receiver base type cannot be
a pointer or interface type and it must be defined in the same package as the method.
a pointer or interface type and it must be declared in the same package as the method.
The method is said to be <i>bound</i> to its receiver base type and the method name
is visible only within <a href="#Selectors">selectors</a> for type <code>T</code>
or <code>*T</code>.
@@ -3410,7 +3410,7 @@ func(ch chan int) { ch &lt;- ACK }(replyChan)
<p>
Function literals are <i>closures</i>: they may refer to variables
defined in a surrounding function. Those variables are then shared between
declared in a surrounding function. Those variables are then shared between
the surrounding function and the function literal, and they survive as long
as they are accessible.
</p>
@@ -8341,7 +8341,7 @@ func init() { … }
</pre>
<p>
Multiple such functions may be defined per package, even within a single
Multiple such functions may be declared per package, even within a single
source file. In the package block, the <code>init</code> identifier can
be used only to declare <code>init</code> functions, yet the identifier
itself is not <a href="#Declarations_and_scope">declared</a>. Thus
@@ -8423,7 +8423,7 @@ type error interface {
<p>
It is the conventional interface for representing an error condition,
with the nil value representing no error.
For instance, a function to read data from a file might be defined:
For instance, a function to read data from a file might be declared:
</p>
<pre>