1
0
mirror of https://github.com/golang/go synced 2024-09-24 05:20:13 -06:00
Commit Graph

4113 Commits

Author SHA1 Message Date
Russ Cox
865911424d doc: update Go memory model
Following discussion on #47141, make the following changes:

- Document Go's overall approach.
- Document that multiword races can cause crashes.
- Document happens-before for runtime.SetFinalizer.
- Document (or link to) happens-before for more sync types.
- Document happens-before for sync/atomic.
- Document disallowed compiler optimizations.

See also https://research.swtch.com/gomm for background.

Fixes #50859.

Change-Id: I17d837756a77f4d8569f263489c2c45de20a8778
Reviewed-on: https://go-review.googlesource.com/c/go/+/381315
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-06-04 18:42:07 +00:00
Russ Cox
fc66cae490 doc/go1.19: remove TODO about LimitedReader
Rolled back in CL 410133.

For #51115.

Change-Id: I009c557acf98a98a9e5648fa82d998d41974ae60
Reviewed-on: https://go-review.googlesource.com/c/go/+/410357
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-06-04 16:11:54 +00:00
Michael Pratt
9d3dbd78c7 doc/go1.19: add TODOs for undocumented runtime features
As of this CL, release notes for all packages owned by @golang/runtime
on https://dev.golang.org/owners are either complete or have explicit
TODOs.

For #51400

Change-Id: I5b6affd43883991a3b8a065b4aa211efce7427f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/410118
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-06-03 20:54:52 +00:00
Michael Pratt
54a2f4b676 doc/go1.19: add release notes for runtime packages
This documents most of the changes in runtime packages, which the major
exception of GC changes, which will be documented in a future CL.

For #51400

Change-Id: Ibcf501e1b4f7caa3397db6b9136daec07aac5a65
Reviewed-on: https://go-review.googlesource.com/c/go/+/410117
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-06-03 20:54:45 +00:00
Michael Pratt
e1036a741c doc/go1.19: add release notes for syscall
For #51400

Change-Id: If5fc131df254d47a989ff61c8e584cb8149cbd09
Reviewed-on: https://go-review.googlesource.com/c/go/+/410116
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-06-03 19:57:46 +00:00
Michael Pratt
559b17fe34 doc/go1.19: add release notes for sync/atomic
For #51400

Change-Id: I32a3aedf1e8a52148a9d78c4f7dae1ea59c810b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/410115
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-06-03 19:57:35 +00:00
Bryan C. Mills
74dc84a0e5 doc/go1.19: add a release note for CL 404134
For #51473.

Change-Id: I01a35e5ebc83b8b72e414ed1730e9147ea590959
Reviewed-on: https://go-review.googlesource.com/c/go/+/409176
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-06-02 20:39:24 +00:00
Bryan C. Mills
3b6b9a7ef0 doc/go1.19: add release note for CL 398058
Change-Id: I483de9a6a2016432df13e030c675d42470db9ed1
Reviewed-on: https://go-review.googlesource.com/c/go/+/409175
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-06-02 20:39:23 +00:00
Keith Randall
a21cf916f4 doc: add release note for reflect.Value.{Bytes,Len,Cap}
Update #47066
Update #52411

Change-Id: I85139d774c16c9e6d1a2592a5abba58a49338674
Reviewed-on: https://go-review.googlesource.com/c/go/+/408874
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
2022-05-30 15:47:08 +00:00
Ian Lance Taylor
52f68efa45 mime: ignore .js => text/plain in Windows registry
This seems to be a common registry misconfiguration on Windows.

Fixes #32350

Change-Id: I68c617c42a6e72948e2acdf335ff8e7df569432d
Reviewed-on: https://go-review.googlesource.com/c/go/+/406894
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2022-05-28 20:07:28 +00:00
Rhys Hiltner
1247354a08 doc/go1.19: mention runtime/trace's CPU samples
Change-Id: Ia8becc3e28523e9b1da4f7a274c800309add331a
Reviewed-on: https://go-review.googlesource.com/c/go/+/408994
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
2022-05-28 00:28:55 +00:00
Keith Randall
42f1b37b7b doc: fix up race detector release note
It's already mentioned under runtime/race, we don't need it
also mentioned under runtime.

Change-Id: I538322b32d75b9642f3ead03539fccb95988ef8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/408875
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Rhys Hiltner <rhys@justin.tv>
2022-05-27 15:13:07 +00:00
Rhys Hiltner
f5b5273190 doc/go1.19: don't mention golang.org/x/crypto/ssh
CL 392134 appears to have been marked for the release notes by accident.
Remove mention of this package.

Change-Id: I62ae30512512ef8e20e9040b71e613be5ee5ee26
Reviewed-on: https://go-review.googlesource.com/c/go/+/408819
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Auto-Submit: Alex Rakoczy <alex@golang.org>
2022-05-27 15:07:03 +00:00
George Looshch
fd0ffedae2 doc: replace tabs with spaces for alignment in code snippets
Fixes #52255

Change-Id: Ibb518cf2f6bac9e1ffc426a014afe80cc4c0df5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/399394
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-05-26 23:22:37 +00:00
Koichi Shiraishi
55c42c2892 doc/go1.19: fix strconv.Quote pkg link
For #51400.

Change-Id: I122b3a58e5fbaaa8ceb5b013e8e392f4bcbbd2e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/408495
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-05-26 22:25:23 +00:00
Ian Lance Taylor
e6d8b05a61 Revert "reflect: deprecate (Slice|String)Header"
This reverts CL 401434.

Reason for revert: We should't deprecate these without a replacement.

Fixes #53079

Change-Id: I5515b03e39787d4e528a98c733cdb643b86b17ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/408815
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-05-26 18:56:07 +00:00
Eli Bendersky
581a63c93c doc/go1.19: add pdqsort change to release notes
Change-Id: I4a36491e561f3b2112f980ff580fa4f85d501b6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/408834
Auto-Submit: Eli Bendersky‎ <eliben@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Eli Bendersky‎ <eliben@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2022-05-26 14:42:13 +00:00
Koichi Shiraishi
0ab71cc065 doc/go1.19: fix reflect pkg link and "a" section
Change-Id: Ica05b2b699d8f6383c713460a473ccf753bc78c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/408494
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-26 04:57:33 +00:00
Carlos Amedee
b6bcd0d135 doc/go1.19: update Go 1.19 relese note TODOs using relnote
This updates the release notes with TODOs using relnote. It also
changes all refrences of golang.org to go.dev.

For #51400.

Change-Id: I8a210140483aed7c41fe47242041e4b363e2eb10
Reviewed-on: https://go-review.googlesource.com/c/go/+/408217
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-05-24 21:25:09 +00:00
Carlo Alberto Ferraris
bc2e961cf4 reflect: deprecate (Slice|String)Header
As discussed in CL 401434 there are substantial misuses of these in the
wild, and they are a potential source of unsafety even for code that
does not use them directly.

We should either keep them as-is and document when/how they can be used
safely, or deprecate them so that uses will eventually die out.

After some discussion, it was decided to deprecate them outright.
Since the docs already mentioned that they may be unstable across
releases, it should be possible to get rid of them completely later on.

Change-Id: I3b75819409177b5a286c1e9861a2edb6fd1301b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/401434
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-05-18 15:15:29 +00:00
John Bampton
b2116f748a all: fix spelling
Change-Id: Iee18987c495d1d4bde9da888d454eea8079d3ebc
GitHub-Last-Rev: ff5e01599d
GitHub-Pull-Request: golang/go#52949
Reviewed-on: https://go-review.googlesource.com/c/go/+/406915
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-05-17 21:46:33 +00:00
Keith Randall
d23c80b8e4 doc: update jump table performance release note
Just make it clearer that the performance gains are for the switch
statement itself, not the whole program.

Change-Id: I2d1bf2888f61112af3dc37113e740b00b092e2cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/406874
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-05-17 19:40:11 +00:00
Robert Griesemer
da0a6f4b57 spec: fix prose about promoted methods of embedded fields
The types of embedded fields must be named, but they don't
need to be defined types (e.g. if the type name is an alias).

Fixes #41687.

Change-Id: Ib9de65dfab0e23c27d8303875fa45c217aa03331
Reviewed-on: https://go-review.googlesource.com/c/go/+/406054
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-05-12 22:29:02 +00:00
Robert Griesemer
f269d90bf2 spec: use original terminology in metasyntax (cleanup)
The metasyntax used in the spec is exactly the Wirth Syntax
Notation (WSN), which eventually influenced EBNF. Add a link
but keep mentioning EBNF which is likely more commonly known.

Use the original terms in the productions. Specifically, use
the words "Term" and "Factor" rather than "Alternative" and
"Term".

The terminology cleanup also resolves an inconsistency in the
subsequent prose which is referring to the correct "terms" now.

While at it, add a production for the entire Syntax itself,
matching the original WSN definition.

Also, replace the two uses of "grammar" with "syntax" for
consistency ("syntax" is the prevalent term used throughout
the spec).

Fixes #50074.

Change-Id: If770d5f32f56f509f85893782c1dafbb0eb29b2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/405814
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-05-12 19:04:52 +00:00
Robert Griesemer
1dfe994fe9 spec: use Unicode terminology consistently
- refer to character "categories" rather than "classes" per the
  definitions in the Unicode standard
- use "uppercase", "lowercase" (one word) instead of "upper case"
  or "upper-case", matching the spelling in the Unicode standard
- clarify that that the blank character "_" is considered a lowercase
  letter for Go's purposes (export of identifiers)

Fixes #44715.

Change-Id: I54ef177d26c6c56624662fcdd6d1da60b9bb8d02
Reviewed-on: https://go-review.googlesource.com/c/go/+/405758
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-05-12 19:04:46 +00:00
Robert Griesemer
2bea43b0e7 spec: state that variable names must be unique in short var decls
Fixes #45652.

Change-Id: I5e1434480c12815369a6ce204f3729eb63139125
Reviewed-on: https://go-review.googlesource.com/c/go/+/405757
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-12 04:47:29 +00:00
Robert Griesemer
c01feba15d spec: clarify "continue" statement
Taking into account the discussion and relevant feedback on a
change proposed in 2013 (see e-mail thread mentioned in issue).

Fixes #48864.

Change-Id: I811d518b7cbdf6b815695174f1da3d4251f491c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/405756
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-05-12 04:47:23 +00:00
Robert Griesemer
7e11ff3816 spec: correct assignment rules with respect to type parameters
Fixes #52628.

Change-Id: If4261abc25868d62f7689253d40f872692c23a4d
Reviewed-on: https://go-review.googlesource.com/c/go/+/405755
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-05-12 04:47:18 +00:00
Robert Griesemer
5d0400c72d spec: adjust scope of function/method type parameters
Change scope rules per the accepted proposal #52038.
Match prose for type parameters of type declarations.
Fixing the implementation is tracked by #51503.

Fixes #52038.
For #51503.

Change-Id: Iebd88a82c896b7b2e8520cd514ef6a2cc903e807
Reviewed-on: https://go-review.googlesource.com/c/go/+/405754
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-12 04:47:13 +00:00
Keith Randall
e0ae8540ab doc: mention jump tables and tsan upgrades in 1.19 release notes
Change-Id: I0ab34f2f931e0e712218e4eb086f4535cc17775c
Reviewed-on: https://go-review.googlesource.com/c/go/+/405614
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-11 05:57:07 +00:00
Filippo Valsorda
f0ee7fda63 crypto/tls: remove tls10default GODEBUG flag
Updates #45428

Change-Id: Ic2ff459e6a3f1e8ded2a770c11d34067c0b39a8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/400974
Reviewed-by: Filippo Valsorda <valsorda@google.com>
Auto-Submit: Filippo Valsorda <valsorda@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Filippo Valsorda <valsorda@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2022-04-27 17:20:34 +00:00
Bryan C. Mills
b34838913d os/exec: set PWD implicitly if Dir is non-empty and Env is nil
Fixes #50599.

Change-Id: I4e5dbb3972cdf21ede049567bfb98f2c992c5849
Reviewed-on: https://go-review.googlesource.com/c/go/+/401340
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-21 17:37:05 +00:00
Robert Griesemer
0e08b02ac5 spec: clarify rules for type set construction of an interface
Be explicit that we always mean non-interface types when we
talk about sets of types.

Also, clarify that the quantification "all non-interface types"
means all such types in all possible programs, not just the
current program.

Per suggestion from Philip Wadler.

Change-Id: Ibc7b5823164e547bfcee85d4e523e58c7c27ac8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/398655
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-04-19 23:42:38 +00:00
Bryan C. Mills
0670afa1b3 doc/go1.19: move the description of the runtime.GOROOT change from 'cmd/go' to 'runtime'
Even though the change in the behavior of 'runtime.GOROOT' was
not actually due to a change in the runtime package proper, I
suspect that users who notice it will look for the release note
in that section, not the 'cmd/go' section.

Fixes #51461.

Change-Id: I271752968d4152a7fdf3e170537e3072bf87ce86
Reviewed-on: https://go-review.googlesource.com/c/go/+/400814
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-19 16:24:48 +00:00
Bryan C. Mills
d85694ab4f doc/go1.19: document cmd/go changes involving -trimpath
Updates #51461.

Change-Id: Ie878a9f630062d62027de895750a070b50428a9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/399214
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-12 22:05:26 +00:00
Ian Lance Taylor
6f6942ef7a doc/go1.19: use the right package error.Is arguments
They were swapped.

Fixes #52205

Change-Id: Iea2626aa2204f3bc96d08c571a1aa669436a32ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/398895
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-04-07 20:39:32 +00:00
Nigel Tao
3a0cda43a4 image/draw: have draw.Src preserve NRGBA colors
This reverts a behavior change introduced in Go 1.18 (commit 9f69a443;
CL 340049). In Go 1.17 and earlier, draw.Draw(etc, draw.Src) with
image.NRGBA dst and src images would pass through a (heap allocated)
color.Color interface value holding a color.NRGBA concrete value.
Threading that color.NRGBA value all the way through preserves
non-premultiplied alpha transparency information (distinguishing e.g.
transparent blue from transparent red).

CL 340049 optimized out that heap allocation (per pixel), calling new
SetRGBA64At and RGBA64At methods instead. However, these methods (like
the existing image/color Color.RGBA method) work in premultiplied alpha,
so any distinction between transparent colors is lost.

This commit re-introduces the preservation of distinct transparencies,
when dst and src are both *image.NRGBA (or both *image.NRGBA64) and the
op is draw.Src.

Fixes #51893

Change-Id: Id9c64bfeeaecc458586f169f50b99d6c8aa52a7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/396795
Trust: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-04-07 10:41:34 +00:00
Jared Horvat
0b3cb1a56c doc/go_spec.html: update type identity example
In the Type identity section, the example provides various types as givens.

The example refers to the type *T5, but it is not provided in the givens.

I am assuming this was a typo, and was meant to refer to *A1 or *B1.
*B1 seems to be in alignment with the rest of the provided examples.

Change-Id: I554319ee8bca185c3643559321417e8b2a544ba0
GitHub-Last-Rev: e80560d32a
GitHub-Pull-Request: golang/go#52143
Reviewed-on: https://go-review.googlesource.com/c/go/+/398075
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
2022-04-04 21:36:50 +00:00
Ian Lance Taylor
85b5f86584 net: support error.Is of network errors and context errors
Change timeouts to be Is(context.DeadlineExceeded) and cancelation to
be Is(context.Canceled).

Fixes #51428

Change-Id: Ic580bd9da0f338e993fb79138875a78d99cc1a1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/396877
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-04-03 15:43:15 +00:00
Zach Collier
01c83be793 doc: add illegal octal over 255 example
Octal values over 255, like \400 or \777, are illegal.  It wasn't clear if the expected behavior was a compile error, encoding the value as two characters, or if the value would be capped at 255.

This example explicitly shows that octal values over 255 are illegal.

Change-Id: I45d94680107029c5f083e5d434e6270cc5b258c1
GitHub-Last-Rev: f6bef0379f
GitHub-Pull-Request: golang/go#52111
Reviewed-on: https://go-review.googlesource.com/c/go/+/397555
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
2022-04-02 17:45:45 +00:00
Ian Lance Taylor
31ee4bb28d strconv: quote rune 007F as \x7f, not \u007f
\u007f is not wrong but it's weird to use \u when we could use the
shorter \x.

Fixes #52062

Change-Id: Ica4bdc2463128051876f44e15297ed1e9edf1de8
Reviewed-on: https://go-review.googlesource.com/c/go/+/397255
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2022-03-31 20:37:15 +00:00
Robert Griesemer
ea858734be spec: clarify type term restriction for type parameters
Be clear that the type of a term (not the term itself, which may
be of the form ~P) cannot be a type parameter.

For #50420.

Change-Id: I388d57be0618393d7ebe2c74ec04c1ebe3f33f7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/396915
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-31 01:01:43 +00:00
Ian Lance Taylor
1724077b78 doc/go1.19: mention new unix build constraint
For #51572

Change-Id: Ib27be79379c8b3f72e29365b58067d7ee1919e52
Reviewed-on: https://go-review.googlesource.com/c/go/+/396295
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-03-29 02:25:12 +00:00
Robert Griesemer
fe75fe3c7a spec: various minor clarifications
- Allow for a type parameter as length/capacity to make.
- Be slightly more precise in prose for append.
- Add a couple of links.

Change-Id: Ib97e528bab1ab55d271beeeb53d9bb7a07047b9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/391754
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-11 06:00:18 +00:00
Robert Griesemer
59d80227ef spec: clean up intro and replace bolded text with prose
- Remove "Draft" disclaimer. We're not done but the spec
  is in usable shape with respect to generics features.

- Remove section on "Earlier version" and fold information
  into the "Intro" section.

- Remove caveat for shifts: the rules for arithmetic operators
  on type parameters apply for them as well.

- Simply state that we don't support arguments of type parameter
  type for the built-ins real, imag, and complex.

Fixes #51182.

Change-Id: I6df1427de685cfe7055b64e91753aa7ebff70565
Reviewed-on: https://go-review.googlesource.com/c/go/+/391695
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-11 06:00:14 +00:00
Robert Griesemer
00535b8398 spec: remove note re: field accesses on type literals
For #51576.

Change-Id: I43f72c3fb618e724d46360a70ab9f8abc3d63273
Reviewed-on: https://go-review.googlesource.com/c/go/+/391137
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-10 01:57:27 +00:00
Robert Griesemer
6fb07317e5 spec: more adjustments/corrections
- Change section title from "Type parameters lists" to
  "Type parameter declarations" as the enclosing section
  is about declarations.

- Correct section on parsing ambiguity in type parameter
  lists.

- Rephrase paragraphs on type parameters for method receivers
  and adjust examples.

- Remove duplicate prose in section on function argument type
  inference.

- Clarified "after substitution" column in Instantiations section.

Change-Id: Id76be9804ad96a3f1221e5c4942552dde015dfcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/390994
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-10 01:57:22 +00:00
Robert Griesemer
46f352de2d spec: remove notion of specific types
Specific types were introduced to explain rules for operands of
type parameter type. Specific types are really an implementation
mechanism to represent (possibly infinite) type sets in the machine;
they are not needed in the specification.

A specific type is either standing for a single named or unnamed
type, or it is the underlying (unnamed) type of an infinite set of
types. Each rule that applies to a type T of the set of specific
types must also apply to all types T' in the type set for which T
is a representative of. Thus, in the spec we can simply refer to
the type set directly, infinite or not.

Rather then excluding operands with empty type sets in each instance,
leave unspecified what happens when such an operand is used. Instead
give an implementation some leeway with an implementation restriction.

(The implementation restriction also needs to be formulated for types,
such as in conversions, which technically are not "operands". Left for
another CL.)

Minor: Remove the two uses of the word "concrete" to refer to non-
interface types; instead just say "non-interface type" for clarity.

Change-Id: I67ac89a640c995369c9d421a03820a0c0435835a
Reviewed-on: https://go-review.googlesource.com/c/go/+/390694
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-10 01:57:17 +00:00
Robert Griesemer
6e63be7b69 spec: document that type inference doesn't apply to generic types
Type inference for types was always a "nice to have" feature.
Given the under-appreciated complexity of making it work in all
cases, and the fact that we don't have a good understanding of
how it might affect readability of generic code, require explicit
type arguments for generic types.

This matches the current implementation.

Change-Id: Ie7ff6293d3fbea92ddc54c46285a4cabece7fe01
Reviewed-on: https://go-review.googlesource.com/c/go/+/390577
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-08 02:22:37 +00:00
Robert Griesemer
3bb90a278a spec: clarifications based on feedback
This change includes several smaller changes based on feedback
received so far.

These changes were reviewed at CL 385536. The only additional
change here is to the current date in the subtitle.

Change-Id: I653eb4a143e3b86c5357a2fd3b19168419c9f432
Reviewed-on: https://go-review.googlesource.com/c/go/+/390634
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-07 22:45:58 +00:00
Ian Lance Taylor
797e889046 doc/go1.19: mention use of EDNS(0)
For #51153

Change-Id: I4374c63498b62ba7a08f146eebd034cbd50623f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/389634
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2022-03-04 18:50:03 +00:00
Carlos Amedee
bcb89fc17a doc: start draft of go1.19 release notes, move go1.18 to x/website
This template is based on CL 342070 and previous ones like it.
Continue to eagerly include often-used sections, and clarify that
the TODO is about completing the section, or removing if it turns
out not to be needed.

Move the Go 1.18 release notes to x/website, since that's the new
home for past Go release notes as of CL 291711. They're added to
x/website in CL 388556.

For #51400
Updates #47694

Change-Id: I7b5213e039ad6e14a7ff7ad486311efcecc06824
Reviewed-on: https://go-review.googlesource.com/c/go/+/388515
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-02 20:53:54 +00:00
Ian Lance Taylor
2cb9e116d3 doc/go1.18: warn about possible breakage of 1.18 generic code
The Go 1 compatibility guarantee permits us to break code if there is
a specification error or a bug. Emphasize that for generics.

Change-Id: I8379a14cdab9f63bb747e961ca12d1adecfc2eb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/388454
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2022-03-02 20:14:06 +00:00
Keith Randall
9eb14f1b0e doc: mention change in append behavior
Introduced in CL 347917.

Change-Id: I99b34341f787e779bd45b967110e70a035fa6558
Reviewed-on: https://go-review.googlesource.com/c/go/+/386217
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Martin Möhrmann <martin@golang.org>
Trust: Martin Möhrmann <martin@golang.org>
Run-TryBot: Martin Möhrmann <martin@golang.org>
2022-03-02 20:12:33 +00:00
cuishuang
9fe3676bc7 all: fix typos
Change-Id: I93ff3d33a5db130dd57a9545456f2961fc3f668b
GitHub-Last-Rev: f95fafc049
GitHub-Pull-Request: golang/go#51394
Reviewed-on: https://go-review.googlesource.com/c/go/+/388314
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2022-02-28 21:52:59 +00:00
Matthew Dempsky
b33592dcfd spec: the -'s possessive suffix is English, not code
Change-Id: I2debcf926ef116c632c7366646d37de8686b7c9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/388174
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2022-02-28 19:00:23 +00:00
Bryan C. Mills
55e5b03cb3 doc/go1.18: note changes to automatic go.mod and go.sum updates
Fixes #51242
Updates #45551

Change-Id: Iba6e6acd9a94d24e26fcdd125f1022430723ada7
Reviewed-on: https://go-review.googlesource.com/c/go/+/387920
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Bryan Mills <bcmills@google.com>
2022-02-25 14:32:41 +00:00
Tobias Klauser
6d810241eb doc/go1.18: document minimum Linux kernel version
For #45964

Change-Id: Ic66502c50ca328e944c91e710dca6c8dbc168e4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/387855
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-25 08:02:46 +00:00
Robert Griesemer
b8b3196375 doc/go1.18: document method set limitation for method selectors
For #51183.
For #47694.

Change-Id: If47ae074c3cd9f73b2e7f6408749d9a7d56bd8d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/387924
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-25 00:25:34 +00:00
Felix Geisendörfer
8c5904f149 doc/go1.18: mention runtime/pprof improvements
For #47694.

Change-Id: Ib49145a58b8388d35267cf4b0caa730d7e436d06
Reviewed-on: https://go-review.googlesource.com/c/go/+/387574
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Rhys Hiltner <rhys@justin.tv>
Reviewed-by: Bryan Mills <bcmills@google.com>
Trust: Bryan Mills <bcmills@google.com>
2022-02-24 17:31:07 +00:00
Tobias Klauser
b2dfec100a doc/go1.18: fix typo in AMD64 port section
Change-Id: I234ae7988fd3c7a41c08e72664f8db811eb23bb1
Reviewed-on: https://go-review.googlesource.com/c/go/+/387854
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
2022-02-24 15:38:08 +00:00
Michael Pratt
d0c3b01162 doc/go1.18: drop misplaced period
Change-Id: Id29f352c8d2e61672f55294120058b1f585f7aeb
Reviewed-on: https://go-review.googlesource.com/c/go/+/387655
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-23 18:00:06 +00:00
Cherry Mui
3140625606 doc/go1.18: correct "go build -asan" HTML tag
The tag was "go-mod-vendor", which doesn't match the content.

Also move that section later, so "go mod" sections stay together.

For #47694.

Change-Id: Id4fa7ee0768682a9aadfeb1b2f1d723e7521896b
Reviewed-on: https://go-review.googlesource.com/c/go/+/387354
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-22 18:06:06 +00:00
Alberto Donizetti
c9fe126c8b doc/go1.18: fix a few small typos, add a few commas
Updates #47694

Change-Id: I6c1c3698fdd55fe83c756f28776d1d26dba0a9df
Reviewed-on: https://go-review.googlesource.com/c/go/+/386974
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-21 21:28:40 +00:00
Nick Sherron
903e7cc699 doc/go1.18: fix grammar error
sed 's/the/that/g'

Change-Id: I3f539817b055d54b0ec99346555ac91b756d9ed6
GitHub-Last-Rev: 2e7df1c346
GitHub-Pull-Request: golang/go#51267
Reviewed-on: https://go-review.googlesource.com/c/go/+/386854
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2022-02-19 00:03:22 +00:00
Russ Cox
61b5c866a9 doc/go1.18: document Go 1.17 bootstrap and //go:build fix
For #44505 and #41184.

Change-Id: I9503292dace1aa60de167ca5807bf131554465b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/386774
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2022-02-18 20:32:59 +00:00
Michael Matloob
5d8d387849 cmd/go: set go.work path using GOWORK, and remove -workfile flag
This change removes the -workfile flag and allows the go.work file path
to be set using GOWORK (which was previously read-only). This removes
the potential discrepancy and confusion between the flag and environment
variable.

GOWORK will still return the actual path of the go.work file found if it
is set to '' or 'auto'. GOWORK will return 'off' if it is set to 'off'.

For #45713
Fixes #51171

Change-Id: I72eed65d47c63c81433f2b54158d514daeaa1ab3
Reviewed-on: https://go-review.googlesource.com/c/go/+/385995
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-02-16 15:58:47 +00:00
Jeremy Faller
b2cb1bd0f5 doc/go1.18: remove ppc regabi TODO as it's in the compiler section
Updates #47694

Change-Id: I55175988f193fb573339933e9ff0d4c49734b444
Reviewed-on: https://go-review.googlesource.com/c/go/+/385658
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-02-14 19:37:40 +00:00
Robert Griesemer
badbc52d82 spec: highlight missing prose for easier review, fixed a few sections
The (temporary) highlights will make it easier to review the spec
in formatted form as opposed to html text.

Added a missing rule about the use of adjusted core types for
constraint type inference.

Adjusted rule for invalid embedding of interface types.

Change-Id: Ie573068d2307b66c937e803c486724175415b9c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/385535
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-14 05:18:03 +00:00
Robert Griesemer
18e1a5a085 spec: combine section on type parameters and type parameter lists
This change moves the relevant prose of the section on type parameters
into the section on type parameter lists and eliminates the former.

With this change, the section on types now exclusively describes all
Go composite types.

User-defined named types (defined types and type parameters) are
described with their declarations.

Change-Id: I3e421cd236e8801d31a4a81ff1e5ec9933e3ed20
Reviewed-on: https://go-review.googlesource.com/c/go/+/385037
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-11 16:26:49 +00:00
Robert Griesemer
ea9b1f1573 spec: add a section on implementing an interface
Also, fixed several closing header tags and removed a duplicate "the".
(Thanks to @hopehook and Hossein Zolfi for pointing these out.)

Change-Id: I85a40ba44b8570a578bce8d211dcc5ea3901fb1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/385036
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-11 16:26:45 +00:00
Robert Griesemer
e50f0f372b spec: describe processing of function arguments for type inference more precisely
The outcome of type inference depends critically on when function
argument type inference stops processing arguments. Describe this
and explain an example with some detail.

Also: In the section on the built-in function delete, refer to the
value rather than the type of the second argument, as it may be an
untyped constant.

Change-Id: Ice7fbb33f985afe082380b8d37eaf763238a3818
Reviewed-on: https://go-review.googlesource.com/c/go/+/385034
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-11 05:11:58 +00:00
Kevin Burke
9fdcfb7c10 doc: fix spelling error in link ID
Change-Id: I6de236442f213ab4b4f19ec881add4923d8bfd8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/385054
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Kevin Burke <kevin@burke.dev>
2022-02-11 04:50:35 +00:00
Robert Griesemer
30501bbef9 spec: introduce notion of basic interface, misc. fine-tuning
A basic interface is a classical Go interface containing only
methods or embedding basic interfaces.

Use this to simplify rule about what interfaces may be used
where. The term "basic interface" will also be useful when
talking about various interfaces in general.

Fix rule restricting union terms: as it was written it also
excluded interface terms with non-empty method sets due to
embedded non-interface types with methods.

Split the large section on interfaces into three smaller
pieces by introducing section titles.

Change-Id: I142a4d5609eb48aaa0f7800b5b85c1d6c0703fcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/384994
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-11 00:30:56 +00:00
Robert Griesemer
ca3fae1e0e spec: use the term "generic" rather than "(type-)parameterized"
This makes the prose easier to read while being just as precise.

Change-Id: Ie46c6c5042f419de9fdeb1c75bb72b5a40c37073
Reviewed-on: https://go-review.googlesource.com/c/go/+/384774
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-11 00:26:29 +00:00
Robert Griesemer
11788aa6e0 spec: adjust rules to use core or specific types as necessary
Change-Id: I64280c1bb9608d7781514f237ac70c6abbfde9f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/384754
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-11 00:26:18 +00:00
Robert Griesemer
99b61be9f5 spec: move all sections describing type properties into one place
This change only shuffles sections for better organization; there
are no other changes except title and link adjustments.

Until now, the sections on underlying types and method sets were
immediately following the introduction of types. As it becomes
necessary to introduce the notion of a core type more centrally,
the natural place is immediately following the section on underlying
types. All together, these sections, immediately after the introduction
of types, would distract from purpose of the section on types, which
is to introduce the various types that Go offers.

The more natural place for the definition of underlying, core, and
specific types is the section on properties of types and values.

To accomplish this, the section on the structure of interfaces is
split into a section on core types and one on specific types, and
the various sections are reorganized appropriately.

The new organization of the section on types now simply introduces
all Go types as follows:

- boolean types
- numeric types
- string types
- array types
- slice types
- struct types
- pointer types
- function types
- interface types
- map types
- channel types
- type parameters

The new organization of the section on properties of types and values
is as follows:

- underlying types
- core types
- specific types
- type identity
- assignability
- representability
- method sets

Change-Id: I59e4d47571da9d4c89d47d777f5353fb1c5843e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/384623
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-10 21:40:49 +00:00
Robert Griesemer
3b8c716e0f spec: document numeric operations behavior for generic types
Includes a few minor cosmetic changes.

Change-Id: I6c307d958b47d83671142688630ea7835168439f
Reviewed-on: https://go-review.googlesource.com/c/go/+/384622
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-10 21:40:12 +00:00
Carlos Amedee
656d3f4401 doc/go1.18: remove some TODOs for changes we aren't mentioning again
These TODOs were originally removed in CL 368794.

Updates #47694

Change-Id: I39d5c0ce5f96adbbc466585a5831f721057dbed5
Reviewed-on: https://go-review.googlesource.com/c/go/+/384619
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-10 01:08:52 +00:00
Robert Griesemer
9867262dfd spec: document behavior of generic type switch cases
Fixes #51110.

Change-Id: I11370417f1ef435b05dfab18eeabc2c3c1b7b8a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/384674
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-09 21:51:54 +00:00
Robert Griesemer
20c300bc70 spec: the type of a constant cannot be a type parameter
Add corresponding rules and a couple of examples.

Fixes #50202.

Change-Id: I4287b5e2d0fd29a0c871795e07f1bb529c9c6004
Reviewed-on: https://go-review.googlesource.com/c/go/+/384240
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-09 21:50:10 +00:00
Robert Griesemer
5d3476c3db spec: use "core type" rather than "structural type"
This change in terminology prevents potential confusion
that migth be caused by associating "structural type"
with "structural typing"; the two are not connected.

Also, adjusted introductory paragraph of section on
constraint type inference: type inference goes in both
directions, from type parameter to core type and vice
versa. The previous description was not quite accurate.

Change-Id: If4ca300f525eea660f68486302619aa6ad5dbc2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/384238
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-09 21:50:07 +00:00
Carlos Amedee
a3aed62512 doc/go1.18: update Go 1.18 release note TODOs using relnote
For #47694.

Change-Id: I5f6850e171f574a5342671778df854dc68a5148f
Reviewed-on: https://go-review.googlesource.com/c/go/+/384554
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Trust: Alex Rakoczy <alex@golang.org>
Run-TryBot: Alex Rakoczy <alex@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-09 21:15:07 +00:00
Robert Griesemer
255acb0c05 doc/go1.18: document behavior of go/types predicates for extended interfaces
For #47694.

Change-Id: Ic27193b65ef4b3c0c932107b8731b5f8d3190ad5
Reviewed-on: https://go-review.googlesource.com/c/go/+/383918
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-09 05:39:47 +00:00
Robert Griesemer
3e514a0103 spec: explicitly define integer, floating-point, and complex types
The terms "integer type", "floating-point type", and "complex type"
are used frequently in the spec but are not explicitly (only indirectly)
defined.

Slightly rephrased the section on numeric types and introduce these
terms explicitly. Add links to this section.

Change-Id: I3fb888933bece047da8b356b684c855618e9aee4
Reviewed-on: https://go-review.googlesource.com/c/go/+/384157
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-08 22:16:52 +00:00
Josh Bleecher Snyder
69e1711f28 doc/go1.18: mention linker improvements
Change-Id: I12cad608448ddd17a5da2b1d1209007102d892a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/383914
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-07 23:45:09 +00:00
Ian Lance Taylor
fa04846404 doc/go1.18: mention new x/exp generic packages
Change-Id: I119cfb1a0da9af89ced78935b8fcdfdb8d9b4ab6
Reviewed-on: https://go-review.googlesource.com/c/go/+/383794
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2022-02-07 18:09:07 +00:00
Roland Shoemaker
0003d9da09 doc/go1.18: add crypto/x509 verifier notes
Change-Id: If3e835e868ae695ba232b57096c135ce2e73305b
Reviewed-on: https://go-review.googlesource.com/c/go/+/365835
Trust: Roland Shoemaker <roland@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2022-02-03 17:15:11 +00:00
Ian Lance Taylor
070951c5dc constraints: remove package
It has moved to golang.org/x/exp/constraints. Perhaps it will move
back to the standard library in a future release.

For golang/go#45458
Fixes golang/go#50792

Change-Id: I93aa251a7afe7b329a3d3faadc0c5d6388b1f0e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/382460
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-03 03:13:33 +00:00
Filippo Valsorda
a9384eef7a doc/go1.18: add crypto/tls, crypto/x509, and crypto/elliptic release notes
Updates #45428
Updates #41682

Change-Id: I811bc4f8ec8de6b6db6a2917e265a72134a05e78
Reviewed-on: https://go-review.googlesource.com/c/go/+/382454
Trust: Filippo Valsorda <filippo@golang.org>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2022-02-02 23:37:18 +00:00
Robert Griesemer
a42bbf47d6 doc/go1.18: explain changes to compiler error messages
For #47694.
For #50954.

Change-Id: I3789e145d64025fe2bf787fa5d01a21832903586
Reviewed-on: https://go-review.googlesource.com/c/go/+/381968
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-01 18:15:11 +00:00
Robert Griesemer
125c5a3d69 doc/go1.18: document restrictions for real, imag, complex
For #47694.
For #50912.
For #50937.

Change-Id: I3fae6c8dbbd61a45e669b8fb0c18ac76f2183963
Reviewed-on: https://go-review.googlesource.com/c/go/+/381967
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-01 18:15:07 +00:00
Robert Griesemer
9152e21132 spec: add section on comparable constraint
For #50646.
Fixes #50791.

Change-Id: I8fec25ae3f0280c5b5a778011d23842b886ba79e
Reviewed-on: https://go-review.googlesource.com/c/go/+/381896
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-01 15:39:16 +00:00
Ian Lance Taylor
122654739d doc/go1.18: mention new debug/dwarf DataBitOffset fields
For #46784
For #47694
For #50685

Change-Id: I5351b56722d036a520d1a598ef7af95c5eb44c35
Reviewed-on: https://go-review.googlesource.com/c/go/+/381778
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-01-29 19:58:17 +00:00
Ian Lance Taylor
1fadc392cc doc/go1.18: in workspace mode doc, link to "go work" docs
For #45713
For #47694

Change-Id: I6f615c07749fca49c19f2ae22f79971c29aa8183
Reviewed-on: https://go-review.googlesource.com/c/go/+/381779
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2022-01-28 23:08:40 +00:00
Robert Griesemer
654d5f4b5d spec: add section on type inference
Change-Id: Ic338788d6410ed0d09ad129811377ee9ce5ed496
Reviewed-on: https://go-review.googlesource.com/c/go/+/367954
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-28 22:17:23 +00:00
Robert Griesemer
db48840cfc Revert "spec: document the underlying type of comparable"
This reverts CL 380854.

Per the conluding discussions on #50791. A follow-up will
document `comparable` more thoroughly.

For #50791.

Change-Id: I15db9051784a012f713e28d725c3b8bbfeb40569
Reviewed-on: https://go-review.googlesource.com/c/go/+/381076
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-26 23:43:39 +00:00
Russ Cox
c8b0dcea4a doc/go1.18: note short-circuit and/or in html/template
It was already noted in text/template; copied from there.

Change-Id: Ie749d04004af60f2333073ddf556ff7e16c81c45
Reviewed-on: https://go-review.googlesource.com/c/go/+/379794
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-26 20:51:54 +00:00
Robert Griesemer
719e9894f9 spec: document the underlying type of comparable
For #50791.

Change-Id: I7f135bb6626128a3cee9fd71c57535c1fc83ac7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/380854
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-26 17:58:00 +00:00
Ian Lance Taylor
b7fa0f941f spec: minor formatting and link cleanups
Mostly from CL 367954.

Change-Id: Id003b0f785a286a1a649e4d6e8c87d0418a36545
Reviewed-on: https://go-review.googlesource.com/c/go/+/379920
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2022-01-21 23:16:33 +00:00
Robert Griesemer
d15481b8c7 Revert "doc/go1.18: document type parameter name restriction"
This reverts CL 376414.

For #47694.
For #50481.

Change-Id: Ie73961046e52e6e5d3262ef0aeaa24bec7eaa937
Reviewed-on: https://go-review.googlesource.com/c/go/+/379835
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-21 01:14:28 +00:00
Ian Lance Taylor
a4d3c73ac3 doc/go1.18: don't mention -buildinfo flag
It was removed in CL 378576.

For #50501

Change-Id: I26b8f0e99a40fa5c616aa4849a6ab15dd0d072f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/379314
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-01-19 20:47:21 +00:00
Robert Griesemer
4042194f2d spec: add another example for an invalid shift case
Fixes #45114.

Change-Id: I969e5f1037254fc0ffbba2fc07a81a3987e6b05f
Reviewed-on: https://go-review.googlesource.com/c/go/+/379275
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-19 04:00:05 +00:00
Bryan C. Mills
71888fe4b0 doc/go1.18: add a release note for 'go mod tidy' checksum changes
Updates #47738
Fixes #49598

Change-Id: I708dcb880a701699116227a9eaca994cf460fef9
Reviewed-on: https://go-review.googlesource.com/c/go/+/378577
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Trust: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-01-18 21:38:42 +00:00
Keith Randall
24239120bf doc: mention that GOAMD64 is a compile-time setting
Fixes #50589

Change-Id: Ic260a6edd9af5c9c6dd8b40f0830f88644c907f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/378179
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-01-13 00:53:53 +00:00
Robert Griesemer
3df4472201 spec: adjust rules for specific types once more
Introduce a (local) notion of a set of representative types,
which serves as a representation/approximation of an
interface's actual type set. If the set of representative
types is is non-empty and finite, it corresponds to the set
of specific types of the interface.

In the implementation, the set of representative types serves
as a finite representation of an interface's type set, together
with the set of methods.

Change-Id: Ib4c6cd5e17b81197672e4247be9737dd2cb6b56f
Reviewed-on: https://go-review.googlesource.com/c/go/+/376834
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-12 01:41:46 +00:00
Robert Griesemer
ade5488d75 doc/go1.18: document type parameter name restriction
For #47694.

Change-Id: I00862f987a0ff9f71e0295ce4320e6f9a6a4332f
Reviewed-on: https://go-review.googlesource.com/c/go/+/376414
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-07 18:20:24 +00:00
Robert Griesemer
40afced8d7 spec: be more precise with rules on specific types
Problem pointed out on golang-nuts mailing list.

Change-Id: If1c9b22e1ed7b4ec7ebcaadc80fa450333e6856c
Reviewed-on: https://go-review.googlesource.com/c/go/+/375799
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-07 02:37:20 +00:00
Robert Griesemer
2bb7f6b4f1 doc/go1.18: point to spec in same directory for release notes
The release notes explicitly refer to sections updated
for generics in the spec but then point to the old spec
which is very confusing for beta users.

For #47694

Change-Id: I5b555db3543cc32f088a8b267ec3f1195a52a812
Reviewed-on: https://go-review.googlesource.com/c/go/+/373174
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-01-07 02:32:39 +00:00
Ulrich Kunitz
b5bfaf410a doc: improve documentation for GOAMD64
The change clarifies in the release notes for go1.18 that the variable
is for compilation and references the microarchitecture description in
the Go Wiki,
https://golang.org/wiki/MinimumRequirements#amd64,
and references the same information in the output of go help
environment.

Fixes #50174

Change-Id: I6a7d5a06f48463a810c96cc9c76fe66113d5147c
Reviewed-on: https://go-review.googlesource.com/c/go/+/372194
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-01-06 00:26:47 +00:00
Ian Lance Taylor
1c8f9d2c97 doc/go1.18: mention new cmd/go fuzzing flags
For #47694

Change-Id: I00da9bd39700e938ec492daa71aba2035d911a06
Reviewed-on: https://go-review.googlesource.com/c/go/+/374354
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2022-01-04 21:10:15 +00:00
Ian Lance Taylor
b357b05b70 doc/go1.18: add section for runtime/debug changes
For #37475
For #47694

Change-Id: If8c1f1b756daf32648110f1a669b2ea60f797a24
Reviewed-on: https://go-review.googlesource.com/c/go/+/373875
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-23 20:03:38 +00:00
Ian Lance Taylor
0e4b878258 doc/go1.18: mention debug/plan9obj.ErrNoSymbols
For #47694
For #48052

Change-Id: I136be9b498033309d876099aae16bad330555416
Reviewed-on: https://go-review.googlesource.com/c/go/+/373774
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2021-12-23 19:58:13 +00:00
Carl Johnson
d2ce939604 doc/go1.18: fix broken HTML in net/http.MaxBytesHandler
For #47694

Sorry about that! I guess the autocompleter in VSCode auto-closed the paragraph and I didn't notice.

Change-Id: I1e834e47deb708cd5285d26201a442305f8c3b24
GitHub-Last-Rev: ab88731551
GitHub-Pull-Request: golang/go#50305
Reviewed-on: https://go-review.googlesource.com/c/go/+/374014
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-22 23:31:40 +00:00
Ian Lance Taylor
0f3becf62f doc/go1.18: list new net/netip and net functions and methods
For #46518
For #47694

Change-Id: I4848556674baf85ceec350645d9eddcd83f1b2e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/373834
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-12-22 18:43:55 +00:00
Ian Lance Taylor
d7b035f930 doc/go1.18: mention testing.F in testing package section
For #47694

Change-Id: I27d88d864319bd8dbabfa6675a6abf2f74c50717
Reviewed-on: https://go-review.googlesource.com/c/go/+/373914
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Katie Hockman <katie@golang.org>
2021-12-22 18:38:41 +00:00
Ian Lance Taylor
90fb5a4f97 doc/go1.18: document {text,html}/template {break,continue} commands
For #20531
For #47694

Change-Id: Iaefaa0a8982eabf59cd6a53120c8af9124d60d1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/373915
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-22 00:11:21 +00:00
Carl Johnson
ebac50e9ce doc/go1.18: add net/http.MaxBytesHandler
For #47694

Change-Id: Ifab2c2720ec2ccef175a0e14a95f8df0437eb009
GitHub-Last-Rev: f3c2f12c7b
GitHub-Pull-Request: golang/go#50250
Reviewed-on: https://go-review.googlesource.com/c/go/+/373015
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-21 23:09:59 +00:00
Ian Lance Taylor
60f2c12a85 doc/go1.18: mention new go/types/Config.Context field
For #47694
For #47916

Change-Id: Ieeffaf161da744adfdb4da8aac58a64c109ebcab
Reviewed-on: https://go-review.googlesource.com/c/go/+/373775
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-21 22:26:48 +00:00
Ian Lance Taylor
9502339561 doc/go1.18: mention new debug/elf.R_PPC64_RELATIVE constant
For #47694

Change-Id: I9f4838100741d3ba13e9374e70466fa405c6e4d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/372634
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-21 18:43:00 +00:00
Ian Lance Taylor
529939072e doc/go1.18: document union element restriction
For #47694

Change-Id: I9af871a4a45b002e72629904011aac8f076617f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/372974
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-12-17 03:59:09 +00:00
Robert Griesemer
3c495839fe spec: describe constraint parsing ambiguity and work-around more precisely
The new description matches the implementation (CL 370774).

Also, in the section on type constraints, use "defines" instead of
"determines" because the constraint interface defines the type set
which is precisely the set of acceptable type arguments.

For #49482.

Change-Id: I6f30f49100e8ba8bec0a0f1b450f88cae54312eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/372874
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-17 03:28:06 +00:00
Robert Griesemer
2bdf34f3e8 spec: clarify that comparable cannot be a union element
For #49602.

Change-Id: I0d3ff8f087dffb3409918494147fd1dceff7514d
Reviewed-on: https://go-review.googlesource.com/c/go/+/372694
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-17 03:28:05 +00:00
Hana
b1c7703f26 doc/go1.18: discuss embedded build info compatibility
Fixes #50085

Change-Id: I9be8ddb983fb4fe598becbb0b93bb5b7e1f8438f
Reviewed-on: https://go-review.googlesource.com/c/go/+/372214
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2021-12-15 14:48:19 +00:00
Ian Lance Taylor
9d0ca262bb doc/go1.18: mention that embedding a type parameter is forbidden
For #47694

Change-Id: Ibf38eabcb78abc563fcf77e2b566175a18c06fa3
Reviewed-on: https://go-review.googlesource.com/c/go/+/372114
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-15 00:33:55 +00:00
Brad Fitzpatrick
dc5a8f9647 doc/go1.18: fix an unclosed anchor
Change-Id: I432bcc6ff917d008598b2f37c6e826f588a3d6d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/372074
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
2021-12-14 23:57:51 +00:00
Olivier Mengué
38c067d178 doc: fix typo in 1.18 release notes for package testing
In release notes for Go 1.18, fix typo in changes for package testing to
correctly document the change in CL 343883.

Change-Id: I40d92858ed3f74554a094466c06771f83dd81942
Reviewed-on: https://go-review.googlesource.com/c/go/+/371616
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
2021-12-14 23:55:40 +00:00
Ian Lance Taylor
1540239f48 doc/go1.18: add caution about use of generics in production
Per https://groups.google.com/g/golang-dev/c/iuB22_G9Kbo/m/7B1jd1I3BQAJ.

For #47694

Change-Id: I033cdadb2067e432f7c307d1546b4c5d0cfd5d8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/371954
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-12-14 22:42:47 +00:00
Cherry Mui
fc8ae9860a doc/go1.18: move debug/buildinfo to core library section
It is a new package and seems a major change.

Updates #47694.

Change-Id: If854e494e28bcd1e79c99e59119755b9cb6793d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/371816
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2021-12-14 21:23:43 +00:00
Michael Matloob
265fbaa94b doc: update go1.18 release notes with a blurb about workspace mode
For #47694

Change-Id: I79cdbdc66ea9942b597f29c9a4f428075f053466
Reviewed-on: https://go-review.googlesource.com/c/go/+/371295
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2021-12-14 19:10:22 +00:00
Cherry Mui
46ba32a2ca doc/go1.18: remove residual TODOs
There doesn't seem anything that still needs to de done there.

Updates #47694.

Change-Id: I7909f566638332f3904d20a34f61d371af1d2da2
Reviewed-on: https://go-review.googlesource.com/c/go/+/371754
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Trust: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
2021-12-14 17:22:06 +00:00
Robert Griesemer
083ef54624 spec: fix conversion rules (match implementation)
As written, the conversion P(x), where P and the type
of x are type parameters with identical underlying types
(i.e., identical constraints), is valid. However, unless
the type of x and P are identical (which is covered with
the assignability rule), such a conversion is not valid
in general (consider the case where both type parameters
are different type parameters with constraint "any").

This change adjusts the rules to prohibit type parameters
in this case. The same reasoning applies and the analogue
change is made for pointer types.

The type checker already implements these updated rules.

Change-Id: Id90187900cb2820f6a0a0cf582cf26cdf8addbce
Reviewed-on: https://go-review.googlesource.com/c/go/+/371074
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-13 18:41:35 +00:00
Tim King
766f89b5c6 doc: document cmd/vet changes for 1.18 release
cmd/vet has several precision improvements for the checkers copylock, printf, sortslice, testinggoroutine, and tests. Adds a high level mention in the release notes and an example of string constant concatenation.

Updates #47694

Change-Id: I7a342a57ca3fd9e2f3e8ec99f7b647269798317f
Reviewed-on: https://go-review.googlesource.com/c/go/+/370734
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Tim King <taking@google.com>
Run-TryBot: Tim King <taking@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-10 19:26:50 +00:00
Robert Findley
d6c4583ad4 doc: document the new types.Config.GoVersion field
Also update some other go/types release notes to use the present tense.

Updates #47694

Change-Id: I654371c065e76fd5d22679d0d3c1a81bc3d1e513
Reviewed-on: https://go-review.googlesource.com/c/go/+/370235
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-12-08 23:38:20 +00:00
Robert Findley
9e29dd42df doc: document cmd/vet changes for generics in 1.18
Fixes #50011
Updates #47694

Change-Id: Id3d43f2f72de61b360b79c2b375ca1372d5f4692
Reviewed-on: https://go-review.googlesource.com/c/go/+/369979
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tim King <taking@google.com>
2021-12-08 21:21:44 +00:00
Dan Scales
7b7efd7a7c doc: add in release note about compiler being roughly 15% slower
Updates #49569

Change-Id: Ifba769993c50bb547cb355f56934fb572ec17a1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/370154
Reviewed-by: Austin Clements <austin@google.com>
Trust: Dan Scales <danscales@google.com>
2021-12-08 18:06:06 +00:00
Austin Clements
c759ec2284 doc/go1.18: clarify additions to net package API
For #47694.

Updates #46518.

Change-Id: Ife3a8d3d6a1c50f55b5ab15730d5a6bd3ec512e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/370134
Trust: Austin Clements <austin@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2021-12-08 17:04:27 +00:00
Ian Lance Taylor
a19e72cb89 doc/go1.18: move fuzzing to tools section
For #47694

Change-Id: Idab1a5822a096447c71776ee4339c4262183ceb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/370034
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Katie Hockman <katie@golang.org>
2021-12-08 04:14:00 +00:00
Austin Clements
e08d1fba37 doc/go1.18: mention bytes.Cut and strings.Cut
For #47694.

Updates #46336.

Change-Id: Ibbd058a1fd4d6b0aa38d3e8dc15b560d1e149f7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/369981
Trust: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2021-12-07 21:32:48 +00:00
Austin Clements
dc50d69119 doc/go1.18: drop TODO for "Changes to the language"
For #47694

Change-Id: I142776001eecb451e8722163cfd3f2ecb0ecf35c
Reviewed-on: https://go-review.googlesource.com/c/go/+/369980
Trust: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2021-12-07 21:31:42 +00:00
Jeremy Faller
085d6ff531 doc/go1.18: add docs for -count when benchmarking
CL 356669

Updates #47694

Change-Id: I49e0cdd3b34e81e9e44020a8eb1304d78249cd66
Reviewed-on: https://go-review.googlesource.com/c/go/+/368677
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-07 17:59:54 +00:00
Jeremy Faller
d16a57542a doc/go1.18: add new sync.[RW]Mutex methods
CL 319769

Updates #47694

Change-Id: I9655af0d249926617645c33617d53b73f985aa19
Reviewed-on: https://go-review.googlesource.com/c/go/+/368797
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-06 21:14:21 +00:00
Jeremy Faller
870f33f6ef doc/go1.18: add changes to strconv.Unquote to release notes
CL 343877

Updates #47694

Change-Id: I37a0a0d1f7ab937b12812981ecddc89eb8c99c24
Reviewed-on: https://go-review.googlesource.com/c/go/+/368796
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
2021-12-06 21:09:34 +00:00
Jeremy Faller
1c4cf50e11 doc/go1.18: add docs for js.Wrapper's removal
CL 356430

Updates #47694

Change-Id: I802cd50f2827caa0549c25685c0b1bb8dfc40968
Reviewed-on: https://go-review.googlesource.com/c/go/+/368799
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-12-06 21:02:48 +00:00
Jeremy Faller
0bbb74b5ac doc/go1.18: add changes to regexp to release notes
CL 354569

Updates #47694

Change-Id: I78536c110215b3c9f247c1420bcaa5fc3d8fb930
Reviewed-on: https://go-review.googlesource.com/c/go/+/368795
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-06 21:01:12 +00:00
Austin Clements
9ecb853cf2 doc/go1.18: minor tweaks to generics section
This CL reorders the bullet points in the generics section to more
closely match what I think users will consider most important. I put
the ~ token before the mention of ~T in interfaces to avoid a forward
reference, though I wonder if we actually want to spent a couple more
sentences saying what union and ~T types are, since most people are
going to care about that a lot more than they care about the low-level
detail that there's a new token.

For #47694.

Change-Id: Ib84f096ef6346a711801268ce362b64fa423d3f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/369734
Trust: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-06 19:50:32 +00:00
Austin Clements
2cb9042dc2 doc/go1.18: cite CLs for more efficient scavenging
For #47694.

Change-Id: Ic6088b1811600670a57f28426f4158a7c7517c82
Reviewed-on: https://go-review.googlesource.com/c/go/+/369616
Trust: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-12-06 17:34:53 +00:00
Robert Findley
f8a8a73096 go/types, types2: unexport NewTypeList
NewTypeList was not part of the go/types API proposal, and was left in
by accident. It also shouldn't be necessary, so remove it.

Updates #47916

Change-Id: I4db3ccf036ccfb708ecf2c176ea4921fe68089a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/369475
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-12-06 14:58:33 +00:00
Ian Lance Taylor
3396878af4 doc/go1.18: use correct link for reflect.PointerTo
For #47694

Change-Id: Iee4fda069a56ea4436b8aa32e2605f3349d7c154
Reviewed-on: https://go-review.googlesource.com/c/go/+/369334
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-12-04 17:16:07 +00:00
Jeremy Faller
1876b38263 doc/go1.18: add docs for SysProcAttr.Pdeathsig
CL 355570

Updates #47694

Change-Id: I922cda28ca4cf1ae6d5e4f457cc66d5041b0e3e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/368798
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2021-12-04 11:59:35 +00:00
Robert Griesemer
549cfefc72 doc/go1.18: expand section on generics
Also, move it up in the document.

Updates #47694

Change-Id: I927c4c845089a5c22e2c5b5f3de1831c04c6d990
Reviewed-on: https://go-review.googlesource.com/c/go/+/369102
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-04 04:50:55 +00:00
Robert Griesemer
cd5f2cf50f doc/go1.18: add documentation for changes to go/types
The number of involved CLs is too large (hundreds) so
no CLs are mentioned in (html) comments.

Updates #47694

Change-Id: I655d800a1e56a71e9d70a190f1c42c17baf6861e
Reviewed-on: https://go-review.googlesource.com/c/go/+/369099
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-04 04:41:31 +00:00
Robert Griesemer
fa88ba1e8a doc/go1.18: add documentation for changes to go/ast
Updates #47694

Change-Id: Ied26f6345df2c8640d4be5132a05db3897b59009
Reviewed-on: https://go-review.googlesource.com/c/go/+/369096
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-04 01:07:28 +00:00
Robert Griesemer
821bf04f2a doc/go1.18: add documentation for changes to go/token
Updates #47694

Change-Id: I232fb20b3a77409b84c15f9ec1586e480f0f6390
Reviewed-on: https://go-review.googlesource.com/c/go/+/369095
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-04 01:07:21 +00:00
Robert Griesemer
ba83aa7caa doc/go1.18: add documentation for changes to go/constant
Updates #47694

Change-Id: I2ce5aaa4493259790712a8a49e5b03472c8a7400
Reviewed-on: https://go-review.googlesource.com/c/go/+/369094
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-12-04 01:07:10 +00:00
Hossein Zolfi
d20a0bfc8a doc/go1.18: change github.com/golang/go/issues to golang.org/issue
Updates #47694

Change-Id: I84547ff995e2a302cf229fefefd28a7220a17028
Reviewed-on: https://go-review.googlesource.com/c/go/+/369016
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Trust: Austin Clements <austin@google.com>
2021-12-03 21:25:05 +00:00
Austin Clements
ebe99189fc doc/go1.18: catch up with runtime/compiler commits and API changes
For #47694.

Change-Id: I21b1af1807d4da2fb2f4d9b961d44a21d715d7d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/369155
Trust: Austin Clements <austin@google.com>
Trust: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2021-12-03 21:23:09 +00:00
Katie Hockman
deb988a286 doc/go1.18: mention fuzzing in the release notes
Also make a few small formatting fixes.

Change-Id: Iad99d030312393af3b6533f2cd00f09aea0f2a7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/369074
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-12-03 18:09:19 +00:00
Austin Clements
d921bb21df doc/go1.18: reorganize runtime/compiler a little
For #47694.

Change-Id: Iedf85f522f7c79ae0a61b4fc1f2f092cf7b613df
Reviewed-on: https://go-review.googlesource.com/c/go/+/368696
Trust: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2021-12-03 17:13:03 +00:00
Ian Lance Taylor
8835343280 doc/go1.18: mention new -asan option
For #44853
For #47694

Change-Id: Ia76246218b1361d8bdf510bbfc5178c83cdd3eec
Reviewed-on: https://go-review.googlesource.com/c/go/+/368834
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-12-02 23:02:33 +00:00
Jeremy Faller
06dbf6121a doc/go1.18: remove some TODOs for changes we aren't mentioning
Updates #47694

Change-Id: I8fdbded4aaf974425ee317a1cdd940a5ac88c0b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/368794
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-02 22:06:27 +00:00
Jeremy Faller
48e4284e55 doc/go1.18: add docs on FieldByIndexErr
From:
https://go-review.googlesource.com/c/go/+/357962/

Updates #47694

Change-Id: I2d43dcbd28c03457b55eada26e87f7710a113b0c
Reviewed-on: https://go-review.googlesource.com/c/go/+/368364
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-02 22:06:10 +00:00
Jeremy Faller
e533b5793f doc/go1.18: add docs on new reflect.Value methods
From:

https://go-review.googlesource.com/c/go/+/352131/

Updates #47694

Change-Id: I7c7811c49900049f5ef7fc906fe25d2ffd73c7b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/368363
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Fabio Falzoi <fabio.falzoi84@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-02 22:05:56 +00:00
Jeremy Faller
f9b2733e3a doc/go1.18: add docs on MapIter.Reset
From:

https://go-review.googlesource.com/c/go/+/321891

Updates #47694

Change-Id: I2cdd5d9f3da62a5690cd2ef921ed48957c602d64
Reviewed-on: https://go-review.googlesource.com/c/go/+/368360
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-02 22:05:01 +00:00
Jeremy Faller
bcb98f126b doc/go1.18: add docs on User.GroupIds
Cobbled up some release notes from:

https://go-review.googlesource.com/c/go/+/330753/

Updates #47694

Change-Id: I249e4b96b7d51185b07c11a734505677e9e36315
Reviewed-on: https://go-review.googlesource.com/c/go/+/368358
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-02 22:04:50 +00:00
Jeremy Faller
c8c89d20ce doc/go1.18: add docs on Cookie.Valid
Updates #47694

Change-Id: Ibf3e25fbccf82e4abd7bd76b2ea6ceb4b05d4664
Reviewed-on: https://go-review.googlesource.com/c/go/+/368357
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-02 22:04:23 +00:00
Jeremy Faller
25f06cb71f doc/go1.18: add deprecation note for net.Error.Temporary
Updates #47694

Change-Id: Ia25ad49f688efa3d60d83290095648711704b478
Reviewed-on: https://go-review.googlesource.com/c/go/+/368316
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-02 22:03:54 +00:00
Jeremy Faller
94e22fa03e doc/go1.18: add Conn.NetConn documentation to crypto/tls section
Updates #47694

Change-Id: Iead44baa8b2a06ecf7b92d343ed9117f0fc0793e
Reviewed-on: https://go-review.googlesource.com/c/go/+/368315
Trust: Jeremy Faller <jeremy@golang.org>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
2021-12-02 22:03:34 +00:00
Jeremy Faller
d3bf627bc1 doc/go1.18: add constraints package documentation
Updates #47694

Change-Id: I3239023dad194c317e271e6093eff2cfbed1a4b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/368314
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-12-02 22:03:11 +00:00
Jeremy Faller
d514411625 doc/go1.18: add information on new pacer.
This is based off Michael's notes.

Updates #47694

Change-Id: I6e7944f85b776e8481829a2fafd177a49557c6ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/368156
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-12-02 22:02:54 +00:00
Jeremy Faller
3c6295d272 doc/go1.18: add short-circuit evaluation for text/template
This description is based on https://golang.org/cl/321490.

Updates #47694

Change-Id: I48656cd487d2fccf0b0d3390f350f1bc6f2b0080
Reviewed-on: https://go-review.googlesource.com/c/go/+/365738
Trust: Jeremy Faller <jeremy@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-02 20:45:47 +00:00
Cherry Mui
c3a7fb2074 doc/go1.18: mention stack trace change
For #47694.

Change-Id: I06cac88d5328c8c0e38212ad801d70bc36cdfc6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/368234
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2021-12-01 22:20:39 +00:00
Robert Griesemer
61ff501968 spec: adjust section on package unsafe for type parameters
Change-Id: I562d4648756e710020ee491f3801896563a89baa
Reviewed-on: https://go-review.googlesource.com/c/go/+/367395
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-29 19:24:41 +00:00
Robert Griesemer
68da368a4e spec: rules for index expressions, len, cap, with type parameter types
We want to support some special cases for index expressions, len, and
cap on operands of type parameters (such as indexing a value constrained
by byte slices and strings), hence the extra rules.

Change-Id: I4a07dc7e64bb47361b021d606c52eae1784d5430
Reviewed-on: https://go-review.googlesource.com/c/go/+/366814
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
2021-11-29 19:24:34 +00:00
Robert Griesemer
37a5d720d4 spec: corrections to various sections
- fix definition of "specific types" and add more examples
- state that a parameterized function must be instantiated
  when used as a function value
- remove duplicate word ("can can" -> "can")

Thanks to @danscales for finding these.

Change-Id: Ideb41efc35a3e67694d3bc97e462454feae37c44
Reviewed-on: https://go-review.googlesource.com/c/go/+/367394
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
2021-11-29 19:24:26 +00:00
Jason A. Donenfeld
a59ab29bf2 doc/go1.18: use <code> instead of <pre> for target specification
For #47694.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Change-Id: I38c2fd9b57fbbacf220a2bc679f67e2dfdcc7cb1
Reviewed-on: https://go-review.googlesource.com/c/go/+/367514
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-11-29 16:08:23 +00:00
syumai
0fa53e41f1 spec: fix link for instantiations
This change corrects the link `Instantiantions` to `Instantiations` in the spec.

Change-Id: Ib0ed03420ae401d20af1ea723c5487018b2f462d
GitHub-Last-Rev: b84316c818
GitHub-Pull-Request: golang/go#49816
Reviewed-on: https://go-review.googlesource.com/c/go/+/367274
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-11-27 23:29:50 +00:00
Carlo Alberto Ferraris
a142d6587c doc: go1.18 release notes for CLs 323318/332771
Updates #47694

Change-Id: Ib76737996a701906117e096eb6d05b388576a874
GitHub-Last-Rev: 05b9649965
GitHub-Pull-Request: golang/go#49588
Reviewed-on: https://go-review.googlesource.com/c/go/+/363840
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Daniel Martí <mvdan@mvdan.cc>
2021-11-27 19:49:32 +00:00
Jason A. Donenfeld
77038044ca doc/go1.18: document non-cooperative preemption on windows/arm{,64}
For #47694.
Updates #49759.

Change-Id: I7accd81b8ea6c31e4a2b5e155cf93fe9c447813b
Reviewed-on: https://go-review.googlesource.com/c/go/+/367095
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2021-11-26 13:18:11 +00:00
jiahua wang
5527d7ff79 doc/go1.18: add Clone doc
For #47694

Change-Id: I3b135f6ff199d7a9746726b131fbe7dd97a8e95e
Reviewed-on: https://go-review.googlesource.com/c/go/+/364254
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Heschi Kreinick <heschi@google.com>
2021-11-24 21:08:29 +00:00
Robert Griesemer
696515ee39 spec: type assertions and switches don't operate on type parameters
Change-Id: I11111b3617673be94508128489aed6488d518537
Reviewed-on: https://go-review.googlesource.com/c/go/+/366834
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-24 20:54:12 +00:00
Robert Griesemer
6ea17aa52c spec: adjust type identity rules for type parameters
Change-Id: I5ffc7f26236487070447eaa0f6b14d1fab44c3c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/366794
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-24 20:54:07 +00:00
Robert Griesemer
a3b8f627c2 spec: add section on instantiation
Change-Id: I2770da87b4c977b51dfa046f2f08283917675e1c
Reviewed-on: https://go-review.googlesource.com/c/go/+/365916
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
2021-11-24 20:53:54 +00:00
Robert Griesemer
ce2a20af46 spec: adjust conversion rules for type parameters
Change-Id: I7bfddf4be0d1d95419f312bb349ae2e16b74b795
Reviewed-on: https://go-review.googlesource.com/c/go/+/365915
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-24 20:53:51 +00:00
Robert Griesemer
939480033a spec: adjust assignability rules for type parameters
Change-Id: I3c4d8bdb5e92ee7fdca9593fb043f94f467755e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/365434
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-24 20:53:45 +00:00
Robert Griesemer
003e7faf53 spec: adjust representability rules for type parameters
Change-Id: I4423a059527066c4418c195911f8184dfd3f5a15
Reviewed-on: https://go-review.googlesource.com/c/go/+/365914
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-24 20:53:29 +00:00
Robert Griesemer
5d8c49a5a1 spec: add definition of "specific types" of an interface
The notion of specific types will be used to define rules for
assignability, convertability, etc. when type parameters are
involved.

Change-Id: Ic5c134261e2a9fe05cdf25efd342f052458ab5c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/366754
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-24 20:51:25 +00:00
Dmitri Shuralyov
e883005d2a doc/go1.18: document that iOS 12 or newer is required
For #47694.
Updates #49616.
Updates #48076.

Change-Id: I570564c3a54d3cd9cfc9b8267df9fbee3363b650
Reviewed-on: https://go-review.googlesource.com/c/go/+/366914
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-11-24 18:59:20 +00:00
Robert Griesemer
0244343088 spec: fix Swap example (correctly swap type arguments and parameters)
Thanks to @danscales for noticing the mistake.

Change-Id: I547ee80a78419765b82d39d7b34dc8d3bf962c35
Reviewed-on: https://go-review.googlesource.com/c/go/+/366215
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
2021-11-22 23:00:32 +00:00
Robert Griesemer
7456b94853 doc/go1.18: document new overflow error for some untyped arguments to print/ln
Fixes #49216.
For #47694.

Change-Id: Ib129d790c382ddcc9677d87db4ca827b7159856a
Reviewed-on: https://go-review.googlesource.com/c/go/+/366275
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-22 22:36:03 +00:00
Robert Griesemer
7fbe2f4cc8 doc/go1.18: document compiler change for "declared but not used" errors
Fixes #49214.
For #47694.

Change-Id: Iba68ed17bfd81890309b6a6732087f87a03e1350
Reviewed-on: https://go-review.googlesource.com/c/go/+/366274
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-22 22:35:57 +00:00
Robert Griesemer
e30ebaab0b spec: add section on the structure of interfaces
This change introduces the notion of a structural interface
and its corresponding structural type.

Change-Id: Ib5442dfd04cb5950b4467428cae51849f8922272
Reviewed-on: https://go-review.googlesource.com/c/go/+/365474
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-22 04:27:29 +00:00
Robert Griesemer
a287c4aa38 spec: add type parameter types
- add section on type parameters
- added two sections on the scope of type parameters
- expanded general section on types accordingly
- introduced the notion of a named type which will
  help in simplifying various rules (subsequent CLs)

Change-Id: I49c1ed7d6d4f951d751f0a3ca5dfb637e49829f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/365414
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-22 03:24:07 +00:00
Robert Griesemer
0c3b4a358a spec: add type parameter lists
Change-Id: I29e9188a0fa1326c2755a9b86aeb47feaa8019be
Reviewed-on: https://go-review.googlesource.com/c/go/+/365274
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-22 03:24:01 +00:00
Cherry Mui
ba9f0f6665 doc/go1.18: mention register ABI on ARM64 and PPC64
For #47694.

Change-Id: Ide378f4a34587027c3d84fed2126c5b9bd8f7287
Reviewed-on: https://go-review.googlesource.com/c/go/+/363694
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
2021-11-19 21:41:33 +00:00
Jeremy Faller
aec5c2eed6 [go] doc: document speedups to Trim[|Left|Right]
CL: #332771

Updates: #47694
Change-Id: I8c729084b7a8745ec73f87ef3c469edbd596ddb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/365318
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
2021-11-19 21:36:24 +00:00
Jeremy Faller
0f75a9ecdf [go] doc: add new bufio functionality
cl/345570
cl/345569

Updates: #47694
Change-Id: I170af16d5fc9f022d3d29ed0772cfc3d02b8bbcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/365317
Trust: Jeremy Faller <jeremy@golang.org>
Run-TryBot: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Joe Tsai <joetsai@digital-static.net>
2021-11-19 21:36:17 +00:00
Robert Griesemer
24898d6948 spec: various clarifications/fixes for method sets and interfaces
- fixed a typo in the method set section
- express in the syntax that ~T denotes an underlying type
- be more precise when talking about types vs type terms
- refer to "unions" rather than "union expressions"
- make it clear in the spec title that this is WIP

Change-Id: I9b2c4b1f77bc50dd574ed6893bedd40529c320fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/365154
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-18 20:11:45 +00:00
Robert Griesemer
f6647f2e3b spec: generalize method sets and interface types to type sets
This is the first of several CLs that update the existing
Go 1.17 spec for type parameters.

This CL updates the section on method sets and interface types.
It also adds "any", "comparable" to the list of predeclared
identifiers.

Change-Id: I0ce25dc02791c33150c0d949528512610faf3eab
Reviewed-on: https://go-review.googlesource.com/c/go/+/362999
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-18 06:05:29 +00:00
Keith Randall
febbef593e doc: mention generics in release notes
Also mention local types restriction.

We probably want to say more at some point, this is just a
placeholder to start.

Update #47631

Change-Id: I828e451e1e8504d21cb55c7132e9cb330b160a54
Reviewed-on: https://go-review.googlesource.com/c/go/+/364134
Trust: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-11-16 06:31:54 +00:00