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

9651 Commits

Author SHA1 Message Date
Stefan Nilsson
c5488d4f00 sort: fix computation of maxDepth to avoid infinite loop
The current computation loops indefinitely if n > 1<<30 (for 32-bit ints).

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5848067
2012-03-20 14:23:12 -07:00
Ian Lance Taylor
c5b45aa991 cmd/go: use .o, not .{5,6,8}, for gccgo created object files
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5861044
2012-03-20 14:17:06 -07:00
Brad Fitzpatrick
65dc7dc90b sort: document two undocumented functions
They looked out of place in godoc.
Includes documenting sort stability.

Fixes #3356

R=golang-dev, gri, trolleriprofessorn
CC=golang-dev
https://golang.org/cl/5855044
2012-03-20 11:40:41 -07:00
Shenghou Ma
4b1933dfb2 runtime: remove unused goc2c.c
Its functionality has been moved into cmd/dist.

R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/5843062
2012-03-21 00:49:45 +08:00
Shenghou Ma
23322ab841 build: unset GOPATH before tests
This is because we disallow local import for non-local packages, if
GOROOT happens to be under one of GOPATH, then some tests will fail
to build.
Fixes #3337.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5852043
2012-03-21 00:47:27 +08:00
Alex Brainman
8521811cde run.bat: disable test in test\bench\go1 to fix build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5848066
2012-03-20 14:59:51 +11:00
Rob Pike
49be7f7d0d html/template: add Templates and *Escape functions
to bring it in line with text/template's interface.
Fixes #3296.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5843066
2012-03-20 14:38:07 +11:00
Andrew Gerrand
abdb4dbe2c cmd/godoc: inform users that the playground doesn't work via local godoc
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5843065
2012-03-20 14:11:38 +11:00
Alex Brainman
7fbef930a6 build: do more during windows build
- use GO_GCFLAGS and GO_LDFLAGS if supplied
- build misc\dashboard\builder and misc\goplay
- run tests in test\bench\go1
- check api compatibility

R=golang-dev, r, kardianos, bradfitz
CC=golang-dev
https://golang.org/cl/5847063
2012-03-20 14:04:20 +11:00
Mikio Hara
7905faaee2 net: drop unnecessary type assertions and fix leak in test
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5847064
2012-03-20 10:57:54 +09:00
Anthony Martin
e1f22bdcc5 gc: fix struct and array comparisons for new bool rules
The two optimizations for small structs and arrays
were missing the implicit cast from ideal bool.

Fixes #3351.

R=rsc, lvd
CC=golang-dev
https://golang.org/cl/5848062
2012-03-19 15:57:28 -07:00
Adam Langley
aa1d4170a4 crypto/tls: always send a Certificate message if one was requested.
If a CertificateRequest is received we have to reply with a
Certificate message, even if we don't have a certificate to offer.

Fixes #3339.

R=golang-dev, r, ality
CC=golang-dev
https://golang.org/cl/5845067
2012-03-19 12:34:35 -04:00
Alex Brainman
2ef4a84022 path/filepath: implement Match and Glob on windows
As discussed on golang-dev, windows will use
"\" as path separator. No escaping allowed.

R=golang-dev, r, mattn.jp, rsc, rogpeppe, bsiegert, r
CC=golang-dev
https://golang.org/cl/5825044
2012-03-19 16:51:06 +11:00
Rob Pike
1f6fc949f6 sysycall: remove creds_linux_test.go
It is unprecedented to add tests to package syscall, especially
system-specific ones. Not a policy worth changing right before Go 1
is cut.

The sole existing test, passfd_test.go, contains the line
        // +build linux darwin probablyfreebsd probablyopenbsd
which argues that this is not a subject to be undertaking likely.
Note that passfd_test.go also went in just now. It's the only test
in syscall.

Deleting for now, will reconsider after Go 1.

R=golang-dev, bradfitz, r, dsymonds
CC=golang-dev
https://golang.org/cl/5846063
2012-03-19 11:15:28 +11:00
Rob Pike
4161dfc4fe syscall: delete passfd_test.go
We can revisit the issue of testing in syscall after Go 1.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5844057
2012-03-19 11:12:32 +11:00
Albert Strasheim
6a0544091e syscall: Test SCM_CREDENTIALS, SO_PASSCRED on Linux.
R=bradfitz, iant
CC=golang-dev
https://golang.org/cl/5846059
2012-03-18 10:03:00 -07:00
Brad Fitzpatrick
c97cf055d9 syscall: add a test for passing an fd over a unix socket
Updates #1101

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5849057
2012-03-17 22:19:57 -07:00
Brad Fitzpatrick
f69132d7ad build: catch API changes during build
Adds new file api/go1.txt, locking down the current API.
Any changes to the API will need to update that file.

run.bash (but not make.bash, or Windows) will check for
accidental API changes.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5820070
2012-03-17 11:20:46 -07:00
Rob Pike
883a96d950 spec: delete references to unsafe.Reflect,Typeof,Unreflect
They have been deleted from package unsafe.
Also delete their appearance in exp/types.

Fixes #3338.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5847056
2012-03-17 22:50:59 +11:00
Johan Euphrosine
2b3fd37066 godoc: use FormatText for formating code in html template.
R=golang-dev, rsc, r, adg, gri, r
CC=golang-dev
https://golang.org/cl/5835046
2012-03-16 15:33:05 -07:00
Russ Cox
cf0cbfd21a cmd/go: don't add detail to errPrintedOutput
This makes the last error-reporting CL a bit less
aggressive.  errPrintedOutput is a sentinel value
that should not be wrapped.

R=gri
CC=golang-dev
https://golang.org/cl/5845052
2012-03-16 16:35:16 -04:00
Shenghou Ma
367557cd79 cmd/pack: also recognize '\\' as path separator in filenames
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5841051
2012-03-17 01:34:44 +08:00
Robert Griesemer
cb4ed897a3 godoc: apply gofmt
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5842043
2012-03-16 09:58:23 -07:00
Shenghou Ma
4aaf03aa74 make.bat: don't show error message if old generated files do not exist
R=golang-dev, alex.brainman, mattn.jp
CC=golang-dev
https://golang.org/cl/5843045
2012-03-17 00:32:48 +08:00
Shenghou Ma
9b70c70ffb cmd/go: add -fno-common by default on Darwin
Fixes part of issue 3253.
        We still need to support scattered relocations though.

R=golang-dev, bsiegert, rsc, iant
CC=golang-dev
https://golang.org/cl/5822050
2012-03-16 12:05:09 -04:00
Russ Cox
a4b2c5efbc cmd/go: work around occasional ETXTBSY running cgo
Fixes #3001.  (This time for sure!)

R=golang-dev, r, fullung
CC=golang-dev
https://golang.org/cl/5845044
2012-03-16 10:44:09 -04:00
David Symonds
11cc5a26d5 reflect: panic if MakeSlice is given bad len/cap arguments.
Fixes #3330.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5847043
2012-03-16 17:28:16 +11:00
Christopher Redden
8009542f55 make.bat: Fix for old files
Same fix as applied here: https://golang.org/cl/5761044

Fixes #3222.

R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5838043
2012-03-16 14:30:43 +11:00
Russ Cox
2e4a035995 runtime: do not handle signals before configuring handler
There was a small window during program initialization
where a signal could come in before the handling mechanisms
were set up to handle it.  Delay the signal-handler installation
until we're ready for the signals.

Fixes #3314.

R=golang-dev, dsymonds, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5833049
2012-03-15 22:17:54 -04:00
Yasuhiro Matsumoto
7694da1f3b cmd/gofmt: show ascii in usage.
windows cmd.exe can't show utf-8 correctly basically.
chcp 65001 may make it show, but most people don't have fonts which can
show it.

R=golang-dev, rsc, adg, gri, r
CC=golang-dev
https://golang.org/cl/5820060
2012-03-15 16:38:27 -07:00
Rémy Oudompheng
3211b2cca9 cmd/cgo: add support for function export for gccgo.
A "gccgoprefix" flag is added and used by the go tool,
to mirror the -fgo-prefix flag for gccgo, whose value
is required to know how to access functions from C.

Trying to export Go methods or unexported Go functions
will not work.

Also fix go test on "main" packages.

Updates #2313.
Fixes #3262.

R=mpimenov, rsc, iant
CC=golang-dev
https://golang.org/cl/5797046
2012-03-15 23:50:25 +01:00
Brad Fitzpatrick
86c7bc6e8b misc/dist: don't ship cmd/cov or cmd/prof
Fixes #3317

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5784083
2012-03-15 15:22:56 -07:00
Brad Fitzpatrick
c898c519b0 cmd/go: quiet some logging
This should've been behind -v before but was missed.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5836046
2012-03-15 15:10:01 -07:00
Russ Cox
bd6404a4cc runtime: fix arm build
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5832047
2012-03-15 17:40:17 -04:00
Russ Cox
7a84fb3a85 cmd/go: make build errors more visible
Fixes #3324.

Robert suggested not reporting errors until the end of the output.
which I'd also like to do, but errPrintedOutput makes that a bigger
change than I want to do before Go 1.  This change should at least
remove the confusion we had.

# Building packages and commands for linux/amd64.
runtime
errors
sync/atomic
unicode
unicode/utf8
math
sync
unicode/utf16
crypto/subtle
io
syscall
hash
crypto
crypto/md5
hash/crc32
crypto/cipher
crypto/hmac
crypto/sha1
go install unicode: copying /tmp/go-build816525784/unicode.a to /home/rsc/g/go/pkg/linux_amd64/unicode.a: short write
hash/adler32
container/list
container/ring
...

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5837054
2012-03-15 17:35:57 -04:00
Francisco Souza
9e03dcb3fa doc: add Gobs of data article
Originally published on The Go Programming Language Blog, March 24, 2011.

http://blog.golang.org/2011/03/gobs-of-data.html

R=adg
CC=golang-dev
https://golang.org/cl/5834043
2012-03-16 08:21:13 +11:00
Russ Cox
2ed7087c8d reflect: document PkgPath, Method, StructField
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5824053
2012-03-15 17:15:57 -04:00
Russ Cox
9e5db8c90a 5l, 6l, 8l: fix stack split logic for stacks near default segment size
Fixes #3310.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5823051
2012-03-15 15:22:30 -04:00
Russ Cox
b7b3652414 os: do not assume syscall.Write will write everything
Fixes #3323.

R=golang-dev, remyoudompheng, gri
CC=golang-dev
https://golang.org/cl/5837047
2012-03-15 15:10:19 -04:00
Russ Cox
20760e4335 go/build: do not report Target for local imports
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5820064
2012-03-15 15:08:57 -04:00
Brad Fitzpatrick
a4e6197b91 net/http: couple more triv.go modernizations
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5834049
2012-03-15 10:06:25 -07:00
Andrew Gerrand
d528f52d87 cmd/godoc: add toys, tour button to playground
Fixes #3241.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5835043
2012-03-15 17:44:47 +11:00
Alex Brainman
4b872d61fe os: return some invented data from Stat(DevNull) on windows
Fixes #3321.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5831043
2012-03-15 16:33:45 +11:00
Francisco Souza
235863cb12 doc: add "Godoc: documenting Go code" article
Originally published on The Go Programming Language Blog, March 31, 2011.

http://blog.golang.org/2011/03/godoc-documenting-go-code.html

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5830043
2012-03-15 14:51:44 +11:00
Robert Hencke
1c224ab9dd net/http: ensure triv.go compiles and runs
R=golang-dev, bradfitz, dsymonds, dave, r
CC=golang-dev
https://golang.org/cl/5795069
2012-03-14 20:25:57 -07:00
Andrew Gerrand
181dc14cd6 cmd/godoc: use *goroot as base path in zip file
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5781069
2012-03-15 11:31:16 +11:00
Brad Fitzpatrick
c959ebe4d8 archive/zip: move r.zip off disk, into reader_test.go
Makes certain virus scanners happier.

R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/5823053
2012-03-14 14:41:06 -07:00
Robert Griesemer
036731c170 go/build: clearer argument name for Import (src -> srcDir)
R=rsc
CC=golang-dev
https://golang.org/cl/5820052
2012-03-14 13:19:14 -07:00
Russ Cox
95a8bab7b6 cmd/go: fix directory->import path conversion
Fixes #3306.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5821048
2012-03-14 15:12:57 -04:00
Russ Cox
70e58a2f9b io/ioutil: fix crash when Stat fails
Fixes #3320.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5824051
2012-03-14 14:47:13 -04:00
Shenghou Ma
b2a9079e54 runtime: manage stack by ourselves for badcallback on windows/amd64
This function uses 48-byte of precious non-split stack for every callback
function, and without this CL, it can easily overflow the non-split stack.
I encountered this when trying to enable misc/cgo/test on windows/amd64.

R=rsc
CC=golang-dev
https://golang.org/cl/5784075
2012-03-15 02:24:49 +08:00
Volker Dobler
1ddc9feb53 cmd/go: trivial help message fix for go help get
Direct reference to go help build where the flags are described.

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5825046
2012-03-14 12:49:57 -04:00
Shenghou Ma
24ed667b33 os: IsNotExist() should also consider ERROR_PATH_NOT_FOUND on Windows
Also update documentation about IsExist() and IsNotExist(), they are not
    about files only.

R=rsc
CC=golang-dev
https://golang.org/cl/5794073
2012-03-14 23:54:40 +08:00
Rob Pike
214a1ca3c5 html/template: fix nil pointer bug
Fixes #3272.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5819046
2012-03-14 15:08:54 +11:00
Mikio Hara
9eeb90945e runtime/cgo: linux signal masking
Fixes #3314.
Fixes #3101 (again).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5820047
2012-03-14 13:07:25 +09:00
Mikio Hara
1fc9a17c7e runtime/cgo: darwin signal masking
Fixes #3101 (again).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5825043
2012-03-14 12:49:59 +09:00
Andrew Gerrand
ace7d26499 cmd/godoc: s/ignore/appengine/ in appinit.go +build constraint
R=golang-dev
CC=golang-dev
https://golang.org/cl/5784072
2012-03-14 14:02:59 +11:00
Andrew Gerrand
adcb508359 godoc: fix vet warnings for untagged struct literals
src/cmd/godoc/filesystem.go:337:10: os.PathError struct literal uses untagged fields
src/cmd/godoc/filesystem.go:355:10: os.PathError struct literal uses untagged fields

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5820046
2012-03-14 13:19:39 +11:00
Robert Griesemer
d724631a53 all: various typos
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5820045
2012-03-13 17:29:07 -07:00
Johan Euphrosine
fef92cbbac doc: add Go image/draw package article and convert code snippets to Go1.
Originally published on The Go Programming Language Blog, September 29, 2011.

http://blog.golang.org/2011/09/go-imagedraw-package.html

Update #2547.

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/5755057
2012-03-14 11:27:41 +11:00
Brad Fitzpatrick
5f32c8b88b html/template: fix panic on Clone
Fixes #3281

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5819044
2012-03-13 16:55:43 -07:00
Rob Pike
d6ad6f0e61 text/template: variables do not take arguments
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5821044
2012-03-14 10:46:21 +11:00
Robert Griesemer
b5021f3fe0 go/printer, gofmt: fix multi-line logic
A node spans multiple lines if the line difference
between start and end point is > 0 (rather than > 1).
Fixes some odd cases introduced by CL 5706055;
pointed out by dsymonds.

Added corresponding test case. The other change
in the .golden file reverts to the status before
the CL mentioned above and is correct.

gofmt -w src misc changes godoc.go back to where
it was before the CL mentioned above.

Fixes #3304.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5820044
2012-03-13 16:15:58 -07:00
Shenghou Ma
62bb39e2ba fmt: remove dead code
Also fix a typo in comment.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5808043
2012-03-14 04:59:17 +08:00
Rob Pike
8170d81f4f text/template: fix a couple of parse bugs around identifiers.
1) Poor error checking in variable declarations admitted
$x=2 or even $x%2.
2) Need white space or suitable termination character
after identifiers, so $x+2 doesn't parse, in case we want it
to mean something one day.
Number 2 in particular prevents mistakes that we will have
to honor later and so is necessary for Go 1.

Fixes #3270.
Fixes #3271.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5795073
2012-03-14 07:03:11 +11:00
Maxim Pimenov
5361712ab4 go/build: fix match
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5801043
2012-03-13 10:00:43 -04:00
Russ Cox
cc99d8ad0b gc: use quoted string format in import error
R=ken2
CC=golang-dev
https://golang.org/cl/5794077
2012-03-13 09:33:54 -04:00
Alex Brainman
f26b1f8056 make.bat: properly handle directories with spaces
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/5797079
2012-03-13 16:50:44 +11:00
Shenghou Ma
4ca59a010e os: remove document duplication in error predicate functions
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5783092
2012-03-13 13:48:07 +08:00
Rob Pike
d0a4c9bb62 gc: allow ~ in import paths
Windows has paths like C:/Users/ADMIN~1. Also, it so happens
that go/parser allows ~ in import paths. So does the spec.
Fixes the build too.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5777073
2012-03-13 16:03:19 +11:00
Rob Pike
daacba5184 gc: include full text of import path in error message
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5783091
2012-03-13 15:35:08 +11:00
Alex Brainman
16ade99d9d runtime: fix windows/amd64 exception handler
R=golang-dev, rsc
CC=golang-dev, hectorchu
https://golang.org/cl/5797077
2012-03-12 22:42:55 -04:00
Robert Hencke
4809ad655b cmd/go: fix typo
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5777072
2012-03-12 19:41:15 -07:00
David Symonds
fa6d3ab6be build: update comment about GO_LDFLAGS.
(5l/6l/8l aren't involved in building packages)

R=golang-dev, robert.hencke
CC=golang-dev
https://golang.org/cl/5798071
2012-03-13 12:52:15 +11:00
Alex Brainman
7c128493a4 test: actually run them on windows
R=golang-dev, r, rsc, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/5756065
2012-03-13 12:51:28 +11:00
Shenghou Ma
0238cec021 os, syscall: windows really isn't posix compliant, fix os.IsExist()
R=golang-dev, rsc, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/5754083
2012-03-13 12:50:04 +11:00
Brad Fitzpatrick
d46438c3da cmd/godoc: remove sync code
Fixes #3273

R=gri
CC=golang-dev
https://golang.org/cl/5795065
2012-03-12 15:57:38 -07:00
Francisco Souza
bb6e685b7b godoc: fix codewalk handler
For URLs ending with /, the handler did not work, trying to append
".xml" to the path.

For instance, the "Share Memory by Communicating" returned the
following error:

        open /Users/francisco.souza/lib/go/doc/codewalk/sharemem/.xml: no such file or directory

R=adg, minux.ma
CC=golang-dev
https://golang.org/cl/5797065
2012-03-13 09:08:04 +11:00
Francisco Souza
60b98d6208 doc: add C? Go? Cgo! article
Originally published on The Go Programming Language Blog, March 17, 2011.

http://blog.golang.org/2011/03/c-go-cgo.html

Update #2547.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5777054
2012-03-13 09:07:37 +11:00
Fazlul Shahriar
c7cca2756e os/exec: fix typo in documentation
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5797073
2012-03-12 14:08:00 -07:00
Russ Cox
bf09a8c970 undo CL 5754088 / cae9a7c0db06
broke builders

««« original CL description
cmd/go: respect $GOBIN always

Before, we only consulted $GOBIN for source code
found in $GOROOT, but that's confusing to explain
and less useful.  The new behavior lets users set
GOBIN=$HOME/bin and have all go-compiled binaries
installed there.

Fixes #3269.

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

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/5794065
2012-03-12 17:03:29 -04:00
Russ Cox
bccafa7210 cmd/go: respect $GOBIN always
Before, we only consulted $GOBIN for source code
found in $GOROOT, but that's confusing to explain
and less useful.  The new behavior lets users set
GOBIN=$HOME/bin and have all go-compiled binaries
installed there.

Fixes #3269.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5754088
2012-03-12 16:49:12 -04:00
Russ Cox
2d3cc97c9c runtime: fix windows/amd64
Maybe.

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/5754091
2012-03-12 16:48:16 -04:00
Russ Cox
4e18bfb930 cmd/go: make go get new.code/... work
Fixes #2909.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5796072
2012-03-12 16:35:15 -04:00
Russ Cox
b70925d699 cmd/go: make net/... match net too
Otherwise there's no good way to get both, and it comes up often.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5794064
2012-03-12 16:34:24 -04:00
Russ Cox
0af08d8253 log: fix doc comment for Ldate
Fixes #3303.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5795062
2012-03-12 16:29:33 -04:00
Brad Fitzpatrick
a7c9f24907 cmd/fix: add rules for net/http -> net/http/httputil renames
And merge the httputil fix into go1rename.

R=golang-dev, r, dsymonds, r, rsc
CC=golang-dev
https://golang.org/cl/5696084
2012-03-12 13:25:48 -07:00
Brad Fitzpatrick
4edd53e47b os: document FileInfo.Size as system-dependent for irregular files
R=rsc, r
CC=golang-dev
https://golang.org/cl/5795059
2012-03-12 13:17:48 -07:00
Russ Cox
b23691148f runtime: print error on receipt of signal on non-Go thread
It's the best we can do before Go 1.

For issue 3250; not a fix but at least less mysterious.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5797068
2012-03-12 15:55:18 -04:00
Shenghou Ma
72801291d6 build: build correct cmd/dist matching GOHOSTARCH
Fix for issue 3210 comment #1.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/5794057
2012-03-13 03:34:22 +08:00
Shenghou Ma
0359621241 build: update Makefile to track source code dependencies better
Also update .hgignore to ignore y.output.

R=rsc
CC=golang-dev
https://golang.org/cl/5797061
2012-03-13 03:31:11 +08:00
Shenghou Ma
d3191f5c2b gc: correct comment in runtime.go
R=rsc, iant
CC=golang-dev
https://golang.org/cl/5777057
2012-03-13 03:24:13 +08:00
Ingo Oeser
d13b24598f cmd/go: allow ssh tunnelled bzr, git and svn
This is often used in private hosting and collaborating environments.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5753063
2012-03-12 14:41:01 -04:00
Russ Cox
4084f08401 html/template: doc nit
Execute's data is untrusted regardless of package.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5797062
2012-03-12 14:26:10 -04:00
Brad Fitzpatrick
e8deb3f828 net/http: return appropriate errors from ReadRequest
Fixes #3298

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5783080
2012-03-12 10:42:25 -07:00
Russ Cox
da8efae9fe cmd/godoc: fix directory read
Undo CL 5783076 and apply correct fix.

The /doc hack is wrong.  The code to handle this case was
already there and just needs a simple fix:

 	// We didn't find any directories containing Go files.
 	// If some directory returned successfully, use that.
-	if len(all) == 0 && first != nil {
+	if !haveGo {
 		for _, d := range first {
 			haveName[d.Name()] = true
 			all = append(all, d)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5783079
2012-03-12 13:10:37 -04:00
Russ Cox
376fc748f6 cmd/go: stop using $GOROOT and $GOBIN in script output
They were necessary to produce a canonical script
when we checked in build scripts, but now they're just
getting in the way.

Fixes #3279.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5796068
2012-03-12 12:39:31 -04:00
David Symonds
d75abb7ca3 archive/tar: catch short writes.
Also make error messages consistent throughout.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5777064
2012-03-12 17:33:35 +11:00
Andrew Gerrand
92d4af301e cmd/godoc: always include /doc files in union filesystems
Makes Path rewrites work, as the metadata was never being scanned.

Fixes #3282.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5783076
2012-03-12 15:55:39 +11:00
Robert Hencke
663a7716a1 crypto/tls, fmt: print fixes
R=golang-dev, bradfitz, minux.ma, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5787069
2012-03-12 12:04:45 +09:00
David Symonds
2e1bc9e867 cmd/vet: little tweak to tagged literal script to get it closer to drop-in format.
This is a minor change that made it easier for me; if you hate it I can drop it.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5798060
2012-03-12 13:50:25 +11:00
Brad Fitzpatrick
e31fa68a43 cmd/api: work on Windows again, and make gccgo files work a bit more
handle string and []byte conversions.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5754082
2012-03-11 17:55:15 -07:00
David Symonds
764880e2b2 cmd/api: set compiler for all build contexts.
The generated syscall files for Windows are still breaking "go tool api"
(unknown function []byte); I'll look at fixing that separately.

Fixes #3285.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5777062
2012-03-12 11:25:38 +11:00
Russ Cox
cd7ae05d52 cmd/go: local import fixes
1) The -D argument should always be a pseudo-import path,
like _/Users/rsc/foo/bar, never a standard import path,
because we want local imports to always resolve to pseudo-paths.

2) Disallow local imports in non-local packages.  Otherwise
everything works but you get two copies of a package
(the real one and the "local" one) in your binary.

R=golang-dev, bradfitz, yiyu.jgl
CC=golang-dev
https://golang.org/cl/5787055
2012-03-11 15:53:42 -04:00
Gwenael Treguier
c3954dd5da database/sql: ensure Stmts are correctly closed.
To make sure that there is no resource leak,
I suggest to fix the 'fakedb' driver such as it fails when any
Stmt is not closed.
First, add a check in fakeConn.Close().
Then, fix all missing Stmt.Close()/Rows.Close().
I am not sure that the strategy choose in fakeConn.Prepare/prepare* is ok.
The weak point in this patch is the change in Tx.Query:
  - Tests pass without this change,
  - I found it by manually analyzing the code,
  - I just try to make Tx.Query look like DB.Query.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5759050
2012-03-10 15:21:44 -08:00
Brad Fitzpatrick
3297fc63d6 database/sql: fix double connection free on Stmt.Query error
In a transaction, on a Stmt.Query error, it was possible for a
connection to be added to a db's freelist twice. Should use
the local releaseConn function instead.

Thanks to Gwenael Treguier for the failing test.

Also in this CL: propagate driver errors through releaseConn
into *DB.putConn, which conditionally ignores the freelist
addition if the driver signaled ErrBadConn, introduced in a
previous CL.

R=golang-dev, gary.burd
CC=golang-dev
https://golang.org/cl/5798049
2012-03-10 10:00:02 -08:00
David Symonds
81a38fbb77 net/mail: close minor TODO that was waiting on a 6g bug fix.
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5796050
2012-03-10 19:02:52 +11:00
Brad Fitzpatrick
b2e9f425b9 net/http: fix crash with Transport.CloseIdleConnections
Thanks Michael Lore for the bug report!

Fixes #3266

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5754068
2012-03-09 16:27:32 -08:00
Brad Fitzpatrick
98cfe6770d archive/zip: verify CRC32s in non-streamed files
We should check the CRC32s of files on EOF, even if there's no
data descriptor (in streamed files), as long as there's a non-zero
CRC32 in the file header / TOC.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5794045
2012-03-09 14:45:40 -08:00
Alex Brainman
9fffe45c65 crypto/x509: do not forget to free cert context
R=golang-dev, krautz, rsc
CC=golang-dev
https://golang.org/cl/5783059
2012-03-10 09:35:56 +11:00
Brad Fitzpatrick
3cea4131df archive/zip: write data descriptor signature for OS X; fix bugs reading it
We now always write the "optional" streaming data descriptor
signature, which turns out to be required for OS X.

Also, handle reading the data descriptor with or without the
signature, per the spec's recommendation. Fix data descriptor
reading bugs found in the process.

Fixes #3252

R=golang-dev, alex.brainman, nigeltao, rsc
CC=golang-dev
https://golang.org/cl/5787062
2012-03-09 14:12:02 -08:00
Robert Griesemer
ece0d0e7d2 go/printer: example for Fprint
R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5785057
2012-03-09 13:53:25 -08:00
Shenghou Ma
29199aa4e4 cmd/gc: import path cannot start with slash on Windows
For CL 5756065.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5784065
2012-03-10 05:11:51 +08:00
Shenghou Ma
6d4da06d36 cmd/dist, cmd/go: move CGO_ENABLED from 'go tool dist env' to 'go env'
So that we don't duplicate knowledge about which OS/ARCH combination
        supports cgo.
        Also updated src/run.bash and src/sudo.bash to use 'go env'.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5792055
2012-03-10 03:42:23 +08:00
Jeremy Jackins
1e374502f4 cmd/vet: fix typo in documentation
familiy -> family

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5783061
2012-03-09 11:21:01 -08:00
Robert Griesemer
49d2d98697 go/printer, gofmt: nicer formatting of multi-line returns
This affects corner (test) cases only; gofmt -w src misc
doesn't cause any changes.

- added additional test cases
- removed doIndent parameter from printer.valueSpec
  (was always false)
- gofmt -w src misc causes no changes

Fixes #1207.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5786060
2012-03-09 11:05:50 -08:00
Russ Cox
c9e5600f7d runtime: move runtime.write back to C
It may have to switch stacks, since we are calling
a DLL instead of a system call.

badcallback says where it is, because it is being called
on a Windows stack already.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5782060
2012-03-09 00:10:34 -05:00
Mikio Hara
26fa1c8248 net: fix typo
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5782063
2012-03-09 11:50:38 +09:00
Russ Cox
6a19ae74d4 go/build: add NoGoError
R=dsymonds
CC=golang-dev
https://golang.org/cl/5781063
2012-03-08 17:30:45 -05:00
Russ Cox
8a1b3d5a57 runtime: fix windows build
Implement runtime·write, like on the other systems,
and also runtime·badcallback, in assembly to reduce
stack footprint.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5785055
2012-03-08 15:53:11 -05:00
Brad Fitzpatrick
312ff5b58e cmd/go: document import path meta tag discovery in go help remote
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5787059
2012-03-08 11:31:52 -08:00
Russ Cox
2c46569f57 cmd/go: add env command, use to fix misc/cgo/testso
Fixes 386 build on 64-bit machines.

R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/5785053
2012-03-08 14:28:44 -05:00
Russ Cox
36aa7d4d14 runtime: inline calls to notok
When a very low-level system call that should never fail
does fail, we call notok, which crashes the program.
Often, we are then left with only the program counter as
information about the crash, and it is in notok.
Instead, inline calls to notok (it is just one instruction
on most systems) so that the program counter will
tell us which system call is unhappy.

R=golang-dev, gri, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/5792048
2012-03-08 14:03:56 -05:00
Robert Griesemer
56cae1c230 all: gofmt -w -s src misc
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5781058
2012-03-08 10:48:51 -08:00
Brad Fitzpatrick
9fb68a9a0a database/sql{,driver}: add ErrBadConn
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5785043
2012-03-08 10:09:52 -08:00
Shenghou Ma
736ff448de doc: various update to command documents
1. consistent usage section (go tool xxx)
        2. reformat cmd/ld document with minor correction
           document which -H flags are valid on which ld
           document -d flag can't be used on Windows.
           document -Hwindowsgui

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5782043
2012-03-09 01:31:09 +08:00
Francisco Souza
dc57ed8caf misc/cgo: re-enable testso
The test.bash file generates .so file using gcc, builds the executable
using the go tool and then run it with the $LD_LIBRARY_PATH variable
pointing to the directory where the .so file lives.

Fixes #2982.

R=rsc, remyoudompheng
CC=golang-dev
https://golang.org/cl/5788043
2012-03-08 12:13:41 -05:00
Russ Cox
9b73238daa cgo, runtime: diagnose callback on non-Go thread
Before:
$ go run x.go
signal 11 (core dumped)
$

After:
$ go run x.go
runtime: cgo callback on thread not created by Go.
signal 11 (core dumped)
$

For issue 3068.
Not a fix, but as much of a fix as we can do before Go 1.

R=golang-dev, rogpeppe, gri
CC=golang-dev
https://golang.org/cl/5781047
2012-03-08 12:12:40 -05:00
Robert Griesemer
9b7b574edc go/parser: use test harness for short tests
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5782044
2012-03-08 08:53:31 -08:00
Mikkel Krautz
3133b14b30 crypto/x509: allow server gated crypto in windows systemVerify
Also factors out some code into functions to make
systemVerify easier to read.

R=rsc, agl
CC=golang-dev
https://golang.org/cl/5781054
2012-03-08 11:28:04 -05:00
Mikio Hara
dfb1af4b97 cmd/gofmt: fix race in long test
Fixes #3249.

R=rsc
CC=golang-dev
https://golang.org/cl/5792043
2012-03-08 23:56:26 +09:00
Russ Cox
a40065ac68 cmd/godoc: add support for serving templates
doc: convert to use godoc built-in templates

tmpltohtml is gone, to avoid having a second copy of the code.
Instead, godoc -url /doc/go1.html will print the actual HTML
served for that URL.  "make" will generate files named go1.rawhtml
etc, which can be fed through tidy.

It can be hard to tell from the codereview diffs, but all the
tmpl files have been renamed to be html files and then
have "Template": true added.

R=golang-dev, adg, r, gri
CC=golang-dev
https://golang.org/cl/5782046
2012-03-08 08:39:20 -05:00
Russ Cox
e38c5fb23d net: document ReadMsgUnix, WriteMsgUnix
Fixes #3247.

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5784051
2012-03-08 08:36:40 -05:00
Russ Cox
2ee538bc27 time: mention receiver in Unix, UnixNano docs
Fixes #3248.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5784052
2012-03-08 08:32:52 -05:00
Russ Cox
2b64e00f16 cmd/go: rebuild external test package dependencies
Was missing recompilation of packages imported only
by external test packages (package foo_test), primarily
because Root was not set, so those packages looked like
they were from a different Go tree, so they were not
recompiled if they already existed.

Also clean things up so that only one call to computeStale
is needed.

Fixes #3238.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5786048
2012-03-08 08:32:38 -05:00
Volker Dobler
d7d1b18a5d fmt: minor tweak of package doc to show headings in godoc
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5781052
2012-03-08 22:22:36 +11:00
Alex Brainman
2b8a7adde8 go/build: do not parse .syso files
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5786049
2012-03-08 17:06:53 +11:00
Robert Griesemer
f3c39d8f2b go/parser: avoid endless loop in case of internal error
Factored the error synchronization code into two functions
syncStmt and syncDecl. Because they may return w/o advancing
the scanner, there is potential for endless loops across
multiple parse functions; typically caused by an incorrect
token list in these functions (e.g., adding token.ELSE to
syncStmt will cause the parser to go into an endless loop
for test/syntax/semi7.go without this mechanism). This would
indicate a compiler bug, exposed only in an error situation
for very specific source files. Added a mechanism to force
scanner advance if an endless loop is detected. As a result,
error recovery will be less good in those cases, but the parser
reported a source error already and at least doesn't get stuck.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5784046
2012-03-07 21:28:50 -08:00
Russ Cox
d4fb568e04 cmd/gc: implement len(array) / cap(array) rule
The spec is looser than the current implementation.
The spec edit was made in CL 4444050 (May 2011)
but I never implemented it.

Fixes #3244.

R=ken2
CC=golang-dev
https://golang.org/cl/5785049
2012-03-07 22:43:28 -05:00
Russ Cox
43d71e7d7d cmd/cgo: silence const warnings
Fixes #3152.

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5786047
2012-03-07 22:40:32 -05:00
Shenghou Ma
d56e0e7e94 doc: fix freebsd build
Also rename it to test.bash, for naming consistency.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5784045
2012-03-08 12:04:49 +09:00
Russ Cox
9069721b0e cmd/gc: delete old map delete in walk
R=ken2
CC=golang-dev
https://golang.org/cl/5783047
2012-03-07 22:03:35 -05:00
Russ Cox
b0996334c1 go/build, cmd/go: add support for .syso files
.syso files are system objects copied directly
into the package archive.

Fixes #1552.

R=alex.brainman, iant, r, minux.ma, remyoudompheng
CC=golang-dev
https://golang.org/cl/5778043
2012-03-07 22:03:18 -05:00
Francisco Souza
686d699ec6 io: minor change in io.WriteAt docs.
R=adg, bradfitz
CC=golang-dev
https://golang.org/cl/5787048
2012-03-08 12:49:13 +11:00
Robert Griesemer
5827dd052c go/scanner: better panic diagnostic
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5787045
2012-03-07 16:57:26 -08:00
Alex Brainman
0029b0d207 path/filepath: retrieve real file name in windows EvalSymlinks
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5756049
2012-03-08 10:00:25 +11:00
Shenghou Ma
90010f8f63 build: re-enable some broken tests in run.bash
Updates #2982.

R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5759064
2012-03-08 06:23:56 +08:00
Rémy Oudompheng
5c4d6ebb11 cmd/go: support -compiler for go list, fix isStale for gccgo.
Fixes #3228.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5784044
2012-03-07 23:15:55 +01:00
Dmitriy Vyukov
c8b1f85493 encoding/gob: fix memory corruption
Fixes #3175.

R=golang-dev, iant, rsc, r
CC=golang-dev
https://golang.org/cl/5758069
2012-03-08 08:53:08 +11:00
Russ Cox
b0beeb1501 runtime: fix freebsd crash
FreeBSD, alone among our supported operating systems,
required that usleep not be interrupted.  Don't require that.

Fixes #3217.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5781045
2012-03-07 15:30:54 -05:00