Skip to content

Commit 990113f

Browse files
ianlancetaylorgopherbot
authored andcommitted
doc/go1.21: reformat flag init change note
It reads better as a single paragraph. Also added links. Change-Id: Id6ba54111b63fbd536423272f674e0eb64b087a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/499956 TryBot-Bypass: Ian Lance Taylor <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent fecb31f commit 990113f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

doc/go1.21.html

+13-3
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,19 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
568568
</p>
569569

570570
<p><!-- CL 480215 -->
571-
A flag definition (via <code>Bool</code>, <code>BoolVar</code>, <code>Int</code>, <code>IntVar</code>, etc.) will panic if <code>Set</code> has already been called on a flag with the same name.
572-
<p>
573-
This change is intended to detect cases where <a href="#language">changes in initialization order</a> cause flag operations to occur in a different order than expected. In many cases the fix to this problem is to introduce a explicit package dependence to correctly order the definition before any <code>Set</code> operations.
571+
A flag definition
572+
(via <a href="/pkg/flag/#Bool"><code>Bool</code></a>,
573+
<a href="/pkg/flag/#BoolVar"><code>BoolVar</code></a>,
574+
<a href="/pkg/flag/#Int"><code>Int</code></a>,
575+
<a href="/pkg/flag/#IntVar"><code>IntVar</code></a>, etc.)
576+
will panic if <a href="/pkg/flag/#Set"><code>Set</code></a> has
577+
already been called on a flag with the same name. This change is
578+
intended to detect cases where <a href="#language">changes in
579+
initialization order</a> cause flag operations to occur in a
580+
different order than expected. In many cases the fix to this
581+
problem is to introduce a explicit package dependence to
582+
correctly order the definition before any
583+
<a href="/pkg/flag/#Set"><code>Set</code></a> operations.
574584
</p>
575585
</dd>
576586
</dl><!-- flag -->

0 commit comments

Comments
 (0)