]> Cypherpunks repositories - gostls13.git/log
gostls13.git
15 years agogc: method expressions on concrete types
Russ Cox [Sat, 19 Dec 2009 01:24:58 +0000 (17:24 -0800)]
gc: method expressions on concrete types

R=ken2
https://golang.org/cl/180092

15 years agonew comments for bytes.NewBuffer and NewBufferString.
Rob Pike [Fri, 18 Dec 2009 21:42:31 +0000 (08:42 +1100)]
new comments for bytes.NewBuffer and NewBufferString.
corrects a common misunderstanding about NewBuffer.

R=rsc
CC=golang-dev
https://golang.org/cl/179106

15 years agoruntime: fix race condition
Adam Langley [Fri, 18 Dec 2009 20:25:53 +0000 (12:25 -0800)]
runtime: fix race condition

(Thanks to ken and rsc for pointing this out)

rsc:
ken pointed out that there's a race in the new
one-lock-per-channel code.  the issue is that
if one goroutine has gone to sleep doing

select {
case <-c1:
case <-c2:
}

and then two more goroutines try to send
on c1 and c2 simultaneously, the way that
the code makes sure only one wins is the
selgen field manipulation in dequeue:

       // if sgp is stale, ignore it
       if(sgp->selgen != sgp->g->selgen) {
       //prints("INVALID PSEUDOG POINTER\n");
       freesg(c, sgp);
       goto loop;
       }

       // invalidate any others
       sgp->g->selgen++;

but because the global lock is gone both
goroutines will be fiddling with sgp->g->selgen
at the same time.

This results in a 7% slowdown in the single threaded case for a
ping-pong microbenchmark.

Since the cas predominantly succeeds, adding a simple check first
didn't make any difference.

R=rsc
CC=golang-dev
https://golang.org/cl/180068

15 years agofix build, enable an exp/eval's assignment check
Robert Griesemer [Fri, 18 Dec 2009 19:21:11 +0000 (11:21 -0800)]
fix build, enable an exp/eval's assignment check
now that the parser doesn't do this test anymore

R=rsc
CC=golang-dev
https://golang.org/cl/179105

15 years agoreport an error for illegal octal numbers instead of treating them as floats
Robert Griesemer [Fri, 18 Dec 2009 18:52:11 +0000 (10:52 -0800)]
report an error for illegal octal numbers instead of treating them as floats
added more test cases
some capitalization cleanups

R=rsc
CC=golang-dev
https://golang.org/cl/180085

15 years agoremoved semantic check from parsers
Robert Griesemer [Fri, 18 Dec 2009 18:51:47 +0000 (10:51 -0800)]
removed semantic check from parsers

R=rsc
CC=golang-dev
https://golang.org/cl/179099

15 years agoMake.pkg: fix cgo for TARG=a/b
Russ Cox [Fri, 18 Dec 2009 01:28:22 +0000 (17:28 -0800)]
Make.pkg: fix cgo for TARG=a/b

R=dho, phf
CC=golang-dev
https://golang.org/cl/180082

15 years agocgo: include line number information to keep go/printer happy
Russ Cox [Fri, 18 Dec 2009 01:04:48 +0000 (17:04 -0800)]
cgo: include line number information to keep go/printer happy

Fixes #443.

R=dho
CC=golang-dev
https://golang.org/cl/179095

15 years ago first stub for softfloats, intercepts float instructions and skips
Kai Backman [Fri, 18 Dec 2009 00:08:42 +0000 (16:08 -0800)]
first stub for softfloats, intercepts float instructions and skips
        them in the stream.

R=rsc
https://golang.org/cl/174052

15 years agofix for gofmt rewrite matcher bug
Robert Griesemer [Thu, 17 Dec 2009 23:23:19 +0000 (15:23 -0800)]
fix for gofmt rewrite matcher bug

R=rsc
CC=golang-dev
https://golang.org/cl/179096

15 years agogc: fix compiler crash
Russ Cox [Thu, 17 Dec 2009 23:08:55 +0000 (15:08 -0800)]
gc: fix compiler crash

R=ken2
CC=dho
https://golang.org/cl/179097

15 years agouse new tab indentation format in godoc, but convert
Robert Griesemer [Thu, 17 Dec 2009 22:10:49 +0000 (14:10 -0800)]
use new tab indentation format in godoc, but convert
leading tabs into spaces to ensure a good outcome in
most browsers

R=rsc
https://golang.org/cl/165051

15 years agotime: add ISO 8601 time format
Ben Olive [Thu, 17 Dec 2009 21:39:13 +0000 (13:39 -0800)]
time: add ISO 8601 time format

Fixes #431.

R=r, rsc
CC=golang-dev
https://golang.org/cl/179079

15 years agoA+C: Ben Olive (individual CLA)
Russ Cox [Thu, 17 Dec 2009 21:38:28 +0000 (13:38 -0800)]
A+C: Ben Olive (individual CLA)

R=gri
CC=golang-dev
https://golang.org/cl/180081

15 years agoAllow cgo to accept multiple .go inputs for a package
Devon H. O'Dell [Thu, 17 Dec 2009 21:20:56 +0000 (13:20 -0800)]
Allow cgo to accept multiple .go inputs for a package

Fixes #342.

R=rsc
CC=golang-dev
https://golang.org/cl/179062

15 years agoUse BitSize instead of the field's type native ByteSize when calculating
Devon H. O'Dell [Thu, 17 Dec 2009 20:38:29 +0000 (12:38 -0800)]
Use BitSize instead of the field's type native ByteSize when calculating
structs containing bitfields.

Fixes #163.

R=rsc
CC=golang-dev
https://golang.org/cl/180059

15 years agoUpdated the XGB python script to generate semicolon-free
Tor Andersson [Thu, 17 Dec 2009 20:19:40 +0000 (12:19 -0800)]
Updated the XGB python script to generate semicolon-free
source for xproto.go.

R=rsc
CC=golang-dev
https://golang.org/cl/180074

15 years agoruntime: if os/signal is not in use, crash on
Russ Cox [Thu, 17 Dec 2009 04:20:50 +0000 (20:20 -0800)]
runtime: if os/signal is not in use, crash on
most signals, so that ordinary programs
can be killed, for example.

Fixes #434.

R=dsymonds1
CC=golang-dev, hoisie
https://golang.org/cl/180064

15 years agomake it more explicit that design discussions should happen before code reviews
Rob Pike [Thu, 17 Dec 2009 01:12:47 +0000 (12:12 +1100)]
make it more explicit that design discussions should happen before code reviews

R=rsc
CC=golang-dev
https://golang.org/cl/180075

15 years ago- Parse expressions as opposed to statements for gofmt rewrite patterns.
Robert Griesemer [Thu, 17 Dec 2009 00:53:56 +0000 (16:53 -0800)]
- Parse expressions as opposed to statements for gofmt rewrite patterns.
Allows stand-alone types (e.g. []int as patterns) and doesn't require
a semicolon at the end (which are now mandatory terminators).

- Fix a matcher bug.

R=rsc
CC=golang-dev
https://golang.org/cl/179088

15 years agoBasic image/jpeg decoder.
Nigel Tao [Wed, 16 Dec 2009 23:32:17 +0000 (10:32 +1100)]
Basic image/jpeg decoder.

This is not a complete JPEG implementation (e.g. it does not handle
progressive JPEGs or restart markers), but I was able to take a photo
with my phone, and view the resultant JPEG in pure Go.

The decoder is simple, but slow. The Huffman decoder in particular
should be easily improvable, but optimization is left to future
changelists. Being able to inline functions in the inner loop should
also help performance.

The output is not pixel-for-pixel identical to libjpeg, although
identical behavior isn't necessarily a goal, since JPEG is a lossy
codec. There are at least two reasons for the discrepancy.

First, the inverse DCT algorithm used is the same as Plan9's
src/cmd/jpg, which has different rounding errors from libjpeg's
default IDCT implementation. Note that libjpeg actually has three
different IDCT implementations: one floating point, and two fixed
point. Out of those four, Plan9's seemed the simplest to understand,
partly because it has no #ifdef's or C macros.

Second, for 4:2:2 or 4:2:0 chroma sampling, this implementation does
nearest neighbor upsampling, compared to libjpeg's triangle filter
(e.g. see h2v1_fancy_upsample in jdsample.c).

The difference from the first reason is typically zero, but sometimes
1 (out of 256) in YCbCr space, or double that in RGB space. The
difference from the second reason can be as large as 8/256 in YCbCr
space, in regions of steep chroma gradients. Informal eyeballing
suggests that the net difference is typically imperceptible, though.

R=r
CC=golang-dev, rsc
https://golang.org/cl/164056

15 years agoAdd roadmap document.
Ian Lance Taylor [Wed, 16 Dec 2009 23:30:39 +0000 (15:30 -0800)]
Add roadmap document.

Also adds Development heading on navbar, with Roadmap being
the only current entry.

R=r
CC=golang-dev
https://golang.org/cl/180069

15 years agoDon't ignore flags controlling the amount of source code parsed
Robert Griesemer [Wed, 16 Dec 2009 22:12:24 +0000 (14:12 -0800)]
Don't ignore flags controlling the amount of source code parsed
in parser's ParsePkgFile and ParsePackage functions.

R=rsc
CC=golang-dev, rog
https://golang.org/cl/180070

15 years agoadd the ability to invoke niladic single-valued methods in templates.
Rob Pike [Wed, 16 Dec 2009 11:10:50 +0000 (03:10 -0800)]
add the ability to invoke niladic single-valued methods in templates.
Fixes #389.

R=rsc
CC=golang-dev
https://golang.org/cl/180061

15 years agoThis patch enables cgo utility to correctly convert enums in the C source
Moriyoshi Koizumi [Wed, 16 Dec 2009 05:24:17 +0000 (21:24 -0800)]
This patch enables cgo utility to correctly convert enums in the C source
into consts in the resulting Go source.  Previously known as issue 161047,
which I deleted accidentally.  Fixes issue 207.

R=rsc
https://golang.org/cl/166059

15 years agorand: Zipf distributed random variates.
William Josephson [Wed, 16 Dec 2009 05:10:37 +0000 (21:10 -0800)]
rand: Zipf distributed random variates.

R=rsc
https://golang.org/cl/176070

15 years agobytes, strings: add new function Fields
Andrey Mirtchovski [Wed, 16 Dec 2009 05:09:55 +0000 (21:09 -0800)]
bytes, strings: add new function Fields

R=rsc, r, phf
CC=golang-dev
https://golang.org/cl/170046

15 years agomath: special cases for Pow
Charles L. Dorian [Wed, 16 Dec 2009 04:43:12 +0000 (20:43 -0800)]
math: special cases for Pow

R=rsc
CC=golang-dev
https://golang.org/cl/176064

15 years agodoc/install.html: how to update to a new release
Russ Cox [Wed, 16 Dec 2009 03:16:56 +0000 (19:16 -0800)]
doc/install.html: how to update to a new release

Fixes #422.

R=r
CC=golang-dev
https://golang.org/cl/180057

15 years agoos/signal: new package
David Symonds [Wed, 16 Dec 2009 02:21:29 +0000 (18:21 -0800)]
os/signal: new package

Fixes #71.

R=rsc, r
https://golang.org/cl/162056

15 years agoFix for scanner bug (introduced with most recent change).
Robert Griesemer [Wed, 16 Dec 2009 02:03:59 +0000 (18:03 -0800)]
Fix for scanner bug (introduced with most recent change).

Fixes #433.

R=rsc
CC=golang-dev
https://golang.org/cl/179072

15 years agosyscall: RawSyscall must not call exitsyscall
Russ Cox [Wed, 16 Dec 2009 01:37:47 +0000 (17:37 -0800)]
syscall: RawSyscall must not call exitsyscall

Fixes #405.

R=r
CC=golang-dev, hoisie
https://golang.org/cl/180056

15 years agonew semicolon rule in effective_go.html.
Rob Pike [Wed, 16 Dec 2009 01:31:18 +0000 (12:31 +1100)]
new semicolon rule in effective_go.html.
eliminate all tab characters while we're here.

R=rsc
CC=golang-dev
https://golang.org/cl/180055

15 years agorand: add explicit Int31n to avoid 64-bit divide on 32-bit machines
Russ Cox [Wed, 16 Dec 2009 01:21:34 +0000 (17:21 -0800)]
rand: add explicit Int31n to avoid 64-bit divide on 32-bit machines
    use Int31n in Intn when possible.

Fixes #390.

(using 8g)
Intn1000      50000000         38 ns/op
Int31n1000    50000000         39 ns/op
Int63n1000    20000000        114 ns/op

R=r
CC=golang-dev, skybrian
https://golang.org/cl/180054

15 years agomath: faster, easier to inline IsNaN, IsInf
Russ Cox [Wed, 16 Dec 2009 01:21:01 +0000 (17:21 -0800)]
math: faster, easier to inline IsNaN, IsInf

R=r
CC=golang-dev
https://golang.org/cl/180046

15 years agoruntime: return zero value in x, ok = <-c when ok == false
Russ Cox [Wed, 16 Dec 2009 00:59:23 +0000 (16:59 -0800)]
runtime: return zero value in x, ok = <-c when ok == false

Fixes #401.

R=ken2
https://golang.org/cl/180053

15 years agogc: fix import name resolution
Russ Cox [Wed, 16 Dec 2009 00:44:28 +0000 (16:44 -0800)]
gc: fix import name resolution

Fixes #403.

R=ken2
https://golang.org/cl/180052

15 years agoAdd basic http authentication support.
Ivan Krasin [Wed, 16 Dec 2009 00:27:45 +0000 (16:27 -0800)]
Add basic http authentication support.
Fixes #407.

R=rsc, ajstarks
CC=ushakov
https://golang.org/cl/176076

15 years agogc: bug fixes.
Russ Cox [Wed, 16 Dec 2009 00:22:04 +0000 (16:22 -0800)]
gc: bug fixes.
  * better error for lookup of unexported field
  * do not assign "ideal string" type to typed string literal
  * do not confuse methods and fields during interface check

Fixes #410.
Fixes #411.
Fixes #426.

R=ken2
https://golang.org/cl/179069

15 years agogc: allow ... in method lists
Russ Cox [Wed, 16 Dec 2009 00:20:37 +0000 (16:20 -0800)]
gc: allow ... in method lists

R=ken2
https://golang.org/cl/179070

15 years ago1) Change default gofmt default settings for
Robert Griesemer [Tue, 15 Dec 2009 23:41:46 +0000 (15:41 -0800)]
1) Change default gofmt default settings for
   parsing and printing to new syntax.

   Use -oldparser to parse the old syntax,
   use -oldprinter to print the old syntax.

2) Change default gofmt formatting settings
   to use tabs for indentation only and to use
   spaces for alignment. This will make the code
   alignment insensitive to an editor's tabwidth.

   Use -spaces=false to use tabs for alignment.

3) Manually changed src/exp/parser/parser_test.go
   so that it doesn't try to parse the parser's
   source files using the old syntax (they have
   new syntax now).

4) gofmt -w src misc test/bench

5th and last set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/180050

15 years ago1) Change default gofmt default settings for
Robert Griesemer [Tue, 15 Dec 2009 23:40:16 +0000 (15:40 -0800)]
1) Change default gofmt default settings for
   parsing and printing to new syntax.

   Use -oldparser to parse the old syntax,
   use -oldprinter to print the old syntax.

2) Change default gofmt formatting settings
   to use tabs for indentation only and to use
   spaces for alignment. This will make the code
   alignment insensitive to an editor's tabwidth.

   Use -spaces=false to use tabs for alignment.

3) Manually changed src/exp/parser/parser_test.go
   so that it doesn't try to parse the parser's
   source files using the old syntax (they have
   new syntax now).

4) gofmt -w src misc test/bench

4th set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/180049

15 years ago1) Change default gofmt default settings for
Robert Griesemer [Tue, 15 Dec 2009 23:35:38 +0000 (15:35 -0800)]
1) Change default gofmt default settings for
   parsing and printing to new syntax.

   Use -oldparser to parse the old syntax,
   use -oldprinter to print the old syntax.

2) Change default gofmt formatting settings
   to use tabs for indentation only and to use
   spaces for alignment. This will make the code
   alignment insensitive to an editor's tabwidth.

   Use -spaces=false to use tabs for alignment.

3) Manually changed src/exp/parser/parser_test.go
   so that it doesn't try to parse the parser's
   source files using the old syntax (they have
   new syntax now).

4) gofmt -w src misc test/bench

3rd set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/180048

15 years ago 1) Change default gofmt default settings for
Robert Griesemer [Tue, 15 Dec 2009 23:33:31 +0000 (15:33 -0800)]
           1) Change default gofmt default settings for
                  parsing and printing to new syntax.

                  Use -oldparser to parse the old syntax,
                  use -oldprinter to print the old syntax.

               2) Change default gofmt formatting settings
                  to use tabs for indentation only and to use
                  spaces for alignment. This will make the code
                  alignment insensitive to an editor's tabwidth.

                  Use -spaces=false to use tabs for alignment.

               3) Manually changed src/exp/parser/parser_test.go
                  so that it doesn't try to parse the parser's
                  source files using the old syntax (they have
                  new syntax now).

               4) gofmt -w src misc test/bench

       1st set of files.

R=rsc
CC=agl, golang-dev, iant, ken2, r
https://golang.org/cl/180047

15 years agoupdate tutorial.
Rob Pike [Tue, 15 Dec 2009 23:29:53 +0000 (10:29 +1100)]
update tutorial.

R=rsc
CC=golang-dev
https://golang.org/cl/179063

15 years ago 1) Change default gofmt default settings for
Robert Griesemer [Tue, 15 Dec 2009 23:27:16 +0000 (15:27 -0800)]
           1) Change default gofmt default settings for
                  parsing and printing to new syntax.

                  Use -oldparser to parse the old syntax,
                  use -oldprinter to print the old syntax.

               2) Change default gofmt formatting settings
                  to use tabs for indentation only and to use
                  spaces for alignment. This will make the code
                  alignment insensitive to an editor's tabwidth.

                  Use -spaces=false to use tabs for alignment.

               3) Manually changed src/exp/parser/parser_test.go
                  so that it doesn't try to parse the parser's
                  source files using the old syntax (they have
                  new syntax now).

               4) gofmt -w src misc test/bench

       2nd set of files.

R=rsc
CC=golang-dev
https://golang.org/cl/179067

15 years agogc: double-check usage of ...
Russ Cox [Tue, 15 Dec 2009 22:26:50 +0000 (14:26 -0800)]
gc: double-check usage of ...

Fixes #423.

R=ken2
https://golang.org/cl/180045

15 years agogc: var x, ok = m[y]
Russ Cox [Tue, 15 Dec 2009 22:26:33 +0000 (14:26 -0800)]
gc: var x, ok = m[y]

Fixes #384.

R=ken2
https://golang.org/cl/179061

15 years agoTweak test to work with both 6g and gccgo.
Ian Lance Taylor [Tue, 15 Dec 2009 21:57:24 +0000 (13:57 -0800)]
Tweak test to work with both 6g and gccgo.

Pull the struct into a single line, since 6g reports the error
on the last line of the struct definition and gccgo reports it
on the first line.

6g:
bug215.go:12: invalid recursive type A

gccgo:
bug215.go:12:6: error: invalid recursive type ‘A’

R=rsc
https://golang.org/cl/180044

15 years agocodereview: add golang-dev@googlegroups.com
Russ Cox [Tue, 15 Dec 2009 21:36:05 +0000 (13:36 -0800)]
codereview: add golang-dev@googlegroups.com
    automatically in "hg mail".
also, avoid "empty list means all modified files in client" bug

R=gri, cw
CC=golang-dev
https://golang.org/cl/174072

15 years agofix TODO: insert semicolons before any sequence of comments
Robert Griesemer [Tue, 15 Dec 2009 16:41:50 +0000 (08:41 -0800)]
fix TODO: insert semicolons before any sequence of comments
that introduce the newline (important for correct placement
of comments with gofmt when parsing new syntax)

R=rsc
https://golang.org/cl/179055

15 years agoxml: handle unexpected EOF while parsing and fix a bug in name
Arvindh Rajesh Tamilmani [Tue, 15 Dec 2009 03:28:36 +0000 (19:28 -0800)]
xml: handle unexpected EOF while parsing and fix a bug in name

mustgetc reports unexpected EOF as SyntaxError.  using
mustgetc seems to be a better approach than letting the
caller handle unexpected EOF every time.

name: the second if statement should explicitly return
ok==false.

R=rsc
https://golang.org/cl/174083

15 years agoruntime: in exitsyscall, avoid confusing garbage collector
Russ Cox [Tue, 15 Dec 2009 03:06:20 +0000 (19:06 -0800)]
runtime: in exitsyscall, avoid confusing garbage collector

R=r
CC=golang-dev
https://golang.org/cl/178046

15 years agoimproved formatting of import declarations and
Robert Griesemer [Tue, 15 Dec 2009 01:35:12 +0000 (17:35 -0800)]
improved formatting of import declarations and
multi-line expressions with comments

Fixes #414.

R=rsc
https://golang.org/cl/179047

15 years agocrypto/sha256: new package
Andy Davis [Mon, 14 Dec 2009 23:09:49 +0000 (15:09 -0800)]
crypto/sha256: new package

R=rsc
CC=golang-dev
https://golang.org/cl/176062

15 years agosimpler fix for the negative rune problem, spotted seconds after submitting the previ...
Rob Pike [Mon, 14 Dec 2009 22:31:24 +0000 (09:31 +1100)]
simpler fix for the negative rune problem, spotted seconds after submitting the previous fix.

R=rsc
https://golang.org/cl/178044

15 years agogenerate replacement rune when asked to encode a negative rune value.
Rob Pike [Mon, 14 Dec 2009 22:19:54 +0000 (09:19 +1100)]
generate replacement rune when asked to encode a negative rune value.
Fixes #425.

R=rsc
https://golang.org/cl/178043

15 years agoarchive/tar: bug fixes.
Christopher Wedgwood [Mon, 14 Dec 2009 19:35:02 +0000 (11:35 -0800)]
archive/tar: bug fixes.
1. If all data is exhausted using Read then a following Next will
   fail as if it saw EOF.  (Test case added.)
2. Seeking isn't always possible (i.e. sockets and pipes).  Fallback
   to read.  (Test case added.)
3. Fix to readHeader (cleaner fix pointed out by rsc).
   (TestReader modified.)
4. When Read has consumed all the data, don't try to read 0 bytes from reader.
   In cases where tr.nb is zero we attempt to read zero bytes and thus
   never see an EOF (this is most easily seen when the 'tar source' is
   something like bytes.Buffer{} as opposed to os.File).
5. If write is used to the point of ErrWriteTooLong, allow additional file entries.
6. Make close work as expected.  That is any further Write or
   WriteHeader attempts will result in ErrWriteAfterClose.
Fixes #419.

R=rsc, dsymonds1
https://golang.org/cl/162062

15 years agodon't show semicolons anymore with godoc
Robert Griesemer [Mon, 14 Dec 2009 17:14:00 +0000 (09:14 -0800)]
don't show semicolons anymore with godoc

R=rsc
https://golang.org/cl/174078

15 years agoA+C: two more names
Russ Cox [Mon, 14 Dec 2009 02:39:04 +0000 (18:39 -0800)]
A+C: two more names
Andy Davis (individual CLA)
Arvindh Rajesh Tamilmani (individual CLA)

R=r
https://golang.org/cl/176067

15 years agofix naked < as reported by pwil3058@gmail.com
Rob Pike [Mon, 14 Dec 2009 02:30:11 +0000 (13:30 +1100)]
fix naked < as reported by pwil3058@gmail.com

R=rsc
CC=pwil3058
https://golang.org/cl/174087

15 years agoWhen the buffer is empty, reset b.off to the beginning of the buffer
Rob Pike [Mon, 14 Dec 2009 02:13:01 +0000 (13:13 +1100)]
When the buffer is empty, reset b.off to the beginning of the buffer
to avoid growing unnecessarily.

R=rsc
CC=golang-dev
https://golang.org/cl/176071

15 years agosyscall: fix error return bug for 64-bit return on 32-bit platform
Christopher Wedgwood [Sun, 13 Dec 2009 21:05:49 +0000 (13:05 -0800)]
syscall: fix error return bug for 64-bit return on 32-bit platform

R=dho, rsc
CC=r
https://golang.org/cl/176058

15 years ago8l: add support for PE output.
Hector Chu [Sun, 13 Dec 2009 20:39:20 +0000 (12:39 -0800)]
8l: add support for PE output.

R=rsc
https://golang.org/cl/166080

15 years agoclean.bash: stop if $GOROOT is not set
Christopher Wedgwood [Sun, 13 Dec 2009 20:27:19 +0000 (12:27 -0800)]
clean.bash: stop if $GOROOT is not set

Doing rm -rf /pkg/.. blindly isn't nice.  It could have
unintended consequences.

Secondly set bash to abort on (unexpected) errors.

R=dho, rsc
CC=golang-dev
https://golang.org/cl/176056

15 years agoPorted godefs to Windows.
Hector Chu [Sun, 13 Dec 2009 20:21:44 +0000 (12:21 -0800)]
Ported godefs to Windows.

R=rsc
https://golang.org/cl/164049

15 years agogc: fix comment
Russ Cox [Sun, 13 Dec 2009 20:11:56 +0000 (12:11 -0800)]
gc: fix comment

R=gri
CC=golang-dev
https://golang.org/cl/174077

15 years agoUpdate goyacc to new syntax, still with semicolons.
Rob Pike [Sun, 13 Dec 2009 19:34:51 +0000 (06:34 +1100)]
Update goyacc to new syntax, still with semicolons.
Update units.y too.
Fixes #417.

R=rsc
CC=golang-dev
https://golang.org/cl/176063

15 years agomore on the optimizer
Ken Thompson [Sat, 12 Dec 2009 22:36:52 +0000 (14:36 -0800)]
more on the optimizer
trying to get alizses
to optimize

R=rsc
https://golang.org/cl/176061

15 years agofix bug for large counts: used a one-byte buffer.
Rob Pike [Sat, 12 Dec 2009 20:27:43 +0000 (07:27 +1100)]
fix bug for large counts: used a one-byte buffer.

R=rsc
CC=golang-dev
https://golang.org/cl/174082

15 years agoVarious cleanups:
Robert Griesemer [Sat, 12 Dec 2009 00:42:14 +0000 (16:42 -0800)]
Various cleanups:
- no need to replace comments for stand-alone blocks
- always print string concatenations with interspersed "+"
  (remove option)
- minor cleanups

R=rsc
https://golang.org/cl/174076

15 years agogc: semicolons
Russ Cox [Fri, 11 Dec 2009 23:59:41 +0000 (15:59 -0800)]
gc: semicolons

Fixes #89.
Fixes #92.
Fixes #118.
Fixes #182.
Fixes #328.
Fixes #340.

R=ken2, ken3
CC=golang-dev
https://golang.org/cl/172049

15 years agobug in 6g optimizer
Ken Thompson [Fri, 11 Dec 2009 23:55:09 +0000 (15:55 -0800)]
bug in 6g optimizer
8g still needs fixing

R=rsc
https://golang.org/cl/176057

15 years agoparser changed to reflect new semicolon rules
Robert Griesemer [Fri, 11 Dec 2009 23:31:24 +0000 (15:31 -0800)]
parser changed to reflect new semicolon rules

R=rsc
https://golang.org/cl/175046

15 years agofix printer test for new syntax
Robert Griesemer [Fri, 11 Dec 2009 23:31:06 +0000 (15:31 -0800)]
fix printer test for new syntax

R=rsc
https://golang.org/cl/175048

15 years agoRemove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src
Devon H. O'Dell [Fri, 11 Dec 2009 23:14:09 +0000 (15:14 -0800)]
Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src

This change removes the necessity to have GOBIN in $PATH,
and also doesn't assume that the build is being run from
$GOROOT/src. This is a minimal set of necessary changes
to get Go to build happily from the FreeBSD ports
collection.

R=rsc
CC=golang-dev
https://golang.org/cl/171044

15 years agomisc/bash: completion file for bash
Russ Cox [Fri, 11 Dec 2009 21:54:00 +0000 (13:54 -0800)]
misc/bash: completion file for bash
suggested by Alex Ray <ajray@ncsu.edu>

R=gri
CC=golang-dev
https://golang.org/cl/174063

15 years agoencoding/binary: Add support for slices of arrays of fixed-size values.
Maxim Ushakov [Fri, 11 Dec 2009 21:04:03 +0000 (13:04 -0800)]
encoding/binary: Add support for slices of arrays of fixed-size values.

R=rsc
CC=krasin
https://golang.org/cl/167050

15 years agoAdd a Makefile in place of all.bash. Update docs to reflect
Devon H. O'Dell [Fri, 11 Dec 2009 20:48:55 +0000 (12:48 -0800)]
Add a Makefile in place of all.bash. Update docs to reflect
this change.

R=rsc
CC=golang-dev
https://golang.org/cl/171048

15 years agosyslog: new package
Yves Junqueira [Fri, 11 Dec 2009 20:41:51 +0000 (12:41 -0800)]
syslog: new package

R=golang-dev, rsc
https://golang.org/cl/157168

15 years agomkbuiltin: generate builtin.c directly
Yongjian Xu [Fri, 11 Dec 2009 20:41:33 +0000 (12:41 -0800)]
mkbuiltin: generate builtin.c directly

R=golang-dev, rsc
https://golang.org/cl/173041

15 years agoA+C:
Russ Cox [Fri, 11 Dec 2009 20:41:04 +0000 (12:41 -0800)]
A+C:
Andrey Mirtchovski (individual CLA),
Maxim Ushakov (Google),
Yongjian Xu (individual CLA)

R=gri
https://golang.org/cl/174064

15 years agobytes, strings: allow -1 in Map to mean "drop this character".
Kei Son [Fri, 11 Dec 2009 18:37:48 +0000 (10:37 -0800)]
bytes, strings: allow -1 in Map to mean "drop this character".

xml: drop invalid characters in attribute names
    when constructing struct field names.

R=rsc
CC=r
https://golang.org/cl/157104

15 years ago- make make test working again
Robert Griesemer [Fri, 11 Dec 2009 03:07:10 +0000 (19:07 -0800)]
- make make test working again
- some factoring for easier experimentation

R=rsc
https://golang.org/cl/174048

15 years agoNew flags for gofmt:
Robert Griesemer [Fri, 11 Dec 2009 03:03:28 +0000 (19:03 -0800)]
New flags for gofmt:
- oldparser            parse old syntax (required semicolons)
- oldprinter           print old syntax (required semicolons)

By default, these flags are enabled for now.
Setting -oldparser=false has no effect until go/parser is changed
to accept the new syntax.

Enabled exp/parser in Makefile; update dependent exp/eval.

R=rsc
https://golang.org/cl/174051

15 years agorename exp/parser package to oldParser
Robert Griesemer [Fri, 11 Dec 2009 02:27:48 +0000 (18:27 -0800)]
rename exp/parser package to oldParser
to allow simultaneous import with the
current go/parser

R=rsc
https://golang.org/cl/174053

15 years agoSpec modified to reflect new semicolon rules.
Robert Griesemer [Fri, 11 Dec 2009 00:43:01 +0000 (16:43 -0800)]
Spec modified to reflect new semicolon rules.

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/166066

15 years agoimplement NoSemis and NoStringConcat mode for go/printer
Robert Griesemer [Thu, 10 Dec 2009 23:45:57 +0000 (15:45 -0800)]
implement NoSemis and NoStringConcat mode for go/printer

R=rsc
https://golang.org/cl/174050

15 years agoimplemented InsertSemis mode for go/scanner
Robert Griesemer [Thu, 10 Dec 2009 23:31:02 +0000 (15:31 -0800)]
implemented InsertSemis mode for go/scanner

R=rsc
https://golang.org/cl/175047

15 years ago- unmodified copy of existing go/parser, not yet hooked up
Robert Griesemer [Thu, 10 Dec 2009 22:26:25 +0000 (14:26 -0800)]
- unmodified copy of existing go/parser, not yet hooked up

R=rsc
CC=r
https://golang.org/cl/175045

15 years agotrailing comma's are not accepted with current syntax
Robert Griesemer [Thu, 10 Dec 2009 21:14:44 +0000 (13:14 -0800)]
trailing comma's are not accepted with current syntax

R=rsc, ken2
https://golang.org/cl/174047

15 years agotest/fixedbug: drop obsolete bug125, bug166
Russ Cox [Thu, 10 Dec 2009 20:54:30 +0000 (12:54 -0800)]
test/fixedbug: drop obsolete bug125, bug166

R=gri
CC=golang-dev
https://golang.org/cl/173044

15 years agomake test/ken safe for optional semis
Robert Griesemer [Thu, 10 Dec 2009 20:53:23 +0000 (12:53 -0800)]
make test/ken safe for optional semis

R=rsc, ken2, ken3
https://golang.org/cl/174042

15 years agofix calling convention and make memmove restore the g and m
Kai Backman [Thu, 10 Dec 2009 19:42:01 +0000 (11:42 -0800)]
fix calling convention and make memmove restore the g and m
registers.

R=rsc
https://golang.org/cl/166049

15 years agoadded SHUT_RD, SHOT_WR and xSHUT_RDWR to fix net compilation error
Kai Backman [Thu, 10 Dec 2009 19:40:11 +0000 (11:40 -0800)]
added SHUT_RD, SHOT_WR and xSHUT_RDWR to fix net compilation error

R=rsc
https://golang.org/cl/165044

15 years agomake test/fixedbugs save for optional semis
Robert Griesemer [Thu, 10 Dec 2009 19:25:54 +0000 (11:25 -0800)]
make test/fixedbugs save for optional semis

R=rsc
https://golang.org/cl/173045

15 years agomissed a couple of files in test
Robert Griesemer [Thu, 10 Dec 2009 05:39:20 +0000 (21:39 -0800)]
missed a couple of files in test

R=rsc, r
https://golang.org/cl/172045

15 years agomaking some more non-gofmt'ed files save for new semicolon rule
Robert Griesemer [Thu, 10 Dec 2009 03:27:08 +0000 (19:27 -0800)]
making some more non-gofmt'ed files save for new semicolon rule

R=rsc, r
https://golang.org/cl/171051

15 years ago- gofmt these files
Robert Griesemer [Thu, 10 Dec 2009 00:55:03 +0000 (16:55 -0800)]
- gofmt these files
- remove use of implicit string concatenation
- these appear to be the only files correctly compiling under test
  that used implicit string concatenation

R=rsc
https://golang.org/cl/172043

15 years agominor manual format corrections
Robert Griesemer [Thu, 10 Dec 2009 00:54:24 +0000 (16:54 -0800)]
minor manual format corrections

R=rsc
https://golang.org/cl/172042