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

4505 Commits

Author SHA1 Message Date
Andrew Balholm
631a575fd9 html: store the current insertion mode in the parser
Currently, the state transition functions in the HTML parser
return the next insertion mode and whether the token is consumed.
This works well except for when one insertion mode needs to use
the rules for another insertion mode. Then the useTheRulesFor
function needs to patch things up. This requires comparing functions
for equality, which is going to stop working.

Adding a field to the parser structure to store the current
insertion mode eliminates the need for useTheRulesFor;
one insertion mode function can now just call the other
directly. The insertion mode will be changed only if it needs to be.

This CL is an alternative to CL 5372078.

R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/5372079
2011-11-13 12:39:41 +11:00
Joel Sing
13dc53055f runtime: remove no longer used enums for openbsd
The code that used these has been moved to lock_sema.c.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5376062
2011-11-13 03:58:24 +11:00
Andrew Balholm
3df0512469 html: handle end tags in strange places
Pass tests1.dat, test 111:
</strong></b></em></i></u></strike></s></blink></tt></pre></big></small></font></select></h1></h2></h3></h4></h5></h6></body></br></a></img></title></span></style></script></table></th></td></tr></frame></area></link></param></hr></input></col></base></meta></basefont></bgsound></embed></spacer></p></dd></dt></caption></colgroup></tbody></tfoot></thead></address></blockquote></center></dir></div></dl></fieldset></listing></menu></ol></ul></li></nobr></wbr></form></button></marquee></object></html></frameset></head></iframe></image></isindex></noembed></noframes></noscript></optgroup></option></plaintext></textarea>

| <html>
|   <head>
|   <body>
|     <br>
|     <p>

Also pass all the remaining tests in tests1.dat.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5372066
2011-11-12 12:23:30 +11:00
Ian Lance Taylor
3f2d787c2b runtime: remove declarations of nonexistent functions
R=rsc, r
CC=golang-dev
https://golang.org/cl/5369089
2011-11-11 14:30:27 -08:00
Russ Cox
5fc3771b3a gc: remove m[k] = x, false
R=ken2
CC=golang-dev
https://golang.org/cl/5376076
2011-11-11 16:48:25 -05:00
Anthony Martin
a6c501e4b1 net, io/ioutil: remove use of os.Time
I had to replace the single use of io/ioutil
in the time package with a bytes.Buffer since
there would've been a dependency cycle.

There are no other uses of os.Time.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5372054
2011-11-11 14:40:41 -05:00
Adam Langley
252ef18d04 exp/terminal: rename shell to terminal and add SetSize
It was never really a shell, but the name carried
over from SSH's ServerShell.

Two small functional changes:

Add SetSize, which allows the size of the terminal
to be changed in response, say, to an SSH message.

Don't write the prompt if there's already something
on the current line.

R=rsc
CC=golang-dev
https://golang.org/cl/5376066
2011-11-11 14:04:33 -05:00
Joel Sing
791aef1821 syscall: fix zerrors for openbsd 386
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5369076
2011-11-12 05:19:09 +11:00
Adam Langley
d08f57e68c exp/terminal: rename terminal.go to util.go
(This is part of removing the duplicate code between exp/terminal and
exp/ssh, but hg is having a very hard time keeping up so I'm doing it
in small steps.)

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5373061
2011-11-11 11:18:45 -05:00
Mikio Hara
ca4708fa79 syscall: regenerate z-files for freebsd, openbsd
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5375057
2011-11-12 00:22:22 +09:00
Andrew Balholm
0a61c846ef html: ignore <col> tag outside tables
Pass tests1.dat, test 109:
<table><col><tbody><col><tr><col><td><col></table><col>

| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|         <col>
|       <tbody>
|       <colgroup>
|         <col>
|       <tbody>
|         <tr>
|       <colgroup>
|         <col>
|       <tbody>
|         <tr>
|           <td>
|       <colgroup>
|         <col>

Also pass test 110:
<table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5369069
2011-11-11 21:44:01 +11:00
Andrew Balholm
83f61a27d6 html: parse column groups
Pass tests1.dat, test 108:
<table><colgroup><col><colgroup><col><col><col><colgroup><col><col><thead><tr><td></table>

| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|         <col>
|       <colgroup>
|         <col>
|         <col>
|         <col>
|       <colgroup>
|         <col>
|         <col>
|       <thead>
|         <tr>
|           <td>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5369061
2011-11-11 11:41:46 +11:00
Russ Cox
dd2abe5152 runtime, syscall: convert from godefs to cgo
R=golang-dev, mikioh.mikioh, r
CC=golang-dev
https://golang.org/cl/5348052
2011-11-10 19:08:28 -05:00
Volker Dobler
d989709630 time: add ISOWeek method to Time
As the ISO 8601 week number is untrivial to compute a new method
on *Time provides year and number of week.

R=golang-dev, rsc, r, r
CC=golang-dev
https://golang.org/cl/5316074
2011-11-10 12:40:50 -08:00
Rob Pike
2c39ca08cd testing: add file:line stamps to messages.
A single-line error looks like this:
--- FAIL: foo_test.TestFoo (0.00 seconds)
        foo_test.go:123: Foo(8) = "10" want "100"

A multi-line error looks like this:
--- FAIL: foo_test.TestFoo (0.00 seconds)
        foo_test.go:456: Foo(88) = "100"
                want "1000"

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5376057
2011-11-10 11:59:50 -08:00
Joel Sing
85b7419211 runtime: fix semasleep() duration for openbsd
The timespec passed to thrsleep() needs to be an absolute/realtime
value, so add the current nanotime to ns.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5374048
2011-11-10 11:42:01 -08:00
David G. Andersen
120f3b7b9d math/big: Correcting typo in SetBit() documentation
z is set to x+bit change, not z+bit change

R=golang-dev
CC=golang-dev
https://golang.org/cl/5374056
2011-11-10 14:41:24 -05:00
Andrew Balholm
e9e874b7fc html: parse framesets
Pass tests1.dat, test 106:
<frameset><frame><frameset><frame></frameset><noframes></noframes></frameset>

| <html>
|   <head>
|   <frameset>
|     <frame>
|     <frameset>
|       <frame>
|     <noframes>

Also pass test 107:
<h1><table><td><h3></table><h3></h1>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5373050
2011-11-10 23:56:13 +11:00
Mikio Hara
be8025604e runtime: fix freebsd build
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5370050
2011-11-10 10:02:24 +09:00
Rob Pike
217408abf3 crypto: update incorrect references to Cipher interface; should be Block.
R=gri, rsc, r
CC=golang-dev
https://golang.org/cl/5372050
2011-11-09 14:22:44 -08:00
Scott Lawrence
6c10aa19b8 os/exec: Fix documentation references to os.DevNull
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5372049
2011-11-09 13:50:13 -08:00
Andrew Balholm
ddc5ec642d html: don't emit text token for empty raw text elements.
Pass tests1.dat, test 99:
<script></script></div><title></title><p><p>

| <html>
|   <head>
|     <script>
|     <title>
|   <body>
|     <p>
|     <p>

Also pass tests through test 105:
<ul><li><ul></li><li>a</li></ul></li></ul>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5373043
2011-11-10 08:09:54 +11:00
Charles L. Dorian
300b443ade math: faster Lgamma
Converting from polynomial constants to counted array speeds up Lgamma from 51.3 to 37.7 ns/op. Variables renamed in Gamma to avoid overlap in Lgamma.

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5359045
2011-11-09 15:44:49 -05:00
Russ Cox
3b860269ee runtime: add timer support, use for package time
This looks like it is just moving some code from
time to runtime (and translating it to C), but the
runtime can do a better job managing the goroutines,
and it needs this functionality for its own maintenance
(for example, for the garbage collector to hand back
unused memory to the OS on a time delay).
Might as well have just one copy of the timer logic,
and runtime can't depend on time, so vice versa.

It also unifies Sleep, NewTicker, and NewTimer behind
one mechanism, so that there are no claims that one
is more efficient than another.  (For example, today
people recommend using time.After instead of time.Sleep
to avoid blocking an OS thread.)

Fixes #1644.
Fixes #1731.
Fixes #2190.

R=golang-dev, r, hectorchu, iant, iant, jsing, alex.brainman, dvyukov
CC=golang-dev
https://golang.org/cl/5334051
2011-11-09 15:17:05 -05:00
Dmitriy Vyukov
fbfed49134 cgo: fix g0 stack guard
Fixes crash when cgo consumes more than 8K
of stack and makes a callback.

Fixes #1328.

R=golang-dev, rogpeppe, rsc
CC=golang-dev, mpimenov
https://golang.org/cl/5371042
2011-11-09 23:11:48 +03:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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