From a6449b66a4897c406d7d360daab558a11d6a74f8 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 3 Aug 2010 23:39:01 -0700 Subject: [PATCH] gofmt: make code more readable by avoiding redeclaration R=r CC=golang-dev https://golang.org/cl/1910045 --- src/cmd/gofmt/gofmt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go index ffec0325fe..c8c7d607b6 100644 --- a/src/cmd/gofmt/gofmt.go +++ b/src/cmd/gofmt/gofmt.go @@ -133,10 +133,10 @@ func processFile(f *os.File) os.Error { } -func processFileByName(filename string) (err os.Error) { +func processFileByName(filename string) os.Error { file, err := os.Open(filename, os.O_RDONLY, 0) if err != nil { - return + return err } defer file.Close() return processFile(file)