summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2009-11-23go: makes it build for the case $GOROOT has whitespacesSergio Luis O. B. Correia131-288/+304
the bash scripts and makefiles for building go didn't take into account the fact $GOROOT / $GOBIN could both be directories containing whitespaces, and was not possible to build it in such a situation. this commit adjusts the various makefiles/scripts to make it aware of that possibility, and now it builds successfully when using a path with whitespaces as well. Fixes issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
2009-11-23cmd/cc: change getquoted() to accept whitespaces.Sergio Luis O. B. Correia1-1/+1
getquoted() currently checks for whitespaces and returns nil if it finds one. this prevents us from having go in a path containing whitespaces, as the #pragma dynld directives are processed through the said function. this commit makes getquoted() accept whitespaces, and this is also needed for solving issue #115. R=rsc http://codereview.appspot.com/157066 Committer: Russ Cox <rsc@golang.org>
2009-11-23gofmt -r: documentation and minor fixesRuss Cox3-29/+67
fix a few paren insertion bugs in the printer too. R=gri, r CC=golang-dev http://codereview.appspot.com/157119
2009-11-23 Fix crash in xml.Unmarshal. Occasionally while running a scrape of some xml ↵Vish Subramanian1-1/+1
with many goroutines I see a crash with the following stack trace: SIGSEGV: segmentation violation Faulting address: 0x44 PC=0x44e510 runtime·mapaccess2+0x18 /home/vish/go/src/pkg/runtime/hashmap.c:790 runtime·mapaccess2(0x0, 0x0) xml·*Parser·text+0x922 /home/vish/go/src/pkg/xml/xml.go:765 xml·*Parser·text(0xe44c9870, 0x7fa3, 0xffffffff, 0x7f00, 0x44b5c4, ...) xml·*Parser·RawToken+0x174 /home/vish/go/src/pkg/xml/xml.go:405 xml·*Parser·RawToken(0xe44c9870, 0x7fa3, 0x0, 0x0) xml·*Parser·Token+0x625 /home/vish/go/src/pkg/xml/xml.go:205 xml·*Parser·Token(0xe44c9870, 0x7fa3, 0x0, 0x0, 0x0, ...) xml·*Parser·Skip+0x27 /home/vish/go/src/pkg/xml/read.go:371 xml·*Parser·Skip(0xe44c9870, 0x7fa3, 0x8, 0x0) xml·*Parser·unmarshal+0xae6 /home/vish/go/src/pkg/xml/read.go:328 xml·*Parser·unmarshal(0xe44c9870, 0x7fa3, 0xe8127120, 0x7fa3, 0xdc94bc40, ...) xml·Unmarshal+0xda /home/vish/go/src/pkg/xml/read.go:121 xml·Unmarshal(0xe65724b0, 0x7fa3, 0xdc94bc00, 0x7fa3, 0x4bcfc0, ...) scraper·DoSearch+0x3d1 /home/vish/my-go-src/google3/experimental/users/vish/go_http/scraper.go:95 scraper·DoSearch(0xe7dc28c0, 0x7fa3, 0x33, 0x3, 0x6d2510, ...) main·scrapeQueries+0x202 /home/vish/my-go-src/google3/experimental/users/vish/go_http/scrape.go:251 main·scrapeQueries(0xe7da2600, 0x7fa3, 0x64, 0x1db0, 0xe7e10000, ...) goexit /home/vish/go/src/pkg/runtime/proc.c:135 goexit() 0x7fa3e7da2600 unknown pc Clearly xml.Parser is accessing an uninitialized map. Add a check for a nil map before accessing it. R=r, rsc http://codereview.appspot.com/159050 Committer: Russ Cox <rsc@golang.org>
2009-11-23two more if(h<0) that gcc 4.3 -O2 miscompilesRuss Cox2-5/+2
R=r http://codereview.appspot.com/160044
2009-11-23io.ReadWriter: fix doc comment (ReadWrite -> ReadWriter)Russ Cox1-1/+1
R=r CC=eds http://codereview.appspot.com/160045
2009-11-23fix bug in prefix code: must stop one character before any potential match ↵Rob Pike2-3/+8
of an empty string Fixes issue 308. R=rsc CC=golang-dev http://codereview.appspot.com/157142
2009-11-23Fix doc striing for NewReadLogger.Rob Pike1-2/+2
Fixes issue 315. R=rsc http://codereview.appspot.com/157140
2009-11-238g: call throwindex for array out of boundsRuss Cox1-4/+2
R=ken2 http://codereview.appspot.com/160043
2009-11-21crypto/tls: add initial client implementation.Adam Langley9-7/+439
R=rsc, agl CC=golang-dev http://codereview.appspot.com/157076
2009-11-20gofmt: add -r flag to rewrite source code according to patternRuss Cox4-5/+252
a little slow, but usable (speed unchanged when not using -r) tweak go/printer to handle nodes without line numbers more gracefully in a couple cases. R=gri http://codereview.appspot.com/156103
2009-11-20Missed a reference to sc instead of mc in 157065.William Josephson1-1/+1
R=rsc, dho http://codereview.appspot.com/157116 Committer: Russ Cox <rsc@golang.org>
2009-11-20FreeBSD's mcontext isn't exactly the same as sigcontext, soDevon H. O'Dell5-122/+43
we can't use them interchangably. R=rsc, wjosephson CC=golang-dev http://codereview.appspot.com/156113 Committer: Russ Cox <rsc@golang.org>
2009-11-20Support for basic try-catch style exception handling.Robert Griesemer4-0/+156
Meant as illustration of the Go pattern that is using goroutines and channels to handle exceptional situations. Note: There is no need for "Finally" since the "try block" (the function f supplied to Try) cannot do a Smalltalk-style non-local return and terminate the function surrounding Try. Replaces CL 157083. R=r, rsc http://codereview.appspot.com/157087
2009-11-20gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkgRuss Cox118-308/+308
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
2009-11-20x[y:] for stringsRuss Cox5-5/+31
R=ken2 http://codereview.appspot.com/157114
2009-11-20fix buildRob Pike1-1/+0
R=rsc http://codereview.appspot.com/159044
2009-11-20slight simplification made possible by the code now processing match statesRob Pike1-4/+3
in order of discovery. R=rsc http://codereview.appspot.com/157112
2009-11-20add unimplemented %+ and % (space) flags to floating-point print.Rob Pike2-11/+37
fix %E: was same as %e. add tests. Fixes issue 278. R=rsc CC=golang-dev http://codereview.appspot.com/157111
2009-11-20x[lo:] - gc and runtime.Russ Cox15-145/+887
* add runtime sliceslice1 for x[lo:] * remove runtime arraytoslice, rewriting &arr into arr[0:len(arr)]. * port cgen_inline into 8g, 5g. * use native memmove in maps R=ken2 http://codereview.appspot.com/157106
2009-11-20cgo: allow .so in subdirectoriesRuss Cox2-2/+2
R=r http://codereview.appspot.com/157103
2009-11-19add a match arena to regexp to avoid generating garbage.Rob Pike2-46/+133
simple regexps run 20x faster. the regex-dna benchmark goes 3x faster. R=rsc CC=golang-dev http://codereview.appspot.com/156108
2009-11-19cgo now renders types with unknown size as [0]byte instead of raising aEden Li1-2/+5
fatal error. Fixes issue 126. R=rsc http://codereview.appspot.com/157101 Committer: Russ Cox <rsc@golang.org>
2009-11-19reflect fixesRuss Cox3-1/+12
R=r http://codereview.appspot.com/156104
2009-11-19fix arm build.Russ Cox1-0/+6
once more with feeling. TBR=kaib http://codereview.appspot.com/157100
2009-11-19Map support for template.Execute().James Meneghello2-12/+59
Allows the developer to pass a map either by itself for evaluation, or inside a struct. Access to data inside maps is identical to the current system for structs, ie. -Psuedocode- mp map[string]string = { "header" : "A fantastic header!", "footer" : "A not-so-fantastic footer!", } template.Execute(mp) ...can be accessed using {header} and {footer} in the template. Similarly, for maps inside structs: type s struct { mp map[string]string, } s1 = new s s1.mp["header"] = "A fantastic header!"; template.Execute(s1) ...is accessed using {mp.header}. Multi-maps, ie. map[string](map[string]string) and maps of structs containing more maps are unsupported, but then, I'm not even sure if that's supported by the language. Map elements can be of any type that can be written by the formatters. Keys should really only be strings. Fixes issue 259. R=r, rsc http://codereview.appspot.com/157088 Committer: Rob Pike <r@golang.org>
2009-11-19Add json.Marshal to json packageMichael Hoisie2-0/+143
R=rsc CC=golang-dev http://codereview.appspot.com/157068 Committer: Russ Cox <rsc@golang.org>
2009-11-19archive/tar: Make Reader and Writer more closely follow io.Reader and ↵Evan Shaw2-2/+2
io.Writer interfaces There's no functional change here. io gives the Read and Write methods byte slice arguments, but tar called them uint8. It's the same thing, but I think this is clearer and it matches what other packages do. R=rsc CC=golang-dev http://codereview.appspot.com/157099 Committer: Russ Cox <rsc@golang.org>
2009-11-19big: fix arm build - forgot how to spell JMPRuss Cox1-7/+7
Fixes issue 269. TBR=kaib http://codereview.appspot.com/156107
2009-11-19gc: reject large channel values at compile timeRuss Cox2-0/+13
Fixes issue 144. R=ken2 CC=agl1 http://codereview.appspot.com/156102
2009-11-19two easy optimizations for regexp:Rob Pike2-13/+83
1) if char class contains a single character, make it a single character. (this is used to quote, e.g. [.] rather than \. 2) if regexp begins with ordinary text substring, use plain string match to start engine R=rsc CC=golang-dev http://codereview.appspot.com/157095
2009-11-19update test.sh for gofmtRobert Griesemer1-6/+3
R=rsc http://codereview.appspot.com/157096
2009-11-19Permit omission of hi bound in slices.Robert Griesemer9-25/+74
R=r, rsc http://codereview.appspot.com/157082
2009-11-19Adds benchmark support to gotest.Trevor Strohman6-4/+231
No benchmarks are run unless the --benchmarks=<regexp> flag is specified on the gotest command line. This change includes sample benchmarks for regexp. % gotest --benchmarks=.* (standard test output redacted) testing.BenchmarkSimpleMatch 200000 7799 ns/op testing.BenchmarkUngroupedMatch 20000 76898 ns/op testing.BenchmarkGroupedMatch 50000 38148 ns/op R=r, rsc http://codereview.appspot.com/154173 Committer: Russ Cox <rsc@golang.org>
2009-11-19build Make.deps during make.bash insteadRuss Cox2-85/+4
of keeping a checked-in copy. doesn't slow down make.bash appreciably. R=r http://codereview.appspot.com/156099
2009-11-19put copy into goyaccKen Thompson1-40/+16
R=rsc http://codereview.appspot.com/156100
2009-11-19os.ReadAt doesn't return EOF at EOF.Rob Pike1-0/+3
thanks to lionkov for the fix. Fixes issue 262. R=rsc CC=golang-dev http://codereview.appspot.com/156097
2009-11-19runtime: mask signals during signal handler on OS XRuss Cox2-2/+2
Fixes issue 265. R=r CC=golang-dev http://codereview.appspot.com/157084
2009-11-18replace custom findByte with bytes.IndexByteRob Pike2-25/+15
R=rsc http://codereview.appspot.com/156093
2009-11-18big: fix large division.Adam Langley1-13/+19
I missed a case. R=rsc, agl CC=golang-dev http://codereview.appspot.com/156092
2009-11-18add bytes.IndexByte; common case we can make fast later.Rob Pike4-17/+96
also pick off the special case in strings.Index. don't want strings.IndexByte because the call site will very rarely need to allocate and we can handle the test in the code itself. bytes.IndexByte can avoid a common allocation. R=rsc CC=golang-dev http://codereview.appspot.com/156091
2009-11-18runtime: fix bug on darwin/amd64 - bad g in bsdthread_startRuss Cox1-2/+2
R=r http://codereview.appspot.com/157077
2009-11-18More FreeBSD-touchups. Thundercats are GOOOOO!Devon H. O'Dell6-24/+28
R=rsc CC=golang-dev http://codereview.appspot.com/157074 Committer: Russ Cox <rsc@golang.org>
2009-11-18crypto/x509: RawContents -> RawContentAdam Langley1-1/+1
TBR=rsc R=rsc http://codereview.appspot.com/157075
2009-11-18asn1: add support for RawContentAdam Langley2-1/+46
R=rsc CC=golang-dev http://codereview.appspot.com/157056
2009-11-18crypto/x509: add certificate support.Adam Langley2-3/+623
R=rsc CC=golang-dev http://codereview.appspot.com/156054
2009-11-186l, 8l: add trivial hash table for dynamic symbolsRuss Cox2-36/+42
R=r http://codereview.appspot.com/156085
2009-11-18remove bytes.CopyRob Pike20-148/+79
replace all calls with calls to copy use copy in regexp and bytes.Buffer R=rsc CC=golang-dev http://codereview.appspot.com/157073
2009-11-18bugs in memmove:Rob Pike3-6/+7
- has arguments (no stack split) - MOVL does not set condition R=ken2, rsc http://codereview.appspot.com/156086
2009-11-18gc: allow implicit conversion of *[10]int -> []intRuss Cox1-2/+26
when used as arg to copy. R=ken2 http://codereview.appspot.com/157071