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

7958 Commits

Author SHA1 Message Date
Luuk van Dijk
40b2fe004f gc: changes in export format in preparation of inlining.
Includes minimal change to gcimporter to keep it working,

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5431046
2011-12-05 14:40:19 -05:00
Russ Cox
5cb1c82d96 gc: remove type elision in struct literals
R=ken2
CC=golang-dev
https://golang.org/cl/5437136
2011-12-05 14:22:41 -05:00
Charles L. Dorian
abc7df9686 math: add special-cases comments to Sinh and Tanh.
Also change "Special conditions" to "Special cases" as in other functions.

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5440078
2011-12-05 14:01:24 -05:00
Rémy Oudompheng
3538d40ab5 crypto/aes: eliminate some bounds checking and manual truncation.
By converting array indices to uint8, they are automatically
constrained in the array range, and the binary AND with 0xff
is no longer needed anymore.

Before:  aes.BenchmarkEncrypt    363 ns/op
After:   aes.BenchmarkEncrypt    273 ns/op

R=golang-dev, gri, agl
CC=golang-dev, remy
https://golang.org/cl/5450084
2011-12-05 13:30:25 -05:00
Russ Cox
b9ccd077dc runtime: prep for type-specific algorithms
Equality on structs will require arbitrary code for type equality,
so change algorithm in type data from uint8 to table pointer.
In the process, trim top-level map structure from
104/80 bytes (64-bit/32-bit) to 24/12.

Equality on structs will require being able to call code generated
by the Go compiler, and C code has no way to access Go return
values, so change the hash and equal algorithm functions to take
a pointer to a result instead of returning the result.

R=ken
CC=golang-dev
https://golang.org/cl/5453043
2011-12-05 09:40:22 -05:00
David Symonds
dbaeb0cf13 net/mail: correctly compare parsed times in the test.
Fixes #2522.

R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/5449084
2011-12-05 10:05:29 +11:00
Russ Cox
214ec7b547 gc: fix build (not sure how this edit got lost)
R=ken2, ken
CC=golang-dev
https://golang.org/cl/5449072
2011-12-02 15:05:45 -05:00
Russ Cox
7a42dddbe6 gc: fix line number for redundant print
R=ken2
CC=golang-dev
https://golang.org/cl/5434111
2011-12-02 14:58:26 -05:00
Russ Cox
434a6c85cb gc: use gofmt spacing when printing map type
R=ken2
CC=golang-dev
https://golang.org/cl/5450071
2011-12-02 14:45:07 -05:00
Russ Cox
dcf1d7bc0e gofmt -s misc src
R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5451079
2011-12-02 14:14:25 -05:00
Russ Cox
0dab624b70 gofmt: handle &T in composite literal simplify
R=gri
CC=golang-dev
https://golang.org/cl/5448086
2011-12-02 14:14:04 -05:00
Russ Cox
7dc9d8c72b gc: composite literals as per Go 1
R=ken2
CC=golang-dev
https://golang.org/cl/5450067
2011-12-02 14:13:12 -05:00
Robert Griesemer
951ba56adb goinstall: fix typo in comment
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5449068
2011-12-02 10:30:35 -08:00
Russ Cox
7d15eda95d gc: do not allow slice of array literal
R=ken2
CC=golang-dev
https://golang.org/cl/5440083
2011-12-02 12:30:56 -05:00
Gustav Paul
bd9dc3d55f exp/ssh: allow for msgUserAuthBanner during authentication
The SSH spec allows for the server to send a banner message to the client at any point during the authentication process. Currently the ssh client auth types all assume that the first response from the server after issuing a userAuthRequestMsg will be one of a couple of possible authentication success/failure messages. This means that client authentication breaks if the ssh server being connected to has a banner message configured.

This changeset refactors the noneAuth, passwordAuth and publickeyAuth types' auth() function and allows for msgUserAuthBanner during authentication.

R=golang-dev, rsc, dave, agl
CC=golang-dev
https://golang.org/cl/5432065
2011-12-02 10:34:42 -05:00
Robert Hencke
6f0ef845e6 asn1: fix incorrect prints found by govet
R=golang-dev
CC=golang-dev
https://golang.org/cl/5449063
2011-12-02 10:13:02 -05:00
Mikio Hara
cf4acf80b4 net, syscall: remove BindToDevice API from UDPConn, IPConn
For now a pair of socket options SOL_SOCKET and SO_BINDTODEVICE
is supported on Linux only. I'd like to demote BindToDevice API
to syscall level because it's Linux dependent one.

In the near future, probably we may have a bit more portable
API that using IPROTO_IP/IPV6 level socket options to specify,
identify an inbound, outbound IP interface on incoming, outgoing
UDP and raw IP packets.

R=cw, golang-dev
CC=golang-dev
https://golang.org/cl/5447071
2011-12-02 23:18:16 +09:00
Rob Pike
30775f67e7 encoding/gob: don't send type info for unexported fields
Fixes #2517.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5440079
2011-12-02 00:02:24 -08:00
Benny Siegert
2a876beb18 os/exec: make LookPath always search the current directory under Windows.
cmd.exe implicitly looks in "." before consulting PATH.
LookPath should match this behavior.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5434093
2011-12-02 14:29:24 +11:00
Rob Pike
e6b3371781 template: move the empty check into parse, which needs it when constructing
tree sets.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5449062
2011-12-01 17:24:54 -08:00
Andrew Balholm
a5d300862b html: allow whitespace between head and body
Also ignore <head> tag after </head>.

Pass tests6.dat, test 0:
<!doctype html></head> <head>

| <!DOCTYPE html>
| <html>
|   <head>
|   " "
|   <body>

Also pass tests through test 6:
<body>
<div>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5447064
2011-12-02 11:46:24 +11:00
Robert Griesemer
6ea3a268b6 go/doc: exclude lines ending in ':' from possible headings
This is a more conservative approach to heading detection and
removes 11 headings from the current repository (several in
fmt). The current headscan output is:

/home/gri/go3/src/cmd/goinstall (package documentation)
        Remote Repositories
        The GOPATH Environment Variable
/home/gri/go3/src/pkg/exp/gotype (package documentation)
        Examples
/home/gri/go3/src/pkg/html/template (package template)
        Introduction
        Contexts
        Errors
        A fuller picture
        Contexts
        Typed Strings
        Security Model
/home/gri/go3/src/pkg/text/template (package template)
        Actions
        Arguments
        Pipelines
        Variables
        Examples
        Functions
        Associated templates
        Nested template definitions
18 headings found

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5437105
2011-12-01 15:14:15 -08:00
Robert Griesemer
15a3a5cf6c gofmt: applied gofmt -w -s src misc
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5451070
2011-12-01 14:33:24 -08:00
Robert Griesemer
e281576b9a go/doc: switch ToHTML from []byte to string argument
- this removes extra conversions from strings to bytes and vice versa
  for each comment
- minor cleanups

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5434096
2011-12-01 13:46:57 -08:00
Robert Griesemer
bc9ce6a129 go/doc: better headscan
- scan all comments not just the package documentation
- declutter output so that false positives are more easily spotted
- count the number of headings to quickly see differences
- minor tweaks

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5450061
2011-12-01 11:50:15 -08:00
Rob Pike
473de60359 time: update doc string for Error method
Fixes #2512.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5449057
2011-12-01 11:44:17 -08:00
Gustavo Niemeyer
d2b77bb194 os: add ModeType constant to mask file type bits
This covers the lack of IsRegular comfortably:

    if stat.Mode()&os.ModeType == 0 { ... }

R=golang-dev, r, rsc, r, gustavo
CC=golang-dev
https://golang.org/cl/5440075
2011-12-01 17:35:43 -02:00
Brad Fitzpatrick
744fb52102 os: be consistent with receiver names for godoc TOC alignment
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5449056
2011-12-01 11:23:39 -08:00
Gustav Paul
fad57c0c03 exp/ssh: export type signal. Renamed to Signal
R=dave, agl, rsc, golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5450059
2011-12-01 14:06:15 -05:00
Russ Cox
c52b7db470 gofix: add time+fileinfo fix
R=adg, rogpeppe, r, cw
CC=golang-dev
https://golang.org/cl/5450050
2011-12-01 13:59:57 -05:00
Volker Dobler
a6729b3085 go/doc: Detect headings in comments and format them as h3 in html.
To structure larger sections of comments in html output headings
are detected in comments and formated as h3 in the generated html.
A simple heuristic is used to detect headings in comments:
A heading is a non-blank, non-indented line preceded by a blank
line. It is followed by a blank and a non-blank, non-indented line.
A heading must start with an uppercase letter and end with a letter,
digit or a colon.  A heading may not contain punctuation characters.

R=jan.mercl, gri, adg, rsc, r
CC=golang-dev
https://golang.org/cl/5437056
2011-12-01 09:49:58 -08:00
Alex Brainman
d5f37122d2 crypto/tls: cleanup certificate load on windows
- correct syscall.CertEnumCertificatesInStore so it returns error
- remove "reflect" dependency

R=hectorchu, agl, rsc
CC=golang-dev, krautz
https://golang.org/cl/5441052
2011-12-01 12:38:00 -05:00
Adam Langley
bac7bc55a6 Add a []byte argument to hash.Hash to allow an allocation to be saved.
This is the result of running `gofix -r hashsum` over the tree, changing
the hash function implementations by hand and then fixing a couple of
instances where gofix didn't catch something.

The changed implementations are as simple as possible while still
working: I'm not trying to optimise in this CL.

R=rsc, cw, rogpeppe
CC=golang-dev
https://golang.org/cl/5448065
2011-12-01 12:35:37 -05:00
Adam Langley
2308aefc84 gofix: add a fix for hash.Sum.
This fix adds an output argument to hash.Sum.

Tree changes in https://golang.org/cl/5448065

R=rsc
CC=golang-dev
https://golang.org/cl/5450051
2011-12-01 12:25:09 -05:00
Rob Pike
d38cc47c0c text/template: replace Add with AddParseTree
Makes it clear we're adding exactly one tree and creating a
new template for it.

R=rsc
CC=golang-dev
https://golang.org/cl/5448077
2011-12-01 09:19:53 -08:00
Luuk van Dijk
6bee4e556f gc: avoid re-genning ninit in branches involving float comparison.
R=rsc
CC=golang-dev
https://golang.org/cl/5451050
2011-12-01 14:46:32 +01:00
Dave Cheney
c4d0ac0e2f exp/ssh: add Std{in,out,err}Pipe methods to Session
R=gustav.paul, cw, agl, rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/5433080
2011-12-01 08:30:16 -02:00
Alex Brainman
68e30a9765 time: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/5440071
2011-12-01 15:26:28 +11:00
Rob Pike
9a86e244bf html/template: make execution thread-safe
The problem is that execution can modify the template, so it needs
interlocking to have the same thread-safe guarantee as text/template.
Fixes #2439.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5450056
2011-11-30 20:11:57 -08:00
Andrew Balholm
ce27b00f48 html: implement fragment parsing algorithm
Pass the tests in tests4.dat.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5447055
2011-12-01 12:47:57 +11:00
Joel Sing
595efd0d20 syscall: fix openbsd sysctl hostname/domainname workaround
Fixes #2509.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5451055
2011-12-01 10:17:33 +11:00
Rob Pike
07ee3cc741 html/template: update to new template API
Not quite done yet but enough is here to review.

Embedding is eliminated so clients can't accidentally reach
methods of text/template.Template that would break the
invariants.

TODO later: Add and Clone are unimplemented.
TODO later: address issue 2349

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5434077
2011-11-30 17:42:18 -05:00
Dave Cheney
0e62c75b9d undo CL 5436056 / 03560deae933
Remove the accidentally exported net.Listener

««« original CL description
exp/ssh: remove unused forwarding methods in Server Listener

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

»»»

R=agl, rsc
CC=golang-dev
https://golang.org/cl/5437090
2011-11-30 17:14:03 -05:00
Ian Lance Taylor
bf43161c00 ld: align ELF data sections
fixes #2506

R=rsc, iant
CC=golang-dev
https://golang.org/cl/5440066
2011-11-30 13:24:16 -08:00
Russ Cox
97197a6248 time: fix windows build
TBR=brainman
CC=golang-dev
https://golang.org/cl/5447057
2011-11-30 15:45:24 -05:00
Charles L. Dorian
06e635e46d math: faster Sincos
Sincos via sincos.go is 35.4 ns/op, via sincos_amd64.s is 37.4 ns/op on 2.53 GHz Intel Core 2 Duo (Mac OS X).

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5447045
2011-11-30 15:11:44 -05:00
Russ Cox
e62622b1b1 os: fix path/filepath test on Windows
This is not the right fix, but it is what used to happen
before the FileInfo conversion, and it should get the
build working again (at least that part).

TBR=brainman
CC=golang-dev
https://golang.org/cl/5434090
2011-11-30 13:42:14 -05:00
Russ Cox
e812db3558 encoding/asn1: fix test on OpenBSD
time.Parse uses time.Local if it has the right zone offset,
otherwise it calls time.FixedZone.  The test's use of reflect.DeepEqual
meant that the test expected time.FixedZone always, failing
when the local time zone really would have used -0700 for
that time.  The fix is to format the time to display only the
pieces we intend to test.

R=golang-dev, agl, iant
CC=golang-dev
https://golang.org/cl/5437088
2011-11-30 13:36:25 -05:00
Russ Cox
12eee9edbc os: fix windows build
TBR=brainman
CC=golang-dev
https://golang.org/cl/5449048
2011-11-30 12:38:54 -05:00
Roger Peppe
ca6de008ba math/big: fix destination leak into result value
This code would panic:
z := big.NewInt(1)
z.SetBit(big.NewInt(0), 2, 1)
if z.Cmp(big.NewInt(1<<2)) != 0 {
        panic("fail")
}

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5437081
2011-11-30 09:29:58 -08:00