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

9495 Commits

Author SHA1 Message Date
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