aboutsummaryrefslogtreecommitdiff
path: root/doc
AgeCommit message (Collapse)Author
2022-04-21os/exec: set PWD implicitly if Dir is non-empty and Env is nilBryan C. Mills
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-19spec: clarify rules for type set construction of an interfaceRobert Griesemer
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-19doc/go1.19: move the description of the runtime.GOROOT change from 'cmd/go' ↵Bryan C. Mills
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-12doc/go1.19: document cmd/go changes involving -trimpathBryan C. Mills
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-07doc/go1.19: use the right package error.Is argumentsIan Lance Taylor
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-07image/draw: have draw.Src preserve NRGBA colorsNigel Tao
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-04doc/go_spec.html: update type identity exampleJared Horvat
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: e80560d32abcb36c51554606beb09a53d45f0062 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-03net: support error.Is of network errors and context errorsIan Lance Taylor
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-02doc: add illegal octal over 255 exampleZach Collier
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: f6bef0379f547ca6204c837279d67ad87c2b69c7 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-03-31strconv: quote rune 007F as \x7f, not \u007fIan Lance Taylor
\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-31spec: clarify type term restriction for type parametersRobert Griesemer
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-29doc/go1.19: mention new unix build constraintIan Lance Taylor
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-11spec: various minor clarificationsRobert Griesemer
- 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-11spec: clean up intro and replace bolded text with proseRobert Griesemer
- 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-10spec: remove note re: field accesses on type literalsRobert Griesemer
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-10spec: more adjustments/correctionsRobert Griesemer
- 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-10spec: remove notion of specific typesRobert Griesemer
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-08spec: document that type inference doesn't apply to generic typesRobert Griesemer
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-07spec: clarifications based on feedbackRobert Griesemer
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-04doc/go1.19: mention use of EDNS(0)Ian Lance Taylor
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-02doc: start draft of go1.19 release notes, move go1.18 to x/websiteCarlos Amedee
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-02doc/go1.18: warn about possible breakage of 1.18 generic codeIan Lance Taylor
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-02doc: mention change in append behaviorKeith Randall
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-02-28all: fix typoscuishuang
Change-Id: I93ff3d33a5db130dd57a9545456f2961fc3f668b GitHub-Last-Rev: f95fafc04937a99f82cb992aabb7bac602033d8e 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-28spec: the -'s possessive suffix is English, not codeMatthew Dempsky
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-25doc/go1.18: note changes to automatic go.mod and go.sum updatesBryan C. Mills
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-25doc/go1.18: document minimum Linux kernel versionTobias Klauser
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-25doc/go1.18: document method set limitation for method selectorsRobert Griesemer
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-24doc/go1.18: mention runtime/pprof improvementsFelix Geisendörfer
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-24doc/go1.18: fix typo in AMD64 port sectionTobias Klauser
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-23doc/go1.18: drop misplaced periodMichael Pratt
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-22doc/go1.18: correct "go build -asan" HTML tagCherry Mui
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-21doc/go1.18: fix a few small typos, add a few commasAlberto Donizetti
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-19doc/go1.18: fix grammar errorNick Sherron
sed 's/the/that/g' Change-Id: I3f539817b055d54b0ec99346555ac91b756d9ed6 GitHub-Last-Rev: 2e7df1c3462d4b3a17e9a05ff178341f4ee369b0 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-18doc/go1.18: document Go 1.17 bootstrap and //go:build fixRuss Cox
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-16cmd/go: set go.work path using GOWORK, and remove -workfile flagMichael Matloob
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-14doc/go1.18: remove ppc regabi TODO as it's in the compiler sectionJeremy Faller
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-14spec: highlight missing prose for easier review, fixed a few sectionsRobert Griesemer
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-11spec: combine section on type parameters and type parameter listsRobert Griesemer
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-11spec: add a section on implementing an interfaceRobert Griesemer
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-11spec: describe processing of function arguments for type inference more ↵Robert Griesemer
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-11doc: fix spelling error in link IDKevin Burke
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-11spec: introduce notion of basic interface, misc. fine-tuningRobert Griesemer
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-11spec: use the term "generic" rather than "(type-)parameterized"Robert Griesemer
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-11spec: adjust rules to use core or specific types as necessaryRobert Griesemer
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-10spec: move all sections describing type properties into one placeRobert Griesemer
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-10spec: document numeric operations behavior for generic typesRobert Griesemer
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-10doc/go1.18: remove some TODOs for changes we aren't mentioning againCarlos Amedee
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-09spec: document behavior of generic type switch casesRobert Griesemer
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-09spec: the type of a constant cannot be a type parameterRobert Griesemer
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>