Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(108)

Issue 162041: code review 162041: gofmt: use os.Stdin instead of opening /dev/stdin (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 4 months ago by fhs
Modified:
15 years, 4 months ago
Reviewers:
CC:
rsc, gri, golang-dev
Visibility:
Public.

Description

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.)

Patch Set 1 #

Patch Set 2 : code review 162041: gofmt: use os.Stdin instead of opening /dev/stdin #

Total comments: 3

Patch Set 3 : code review 162041: gofmt: use os.Stdin instead of opening /dev/stdin #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -8 lines) Patch
M src/cmd/gofmt/gofmt.go View 1 2 6 chunks +16 lines, -8 lines 0 comments Download

Messages

Total messages: 7
fhs
Hello rsc, gri (cc: golang-dev@googlegroups.com), I'd like you to review the following change.
15 years, 4 months ago (2009-11-27 03:28:01 UTC) #1
rsc
Arguably this is working around a bug in Linux, but it's cleaner to use os.Stdin ...
15 years, 4 months ago (2009-11-29 23:24:06 UTC) #2
gri
http://codereview.appspot.com/162041/diff/1001/4 File src/cmd/gofmt/gofmt.go (right): http://codereview.appspot.com/162041/diff/1001/4#newcode89 src/cmd/gofmt/gofmt.go:89: file, err := parser.ParseFile(filename, src, parserMode()); s/filename/f.Name()/ and get ...
15 years, 4 months ago (2009-11-30 19:09:13 UTC) #3
fhs
PTAL On 2009/11/30 19:09:13, gri wrote: > http://codereview.appspot.com/162041/diff/1001/4 > File src/cmd/gofmt/gofmt.go (right): > > http://codereview.appspot.com/162041/diff/1001/4#newcode89 ...
15 years, 4 months ago (2009-11-30 23:58:56 UTC) #4
gri
LGTM Thank you.
15 years, 4 months ago (2009-12-01 17:31:29 UTC) #5
gri
*** Submitted as http://code.google.com/p/go/source/detail?r=8399b9f164f0 *** gofmt: use os.Stdin instead of opening /dev/stdin Opening /dev/stdin can ...
15 years, 4 months ago (2009-12-01 17:32:24 UTC) #6
rsc
15 years, 4 months ago (2009-12-02 09:52:09 UTC) #7

          
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b