Nigel Tao [Tue, 25 Oct 2011 00:28:07 +0000 (11:28 +1100)]
html: remove the Tokenizer.ReturnComments option.
The original intention was to simplify the parser, in making it skip
all comment tokens. However, checking that the Go html package is
100% compatible with the WebKit HTML test suite requires parsing the
comments. There is no longer any real benefit for the option.
Dave Cheney [Mon, 24 Oct 2011 23:13:55 +0000 (19:13 -0400)]
exp/ssh: introduce Session to replace Cmd for interactive commands
This CL replaces the Cmd type with a Session type representing
interactive channels. This lays the foundation for supporting
other kinds of channels like direct-tcpip or x11.
client.go:
* replace chanlist map with slice.
* generalize stdout and stderr into a single type.
* unexport ClientChan to clientChan.
doc.go:
* update ServerConfig/ServerConn documentation.
* update Client example for Session.
message.go:
* make channelExtendedData more like channelData.
Robert Griesemer [Fri, 21 Oct 2011 21:11:36 +0000 (14:11 -0700)]
big: usable zero Rat values without need for explicit initialization
- no explicit API change, but new(big.Rat) now creates a big.Rat value
of 0 that is immediately usable, in sync. w/ the conventions elsewhere
- various cleanups along the way
Robert Griesemer [Fri, 21 Oct 2011 20:26:00 +0000 (13:26 -0700)]
big: implemented Rat.Inv
Also:
- changed semantics of return values for [Int|Rat].SetString
if an error occured (returned value is nil); will expose
hidden errors where return values are not checked
- added more tests
- various cleanups throughout
Rob Pike [Fri, 21 Oct 2011 18:16:46 +0000 (11:16 -0700)]
gotest: make it easier to get the help string
Because gotest's args are mingled with the tests, it's
hard to get the usage message to print. This CL adds
explicit support for -help, spelled several different ways.
Gotest has special flags like -file that are somewhat
hidden otherwise.
Dave Cheney [Fri, 21 Oct 2011 15:04:28 +0000 (11:04 -0400)]
exp/ssh: server cleanups
server.go/channel.go:
* rename Server to ServerConfig to match Client.
* rename ServerConnection to ServeConn to match Client.
* add Listen/Listener.
* ServerConn.Handshake(), general cleanups.
client.go:
* fix bug where fmt.Error was not assigned to err
Russ Cox [Wed, 19 Oct 2011 20:06:16 +0000 (16:06 -0400)]
govet: check canonical dynamic method signatures
Adds check that, for example, a Scan method taking
a first argument of type fmt.ScanState has the correct
signature to satisfy fmt.Scanner.
Similarly, a ReadByte should return byte, os.Error.
These are important to check because various pieces
of code (fmt, gob, json, flate) do dynamic checks
for these methods, so code with incorrect signatures
would not be flagged at compile time.
These become even more important to check when
rune is introduced.
Russ Cox [Wed, 19 Oct 2011 20:02:22 +0000 (16:02 -0400)]
unicode: sort tables.go
Makes tables.go output consistent across maketable runs.
(It was already inconsistent across architectures; the new
map iteration order just make it inconsistent across runs.)
Reviewer: mikesamuel@gmail.com, nigeltao@golang.org
mikesamuel: I don't see a type def for rune. Assuming that's a new intrinsic, LGTM. CC: golang-dev@googlegroups.com
Files:
src/pkg/exp/template/html/css.go
src/pkg/exp/template/html/css_test.go
src/pkg/exp/template/html/html.go
src/pkg/exp/template/html/js.go
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5297045
Rob Pike [Tue, 18 Oct 2011 23:23:07 +0000 (16:23 -0700)]
fmt: clean up after reflect.Interface change.
Store the reflect.Value in the internal print state. Code is simpler, cleaner,
and a little faster - back to what it was before the change.
Mike Samuel [Tue, 18 Oct 2011 22:01:42 +0000 (17:01 -0500)]
exp/template/html: fix bug in cssEscaper
cssEscaper escapes using the CSS convention: `\` + hex + optional-space
It outputs the space when the escape could be followed by
a hex digit to distinguish a "\na" from "\u00aa".
It did not output a space when the escape is followed by a space
character so did not distinguish "\n " from "\n".
Currently when doing lookahead, it does not distinguish spaces that
will be escaped later by the same function from ones that will not.
This is correct but suboptimal.
Mikkel Krautz [Tue, 18 Oct 2011 20:31:03 +0000 (16:31 -0400)]
ld: modify macho linkedit segment to enable OS X code signing
Move string table to the end of the __LINKEDIT segment.
This change allows Apple's codesign(1) utility to successfully sign
Go binaries, as long as they don't contain DWARF data (-w flag to
8l/6l). This is because codesign(1) expects the string table to be
the last part of the file.
Russ Cox [Tue, 18 Oct 2011 20:23:35 +0000 (16:23 -0400)]
godoc: generate package toc in template, not in JavaScript
1. Generate TOC for package pages using template,
instead of using JavaScript magic. This makes the
pages generated by godoc -html easier to export
to other systems.
2. Make TOC one column. It's hard to do two columns
portably without invoking JavaScript.
3. Since the TOC is only one column, show full type
signatures for functions and methods. Many times
that's all you need to see anyway.
4. Name the section after the TOC "Overview".
Naming it something is important, to set it off
from the TOC and so that there's a quick link to
it in the TOC.
Russ Cox [Tue, 18 Oct 2011 18:55:50 +0000 (14:55 -0400)]
gc: preserve uint8 and byte distinction in errors, import data
There is no semantic change here, just better errors.
If a function says it takes a byte, and you pass it an int,
the compiler error now says that you need a byte, not
that you need a uint8.
Robert Griesemer [Tue, 18 Oct 2011 17:28:30 +0000 (10:28 -0700)]
godoc: fix ToAbsolute mapping
The implementation of splitFirst was broken;
splitFirst("foo/") must be the same as splitFirst("foo").
As a result, ToAbsolute could be simplified, and as a side
effect this fixes a long-standing bug.
Thanks to Luca Greco <luca.greco@alcacoop.it> for doing
the investigation.
Adam Langley [Tue, 18 Oct 2011 16:58:57 +0000 (12:58 -0400)]
exp/terminal: split terminal handling from exp/ssh
This change splits terminal handling from exp/ssh, as suggested
several times in the ssh code review.
shell.go and shell_test.go are copies from exp/ssh with minimal
changes, so don't need another full review. A future CL will remove
that code from exp/ssh.
transport.go:
* introduce separate cipher, mac and compression for each direction.
* added filteredConn and packetWriter interfaces.
* newTransport requires a source of randomness.
Robert Griesemer [Mon, 17 Oct 2011 23:35:12 +0000 (16:35 -0700)]
scanner: invalidate scanner.Position when no token is present
scanner.Position is the position of the most recently
scanned token. Make sure it is invalid if there is no
token scanned and update corresponding comment. This
is particularly important when reporting errors.
Nigel Tao [Mon, 17 Oct 2011 22:42:16 +0000 (09:42 +1100)]
html: refactor the tokenizer; parse "</>" correctly.
Previously, Next would call either nextText or nextTag, but nextTag
could also call nextText. Both nextText and nextTag were responsible
for detecting "</a" end tags and "<!" comments. This change simplifies
the call chain and puts that responsibility in a single place.