<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/os, branch dev.typealias</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>[release-branch.go1.8] os/exec: deflake TestStdinCloseRace</title>
<updated>2017-03-25T03:59:40+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2017-02-21T15:14:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=f8ed4539eb02e168aeeba891c38973336aa8e21c'/>
<id>f8ed4539eb02e168aeeba891c38973336aa8e21c</id>
<content type='text'>
Stop reporting errors from cmd.Process.Kill; they don't matter for
purposes of this test, and they can occur if the process exits quickly.

Fixes #19211.
Fixes #19213.

Change-Id: I1a0bb9170220ca69199abb8e8811b1dde43e1897
Reviewed-on: https://go-review.googlesource.com/37309
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
(cherry picked from commit 35ffca31b180e6f9da6035326132f048980dc58c)
Reviewed-on: https://go-review.googlesource.com/38607
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Stop reporting errors from cmd.Process.Kill; they don't matter for
purposes of this test, and they can occur if the process exits quickly.

Fixes #19211.
Fixes #19213.

Change-Id: I1a0bb9170220ca69199abb8e8811b1dde43e1897
Reviewed-on: https://go-review.googlesource.com/37309
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
(cherry picked from commit 35ffca31b180e6f9da6035326132f048980dc58c)
Reviewed-on: https://go-review.googlesource.com/38607
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: test adjustments for the iOS builder</title>
<updated>2017-01-14T03:27:53+00:00</updated>
<author>
<name>David Crawshaw</name>
<email>crawshaw@golang.org</email>
</author>
<published>2017-01-14T03:08:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=467109bf56fb560d1fd8a27c6184dbfe4f64ffef'/>
<id>467109bf56fb560d1fd8a27c6184dbfe4f64ffef</id>
<content type='text'>
The working directory is now adjusted to match the typical Go test
working directory in main, as the old trick for adjusting earlier
stopped working with the latest version of LLDB bugs.

That means the small number of places where testdata files are
read before main is called no longer work. This CL adjusts those
reads to happen after main is called. (This has the bonus effect of
not reading some benchmark testdata files in all.bash.)

Fixes compress/bzip2, go/doc, go/parser, os, and time package
tests on the iOS builder.

Change-Id: If60f026aa7848b37511c36ac5e3985469ec25209
Reviewed-on: https://go-review.googlesource.com/35255
Run-TryBot: David Crawshaw &lt;crawshaw@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The working directory is now adjusted to match the typical Go test
working directory in main, as the old trick for adjusting earlier
stopped working with the latest version of LLDB bugs.

That means the small number of places where testdata files are
read before main is called no longer work. This CL adjusts those
reads to happen after main is called. (This has the bonus effect of
not reading some benchmark testdata files in all.bash.)

Fixes compress/bzip2, go/doc, go/parser, os, and time package
tests on the iOS builder.

Change-Id: If60f026aa7848b37511c36ac5e3985469ec25209
Reviewed-on: https://go-review.googlesource.com/35255
Run-TryBot: David Crawshaw &lt;crawshaw@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>os/user: document the difference between Username and Name</title>
<updated>2017-01-07T22:54:27+00:00</updated>
<author>
<name>Kevin Burke</name>
<email>kev@inburke.com</email>
</author>
<published>2016-12-09T06:22:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=1ede11d13a2a4ed63e9a6cf8b6039225749fa6ea'/>
<id>1ede11d13a2a4ed63e9a6cf8b6039225749fa6ea</id>
<content type='text'>
Fixes #18261.

Change-Id: I4bd7363aac4e62461f61fd95b3c7a18063412182
Reviewed-on: https://go-review.googlesource.com/34241
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #18261.

Change-Id: I4bd7363aac4e62461f61fd95b3c7a18063412182
Reviewed-on: https://go-review.googlesource.com/34241
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>os: must fixup path when 248 bytes long</title>
<updated>2016-12-13T03:21:00+00:00</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2016-12-11T16:14:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=b00b214e0d5eecfbb98a7a52d65da07a8c9628f7'/>
<id>b00b214e0d5eecfbb98a7a52d65da07a8c9628f7</id>
<content type='text'>
Fixes #18283

Change-Id: Ic044d2d0657579e8e7786d7264fda2037ddc5ffb
Reviewed-on: https://go-review.googlesource.com/34280
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #18283

Change-Id: Ic044d2d0657579e8e7786d7264fda2037ddc5ffb
Reviewed-on: https://go-review.googlesource.com/34280
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>os/exec: fix race in TestStdinCloseRace</title>
<updated>2016-12-13T01:56:36+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-12-13T00:53:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=c06b10ae9df81ea3ffdfe118a92410da4e153fea'/>
<id>c06b10ae9df81ea3ffdfe118a92410da4e153fea</id>
<content type='text'>
The test for the race detector itself had a race of a sort not
detected by the race detector.

Fixes #18286.

Change-Id: I3265eae275aaa2869a6b6d3e8675b0d88b25831b
Reviewed-on: https://go-review.googlesource.com/34287
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test for the race detector itself had a race of a sort not
detected by the race detector.

Fixes #18286.

Change-Id: I3265eae275aaa2869a6b6d3e8675b0d88b25831b
Reviewed-on: https://go-review.googlesource.com/34287
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: make spelling consistent</title>
<updated>2016-12-08T23:22:37+00:00</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@golang.org</email>
</author>
<published>2016-12-08T22:15:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=4c4201f0e2c1faf1d1480ac72737acadedb37e6e'/>
<id>4c4201f0e2c1faf1d1480ac72737acadedb37e6e</id>
<content type='text'>
Fixes #17938

Change-Id: Iad12155f4976846bd4a9a53869f89e40e5b3deb3
Reviewed-on: https://go-review.googlesource.com/34147
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #17938

Change-Id: Iad12155f4976846bd4a9a53869f89e40e5b3deb3
Reviewed-on: https://go-review.googlesource.com/34147
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>os: document that Rename does not replace an existing directory</title>
<updated>2016-12-08T01:36:44+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2016-12-08T01:13:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=d4b46aa1b8c2e62b1e13de15741c7330fd2e9e3a'/>
<id>d4b46aa1b8c2e62b1e13de15741c7330fd2e9e3a</id>
<content type='text'>
Fixes #18240.

Change-Id: Ife951e2c1320b3f1362c85642615b24fd4291189
Reviewed-on: https://go-review.googlesource.com/34135
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #18240.

Change-Id: Ife951e2c1320b3f1362c85642615b24fd4291189
Reviewed-on: https://go-review.googlesource.com/34135
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "runtime: handle SIGPIPE in c-archive and c-shared programs"</title>
<updated>2016-12-01T11:23:17+00:00</updated>
<author>
<name>Elias Naur</name>
<email>elias.naur@gmail.com</email>
</author>
<published>2016-12-01T09:31:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=0b2daa56504e0f2ff6f724eb5bb71caed0011006'/>
<id>0b2daa56504e0f2ff6f724eb5bb71caed0011006</id>
<content type='text'>
This reverts commit d24b57a6a1a3530e590b7c0a72dc78043e198630.

Reason for revert: Further complications arised (issue 18100). We'll try again in Go 1.9.

Change-Id: I5ca93d2643a4be877dd9c2d8df3359718440f02f
Reviewed-on: https://go-review.googlesource.com/33770
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Minux Ma &lt;minux@golang.org&gt;
Run-TryBot: Minux Ma &lt;minux@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d24b57a6a1a3530e590b7c0a72dc78043e198630.

Reason for revert: Further complications arised (issue 18100). We'll try again in Go 1.9.

Change-Id: I5ca93d2643a4be877dd9c2d8df3359718440f02f
Reviewed-on: https://go-review.googlesource.com/33770
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Minux Ma &lt;minux@golang.org&gt;
Run-TryBot: Minux Ma &lt;minux@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>os: fix handling of Windows Unicode console input and ^Z</title>
<updated>2016-11-29T02:13:03+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2016-11-22T18:31:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=610d522189ed3fcf0d298609a248a3283bde62cd'/>
<id>610d522189ed3fcf0d298609a248a3283bde62cd</id>
<content type='text'>
Go 1.5 worked with Unicode console input but not ^Z.
Go 1.6 did not work with Unicode console input but did handle one ^Z case.
Go 1.7 did not work with Unicode console input but did handle one ^Z case.

The intent of this CL is for Go 1.8 to work with Unicode console input
and also handle all ^Z cases.

Here's a simple test program for reading from the console.
It prints a "&gt; " prompt, calls read, prints what it gets, and repeats.

	package main

	import (
	    "fmt"
	    "os"
	)

	func main() {
	    p := make([]byte, 100)
	    fmt.Printf("&gt; ")
	    for {
	        n, err := os.Stdin.Read(p)
	        fmt.Printf("[%d %q %v]\n&gt; ", n, p[:n], err)
	    }
	}

On Unix, typing a ^D produces a break in the input stream.
If the ^D is at the beginning of a line, then the 0 bytes returned
appear as an io.EOF:

	$ go run /tmp/x.go
	&gt; hello
	[6 "hello\n" &lt;nil&gt;]
	&gt; hello^D[5 "hello" &lt;nil&gt;]
	&gt; ^D[0 "" EOF]
	&gt; ^D[0 "" EOF]
	&gt; hello^Dworld
	[5 "hello" &lt;nil&gt;]
	&gt; [6 "world\n" &lt;nil&gt;]
	&gt;

On Windows, the EOF character is ^Z, not ^D, and there has
been a long-standing problem that in Go programs, ^Z on Windows
does not behave in the expected way, namely like ^D on Unix.
Instead, the ^Z come through as literal ^Z characters:

	C:\&gt;c:\go1.5.4\bin\go run x.go
	&gt; ^Z
	[3 "\x1a\r\n" &lt;nil&gt;]
	&gt; hello^Zworld
	[13 "hello\x1aworld\r\n" &lt;nil&gt;]
	&gt;

CL 4310 attempted to fix this bug, then known as #6303,
by changing the use of ReadConsole to ReadFile.
This CL was released as part of Go 1.6 and did fix the case
of a ^Z by itself, but not as part of a larger input:

	C:\&gt;c:\go1.6.3\bin\go run x.go
	&gt; ^Z
	[0 "" EOF]
	&gt; hello^Zworld
	[13 "hello\x1aworld\r\n" &lt;nil&gt;]
	&gt;

So the fix was incomplete.
Worse, the fix broke Unicode console input.

ReadFile does not handle Unicode console input correctly.
To handle Unicode correctly, programs must use ReadConsole.
Early versions of Go used ReadFile to read the console,
leading to incorrect Unicode handling, which was filed as #4760
and fixed in CL 7312053, which switched to ReadConsole
and was released as part of Go 1.1 and still worked as of Go 1.5:

	C:\&gt;c:\go1.5.4\bin\go run x.go
	&gt; hello
	[7 "hello\r\n" &lt;nil&gt;]
	&gt; hello world™
	[16 "hello world™\r\n" &lt;nil&gt;]
	&gt;

But in Go 1.6:

	C:\&gt;c:\go1.6.3\bin\go run x.go
	&gt; hello
	[7 "hello\r\n" &lt;nil&gt;]
	&gt; hello world™
	[0 "" EOF]
	&gt;

That is, changing back to ReadFile in Go 1.6 reintroduced #4760,
which has been refiled as #17097. (We have no automated test
for this because we don't know how to simulate console input
in a test: it appears that one must actually type at a keyboard
to use the real APIs. This CL at least adds a comment warning
not to reintroduce ReadFile again.)

CL 29493 attempted to fix #17097, but it was not a complete fix:
the hello world™ example above still fails, as does Shift-JIS input,
which was filed as #17939.

CL 29493 also broke ^Z handling, which was filed as #17427.

This CL attempts the never before successfully performed trick
of simultaneously fixing Unicode console input and ^Z handling.
It changes the console input to use ReadConsole again,
as in Go 1.5, which seemed to work for all known Unicode input.
Then it adds explicit handling of ^Z in the input stream.
(In the case where standard input is a redirected file, ^Z processing
should not happen, and it does not, because this code path is only
invoked when standard input is the console.)

With this CL:

	C:\&gt;go run x.go
	&gt; hello
	[7 "hello\r\n" &lt;nil&gt;]
	&gt; hello world™
	[16 "hello world™\r\n" &lt;nil&gt;]
	&gt; ^Z
	[0 "" EOF]
	&gt; [2 "\r\n" &lt;nil&gt;]
	&gt; hello^Zworld
	[5 "hello" &lt;nil&gt;]
	&gt; [0 "" EOF]
	&gt; [7 "world\r\n" &lt;nil&gt;]

This almost matches Unix:

	$ go run /tmp/x.go
	&gt; hello
	[6 "hello\n" &lt;nil&gt;]
	&gt; hello world™
	[15 "hello world™\n" &lt;nil&gt;]
	&gt; ^D
	[0 "" EOF]
	&gt; [1 "\n" &lt;nil&gt;]
	&gt; hello^Dworld
	[5 "hello" &lt;nil&gt;]
	&gt; [6 "world\n" &lt;nil&gt;]
	&gt;

The difference is in the handling of hello^Dworld / hello^Zworld.
On Unix, hello^Dworld terminates the read of hello but does not
result in a zero-length read between reading hello and world.
This is dictated by the tty driver, not any special Go code.

On Windows, in this CL, hello^Zworld inserts a zero length read
result between hello and world, which is treated as an interior EOF.
This is implemented by the Go code in this CL, but it matches the
handling of ^Z on the console in other programs:

	C:\&gt;copy con x.txt
	hello^Zworld
	        1 file(s) copied.

	C:\&gt;type x.txt
	hello
	C:\&gt;

A natural question is how to test all this. As noted above, we don't
know how to write automated tests using the actual Windows console.
CL 29493 introduced the idea of substituting a different syscall.ReadFile
implementation for testing; this CL continues that idea but substituting
for syscall.ReadConsole instead. To avoid the regression of putting
ReadFile back, this CL adds a comment warning against that.

Fixes #17427.
Fixes #17939.

Change-Id: Ibaabd0ceb2d7af501d44ac66d53f64aba3944142
Reviewed-on: https://go-review.googlesource.com/33451
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Quentin Smith &lt;quentin@golang.org&gt;
Reviewed-by: Alex Brainman &lt;alex.brainman@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Go 1.5 worked with Unicode console input but not ^Z.
Go 1.6 did not work with Unicode console input but did handle one ^Z case.
Go 1.7 did not work with Unicode console input but did handle one ^Z case.

The intent of this CL is for Go 1.8 to work with Unicode console input
and also handle all ^Z cases.

Here's a simple test program for reading from the console.
It prints a "&gt; " prompt, calls read, prints what it gets, and repeats.

	package main

	import (
	    "fmt"
	    "os"
	)

	func main() {
	    p := make([]byte, 100)
	    fmt.Printf("&gt; ")
	    for {
	        n, err := os.Stdin.Read(p)
	        fmt.Printf("[%d %q %v]\n&gt; ", n, p[:n], err)
	    }
	}

On Unix, typing a ^D produces a break in the input stream.
If the ^D is at the beginning of a line, then the 0 bytes returned
appear as an io.EOF:

	$ go run /tmp/x.go
	&gt; hello
	[6 "hello\n" &lt;nil&gt;]
	&gt; hello^D[5 "hello" &lt;nil&gt;]
	&gt; ^D[0 "" EOF]
	&gt; ^D[0 "" EOF]
	&gt; hello^Dworld
	[5 "hello" &lt;nil&gt;]
	&gt; [6 "world\n" &lt;nil&gt;]
	&gt;

On Windows, the EOF character is ^Z, not ^D, and there has
been a long-standing problem that in Go programs, ^Z on Windows
does not behave in the expected way, namely like ^D on Unix.
Instead, the ^Z come through as literal ^Z characters:

	C:\&gt;c:\go1.5.4\bin\go run x.go
	&gt; ^Z
	[3 "\x1a\r\n" &lt;nil&gt;]
	&gt; hello^Zworld
	[13 "hello\x1aworld\r\n" &lt;nil&gt;]
	&gt;

CL 4310 attempted to fix this bug, then known as #6303,
by changing the use of ReadConsole to ReadFile.
This CL was released as part of Go 1.6 and did fix the case
of a ^Z by itself, but not as part of a larger input:

	C:\&gt;c:\go1.6.3\bin\go run x.go
	&gt; ^Z
	[0 "" EOF]
	&gt; hello^Zworld
	[13 "hello\x1aworld\r\n" &lt;nil&gt;]
	&gt;

So the fix was incomplete.
Worse, the fix broke Unicode console input.

ReadFile does not handle Unicode console input correctly.
To handle Unicode correctly, programs must use ReadConsole.
Early versions of Go used ReadFile to read the console,
leading to incorrect Unicode handling, which was filed as #4760
and fixed in CL 7312053, which switched to ReadConsole
and was released as part of Go 1.1 and still worked as of Go 1.5:

	C:\&gt;c:\go1.5.4\bin\go run x.go
	&gt; hello
	[7 "hello\r\n" &lt;nil&gt;]
	&gt; hello world™
	[16 "hello world™\r\n" &lt;nil&gt;]
	&gt;

But in Go 1.6:

	C:\&gt;c:\go1.6.3\bin\go run x.go
	&gt; hello
	[7 "hello\r\n" &lt;nil&gt;]
	&gt; hello world™
	[0 "" EOF]
	&gt;

That is, changing back to ReadFile in Go 1.6 reintroduced #4760,
which has been refiled as #17097. (We have no automated test
for this because we don't know how to simulate console input
in a test: it appears that one must actually type at a keyboard
to use the real APIs. This CL at least adds a comment warning
not to reintroduce ReadFile again.)

CL 29493 attempted to fix #17097, but it was not a complete fix:
the hello world™ example above still fails, as does Shift-JIS input,
which was filed as #17939.

CL 29493 also broke ^Z handling, which was filed as #17427.

This CL attempts the never before successfully performed trick
of simultaneously fixing Unicode console input and ^Z handling.
It changes the console input to use ReadConsole again,
as in Go 1.5, which seemed to work for all known Unicode input.
Then it adds explicit handling of ^Z in the input stream.
(In the case where standard input is a redirected file, ^Z processing
should not happen, and it does not, because this code path is only
invoked when standard input is the console.)

With this CL:

	C:\&gt;go run x.go
	&gt; hello
	[7 "hello\r\n" &lt;nil&gt;]
	&gt; hello world™
	[16 "hello world™\r\n" &lt;nil&gt;]
	&gt; ^Z
	[0 "" EOF]
	&gt; [2 "\r\n" &lt;nil&gt;]
	&gt; hello^Zworld
	[5 "hello" &lt;nil&gt;]
	&gt; [0 "" EOF]
	&gt; [7 "world\r\n" &lt;nil&gt;]

This almost matches Unix:

	$ go run /tmp/x.go
	&gt; hello
	[6 "hello\n" &lt;nil&gt;]
	&gt; hello world™
	[15 "hello world™\n" &lt;nil&gt;]
	&gt; ^D
	[0 "" EOF]
	&gt; [1 "\n" &lt;nil&gt;]
	&gt; hello^Dworld
	[5 "hello" &lt;nil&gt;]
	&gt; [6 "world\n" &lt;nil&gt;]
	&gt;

The difference is in the handling of hello^Dworld / hello^Zworld.
On Unix, hello^Dworld terminates the read of hello but does not
result in a zero-length read between reading hello and world.
This is dictated by the tty driver, not any special Go code.

On Windows, in this CL, hello^Zworld inserts a zero length read
result between hello and world, which is treated as an interior EOF.
This is implemented by the Go code in this CL, but it matches the
handling of ^Z on the console in other programs:

	C:\&gt;copy con x.txt
	hello^Zworld
	        1 file(s) copied.

	C:\&gt;type x.txt
	hello
	C:\&gt;

A natural question is how to test all this. As noted above, we don't
know how to write automated tests using the actual Windows console.
CL 29493 introduced the idea of substituting a different syscall.ReadFile
implementation for testing; this CL continues that idea but substituting
for syscall.ReadConsole instead. To avoid the regression of putting
ReadFile back, this CL adds a comment warning against that.

Fixes #17427.
Fixes #17939.

Change-Id: Ibaabd0ceb2d7af501d44ac66d53f64aba3944142
Reviewed-on: https://go-review.googlesource.com/33451
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-by: Quentin Smith &lt;quentin@golang.org&gt;
Reviewed-by: Alex Brainman &lt;alex.brainman@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>os: Executable can use /proc/self/exe on android</title>
<updated>2016-11-29T00:24:22+00:00</updated>
<author>
<name>David Crawshaw</name>
<email>crawshaw@golang.org</email>
</author>
<published>2016-11-28T22:23:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=8a2c34e413bfbcb0ec9b01fd1dac3bc59d921256'/>
<id>8a2c34e413bfbcb0ec9b01fd1dac3bc59d921256</id>
<content type='text'>
Fixes the os test on the Android builder.

Change-Id: Ibb9db712156a620fcccf515e035475c5e2f535a5
Reviewed-on: https://go-review.googlesource.com/33650
Run-TryBot: David Crawshaw &lt;crawshaw@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes the os test on the Android builder.

Change-Id: Ibb9db712156a620fcccf515e035475c5e2f535a5
Reviewed-on: https://go-review.googlesource.com/33650
Run-TryBot: David Crawshaw &lt;crawshaw@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
