I know it's linked in the previous sentence, but this new link is where I want it to be while reading this sentence.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/21770043
Please note the slight rewording for append: The spec now
requires that append reuses the underlying array if it is
sufficiently large. Per majority sentiment.
This is technically a language change but the current
implementation always worked this way.
Fixes#5818.
Fixes#5180.
R=rsc, iant, r, ken, minux.ma, dan.kortschak, rogpeppe, go.peter.90
CC=golang-dev
https://golang.org/cl/14419054
At the moment, godoc expands the example in the link, but in
the past it has not. Add a waffle word to allow either possibility.
Also change the order of cases in the switch in Compare to
be consistent with the other switch in the function.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14439055
That page may be fine for experienced Go programmers
but it's not really targeting new programmers.
There's too much we don't know yet.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14345043
Make the break example slightly more interesting
Update #5725
Effective Go will be updated in a separate CL.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/13368054
Remove "References" section.
Remove most articles and redirect to blog.golang.org.
Move /ref/spec and /ref/mem to /doc/spec and /doc/mem.
Remove duplicate links from the remaining
"Documents", "The Project", and "Help" pages.
Defer to the wiki for more links and community content.
Update command reference and mention cover tool.
Add "Pop-out" text to the front page.
Pick one of four videos at random to feature on the front page.
Fixes#2547.
Fixes#5561.
Fixes#6321.
R=r, dominik.honnef
CC=golang-dev
https://golang.org/cl/13724043
Document the semantic changes within the gc toolchain.
Also delete the mention of unbalanced right delims in template
That change was rolled back.
Absent typos, things we've forgotten, and new things that happen,
the release notes are ready.
R=golang-dev, adg, dominik.honnef
CC=golang-dev
https://golang.org/cl/13368052
Lay out the doc and write text for the minor changes.
(I left the net ones for someone who understands them better,
or for someone to describe them to me better so I can write them.)
Much still to do.
Delete go1.2.txt so there's only one thing to update.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13597044
Not a user-visible API change. Just a minor garbage
win in contrived cases.
Also, the package is io/ioutil.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12987044
(Replacement for CL 11884043.)
1) Explain a[i] and a[i:j] where a is of type *A as
shortcut for (*a)[i] and (*a)[i:j], respectively.
2) Together with 1), because len() of nil slices is
well defined, there's no need to special case nil
operands anymore.
3) The result of indexing or slicing a constant string
is always a non-constant byte or string value.
4) The result of slicing an untyped string is a value
of type string.
5) If the operand of a valid slice a[i:j] is nil (i, j
must be 0 for it to be valid - this already follows
from the in-range rules), the result is a nil slice.
Fixes#4913.
Fixes#5951.
R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/12198043
CL submitted prematurely by mistake.
««« original CL description
spec: clarify index and selector expressions
1) Explain a[i] and a[i:j] where a is of type *A as
shortcut for (*a)[i] and (*a)[i:j], respectively.
2) Together with 1), because len() of nil slices is
well defined, there's no need to special case nil
operands anymore.
3) The result of indexing or slicing a constant string
is always a non-constant byte or string value.
4) The result of slicing an untyped string is a value
of type string.
5) If the operand of a valid slice a[i:j] is nil (i, j
must be 0 for it to be valid - this already follows
from the in-range rules), the result is a nil slice.
Fixes#4913.
Fixes#5951.
R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/11884043
»»»
R=r
CC=golang-dev
https://golang.org/cl/12170046
1) Explain a[i] and a[i:j] where a is of type *A as
shortcut for (*a)[i] and (*a)[i:j], respectively.
2) Together with 1), because len() of nil slices is
well defined, there's no need to special case nil
operands anymore.
3) The result of indexing or slicing a constant string
is always a non-constant byte or string value.
4) The result of slicing an untyped string is a value
of type string.
5) If the operand of a valid slice a[i:j] is nil (i, j
must be 0 for it to be valid - this already follows
from the in-range rules), the result is a nil slice.
Fixes#4913.
Fixes#5951.
R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/11884043
Phrases like "returns whether or not the image is opaque" could be
describing what the function does (it always returns, regardless of
the opacity) or what it returns (a boolean indicating the opacity).
Even when the "or not" is missing, the phrasing is bizarre.
Go with "reports whether", which is still clunky but at least makes
it clear we're talking about the return value.
These were edited by hand. A few were cleaned up in other ways.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/11699043
In practice, rejecting an entire structure due to a single invalid byte
in a string is just too picky, and too hard to track down.
Be consistent with the bulk of the standard library by converting
invalid UTF-8 into UTF-8 with replacement runes.
R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/11211045
The notion of a named type is crucial for the definition
of type identity, assignability, definitions of methods.
Explicitly introduce the notion with an extra sentence.
Fixes#5682.
R=r, rsc, iant
CC=golang-dev
https://golang.org/cl/11055043
The existing compilers convert empty strings to empty
but non-nil byte and rune slices. The spec required
a nil byte and rune slice in those cases. That seems
an odd additional requirement. Adjust the spec to
match the reality.
Also, removed over-specification for conversions of
nil []byte and []rune: such nil slices already act
like empty slices and thus don't need extra language.
Added extra examples instead.
Fixes#5704.
R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/10440045
The significant change between TLS 1.0 and 1.1 is the addition of an explicit IV in the case of CBC encrypted records. Support for TLS 1.1 is needed in order to support TLS 1.2.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7880043
to avoid unintentionally clobber R9/R10.
Thanks Lucio for the suggestion.
PS: yes, this could be considered a big change (but not an API change), but
as it turns out even temporarily changes R9/R10 in user code is unsafe and
leads to very hard to diagnose problems later, better to disable using R9/R10
when the user first uses it.
See CL 6300043 and CL 6305100 for two problems caused by misusing R9/R10.
R=golang-dev, khr, rsc
CC=golang-dev
https://golang.org/cl/9840043
This fixes two intra-page "type assertion" links that were broken in
different ways.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9797043
This text is added to doc.go:
Explicit argument indexes:
In Printf, Sprintf, and Fprintf, the default behavior is for each
formatting verb to format successive arguments passed in the call.
However, the notation [n] immediately before the verb indicates that the
nth one-indexed argument is to be formatted instead. The same notation
before a '*' for a width or precision selects the argument index holding
the value. After processing a bracketed expression [n], arguments n+1,
n+2, etc. will be processed unless otherwise directed.
For example,
fmt.Sprintf("%[2]d %[1]d\n", 11, 22)
will yield "22, 11", while
fmt.Sprintf("%[3]*[2].*[1]f", 12.0, 2, 6),
equivalent to
fmt.Sprintf("%6.2f", 12.0),
will yield " 12.00". Because an explicit index affects subsequent verbs,
this notation can be used to print the same values multiple times
by resetting the index for the first argument to be repeated:
fmt.Sprintf("%d %d %#[1]x %#x", 16, 17)
will yield "16 17 0x10 0x11".
The notation chosen differs from that in C, but I believe it's easier to read
and to remember (we're indexing the arguments), and compatibility with
C's printf was never a strong goal anyway.
While we're here, change the word "field" to "arg" or "argument" in the
code; it was being misused and was confusing.
R=rsc, bradfitz, rogpeppe, minux.ma, peter.armitage
CC=golang-dev
https://golang.org/cl/9680043
This is a file of hints, not a file of polished text.
Let's not try to do polished text until we start the
release process.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9750043
Several old TODOs are either resolved now (e.g. when is a return
needed), or are from a time the language wasn't frozen (^ for uints
only). Consolidated the others.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/9599044