]> Cypherpunks repositories - gostls13.git/commit
gofmt: use os.Stdin instead of opening /dev/stdin
authorFazlul Shahriar <fshahriar@gmail.com>
Tue, 1 Dec 2009 17:32:22 +0000 (09:32 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 1 Dec 2009 17:32:22 +0000 (09:32 -0800)
commitdb18ce2f53f0fc79b7bf1182fca2d33dc7331303
tree569b3832ad87aefc7ac0aadc5d5a0e27b4faeec0
parent9e450880e9c96b6211f37860ccdfbc274fdb8b40
gofmt: use os.Stdin instead of opening /dev/stdin

Opening /dev/stdin can sometimes fail. For example, in the acme editor,
executing "Edit ,|gofmt" fails with:

open /dev/stdin: no such device or address

Executing "Edit ,|ls -l /dev/stdin /proc/self/fd/0" gives:

lrwxrwxrwx 1 root root  15 2009-09-07 02:17 /dev/stdin -> /proc/self/fd/0
lrwx------ 1 fhs  users 64 2009-11-26 22:05 /proc/self/fd/0 -> socket:[5528230]

(This is my first change, and I've signed the individual contributor license agreement.)

R=rsc, gri
CC=golang-dev
https://golang.org/cl/162041
src/cmd/gofmt/gofmt.go