@@ -33,7 +33,7 @@ func parse(fset *token.FileSet, filename string, src []byte, fragmentOk bool) (
3333 // package line and source fragments are ok, fall through to
3434 // try as a source fragment. Stop and return on any other error.
3535 if err == nil || ! fragmentOk || ! strings .Contains (err .Error (), "expected 'package'" ) {
36- return
36+ return file , sourceAdj , indentAdj , err
3737 }
3838
3939 // If this is a declaration list, make it a source file
@@ -49,13 +49,13 @@ func parse(fset *token.FileSet, filename string, src []byte, fragmentOk bool) (
4949 src = src [indent + len ("package p\n " ):]
5050 return bytes .TrimSpace (src )
5151 }
52- return
52+ return file , sourceAdj , indentAdj , err
5353 }
5454 // If the error is that the source file didn't begin with a
5555 // declaration, fall through to try as a statement list.
5656 // Stop and return on any other error.
5757 if ! strings .Contains (err .Error (), "expected declaration" ) {
58- return
58+ return file , sourceAdj , indentAdj , err
5959 }
6060
6161 // If this is a statement list, make it a source file
@@ -86,7 +86,7 @@ func parse(fset *token.FileSet, filename string, src []byte, fragmentOk bool) (
8686 }
8787
8888 // Succeeded, or out of options.
89- return
89+ return file , sourceAdj , indentAdj , err
9090}
9191
9292// format formats the given package file originally obtained from src
0 commit comments