18
18
printerMode = printer .UseSpaces | printer .TabIndent
19
19
)
20
20
21
- //ParseError indicates generated go source is invalid
21
+ // ParseError indicates generated go source is invalid
22
22
type ParseError struct {
23
23
path string
24
24
err error
@@ -28,12 +28,12 @@ func (e ParseError) Error() string {
28
28
return fmt .Sprintf ("Error parsing %v: %v" , e .path , e .err )
29
29
}
30
30
31
- //ErrorHandler is a convenience struct for interpretting generation Errors
31
+ // ErrorHandler is a convenience struct for interpretting generation Errors
32
32
type ErrorHandler struct {
33
33
ReturnCode int
34
34
}
35
35
36
- //Handle interprets the generation error. Proceeds with setting returnCode, or panics depending on error type
36
+ // Handle interprets the generation error. Proceeds with setting returnCode, or panics depending on error type
37
37
func (h * ErrorHandler ) Handle (err error ) {
38
38
switch err := err .(type ) {
39
39
case nil :
@@ -64,9 +64,9 @@ func write(filePath string, fset *token.FileSet, f *ast.File) error {
64
64
return err
65
65
}
66
66
67
- //WriteFile parses the generated code in fileOut and writes the code out to filePath.
68
- //Function performs some import clean up and gofmts the code before writing
69
- //Returns ParseError if the generated source is invalid but is written to filePath
67
+ // WriteFile parses the generated code in fileOut and writes the code out to filePath.
68
+ // Function performs some import clean up and gofmts the code before writing
69
+ // Returns ParseError if the generated source is invalid but is written to filePath
70
70
func WriteFile (filePath , fileOut string ) error {
71
71
fset := token .NewFileSet ()
72
72
f , pErr := parser .ParseFile (fset , "" , fileOut , parser .ParseComments )
0 commit comments