Commit graph

10293 commits

Author SHA1 Message Date
Russ Cox f1b64aa758 os, syscall: update for error
R=adg
CC=golang-dev
https://golang.org/cl/5333052
2011-11-01 22:12:41 -04:00
Russ Cox 44526cdbe0 non-pkg: gofix -r error -force=error
R=golang-dev, iant, r, r
CC=golang-dev
https://golang.org/cl/5307066
2011-11-01 22:06:05 -04:00
Russ Cox eb6929299b src/pkg/[n-z]*: gofix -r error -force=error
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
2011-11-01 22:05:34 -04:00
Russ Cox c2049d2dfe src/pkg/[a-m]*: gofix -r error -force=error
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5322051
2011-11-01 22:04:37 -04:00
Rob Pike 68050ac76b tutorial,effective_go: prepare for error change
R=adg, rsc
CC=golang-dev
https://golang.org/cl/5316068
2011-11-01 21:50:21 -04:00
Russ Cox 451a1fa46d exec: introduce ExitError
The existing code uses *os.Waitmsg as an os.Error,
but *os.Waitmsg is really just a stringer.

Introduce an explicit error type for the real error.

Not to be submitted until just before error goes in;
the gofix for error updates type assertions
        err.(*os.Waitmsg)
to
        err.(*exec.ExitError)

The seemingly redundant String method will become
an Error method when error goes in, and will no longer
be redundant.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5331044
2011-11-01 21:49:44 -04:00
Russ Cox c93b6a1756 exp/ebnf: manual fixup for error
(The definition of ErrorList is in another file, so gofix
has no hope of getting this right.)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5330043
2011-11-01 21:49:33 -04:00
Russ Cox c8ad1a4dc4 cgo, gotest: use error instead of os.Error in generated code
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5319057
2011-11-01 21:49:22 -04:00
Russ Cox 08a073a180 os: use error, io.EOF
R=r
CC=golang-dev
https://golang.org/cl/5298073
2011-11-01 21:49:08 -04:00
Russ Cox c06cf03f0b io: use error, add EOF, avoid os
R=r, r
CC=golang-dev
https://golang.org/cl/5311068
2011-11-01 21:48:52 -04:00
Russ Cox c14f71c788 runtime: update for error
R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/5306075
2011-11-01 21:48:27 -04:00
Russ Cox e67d3c44f7 exp/types: add error type to universe
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5327051
2011-11-01 21:47:33 -04:00
David Symonds 782fd1fc98 misc/vim: add error type.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5331046
2011-11-01 21:47:07 -04:00
Russ Cox e4ae30f5f5 errors: new package
The only function is errors.New, at least for now.

R=r, gustavo, adg, r
CC=golang-dev
https://golang.org/cl/5321061
2011-11-01 21:46:59 -04:00
Russ Cox 2a0e15d36c gc: add error type
R=ken
CC=golang-dev
https://golang.org/cl/5331043
2011-11-01 21:46:41 -04:00
Russ Cox b4e35629ed http: avoid name error in test
R=adg
CC=golang-dev
https://golang.org/cl/5316070
2011-11-01 21:45:37 -04:00
Russ Cox 758200f219 gofix: error fix
To make the error fix more useful, expand typecheck to gather
more information about struct fields, typecheck range statements,
typecheck indirect and index of named types, and collect information
about assignment conversions.

Also, change addImport to rename top-level uses of a to-be-imported
identifier to avoid conflicts.  This duplicated some of the code in
the url fix, so that fix is now shorter.

R=iant, r, r
CC=golang-dev
https://golang.org/cl/5305066
2011-11-01 21:45:21 -04:00
Russ Cox d9877e22fe spec: add error
R=golang-dev, dsymonds, r, r
CC=golang-dev
https://golang.org/cl/5308072
2011-11-01 21:45:02 -04:00
Andrew Gerrand 9a0563548b tag weekly.2011-11-01
R=golang-dev, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5305085
2011-11-02 10:40:35 +09:00
Andrew Gerrand 08757f722c weekly.2011-11-01
R=rsc, r
CC=golang-dev
https://golang.org/cl/5336044
2011-11-02 10:37:01 +09:00
Andrew Balholm 22ee5ae25a html: stop at scope marker node when generating implied </a> tags
A <a> tag generates implied end tags for any open <a> elements.
But it shouldn't do that when it is inside a table cell the the open <a>
is outside the table.
So stop the search for an open <a> when we reach a scope marker node.

Pass tests1.dat, test 78:
<a href="blah">aba<table><tr><td><a href="foo">br</td></tr>x</table>aoe

| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "abax"
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <a>
|                 href="foo"
|                 "br"
|       "aoe"

Also pass test 79:
<table><a href="blah">aba<tr><td><a href="foo">br</td></tr>x</table>aoe

R=nigeltao
CC=golang-dev
https://golang.org/cl/5320063
2011-11-02 11:47:05 +11:00
Nigel Tao 90b76c0f3e html: refactor the blacklist for the "render and re-parse" test.
R=andybalholm
CC=golang-dev, mikesamuel
https://golang.org/cl/5331056
2011-11-02 09:42:25 +11:00
Mike Solomon f753e3facd textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.
This fixes the issue without an extra copy in the average case.

R=golang-dev, ality, bradfitz
CC=golang-dev
https://golang.org/cl/5272049
2011-11-01 10:31:29 -07:00
Rob Pike cf7281e728 doc/Makefile: add 'all' rule to build all docs
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5334044
2011-11-01 09:45:04 -07:00
Russ Cox b4df33a6ea gc: test + fix escape analysis bug
R=lvd
CC=golang-dev
https://golang.org/cl/5333049
2011-11-01 11:02:43 -04:00
Andrew Gerrand 1fe22d2d24 doc: refer to tour.golang.org instead of go-tour.appspot.com
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5331055
2011-11-01 16:09:29 +09:00
Charles L. Dorian 44262d1574 doc: fix typo in spec example code comment
R=r, golang-dev, adg
CC=golang-dev
https://golang.org/cl/5308071
2011-11-01 15:13:33 +09:00
Robert Griesemer b910a27396 go spec: introduce rune type
R=r, iant, rsc, r
CC=golang-dev
https://golang.org/cl/5293048
2011-11-01 01:09:22 -04:00
Russ Cox 2e79e8e549 rpc: avoid infinite loop on input error
Fixes #1828.
Fixes #2179.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5305084
2011-11-01 00:29:41 -04:00
Russ Cox 7b04471dfa gopack: change archive file name length back to 16
This CL grew the archive file name length from 16 to 64:

        changeset:   909:58574851d792
        user:        Russ Cox <rsc@golang.org>
        date:        Mon Oct 20 13:53:56 2008 -0700

Back then, every x.go file in a package became an x.6 file
in the archive.  It was important to be able to allow the
use of long Go source file names, hence the increase in size.

Today, all Go source files compile into a single _go_.6 file
regardless of their names, so the archive file name length
no longer needs to be long.  The longer name causes some
problems on Plan 9, where the native archive format is the
same but with 16-byte names, so revert back to 16.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5333050
2011-11-01 00:29:16 -04:00
Russ Cox 4853c51770 os: do not interpret 0-length read as EOF
Fixes #2402.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5298081
2011-11-01 00:17:05 -04:00
Andrew Balholm 9db3f78c39 html: process </td> tags; foster parent at most one node per token
Correctly close table cell when </td> is read.

Because of reconstructing the active formatting elements, more than one
node may be created when reading a single token.
If both nodes are foster parented, they will be siblings, but the first
node should be the parent of the second.

Pass tests1.dat, test 77:
<a href="blah">aba<table><a href="foo">br<tr><td></td></tr>x</table>aoe

| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "aba"
|       <a>
|         href="foo"
|         "br"
|       <a>
|         href="foo"
|         "x"
|       <table>
|         <tbody>
|           <tr>
|             <td>
|     <a>
|       href="foo"
|       "aoe"

R=nigeltao
CC=golang-dev
https://golang.org/cl/5305074
2011-11-01 11:42:54 +11:00
Scott Lawrence cae23f036a template: fix error checking on execute without parse
Fixed error checking in exec.go to give a sensible error message when
execution is attempted before a successful parse (rather than an
outright panic).

R=r
CC=golang-dev
https://golang.org/cl/5306065
2011-10-31 16:07:17 -07:00
Russ Cox 92926f5472 pkg: minor cleanup
remove some redundant .String()
change variable name to make it os.Error-proof

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5302075
2011-10-31 17:53:39 -04:00
Russ Cox a07841e21e test: make bug107 os.Error-proof
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5306087
2011-10-31 17:50:38 -04:00
Russ Cox d0eaa58b5a runtime/pprof: document OS X being broken
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5307078
2011-10-31 17:50:25 -04:00
Scott Lawrence a7e473be95 time: add RFC1123 with numeric timezone format
Fixes #841.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5322058
2011-10-31 12:59:06 -07:00
Charles L. Dorian 739c442e42 math: Improved accuracy for Sin and Cos.
Fixes #1564.

R=rsc, dchest
CC=golang-dev
https://golang.org/cl/5320056
2011-10-31 14:26:05 -04:00
Alexander Reece 48c75c5f9c json: Properly handle nil slices.
Marshal nil slices as null and parse null value as a nil slice.
Fixes #2278.

R=rsc
CC=golang-dev
https://golang.org/cl/5257053
2011-10-31 13:59:23 -04:00
Russ Cox 288dacd016 A+C: Alexander Reece (individual CLA)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5297072
2011-10-31 13:59:04 -04:00
Andrey Mirtchovski d1f48db1cc syscall: fix Await msg on Plan 9
Plan 9's await() returns '' for nil exit status but programs, most notably gotest,
see this as an error return.

R=rsc
CC=golang-dev
https://golang.org/cl/5305079
2011-10-31 13:34:59 -04:00
Luuk van Dijk 50110c9f83 gc: clean up printing.
Got rid of all the magic mystery globals. Now
for %N, %T, and %S, the flags +,- and # set a sticky
debug, sym and export mode, only visible in the new fmt.c.
Default is error mode. Handle h and l flags consistently with
the least side effects, so we can now change
things without worrying about unrelated things
breaking.

fixes #2361

R=rsc
CC=golang-dev
https://golang.org/cl/5316043
2011-10-31 18:09:40 +01:00
Fazlul Shahriar 5842336089 net: Plan 9 fixes
Makes all tests pass.

R=rsc
CC=golang-dev
https://golang.org/cl/5320041
2011-10-31 11:47:44 -04:00
Jan Newmarch 350a5ce64f misc/emacs/go-lang.el: Fix restoration of multiple windows in a frame after gofmt
If a frame has multiple windows then the windows must all be restored
after gofmt has finished and the old windows must be restored.
Before this fix, only the Go code edit window would be left.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5280050
2011-10-31 11:33:14 -04:00
Marcel van Lohuizen eef7809193 exp/norm: fixed bug that creeped in with moving to the new
regexp, which caused the last line of a test block to be ignored.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5177052
2011-10-31 10:58:04 +01:00
Dave Cheney 0f6b80c694 exp/ssh: fix length header leaking into channel data streams.
The payload of a data message is defined as an SSH string type,
which uses the first four bytes to encode its length. When channelData
and channelExtendedData were added I defined Payload as []byte to
be able to use it directly without a string to []byte conversion. This
resulted in the length data leaking into the payload data.

This CL fixes the bug, and restores agl's original fast path code.

Additionally, a bug whereby s.lock was not released if a packet arrived
for an invalid channel has been fixed.

Finally, as they were no longer used, I have removed
the channelData and channelExtedendData structs.

R=agl, rsc
CC=golang-dev
https://golang.org/cl/5330053
2011-10-29 14:22:30 -04:00
Andrew Balholm 604e10c34d html: adjust bookmark in "adoption agency" algorithm
In the adoption agency algorithm, the formatting element is sometimes
removed from the list of active formatting elements and reinserted at a later index.
In that case, the bookmark showing where it is to be reinserted needs to be moved,
so that its position relative to its neighbors remains the same
(and also so that it doesn't become out of bounds).

Pass tests1.dat, test 70:
<DIV> abc <B> def <I> ghi <P> jkl </B>

| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|       <i>
|         <p>
|           <b>
|             " jkl "

Also pass tests through test 76:
<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

R=nigeltao
CC=golang-dev
https://golang.org/cl/5322052
2011-10-29 10:51:59 +11:00
Andrew Balholm 03f163c7f2 html: don't run "adoption agency" on elements that aren't in scope.
Pass tests1.dat, test 55:
<!DOCTYPE html><font><table></font></table></font>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <font>
|       <table>

Also pass tests through test 69:
<DIV> abc <B> def <I> ghi <P> jkl

R=nigeltao
CC=golang-dev
https://golang.org/cl/5309074
2011-10-28 16:04:58 +11:00
Russ Cox 0e81e508be fmt: handle os.Error values
Handling os.Error is no different than handling fmt.Stringer
here, so the code is redundant now, but it will be necessary
once error goes in.

Adding it now will make gofix fix it.

R=r
CC=golang-dev
https://golang.org/cl/5331045
2011-10-27 21:20:44 -07:00
Russ Cox 853c84631f template: do not use error as stringer
R=r
CC=golang-dev
https://golang.org/cl/5305069
2011-10-27 21:17:47 -07:00