Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
src/cmd/gofix/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