This is not the finished product,
but a good checkpoint from which to
proceed with further development.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5571061
Fixes#2776.
There was a previous attempt at CL 5592043 but that
seems to have stalled. This one is simpler, and more up to date
(correct handling of spdy, for example).
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645091
The paragraph describing the ellipses presents the horizontal ellipsis
in two different fonts and at least on my screen they look too different.
Switch to a consistent rendering.
Of small steps are great journeys undertaken.
R=golang-dev, rsc, dsymonds, gri
CC=golang-dev
https://golang.org/cl/5650055
If a printer is configured with the SourcePos mode
set, it will emit //-line comments as necessary to
ensure that the result - if reparsed - reflects the
original source position information.
This change required a bit of reworking of the
output section in printer.go. Specifically:
- Introduced new Config mode 'SourcePos'.
- Introduced new position 'out' which tracks the
position of the generated output if it were read
in again. If there is a discrepancy between out
and the current AST/source position, a //line
comment is emitted to correct for it.
- Lazy emission of indentation so that //line
comments can be placed correctly. As a result,
the trimmer will have to do less work.
- Merged writeItem into writeString.
- Merged writeByteN into writeByte.
- Use a []byte instead of a byte.Buffer both in the
printer and in the trimmer (eliminates dependency).
Also: introduced explicit printer.Mode type (in
sync w/ parser.Mode, scanner.Mode, etc.)
Runs all tests. Applied gofmt to src, misc w/o changes.
Fixes#1047.
Fixes#2697.
R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5643066
(*Writer, error) if they take a compression level, and *Writer otherwise.
Rename gzip's Compressor and Decompressor to Writer and Reader, similar to
flate and zlib.
Clarify commentary when writing gzip metadata that is not representable
as Latin-1, and fix io.EOF comment bug.
Also refactor gzip_test to be more straightforward.
Fixes#2839.
R=rsc, r, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5639057
Delete O_NDELAY, O_NONBLOCK, O_NOCTTY, O_ASYNC.
Clean up some docs.
Rename ShellExpand -> ExpandEnv.
Make NewFile take a uintptr; change File.Fd to return one.
(for API compatibility between Unix and Windows)
Fixes#2947
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5655045
Other wordings are possible but defining this as one
of the ways to proceed means we don't have to add
language about this to the description of select.
Fixes#2825.
R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5643062
Issue 2856 asks for a rename of a few methods to a
more idiomatic Go style. This is a very early API
that evolved organically throughout the years.
Together with the fact that ErrorVectors were embedded
in other data structures (e.g. Parser), just renaming
methods (e.g. GetError -> Error) would lead to undesired
behavior (e.g., Parser would act like an Error). Instead,
cleaned up API a bit more:
- removed ErrorVector in favor of ErrorList (already
present)
- simplified Scanner.Init by making the error handler a
function instead of requiring an ErrorHandler implementation
- adjusted helper functions accordingly
- updated Go 1 doc
Fixes#2856.
R=rsc
CC=golang-dev
https://golang.org/cl/5624047
Otherwise, the registration semantics are
init-order-dependent, which I was trying very hard
to avoid in the API. This may break broken programs.
Fixes#2900.
R=golang-dev, r, bradfitz, dsymonds, balasanjay, kevlar
CC=golang-dev
https://golang.org/cl/5644051
The function has a bizarre signature: it was the only public function there
that exposed the reflect package. Also, its definition is peculiar and hard to
explain. It doesn't merit being exported.
This is an API change but really, it should never have been exported and
it's certain very few programs will depend on it: it's too weird.
Fixes#2846.
R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5639054
It complicates the interface unnecessarily.
Document this in go1.html.
Also update the go/doc Makefile.
Fixes#2836.
R=golang-dev, gri, bradfitz
CC=golang-dev
https://golang.org/cl/5642054
Specifically, remove simply where it is claiming that the
code or the action to be carried out is simple, since the
reader might disagree.
R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5637048
This CL introduces new function ListenMulticastUDP to fix
multicast UDP listening across multiple listeners issue,
to replace old multicast methods JoinGroup and LeaveGroup
on UDPConn.
This CL also enables multicast testing by default.
Fixes#2730.
R=rsc, paul.a.lalonde, fullung, devon.odell
CC=golang-dev
https://golang.org/cl/5562048
Separating Method from Func made the code only more complicated
without adding much to the useability/readability of the API.
Reverted to where it was, but leaving the new method-specific
fields Orig and Level.
Former clients (godoc) of doc.Method only used the Func fields;
and because Func was embedded, no changes are needed with respect
to the removal of Method.
Changed type of Func.Recv from ast.Expr to string. This was a
long-standing TODO. Also implemented Func.Orig field (another TODO).
No further go/doc API changes are expected for Go 1.
R=rsc, r, r
CC=golang-dev
https://golang.org/cl/5577043
Document that indirection through a nil pointer will panic.
Explain function invocation.
This section will need more work, but it's a start.
Fixes#1865.
Fixes#2252.
R=rsc, iant, r
CC=golang-dev
https://golang.org/cl/5532114
This should make it easier to add the zillion little changes coming.
No content change here beyond a couple of introductory sentences.
Sections have been moved wholesale without editing them.
R=golang-dev, rsc, gri
CC=golang-dev
https://golang.org/cl/5557074
(Sending to r because of the API change.)
Over time we might want to add support for other key types.
While I was in the code, I also made the use of RawSubject the same
between Subject and Issuer when creating certificates.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5554049
(Sending to r because of the API change.)
This change alters the API for crypto/elliptic to permit different
implementations in the future. This will allow us to add faster,
constant-time implementations of the standard curves without any more
API changes.
As a demonstration, it also adds a constant-time implementation of
P224. Since it's only 32-bit, it's actually only about 40% the speed
of the generic code on a 64-bit system.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5528088
Also, disable server-side generation of TOC for commands as they would
only ever show Overview. The JS does a better job (for now).
Fixes#2732.
R=gri, dsymonds
CC=golang-dev
https://golang.org/cl/5558046
This allows HTML pages to specify arbitrary data in a header:
<!--{
"Title": "The page title",
...
}-->
replacing the old style comments:
<!-- title The page title -->
R=gri, rsc, r, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/5532093
Previously, a timeout (in int64 nanoseconds) applied to a granularity
even smaller than one operation: a 100 byte read with a 1 second timeout
could take 100 seconds, if the bytes all arrived on the network 1 second
apart. This was confusing.
Rather than making the timeout granularity be per-Read/Write,
this CL makes callers set an absolute deadline (in time.Time)
after which operations will fail. This makes it possible to
set deadlines at higher levels, without knowing exactly how
many read/write operations will happen in e.g. reading an HTTP
request.
Fixes#2723
R=r, rsc, dave
CC=golang-dev
https://golang.org/cl/5555048
- define "0-sized"
- add clarifying sentence to pointer comparison
- removed notion "location" which was used only in pointer comparisons
and which was never defined
Fixes#2620.
R=r, rsc, iant
CC=golang-dev
https://golang.org/cl/5528053
gofmt likes to put lines like
// STOP OMIT
two blank lines from a closing brace, creating an ugly space inside
<pre> blocks in some of these files. This change resolves this issue.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5520044
They're out of date, a pain to maintain, and most of the material
is better served by the Go Tour.
Fixes#2101.
R=golang-dev, rsc, r, adg
CC=golang-dev
https://golang.org/cl/5489053
Several places mentioned tokens spanning "multiple lines"
which is not a well-defined term in the spec; newline is.
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5490046
This change guarantees that whether the line ending convention
when the source is created includes carriage returns is irrelevant
to the value of the string. See issue 680.
The compilers do not yet implement this.
R=golang-dev, adg, r, gri, rsc, iant
CC=golang-dev
https://golang.org/cl/5491043
Also, clarify when interface comparison panics and
that comparison to nil is a special syntax rather than
a general comparison rule.
R=r, gri, r, iant, cw, bradfitz
CC=golang-dev
https://golang.org/cl/5440117
src/clean.bash:
Add clean-ups for previously overlooked directories.
doc/codelab/wiki/Makefile:
Dropped "index.html" from CLEANFILES so it will not be
deleted on cleaning.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5476050
Lines that end with OMIT are omitted from the output.
A comment such as
// Example stops here. OMIT
can be used as a marker but not appear in the output.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5477050
This is a spec correction, not a language change.
The implementations have behaved like this for years
(and there are tests to that effect), and elsewhere in
the spec true and false are defined to be untyped
boolean constants.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5477047
This CL is in part a proposal for how to write these sections:
- Brief discussion of change
- No attempt to analyze the thinking about it
- Old code
- New code, runnable if possible
- How to update old programs
R=golang-dev, remyoudompheng, gri, adg
CC=golang-dev
https://golang.org/cl/5454044
No content yet other than titles and an introductory paragraph.
Once this is in, content can arise as separate manageable CLs.
R=rsc
CC=golang-dev
https://golang.org/cl/5435090
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.
No attempt is made to use the new Append functions
even though there are definitely opportunities.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
This has always been true, but we lost it from the spec
somewhere along the way, probably when we disallowed
the general 'pointer to anything sliceable' slice case.
R=gri
CC=golang-dev
https://golang.org/cl/5437121
The special case in the spec is that you can take the
address of a composite literal using the & operator.
A composite literal is not, however, generally addressable,
and the slice operator requires an addressable argument,
so [3]int{1,2,3}[:] is invalid. This tutorial code and one bug
report are the only places in the tree where it appears.
R=r, gri
CC=golang-dev
https://golang.org/cl/5437120
To structure larger sections of comments in html output headings
are detected in comments and formated as h3 in the generated html.
A simple heuristic is used to detect headings in comments:
A heading is a non-blank, non-indented line preceded by a blank
line. It is followed by a blank and a non-blank, non-indented line.
A heading must start with an uppercase letter and end with a letter,
digit or a colon. A heading may not contain punctuation characters.
R=jan.mercl, gri, adg, rsc, r
CC=golang-dev
https://golang.org/cl/5437056
The Set type is gone. Instead, templates are automatically associated by
being parsed together; nested definitions implicitly create associations.
Only associated templates can invoke one another.
This approach dramatically reduces the breadth of the construction API.
For now, html/template is deleted from src/pkg/Makefile, so this can
be checked in. Nothing in the tree depends on it. It will be updated next.
R=dsymonds, adg, rsc, r, gri, mikesamuel, nigeltao
CC=golang-dev
https://golang.org/cl/5415060
The allowed conversions before and after are:
type Tstring string
type Tbyte []byte
type Trune []rune
string <-> string // ok
string <-> []byte // ok
string <-> []rune // ok
string <-> Tstring // ok
string <-> Tbyte // was illegal, now ok
string <-> Trune // was illegal, now ok
Tstring <-> string // ok
Tstring <-> []byte // ok
Tstring <-> []rune // ok
Tstring <-> Tstring // ok
Tstring <-> Tbyte // was illegal, now ok
Tstring <-> Trune // was illegal, now ok
Update spec, compiler, tests. Use in a few packages.
We agreed on this a few months ago but never implemented it.
Fixes#1707.
R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5421057
An experiment: allow structs to be copied even if they
contain unexported fields. This gives packages the
ability to return opaque values in their APIs, like reflect
does for reflect.Value but without the kludgy hacks reflect
resorts to.
In general, we trust programmers not to do silly things
like *x = *y on a package's struct pointers, just as we trust
programmers not to do unicode.Letter = unicode.Digit,
but packages that want a harder guarantee can introduce
an extra level of indirection, like in the changes to os.File
in this CL or by using an interface type.
All in one CL so that it can be rolled back more easily if
we decide this is a bad idea.
Originally discussed in March 2011.
https://groups.google.com/group/golang-dev/t/3f5d30938c7c45ef
R=golang-dev, adg, dvyukov, r, bradfitz, jan.mercl, gri
CC=golang-dev
https://golang.org/cl/5372095