Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
2355d18e
Commit
2355d18e
authored
Jan 25, 2012
by
Robert Griesemer
Committed by
Russ Cox
Jan 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofix: add -debug flag for quicker diagnosis of internal errors
R=rsc, r CC=golang-dev
https://golang.org/cl/5564055
parent
ceb59b06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
main.go
src/cmd/gofix/main.go
+8
-0
No files found.
src/cmd/gofix/main.go
View file @
2355d18e
...
...
@@ -36,6 +36,9 @@ var allowed, force map[string]bool
var
doDiff
=
flag
.
Bool
(
"diff"
,
false
,
"display diffs instead of rewriting files"
)
// enable for debugging gofix failures
const
debug
=
false
// display incorrectly reformatted source and exit
func
usage
()
{
fmt
.
Fprintf
(
os
.
Stderr
,
"usage: gofix [-diff] [-r fixname,...] [-force fixname,...] [path ...]
\n
"
)
flag
.
PrintDefaults
()
...
...
@@ -161,6 +164,11 @@ func processFile(filename string, useStdin bool) error {
}
newFile
,
err
=
parser
.
ParseFile
(
fset
,
filename
,
newSrc
,
parserMode
)
if
err
!=
nil
{
if
debug
{
fmt
.
Printf
(
"%s"
,
newSrc
)
report
(
err
)
os
.
Exit
(
exitCode
)
}
return
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment