Because gotest's args are mingled with the tests, it's
hard to get the usage message to print. This CL adds
explicit support for -help, spelled several different ways.
Gotest has special flags like -file that are somewhat
hidden otherwise.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5298052
Adds check that, for example, a Scan method taking
a first argument of type fmt.ScanState has the correct
signature to satisfy fmt.Scanner.
Similarly, a ReadByte should return byte, os.Error.
These are important to check because various pieces
of code (fmt, gob, json, flate) do dynamic checks
for these methods, so code with incorrect signatures
would not be flagged at compile time.
These become even more important to check when
rune is introduced.
R=r
CC=golang-dev
https://golang.org/cl/5305044
Move string table to the end of the __LINKEDIT segment.
This change allows Apple's codesign(1) utility to successfully sign
Go binaries, as long as they don't contain DWARF data (-w flag to
8l/6l). This is because codesign(1) expects the string table to be
the last part of the file.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5271050
If the length of the interpreter string
pushes us over the ELFRESERVE limit, the
resulting error message will be comical.
I was doing some ELF tinkering with a
modified version of 8l when I hit this.
To be clear, the stock linkers wouldn't
hit this without adding about forty more
section headers. We're safe for now. ;)
Also, remove a redundant call to cflush.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5268044
There is no semantic change here, just better errors.
If a function says it takes a byte, and you pass it an int,
the compiler error now says that you need a byte, not
that you need a uint8.
Groundwork for rune.
R=ken2
CC=golang-dev
https://golang.org/cl/5300042
The implementation of splitFirst was broken;
splitFirst("foo/") must be the same as splitFirst("foo").
As a result, ToAbsolute could be simplified, and as a side
effect this fixes a long-standing bug.
Thanks to Luca Greco <luca.greco@alcacoop.it> for doing
the investigation.
Fixes#1157.
R=rsc
CC=golang-dev
https://golang.org/cl/5278050
Revert workaround in compiler and
revert test for compiler workaround.
Tested that the 386 build continues to fail if
the gc change is made without the reflect change.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5312041
The old m[x] = 0, false syntax will be deleted
in a month or so, once people have had time to
change their code (there is a gofix in a separate CL).
R=ken2
CC=golang-dev
https://golang.org/cl/5265048
The Windows signtool.exe thinks our binaries are 'invalid
Win32 programs' unless the PE linker version field is 3.0
or greater.
This minor change makes it possible to successfully sign
gc-built binaries on Windows.
R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5268045
Uses a generic solution of renaming the tested package, instead of
using cryptic names for all other imports, variables and methods
in the generated _testmain.go file.
Fixes#2346.
R=golang-dev, r, adg
CC=golang-dev, rsc
https://golang.org/cl/5254061
Adjust goyacc.go to produce code that is gofmt-compliant whenever it is easy to do so. Also changed two lines in cpyact that appeared to be bugs.
Also updated units.y to remove a few other errors.
After this change, units.go has only two style errors: an extra newline at the top of the file, and yys misaligned in yySymType.
R=rsc
CC=golang-dev
https://golang.org/cl/5265047
Also test only specific fixes, not all fixes.
This means we don't have to keep updating old
test cases to match later changes to the library.
I had to adjust some of the reflect test cases,
because they were implicitly testing
reflect+oserrorstring, not just reflect.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5283042
Use FlagNoPointers and do not zeroize memory when allocate strings.
test/garbage/parser.out old new
run #1 32.923s 32.065s
run #2 33.047s 31.931s
run #3 32.702s 31.841s
run #4 32.718s 31.838s
run #5 32.702s 31.868s
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5259041
The current implementation of formatting for incomplete programs
cannot tolerate program rewrites; ignore -rewrite in that case
with a warning message (temporary solution).
Fix a couple of crashes that were introduced recently.
Fixes#2348.
R=rsc
CC=golang-dev
https://golang.org/cl/5233054
This also shows the source code of exported functions in server
mode (e.g. pkg/big/?m=src).
Fixes#2360.
R=rsc
CC=golang-dev
https://golang.org/cl/5254057
string literals used as package qualifiers are now prefixed with '@'
which obviates the need for the extra ':' before tags.
R=rsc, gri, lvd
CC=golang-dev
https://golang.org/cl/5129057
Also: Fewer calls to flush for faster processing (once per identifier
or error instead of once per token).
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5236041
Removed the URL form parameter "f=text" in favor of a more
flexible mode parameter "m" which now accepts a list of mode
flags as documented in doc.go.
Fixes#1784.
R=rsc
CC=golang-dev
https://golang.org/cl/5227041
This CL introduces the go.Example type and go.Examples functions that
are used to represent and extract code samples from Go source.
They should be of the form:
// Output of this function.
func ExampleFoo() {
fmt.Println("Output of this function.")
}
It also modifies godoc to read example code from _test.go files,
and include them in the HTML output with JavaScript-driven toggles.
It also implements testing of example functions with gotest.
The stdout/stderr is compared against the output comment on the
function.
This CL includes examples for the sort.Ints function and the
sort.SortInts type. After patching this CL in and re-building go/doc
and godoc, try
godoc -http=localhost:6060
and visit http://localhost:6060/pkg/sort/
R=gri, r, rsc
CC=golang-dev
https://golang.org/cl/5137041