cmd/eg: Gofmt eg's dry-run output.
The content of the dry-run and the actual (file-editing) run should now
be the same.
Change-Id: If89f85838f7f53f14ffa4e2b6a425507835dda62
Reviewed-on: https://go-review.googlesource.com/48210
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/eg/eg.go b/cmd/eg/eg.go
index c3cee7d..18b0f09 100644
--- a/cmd/eg/eg.go
+++ b/cmd/eg/eg.go
@@ -7,8 +7,8 @@
"flag"
"fmt"
"go/build"
+ "go/format"
"go/parser"
- "go/printer"
"go/token"
"os"
"os/exec"
@@ -139,7 +139,7 @@
hadErrors = true
}
} else {
- printer.Fprint(os.Stdout, iprog.Fset, file)
+ format.Node(os.Stdout, iprog.Fset, file)
}
}
}