]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agohtml: treat <image> as <img>
Andrew Balholm [Tue, 8 Nov 2011 22:43:55 +0000 (09:43 +1100)]
html: treat <image> as <img>

Pass tests1.dat, test 90:
<p><image></p>

| <html>
|   <head>
|   <body>
|     <p>
|       <img>

Also pass test 91:
<a><table><a></table><p><a><div><a>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5339052

13 years agotext/template: make redefinition of a template in a set more consistent.
Rob Pike [Tue, 8 Nov 2011 22:33:07 +0000 (14:33 -0800)]
text/template: make redefinition of a template in a set more consistent.
Also make it agree with the documentation. You get an error, unless you're
calling Add explicitly, in which case it panics since that's almost certainly
a bug. The discrepancy was caused by a panic that wasn't turned into
an error along one path; deleted the offending function for clarity.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5354045

13 years agoruntime: add timespec definition for freebsd
Joel Sing [Tue, 8 Nov 2011 16:43:58 +0000 (11:43 -0500)]
runtime: add timespec definition for freebsd

R=golang-dev, devon.odell
CC=golang-dev
https://golang.org/cl/5340058

13 years agoos, syscall: fix Plan 9 build
Anthony Martin [Tue, 8 Nov 2011 14:06:02 +0000 (09:06 -0500)]
os, syscall: fix Plan 9 build

R=rsc
CC=golang-dev
https://golang.org/cl/5330067

13 years agohtml: parse <body>, <base>, <link>, <meta>, and <title> tags inside page body
Andrew Balholm [Tue, 8 Nov 2011 06:55:17 +0000 (17:55 +1100)]
html: parse <body>, <base>, <link>, <meta>, and <title> tags inside page body

Pass tests1.dat, test 87:
<body><body><base><link><meta><title><p></title><body><p></body>

| <html>
|   <head>
|   <body>
|     <base>
|     <link>
|     <meta>
|     <title>
|       "<p>"
|     <p>

Handling the last <body> tag requires correcting the original insertion mode in useTheRulesFor.

Also pass test 88:
<textarea><p></textarea>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5364047

13 years agoruntime: add windows callback tests
Alex Brainman [Tue, 8 Nov 2011 05:53:31 +0000 (16:53 +1100)]
runtime: add windows callback tests

Just a copy of cgo callback tests from misc/cgo/test.

R=rsc
CC=golang-dev, hectorchu
https://golang.org/cl/5331062

13 years agogotest: don't run examples that have no expected output
Andrew Gerrand [Mon, 7 Nov 2011 23:11:07 +0000 (10:11 +1100)]
gotest: don't run examples that have no expected output

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5364041

13 years agohtml: fix typo in package docs.
Nigel Tao [Mon, 7 Nov 2011 23:09:17 +0000 (10:09 +1100)]
html: fix typo in package docs.

Fixes #2419.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5352046

13 years agonet: fix build comment
Mikio Hara [Mon, 7 Nov 2011 21:56:35 +0000 (06:56 +0900)]
net: fix build comment

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5353045

13 years agogc: Clean up dostruct/stotype, detect broken fields and propagate up to structs and...
Luuk van Dijk [Mon, 7 Nov 2011 20:35:13 +0000 (21:35 +0100)]
gc: Clean up dostruct/stotype, detect broken fields and propagate up to structs and functions to supress spurious errors.

Fixes #1556.

R=rsc
CC=golang-dev
https://golang.org/cl/5351042

13 years agogo/ast: fix bugs in SortImports
Russ Cox [Mon, 7 Nov 2011 19:44:06 +0000 (14:44 -0500)]
go/ast: fix bugs in SortImports

Tests are in gofix, since the bugs arise in rewritten ASTs.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5365043

13 years agolib9: fix windows build
Russ Cox [Mon, 7 Nov 2011 19:16:00 +0000 (14:16 -0500)]
lib9: fix windows build

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5362045

13 years agolib9: add ctime
Russ Cox [Mon, 7 Nov 2011 18:15:16 +0000 (13:15 -0500)]
lib9: add ctime

ctime differs across Unix vs Plan 9 so add to portability library

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5363043

13 years agoruntime/cgo: fix data declaration to be extern
Russ Cox [Mon, 7 Nov 2011 18:15:06 +0000 (13:15 -0500)]
runtime/cgo: fix data declaration to be extern

Otherwise some OS X toolchains complain about the redeclaration
of libcgo_thread_start by multiple object files.  The real definition
is in util.c.

Fixes #2167.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5364045

13 years agoexp/ssh: improved client authentication support
Dave Cheney [Mon, 7 Nov 2011 17:37:05 +0000 (12:37 -0500)]
exp/ssh: improved client authentication support

This CL adds an API for handling the various SSH
authenticaton methods. None and password continue
to be the only supported methods.

R=bradfitz, agl, n13m3y3r, rsc, cw
CC=golang-dev
https://golang.org/cl/5328045

13 years agoruntime: fix prototype for openbsd thrsleep
Joel Sing [Mon, 7 Nov 2011 16:57:34 +0000 (11:57 -0500)]
runtime: fix prototype for openbsd thrsleep

- Fix function prototype for thrsleep().
- Provide enums for clock identifiers.
- Provide timespec structure for use with thrsleep().

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/5360042

13 years agogc: use HEADER_IO macro from gopack
Ron Minnich [Mon, 7 Nov 2011 16:42:13 +0000 (11:42 -0500)]
gc: use HEADER_IO macro from gopack

Use HEADER_IO macro from gopack to read archive header
The HEADER_IO macro portably reads archive headers. The
current arsize code fails in the case of archive headers produced
on plan 9 6c and read on other systems (it's not portable).
Modify lex.c to use the portable macro
Build tested (including tests) on OSX.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5323072

13 years agogc: format nits
Lucio De Re [Mon, 7 Nov 2011 16:42:08 +0000 (11:42 -0500)]
gc: format nits

src/cmd/gc/bits.c: corrected a mistaken format;
src/cmd/gc/go.h: %E can accept uints.

R=rsc
CC=golang-dev
https://golang.org/cl/5331041

13 years agoCONTRIBUTORS: add David Crawshaw's codereview account
Russ Cox [Mon, 7 Nov 2011 16:18:38 +0000 (11:18 -0500)]
CONTRIBUTORS: add David Crawshaw's codereview account

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5339047

13 years agoxml: allow parsing of <_> </_>.
David Crawshaw [Mon, 7 Nov 2011 15:47:44 +0000 (10:47 -0500)]
xml: allow parsing of <_> </_>.

R=rsc, nigeltao
CC=golang-dev
https://golang.org/cl/5298061

13 years agoarchive/zip: actually close file opened with OpenReader.
Dmitry Chestnykh [Mon, 7 Nov 2011 05:33:53 +0000 (16:33 +1100)]
archive/zip: actually close file opened with OpenReader.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5341044

13 years agonet/http: fix whitespace handling in sniffer.
David Symonds [Mon, 7 Nov 2011 00:55:33 +0000 (11:55 +1100)]
net/http: fix whitespace handling in sniffer.

A single character typo ("\n" instead of "\r") meant that
HTML data using DOS line breaks (CRLF) was not detected as HTML.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5365041

13 years agoruntime: windows_386 sighandler to use correct g
Alex Brainman [Mon, 7 Nov 2011 00:00:14 +0000 (11:00 +1100)]
runtime: windows_386 sighandler to use correct g

Fixes #2403.

R=hectorchu
CC=golang-dev
https://golang.org/cl/5309071

13 years agohtml: be able to test more than one testdata file.
Nigel Tao [Sun, 6 Nov 2011 22:38:40 +0000 (09:38 +1100)]
html: be able to test more than one testdata file.

R=andybalholm
CC=golang-dev
https://golang.org/cl/5351041

13 years agogc: Better error message for range over non-receive channel.
Luuk van Dijk [Sun, 6 Nov 2011 21:14:15 +0000 (22:14 +0100)]
gc: Better error message for range over non-receive channel.

Fixes #2354

R=rsc
CC=golang-dev
https://golang.org/cl/5346044

13 years agogc: Switch related errors should use plain format.
Luuk van Dijk [Sun, 6 Nov 2011 21:13:54 +0000 (22:13 +0100)]
gc: Switch related errors should use plain format.

Fixes #2422.

R=rsc
CC=golang-dev
https://golang.org/cl/5353046

13 years agomath: faster Gamma
Charles L. Dorian [Sat, 5 Nov 2011 19:25:36 +0000 (12:25 -0700)]
math: faster Gamma

Having the compiler count the number of array elements speeds up Gamma from 63.7 to 56.6 ns/op.

R=rsc, golang-dev, r
CC=golang-dev
https://golang.org/cl/5362043

13 years agogofix: avoid panic on body-less functions in netudpgroup.
David Symonds [Sat, 5 Nov 2011 00:28:23 +0000 (11:28 +1100)]
gofix: avoid panic on body-less functions in netudpgroup.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5347041

13 years agotest: make closedchan.go exit with failure if something fails
Ian Lance Taylor [Fri, 4 Nov 2011 21:12:35 +0000 (14:12 -0700)]
test: make closedchan.go exit with failure if something fails

R=golang-dev, rsc, iant
CC=golang-dev
https://golang.org/cl/5356042

13 years agomath: improved high-angle test for Cos, Sin and Tan
Charles L. Dorian [Fri, 4 Nov 2011 19:35:59 +0000 (15:35 -0400)]
math: improved high-angle test for Cos, Sin and Tan

Maximum error for 386 is "close" (1e-14). For amd64, it's "veryclose" (4e-16).

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5340042

13 years agogoinstall: allow packages from launchpad.net/~user branches.
Jani Monoses [Fri, 4 Nov 2011 19:07:34 +0000 (15:07 -0400)]
goinstall: allow packages from launchpad.net/~user branches.

The permitted filename characters should include ~ to allow
the names of user-owned branches in Launchpad.

R=golang-dev, rsc, n13m3y3r, gustavo
CC=golang-dev, gustavo.niemeyer
https://golang.org/cl/5280052

13 years agoCONTRIBUTORS: add Rietveld address for Jani Monoses
Gustavo Niemeyer [Fri, 4 Nov 2011 19:05:32 +0000 (15:05 -0400)]
CONTRIBUTORS: add Rietveld address for Jani Monoses

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5340046

13 years agohtml/template: wraps package template instead of exposing func Escape
Mike Samuel [Fri, 4 Nov 2011 17:09:21 +0000 (13:09 -0400)]
html/template: wraps package template instead of exposing func Escape

This does escaping on first execution.

template.go defines the same interface elements as package template.
It requires rather more duplication of code than I'd like, but I'm
not clear how to avoid that.

Maybe instead of

    mySet.ParseGlob(...)
    template.ParseSetGlob(...)
    mySet.ParseFiles(...)
    mySet.ParseTemplateFiles(...)
    template.ParseTemplateFiles(...)

we combine these into a fileset abstraction that can be wrapped

    var fileset template.FileSet
    fileset.Glob(...)  // Load a few files by glob
    fileset.Files(...)  // Load a few {{define}}d files
    fileset.TemplateFiles(...)  // Load a few files as template bodies
    fileset.Funcs(...)  // Make the givens func available to templates
    // Do the parsing.
    set, err := fileset.ParseSet()
    // or set, err := fileset.ParseInto(set)

or provide an interface that can receive filenames and functions and
parse messages:

    type Bundle interface {
      TemplateFile(string)
      File(string)
      Funcs(FuncMap)
    }

and define template.Parse* to handle the file-system stuff and send
messages to a bundle:

    func ParseFiles(b Bundle, filenames ...string)

R=r, r
CC=golang-dev
https://golang.org/cl/5270042

13 years agohttp: support Trailers in ReadRequest
Brad Fitzpatrick [Fri, 4 Nov 2011 16:17:46 +0000 (09:17 -0700)]
http: support Trailers in ReadRequest

Available after closing Request.Body.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/5348041

13 years agogc: detect type switch variable not used cases.
Luuk van Dijk [Fri, 4 Nov 2011 16:03:50 +0000 (17:03 +0100)]
gc: detect type switch variable not used cases.

Fixes #873
Fixes #2162

R=rsc
CC=golang-dev
https://golang.org/cl/5341043

13 years agohtml,bzip2,sql: rename Error methods that return error to Err
Gustavo Niemeyer [Fri, 4 Nov 2011 13:50:20 +0000 (09:50 -0400)]
html,bzip2,sql: rename Error methods that return error to Err

There are three classes of methods/functions called Error:

a) The Error method in the just introduced error interface
b) Error methods that create or report errors (http.Error, etc)
c) Error methods that return errors previously associated with
   the receiver (Tokenizer.Error, rows.Error, etc).

This CL introduces the convention that methods in case (c)
should be named Err.

The reasoning for the change is:

- The change differentiates the two kinds of APIs based on
  names rather than just on signature, unloading Error a bit
- Err is closer to the err variable name that is so commonly
  used with the intent of verifying an error
- Err is shorter and thus more convenient to be used often
  on error verifications, such as in iterators following the
  convention of the sql package.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5327064

13 years agotemplate: format error with pointer receiver.
David Symonds [Fri, 4 Nov 2011 12:45:38 +0000 (23:45 +1100)]
template: format error with pointer receiver.

This is a continuation of 982d70c6d5d6.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5348042

13 years agoruntime: fix linux/arm nanotime?
Russ Cox [Fri, 4 Nov 2011 12:38:10 +0000 (08:38 -0400)]
runtime: fix linux/arm nanotime?

TBR=r
CC=golang-dev
https://golang.org/cl/5354041

13 years agotemplate: format errors
Russ Cox [Fri, 4 Nov 2011 11:33:55 +0000 (07:33 -0400)]
template: format errors

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5340043

13 years agoruntime: fix openbsd nanotime?
Russ Cox [Fri, 4 Nov 2011 11:24:39 +0000 (07:24 -0400)]
runtime: fix openbsd nanotime?

TBR=r
CC=golang-dev
https://golang.org/cl/5353041

13 years agobytes: fix typo and resolve to be less idiotic next time
Andrew Gerrand [Fri, 4 Nov 2011 06:55:21 +0000 (17:55 +1100)]
bytes: fix typo and resolve to be less idiotic next time

R=bradfitz
CC=golang-dev
https://golang.org/cl/5340044

13 years agobytes: add Contains function
Andrew Gerrand [Fri, 4 Nov 2011 06:46:52 +0000 (17:46 +1100)]
bytes: add Contains function

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5349041

13 years agohtml: properly close <tr> element when an new <tr> starts.
Andrew Balholm [Fri, 4 Nov 2011 04:48:11 +0000 (15:48 +1100)]
html: properly close <tr> element when an new <tr> starts.

Pass tests1.dat, test 87:
<table><tr><tr><td><td><span><th><span>X</table>

| <html>
|   <head>
|   <body>
|     <table>
|       <tbody>
|         <tr>
|         <tr>
|           <td>
|           <td>
|             <span>
|           <th>
|             <span>
|               "X"

R=nigeltao
CC=golang-dev
https://golang.org/cl/5343041

13 years agohttp: doc nits
Brad Fitzpatrick [Fri, 4 Nov 2011 03:37:02 +0000 (20:37 -0700)]
http: doc nits

Remove the last two "convenience" mentions.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5344041

13 years agohttp: clarify Request docs
Brad Fitzpatrick [Fri, 4 Nov 2011 03:05:13 +0000 (20:05 -0700)]
http: clarify Request docs

R=rsc
CC=golang-dev
https://golang.org/cl/5342041

13 years agohttputil: move dump and chunking functions out of http
Brad Fitzpatrick [Fri, 4 Nov 2011 01:12:51 +0000 (18:12 -0700)]
httputil: move dump and chunking functions out of http

This moves DumpRequest, DumpResponse, NewChunkedReader,
and NewChunkedWriter out of http, as part of the continued
http diet plan.

Also, adds DumpRequestOut (for dumping outbound requests),
since DumpRequest's ambiguity (the "wire representation" in
what direction?) was often a source of confusion and bug
reports.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/5339041

13 years agogob: fix bug when registering the same type multiple times
Rob Pike [Fri, 4 Nov 2011 01:05:14 +0000 (18:05 -0700)]
gob: fix bug when registering the same type multiple times
Need to compare user type, not base type.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5340041

13 years agohttp: only recognize application/x-www-form-urlencoded in ParseForm
Brad Fitzpatrick [Fri, 4 Nov 2011 00:21:58 +0000 (17:21 -0700)]
http: only recognize application/x-www-form-urlencoded in ParseForm

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5322070

13 years agohttputil: move ReverseProxy out of http
Brad Fitzpatrick [Thu, 3 Nov 2011 22:54:08 +0000 (15:54 -0700)]
httputil: move ReverseProxy out of http

http diet plan, continued.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5305090

13 years agohtml: move <link> element from after <head> into <head>
Andrew Balholm [Thu, 3 Nov 2011 22:29:06 +0000 (09:29 +1100)]
html: move <link> element from after <head> into <head>

Pass tests1.dat, test 85:
<head><meta></head><link>

| <html>
|   <head>
|     <meta>
|     <link>
|   <body>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5297079

13 years agonet/http/httputil: new package; move ClientConn and ServerConn
Brad Fitzpatrick [Thu, 3 Nov 2011 21:44:29 +0000 (14:44 -0700)]
net/http/httputil: new package; move ClientConn and ServerConn

Part of http diet plan.

More of the lesser-used and newcomer-misleading parts of http will
move here.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5336049

13 years agotime: faster Nanoseconds call
Russ Cox [Thu, 3 Nov 2011 21:35:28 +0000 (17:35 -0400)]
time: faster Nanoseconds call

runtime knows how to get the time of day
without allocating memory.

R=golang-dev, dsymonds, dave, hectorchu, r, cw
CC=golang-dev
https://golang.org/cl/5297078

13 years agoruntime: fix set and not used
Russ Cox [Thu, 3 Nov 2011 21:35:11 +0000 (17:35 -0400)]
runtime: fix set and not used

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5305087

13 years agogofix: make fix order implicit by date.
David Symonds [Thu, 3 Nov 2011 21:34:37 +0000 (08:34 +1100)]
gofix: make fix order implicit by date.

This partially undoes 8fd7e6d070c8, but preserves its semantics.
More importantly, it results in the data about each fix being
decentralised, which makes it easier for new fixes to be added,
and other gofix users to slot new fixes in.

It also adds some useful metadata that could be used in the future.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5306092

13 years agoos,text,unicode: renamings
Rob Pike [Thu, 3 Nov 2011 21:18:06 +0000 (14:18 -0700)]
os,text,unicode: renamings
This is Go 1 package renaming CL #4.
This one merely moves the source; the import strings will be
changed after the next weekly release.
This one moves pieces into os, text, and unicode.

exec -> os/exec
scanner -> text/scanner
tabwriter -> text/tabwriter
template -> text/template
template/parse -> text/template/parse
utf16 -> unicode/utf16
utf8 -> unicode/utf8

This should be the last of the source-rearranging CLs.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5331066

13 years agoall: rename os.EOF to io.EOF in various non-code contexts
Vincent Vanackere [Thu, 3 Nov 2011 21:01:30 +0000 (14:01 -0700)]
all: rename os.EOF to io.EOF in various non-code contexts

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5334050

13 years agonet: renamings
Rob Pike [Thu, 3 Nov 2011 20:26:43 +0000 (13:26 -0700)]
net: renamings
This is Go 1 package renaming CL #3.
This one merely moves the source; the import strings will be
changed after the next weekly release.
This one moves pieces into net.

http -> net/http
http/cgi -> net/http/cgi
http/fcgi -> net/http/fcgi
http/pprof -> net/http/pprof
http/httptest -> net/http/httptest
mail -> net/mail
rpc -> net/rpc
rpc/jsonrpc -> net/rpc/jsonrpc
smtp -> net/smtp
url -> net/url

Also remove rand (now math/rand) from NOTEST - it has a test.

The only edits are in Makefiles and deps.bash.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5335048

13 years agohtml,log,math: renamings
Rob Pike [Thu, 3 Nov 2011 19:42:57 +0000 (12:42 -0700)]
html,log,math: renamings
This is Go 1 package renaming CL #2.
This one merely moves the source; the import strings will be
changed after the next weekly release.

exp/template/html -> html/template
big -> math/big
cmath -> math/cmplx
rand -> math/rand
syslog -> log/syslog

The only edits are in Makefiles and deps.bash.

Note that this CL moves exp/template/html out of exp. I decided
to do that so all the renamings can be done together, even though
the API (and that of template, for that matter) is still fluid.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5332053

13 years agohttp: don't use ClientConn in Transport
Brad Fitzpatrick [Thu, 3 Nov 2011 19:35:56 +0000 (12:35 -0700)]
http: don't use ClientConn in Transport

ClientConn's main feature (pipelining support)
wasn't being used anyway.  Ends up simpler to
just not use it.

This is prep for the http diet, moving ClientConn,
ServerConn, etc into http/httputil.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5305088

13 years agocontainer/heap: document what Push and Pop do
Russ Cox [Thu, 3 Nov 2011 19:30:57 +0000 (15:30 -0400)]
container/heap: document what Push and Pop do

Now that vector is gone, there is no precedent to refer to.
This is a confusing point for people looking to use the
package.

R=golang-dev, r, cw
CC=golang-dev
https://golang.org/cl/5322069

13 years agodeps.bash: attempt to fix the windows build
Rob Pike [Thu, 3 Nov 2011 19:19:07 +0000 (12:19 -0700)]
deps.bash: attempt to fix the windows build
Use simpler shell constructs.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5297080

13 years agoencoding: move asn1, csv, gob, json, xml into encoding
Rob Pike [Thu, 3 Nov 2011 18:39:52 +0000 (11:39 -0700)]
encoding: move asn1, csv, gob, json, xml into encoding
This is Go 1 package renaming CL #1.
This one merely moves the source; the import strings will be
changed after the next weekly release.

The only edits are in Makefiles.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5331060

13 years agogc: Don't pollute the xmethod list with non-methods.
Luuk van Dijk [Thu, 3 Nov 2011 16:51:15 +0000 (17:51 +0100)]
gc: Don't pollute the xmethod list with non-methods.

Fixes #2355.

I have a test, but not sure if it's worth adding.  Instead i've made
the patching-over in reflect.c methods more fatal and more descriptive.

R=rsc
CC=golang-dev
https://golang.org/cl/5302082

13 years agogc, ld: sync pathtoprefix + add comments
Russ Cox [Thu, 3 Nov 2011 16:44:51 +0000 (12:44 -0400)]
gc, ld: sync pathtoprefix + add comments

R=lvd, lvd
CC=golang-dev
https://golang.org/cl/5332051

13 years agogopack: do not look for Go metadata in non-Go objects
Russ Cox [Thu, 3 Nov 2011 16:07:47 +0000 (12:07 -0400)]
gopack: do not look for Go metadata in non-Go objects

Fixes #2333.

R=r
CC=golang-dev
https://golang.org/cl/5316075

13 years ago8a: fix IMULL grammar
Russ Cox [Thu, 3 Nov 2011 15:32:37 +0000 (11:32 -0400)]
8a: fix IMULL grammar

R=ken2
CC=golang-dev
https://golang.org/cl/5298091

13 years agohtml: parse <link> elements in <head>
Andrew Balholm [Thu, 3 Nov 2011 06:12:13 +0000 (17:12 +1100)]
html: parse <link> elements in <head>

Pass tests1.dat, test 83:
<title><meta></title><link><title><meta></title>

| <html>
|   <head>
|     <title>
|       "<meta>"
|     <link>
|     <title>
|       "<meta>"
|   <body>

Also pass test 84:
<style><!--</style><meta><script>--><link></script>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5331061

13 years agobuiltin: remove errant spaces
Andrew Gerrand [Thu, 3 Nov 2011 03:52:38 +0000 (14:52 +1100)]
builtin: remove errant spaces

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5337041

13 years agohttp: update mime sniffing doc reference.
David Symonds [Thu, 3 Nov 2011 03:34:35 +0000 (14:34 +1100)]
http: update mime sniffing doc reference.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5303095

13 years agowebsocket: return an error HTTP response for bad websocket request.
Fumitoshi Ukai [Thu, 3 Nov 2011 03:13:39 +0000 (14:13 +1100)]
websocket: return an error HTTP response for bad websocket request.

websocket spec had changed server-side requiements to return
an HTTP response with an appropriate error code (such as 400 Bad
Request) when it finds client did not send a handshake that matches
websocket protocol, rather than just closing connection.
It needs to flush out response before closing connection.
Fixes issues 2396.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5318072

13 years agotest: clear execute bit from source file
Mikio Hara [Thu, 3 Nov 2011 01:26:33 +0000 (10:26 +0900)]
test: clear execute bit from source file

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5330068

13 years agohtml: properly close <marquee> elements.
Andrew Balholm [Wed, 2 Nov 2011 23:11:06 +0000 (10:11 +1100)]
html: properly close <marquee> elements.

Pass tests1.dat, test 80:
<a href=a>aa<marquee>aa<a href=b>bb</marquee>aa

| <html>
|   <head>
|   <body>
|     <a>
|       href="a"
|       "aa"
|       <marquee>
|         "aa"
|         <a>
|           href="b"
|           "bb"
|       "aa"

Also pass tests through test 82:
<!DOCTYPE html><spacer>foo

R=nigeltao
CC=golang-dev
https://golang.org/cl/5319071

13 years agogc: package paths in symbol names: don't escape periods before last slash, always...
Luuk van Dijk [Wed, 2 Nov 2011 21:33:15 +0000 (22:33 +0100)]
gc: package paths in symbol names: don't escape periods before last slash, always escape >=0x7f.

R=rsc
CC=golang-dev
https://golang.org/cl/5323071

13 years agoall: sort imports
Russ Cox [Wed, 2 Nov 2011 19:54:16 +0000 (15:54 -0400)]
all: sort imports

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072

13 years agogofmt, gofix: sort imports
Russ Cox [Wed, 2 Nov 2011 19:53:57 +0000 (15:53 -0400)]
gofmt, gofix: sort imports

Add ast.SortImports(fset, file) to go/ast, for use by both programs.

Fixes #346.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5330069

13 years agobuiltin: document the basic types
Rob Pike [Wed, 2 Nov 2011 19:06:36 +0000 (12:06 -0700)]
builtin: document the basic types
The recursive definitions are illegal Go, but godoc doesn't mind.

R=bradfitz, r, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/5322067

13 years agoexp/sql: finish transactions, flesh out types, docs
Brad Fitzpatrick [Wed, 2 Nov 2011 18:46:04 +0000 (11:46 -0700)]
exp/sql: finish transactions, flesh out types, docs

Fixes #2328 (float, bool)

R=rsc, r
CC=golang-dev
https://golang.org/cl/5294067

13 years agomath: improved accuracy for Tan
Charles L. Dorian [Wed, 2 Nov 2011 18:01:21 +0000 (14:01 -0400)]
math: improved accuracy for Tan

R=rsc
CC=golang-dev
https://golang.org/cl/5298087

13 years agogc: helpful message instead of internal error on method call on pointer to pointer.
Luuk van Dijk [Wed, 2 Nov 2011 16:18:53 +0000 (17:18 +0100)]
gc: helpful message instead of internal error on method call on pointer to pointer.

Fixes #2343.

R=rsc
CC=golang-dev
https://golang.org/cl/5332048

13 years agobufio: return nil line from ReadLine on error, as documented
Brad Fitzpatrick [Wed, 2 Nov 2011 15:30:50 +0000 (08:30 -0700)]
bufio: return nil line from ReadLine on error, as documented

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5316069

13 years agogc: small fixes for printing.
Luuk van Dijk [Wed, 2 Nov 2011 14:36:33 +0000 (15:36 +0100)]
gc: small fixes for printing.

mark OADDR inserted by typecheck as implicit
OCOPY takes ->left and ->right, not ->list
OMAKE*'s can all have arguments
precedence for OIND was initalized twice

fixes #2414

R=rsc, dave
CC=golang-dev
https://golang.org/cl/5319065

13 years agoruntime: unify mutex code across OSes
Dmitriy Vyukov [Wed, 2 Nov 2011 13:42:01 +0000 (16:42 +0300)]
runtime: unify mutex code across OSes
The change introduces 2 generic mutex implementations
(futex- and semaphore-based). Each OS chooses a suitable mutex
implementation and implements few callbacks (e.g. futex wait/wake).
The CL reduces code duplication, extends some optimizations available
only on Linux/Windows to other OSes and provides ground
for futher optimizations. Chan finalizers are finally eliminated.

(Linux/amd64, 8 HT cores)
benchmark                      old      new
BenchmarkChanContended         83.6     77.8 ns/op
BenchmarkChanContended-2       341      328 ns/op
BenchmarkChanContended-4       382      383 ns/op
BenchmarkChanContended-8       390      374 ns/op
BenchmarkChanContended-16      313      291 ns/op

(Darwin/amd64, 2 cores)
benchmark                      old      new
BenchmarkChanContended         159      172 ns/op
BenchmarkChanContended-2       6735     263 ns/op
BenchmarkChanContended-4       10384    255 ns/op
BenchmarkChanCreation          1174     407 ns/op
BenchmarkChanCreation-2        4007     254 ns/op
BenchmarkChanCreation-4        4029     246 ns/op

R=rsc, jsing, hectorchu
CC=golang-dev
https://golang.org/cl/5140043

13 years agojson: fix typo in scanner_test.go.
Nigel Tao [Wed, 2 Nov 2011 07:03:45 +0000 (18:03 +1100)]
json: fix typo in scanner_test.go.

R=dsymonds
CC=golang-dev
https://golang.org/cl/5303092

13 years agonet: implement LookupTXT for windows
Alex Brainman [Wed, 2 Nov 2011 06:11:40 +0000 (17:11 +1100)]
net: implement LookupTXT for windows

R=rsc
CC=golang-dev
https://golang.org/cl/5318056

13 years agobuiltin: document built-in error type
Andrew Gerrand [Wed, 2 Nov 2011 06:03:36 +0000 (15:03 +0900)]
builtin: document built-in error type

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5307080

13 years agogc: fix spelling of "GOEXPERIMENT" in a comment.
David Symonds [Wed, 2 Nov 2011 05:25:24 +0000 (16:25 +1100)]
gc: fix spelling of "GOEXPERIMENT" in a comment.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5323070

13 years agospec: delete spurious article
Rob Pike [Wed, 2 Nov 2011 03:57:17 +0000 (20:57 -0700)]
spec: delete spurious article
A profound change to christen the new tag.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5327062

13 years agoundo CL 5330066 / 6a5647d82728
Russ Cox [Wed, 2 Nov 2011 03:26:10 +0000 (23:26 -0400)]
undo CL 5330066 / 6a5647d82728

I promised it wouldn't last very long.
People who really need this can sync to 6a5647d82728.

««« original CL description
gc: add GOEXPERIMENT=os.Error

This won't last long, I promise.

R=ken2
CC=golang-dev
https://golang.org/cl/5330066
»»»

R=ken2
CC=golang-dev
https://golang.org/cl/5333053

13 years agogc: add GOEXPERIMENT=os.Error
Russ Cox [Wed, 2 Nov 2011 03:24:28 +0000 (23:24 -0400)]
gc: add GOEXPERIMENT=os.Error

This won't last long, I promise.

R=ken2
CC=golang-dev
https://golang.org/cl/5330066

13 years agotag weekly.2011-11-02
Andrew Gerrand [Wed, 2 Nov 2011 03:01:51 +0000 (12:01 +0900)]
tag weekly.2011-11-02

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5311083

13 years agoweekly.2011-11-02 weekly.2011-11-02
Andrew Gerrand [Wed, 2 Nov 2011 03:00:13 +0000 (12:00 +0900)]
weekly.2011-11-02

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5308077

13 years agoall: rename os.Error to error in various non-code contexts
Russ Cox [Wed, 2 Nov 2011 02:58:09 +0000 (22:58 -0400)]
all: rename os.Error to error in various non-code contexts

R=adg
CC=golang-dev
https://golang.org/cl/5328062

13 years agoos: fixes for error (plan9)
Russ Cox [Wed, 2 Nov 2011 02:19:40 +0000 (22:19 -0400)]
os: fixes for error (plan9)

The Plan 9 build stops in runtime,
but might as well fix these anyway.

R=adg
CC=golang-dev
https://golang.org/cl/5336045

13 years agonet: update for error (linux)
Russ Cox [Wed, 2 Nov 2011 02:18:16 +0000 (22:18 -0400)]
net: update for error (linux)

R=adg
CC=golang-dev
https://golang.org/cl/5303091

13 years agoos, syscall: update for error
Russ Cox [Wed, 2 Nov 2011 02:12:41 +0000 (22:12 -0400)]
os, syscall: update for error

R=adg
CC=golang-dev
https://golang.org/cl/5333052

13 years agonon-pkg: gofix -r error -force=error
Russ Cox [Wed, 2 Nov 2011 02:06:05 +0000 (22:06 -0400)]
non-pkg: gofix -r error -force=error

R=golang-dev, iant, r, r
CC=golang-dev
https://golang.org/cl/5307066

13 years agosrc/pkg/[n-z]*: gofix -r error -force=error
Russ Cox [Wed, 2 Nov 2011 02:05:34 +0000 (22:05 -0400)]
src/pkg/[n-z]*: gofix -r error -force=error

R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074

13 years agosrc/pkg/[a-m]*: gofix -r error -force=error
Russ Cox [Wed, 2 Nov 2011 02:04:37 +0000 (22:04 -0400)]
src/pkg/[a-m]*: gofix -r error -force=error

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5322051

13 years agotutorial,effective_go: prepare for error change
Rob Pike [Wed, 2 Nov 2011 01:50:21 +0000 (21:50 -0400)]
tutorial,effective_go: prepare for error change

R=adg, rsc
CC=golang-dev
https://golang.org/cl/5316068

13 years agoexec: introduce ExitError
Russ Cox [Wed, 2 Nov 2011 01:49:44 +0000 (21:49 -0400)]
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