From c7e151d8c46dbf45b580a73ccb5ba5dd5b5cddef Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 19 Mar 2026 16:37:21 -0700 Subject: [PATCH] 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 Reviewed-by: Alan Donovan Reviewed-by: Robert Griesemer TryBot-Bypass: Robert Griesemer --- doc/go_spec.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index dbc89421cb..c7b929c2fa 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -2989,7 +2989,7 @@ Its type must be a defined type T o pointer to a defined type T, possibly followed by a list of type parameter names [P1, P2, …] enclosed in square brackets. T is called the receiver base type. 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 bound to its receiver base type and the method name is visible only within selectors for type T or *T. @@ -3410,7 +3410,7 @@ func(ch chan int) { ch <- ACK }(replyChan)

Function literals are closures: 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.

@@ -8341,7 +8341,7 @@ func init() { … }

-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 init identifier can be used only to declare init functions, yet the identifier itself is not declared. Thus @@ -8423,7 +8423,7 @@ type error interface {

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: