1
0
mirror of https://github.com/golang/go synced 2024-10-04 09:11:21 -06:00
Commit Graph

7813 Commits

Author SHA1 Message Date
Rob Pike
e99f68f064 builtin: document delete
Fixes #2434.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5370045
2011-11-09 10:49:41 -08:00
Russ Cox
7a6a9755a9 regexp: fix doc comment
Fixes #2432.

R=r, r
CC=golang-dev
https://golang.org/cl/5376041
2011-11-09 13:46:54 -05:00
Lucio De Re
74f61fc656 gopack: fixes for Plan 9 build
. removed an unnexessary initialisation.
. replaced 0 with 0L to match print format that in turn matched
  the type of the original function return value.

R=golang-dev
CC=golang-dev, rsc
https://golang.org/cl/5306072
2011-11-09 13:24:36 -05:00
Russ Cox
1eadb89ee1 undo CL 5375043 / ea8b178f9b73
Never lasts long.

««« original CL description
gc: add GOEXPERIMENT=reorg

This won't last long but may ease conversions.

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

R=ken2, ken
CC=golang-dev
https://golang.org/cl/5370043
2011-11-09 12:36:51 -05:00
Russ Cox
ae7a003cf9 gc: add GOEXPERIMENT=reorg
This won't last long but may ease conversions.

R=ken2
CC=golang-dev
https://golang.org/cl/5375043
2011-11-09 12:35:45 -05:00
Luuk van Dijk
924ea515cf gc: better error for non-calling use of unsafe builtins.
Fixes #1951

R=rsc
CC=golang-dev
https://golang.org/cl/5372041
2011-11-09 18:30:54 +01:00
Brad Fitzpatrick
21f5057639 http: add a disabled failing test for Issue 2357
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5372044
2011-11-09 08:12:26 -08:00
Luuk van Dijk
d5a5855ba1 gc: Preserve original blank name for .anon substitution on out params.
Fixes #1802.

R=rsc
CC=golang-dev
https://golang.org/cl/5364043
2011-11-09 11:27:27 +01:00
Luuk van Dijk
151b2f1509 gc: Fail on implicit assigment to non-exported fields in copy and append.
Fixes #1387.

R=rsc
CC=golang-dev
https://golang.org/cl/5348046
2011-11-09 11:17:06 +01:00
Luuk van Dijk
13e92e4d75 gc: Better typechecks and errors in switches.
Allow any type in switch on interface value.
Statically check typeswitch early.

Fixes #2423.
Fixes #2424.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5339045
2011-11-09 10:58:53 +01:00
Andrew Balholm
820523d091 html: correctly parse </html> in <head> element.
Pass tests1.dat, test 92:
<head></html><meta><p>

| <html>
|   <head>
|   <body>
|     <meta>
|     <p>

Also pass tests through test 98:
<p><b><div><marquee></p></b></div>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5359054
2011-11-09 19:18:26 +11:00
David Symonds
929070ee62 net/http: use t.Errorf from alternate goroutine in test.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5348051
2011-11-09 16:11:47 +11:00
David Symonds
9c6a73e478 net/http: fix sniffing when using ReadFrom.
R=golang-dev, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5362046
2011-11-09 15:48:05 +11:00
Andrew Gerrand
bad305c27b http: make httputil's chunked reader/writer code a direct copy
Arrange the code so that it's easier to keep edits in sync.

R=golang-dev, mikioh.mikioh, bradfitz, andybalholm, rsc
CC=golang-dev
https://golang.org/cl/5345041
2011-11-09 14:55:52 +11:00
Ian Lance Taylor
4ac425fcdd runtime: add comments for various functions in proc.c
R=rsc
CC=golang-dev
https://golang.org/cl/5357047
2011-11-08 18:16:25 -08:00
Rob Pike
f9489bed72 renaming_4: gofix -r everything/but/src/pkg
R=rsc
CC=golang-dev
https://golang.org/cl/5338043
2011-11-08 15:43:02 -08:00
Rob Pike
45e3bcb343 renaming_3: gofix -r go1pkgrename src/pkg/[m-z]*
R=rsc
CC=golang-dev
https://golang.org/cl/5345045
2011-11-08 15:41:54 -08:00
Rob Pike
30aa701fec renaming_2: gofix -r go1pkgrename src/pkg/[a-l]*
R=rsc
CC=golang-dev
https://golang.org/cl/5358041
2011-11-08 15:40:58 -08:00
Rob Pike
6ab6c49fce renaming_1: hand-edited files for go 1 renaming
This contains the files that required handiwork, mostly
Makefiles with updated TARGs, plus the two packages
with modified package names.
html/template/doc.go needs a separate edit pass.
test/fixedbugs/bug358.go is not legal go so gofix fails on it.

R=rsc
CC=golang-dev
https://golang.org/cl/5340050
2011-11-08 15:38:47 -08:00
Rob Pike
e50479ca88 gofix: add go1pkgrename
This will do the package import renamings for Go 1.

R=rsc, r, dsymonds
CC=golang-dev
https://golang.org/cl/5316078
2011-11-08 15:34:23 -08:00
Andrew Balholm
ce4eec2e0a 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
2011-11-09 09:43:55 +11:00
Rob Pike
3e94e757ef 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
2011-11-08 14:33:07 -08:00
Joel Sing
0e5cd9d3f6 runtime: add timespec definition for freebsd
R=golang-dev, devon.odell
CC=golang-dev
https://golang.org/cl/5340058
2011-11-08 11:43:58 -05:00
Anthony Martin
cabe0e6ad3 os, syscall: fix Plan 9 build
R=rsc
CC=golang-dev
https://golang.org/cl/5330067
2011-11-08 09:06:02 -05:00
Andrew Balholm
f2b602ed42 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
2011-11-08 17:55:17 +11:00
Alex Brainman
b776b9e724 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
2011-11-08 16:53:31 +11:00
Andrew Gerrand
2fcb045242 gotest: don't run examples that have no expected output
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5364041
2011-11-08 10:11:07 +11:00
Nigel Tao
46ee09eff1 html: fix typo in package docs.
Fixes #2419.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5352046
2011-11-08 10:09:17 +11:00
Mikio Hara
2d89db65c0 net: fix build comment
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5353045
2011-11-08 06:56:35 +09:00
Luuk van Dijk
087bec3dcd 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
2011-11-07 21:35:13 +01:00
Russ Cox
dfe03bb204 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
2011-11-07 14:44:06 -05:00
Russ Cox
2547ad6b01 lib9: fix windows build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5362045
2011-11-07 14:16:00 -05:00
Russ Cox
3f4a91d778 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
2011-11-07 13:15:16 -05:00
Russ Cox
1c42db8835 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
2011-11-07 13:15:06 -05:00
Dave Cheney
1170a6460f 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
2011-11-07 12:37:05 -05:00
Joel Sing
a1c622dfea 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
2011-11-07 11:57:34 -05:00
Ron Minnich
986ad31b2d 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
2011-11-07 11:42:13 -05:00
Lucio De Re
2e1bb76f9b 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
2011-11-07 11:42:08 -05:00
David Crawshaw
1371ac2f0b xml: allow parsing of <_> </_>.
R=rsc, nigeltao
CC=golang-dev
https://golang.org/cl/5298061
2011-11-07 10:47:44 -05:00
Dmitry Chestnykh
ad0e8b31d8 archive/zip: actually close file opened with OpenReader.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5341044
2011-11-07 16:33:53 +11:00
David Symonds
75af79b9b5 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
2011-11-07 11:55:33 +11:00
Alex Brainman
603d80c28d runtime: windows_386 sighandler to use correct g
Fixes #2403.

R=hectorchu
CC=golang-dev
https://golang.org/cl/5309071
2011-11-07 11:00:14 +11:00
Nigel Tao
bbd173fc3d html: be able to test more than one testdata file.
R=andybalholm
CC=golang-dev
https://golang.org/cl/5351041
2011-11-07 09:38:40 +11:00
Luuk van Dijk
ea9e93862d gc: Better error message for range over non-receive channel.
Fixes #2354

R=rsc
CC=golang-dev
https://golang.org/cl/5346044
2011-11-06 22:14:15 +01:00
Luuk van Dijk
0d6f857c3f gc: Switch related errors should use plain format.
Fixes #2422.

R=rsc
CC=golang-dev
https://golang.org/cl/5353046
2011-11-06 22:13:54 +01:00
Charles L. Dorian
c171633780 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
2011-11-05 12:25:36 -07:00
David Symonds
c29cd8abb9 gofix: avoid panic on body-less functions in netudpgroup.
R=rsc, r
CC=golang-dev
https://golang.org/cl/5347041
2011-11-05 11:28:23 +11:00
Charles L. Dorian
377ac335af 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
2011-11-04 15:35:59 -04:00
Jani Monoses
cd6c7375d4 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
2011-11-04 15:07:34 -04:00
Mike Samuel
a5291099d2 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
2011-11-04 13:09:21 -04:00
Brad Fitzpatrick
b14ee23f9b http: support Trailers in ReadRequest
Available after closing Request.Body.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/5348041
2011-11-04 09:17:46 -07:00
Luuk van Dijk
aac144b120 gc: detect type switch variable not used cases.
Fixes #873
Fixes #2162

R=rsc
CC=golang-dev
https://golang.org/cl/5341043
2011-11-04 17:03:50 +01:00
Gustavo Niemeyer
f2dc50b48d 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
2011-11-04 09:50:20 -04:00
David Symonds
39fcca60cb template: format error with pointer receiver.
This is a continuation of 982d70c6d5d6.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5348042
2011-11-04 23:45:38 +11:00
Russ Cox
7f5ae484eb runtime: fix linux/arm nanotime?
TBR=r
CC=golang-dev
https://golang.org/cl/5354041
2011-11-04 08:38:10 -04:00
Russ Cox
e73680aec0 template: format errors
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5340043
2011-11-04 07:33:55 -04:00
Russ Cox
cb2040b2ab runtime: fix openbsd nanotime?
TBR=r
CC=golang-dev
https://golang.org/cl/5353041
2011-11-04 07:24:39 -04:00
Andrew Gerrand
ed92549071 bytes: fix typo and resolve to be less idiotic next time
R=bradfitz
CC=golang-dev
https://golang.org/cl/5340044
2011-11-04 17:55:21 +11:00
Andrew Gerrand
1a4402a1fe bytes: add Contains function
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5349041
2011-11-04 17:46:52 +11:00
Andrew Balholm
632a2c59b1 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
2011-11-04 15:48:11 +11:00
Brad Fitzpatrick
0865c57f25 http: doc nits
Remove the last two "convenience" mentions.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5344041
2011-11-03 20:37:02 -07:00
Brad Fitzpatrick
3b901f4515 http: clarify Request docs
R=rsc
CC=golang-dev
https://golang.org/cl/5342041
2011-11-03 20:05:13 -07:00
Brad Fitzpatrick
28564d60eb 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
2011-11-03 18:12:51 -07:00
Rob Pike
88cf76a9b3 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
2011-11-03 18:05:14 -07:00
Brad Fitzpatrick
a494c20032 http: only recognize application/x-www-form-urlencoded in ParseForm
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5322070
2011-11-03 17:21:58 -07:00
Brad Fitzpatrick
54049767ae httputil: move ReverseProxy out of http
http diet plan, continued.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5305090
2011-11-03 15:54:08 -07:00
Andrew Balholm
46308d7d11 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
2011-11-04 09:29:06 +11:00
Brad Fitzpatrick
a7f1141dee 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
2011-11-03 14:44:29 -07:00
Russ Cox
f437331f80 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
2011-11-03 17:35:28 -04:00
Russ Cox
31452a3618 runtime: fix set and not used
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5305087
2011-11-03 17:35:11 -04:00
David Symonds
d26144be29 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
2011-11-04 08:34:37 +11:00
Rob Pike
37d82c8520 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
2011-11-03 14:18:06 -07:00
Vincent Vanackere
eb1717e035 all: rename os.EOF to io.EOF in various non-code contexts
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5334050
2011-11-03 14:01:30 -07:00
Rob Pike
de03d502c7 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
2011-11-03 13:26:43 -07:00
Rob Pike
5cb4a15320 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
2011-11-03 12:42:57 -07:00
Brad Fitzpatrick
53493a22fe 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
2011-11-03 12:35:56 -07:00
Russ Cox
41dc7d3a99 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
2011-11-03 15:30:57 -04:00
Rob Pike
d615a5255d deps.bash: attempt to fix the windows build
Use simpler shell constructs.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5297080
2011-11-03 12:19:07 -07:00
Rob Pike
f4cd80224a 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
2011-11-03 11:39:52 -07:00
Luuk van Dijk
11075ed893 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
2011-11-03 17:51:15 +01:00
Russ Cox
80bce97e45 gc, ld: sync pathtoprefix + add comments
R=lvd, lvd
CC=golang-dev
https://golang.org/cl/5332051
2011-11-03 12:44:51 -04:00
Russ Cox
d6ff3c1177 gopack: do not look for Go metadata in non-Go objects
Fixes #2333.

R=r
CC=golang-dev
https://golang.org/cl/5316075
2011-11-03 12:07:47 -04:00
Russ Cox
1738dc0e71 8a: fix IMULL grammar
R=ken2
CC=golang-dev
https://golang.org/cl/5298091
2011-11-03 11:32:37 -04:00
Andrew Balholm
77aabbf217 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
2011-11-03 17:12:13 +11:00
Andrew Gerrand
1c530d5d78 builtin: remove errant spaces
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5337041
2011-11-03 14:52:38 +11:00
David Symonds
e4b464242a http: update mime sniffing doc reference.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5303095
2011-11-03 14:34:35 +11:00
Fumitoshi Ukai
de3d647252 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
2011-11-03 14:13:39 +11:00
Andrew Balholm
cf6a712162 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
2011-11-03 10:11:06 +11:00
Luuk van Dijk
33f1d47b38 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
2011-11-02 22:33:15 +01:00
Russ Cox
965845a86d all: sort imports
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Russ Cox
4a9ebb18f1 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
2011-11-02 15:53:57 -04:00
Rob Pike
7db617b474 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
2011-11-02 12:06:36 -07:00
Brad Fitzpatrick
8089e57812 exp/sql: finish transactions, flesh out types, docs
Fixes #2328 (float, bool)

R=rsc, r
CC=golang-dev
https://golang.org/cl/5294067
2011-11-02 11:46:04 -07:00
Charles L. Dorian
cefee3c919 math: improved accuracy for Tan
R=rsc
CC=golang-dev
https://golang.org/cl/5298087
2011-11-02 14:01:21 -04:00
Luuk van Dijk
7df9ff5594 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
2011-11-02 17:18:53 +01:00
Brad Fitzpatrick
bd43eac303 bufio: return nil line from ReadLine on error, as documented
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5316069
2011-11-02 08:30:50 -07:00
Luuk van Dijk
29a5ae657f 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
2011-11-02 15:36:33 +01:00
Dmitriy Vyukov
ee24bfc058 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
2011-11-02 16:42:01 +03:00
Nigel Tao
5e4e8f49c5 json: fix typo in scanner_test.go.
R=dsymonds
CC=golang-dev
https://golang.org/cl/5303092
2011-11-02 18:03:45 +11:00
Alex Brainman
b43cf81c8c net: implement LookupTXT for windows
R=rsc
CC=golang-dev
https://golang.org/cl/5318056
2011-11-02 17:11:40 +11:00
Andrew Gerrand
4d3c999086 builtin: document built-in error type
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5307080
2011-11-02 15:03:36 +09:00
David Symonds
c4845c1c49 gc: fix spelling of "GOEXPERIMENT" in a comment.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5323070
2011-11-02 16:25:24 +11:00
Russ Cox
4c3ea0008c 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
2011-11-01 23:26:10 -04:00
Russ Cox
47f4bf763d gc: add GOEXPERIMENT=os.Error
This won't last long, I promise.

R=ken2
CC=golang-dev
https://golang.org/cl/5330066
2011-11-01 23:24:28 -04:00
Russ Cox
492098eb75 all: rename os.Error to error in various non-code contexts
R=adg
CC=golang-dev
https://golang.org/cl/5328062
2011-11-01 22:58:09 -04:00
Russ Cox
abd3260990 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
2011-11-01 22:19:40 -04:00
Russ Cox
f7b7338ec2 net: update for error (linux)
R=adg
CC=golang-dev
https://golang.org/cl/5303091
2011-11-01 22:18:16 -04:00
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
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
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
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
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
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
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
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
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
Russ Cox
c0a0fd6cf4 gob: split uses of gobError, remove unnecessary embedding
Will make gofix for error run more smoothly.
The overloading of gobError appears to be unintentional.

R=r
CC=golang-dev
https://golang.org/cl/5308060
2011-10-27 20:20:59 -07:00
Russ Cox
c1178aae86 strconv: use better errors than os.EINVAL, os.ERANGE
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5327052
2011-10-27 19:46:31 -07:00
Russ Cox
01e9a227cc crypto/tls: add Error method to alert
alerts get used as both values and errors.
Rather than introduce an alertError wrapper,
this CL just adds an Error method, which will
satisfy the error interface when the time comes.

R=agl, bradfitz
CC=golang-dev
https://golang.org/cl/5294073
2011-10-27 19:42:32 -07:00
Russ Cox
29fb5d3e0f xml: simplify test
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5320051
2011-10-27 19:40:41 -07:00
Russ Cox
134d6e4fc4 go/build: avoid os.Error in tests
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5308061
2011-10-27 19:39:40 -07:00