From a656390b6986c3d559873b64683aa3454a151115 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 25 Aug 2016 21:01:17 -0700 Subject: [PATCH] spec: clarify text on init functions For #16874. Change-Id: I2e13f582297606e506d805755a6cfc1f3d4306a2 Reviewed-on: https://go-review.googlesource.com/27817 Reviewed-by: Rob Pike --- doc/go_spec.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 75dc2e4634..77ece54d52 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -2320,7 +2320,7 @@

Composite literals

A slice literal describes the entire underlying array literal. -Thus, the length and capacity of a slice literal are the maximum +Thus the length and capacity of a slice literal are the maximum element index plus one. A slice literal has the form

@@ -6162,9 +6162,10 @@

Package initialization

-Multiple such functions may be defined, even within a single -source file. The init identifier is not -declared and thus +Multiple such functions may be defined 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 init functions cannot be referred to from anywhere in a program.