Created
February 4, 2017 13:55
-
-
Save haya14busa/95a5ad6c1b2cfff369ff726b47967c19 to your computer and use it in GitHub Desktop.
ignore missing ','
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/imports.go b/imports/imports.go | |
index 67573f4..32db0ca 100644 | |
--- a/imports/imports.go | |
+++ b/imports/imports.go | |
@@ -124,6 +124,11 @@ func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast | |
if err == nil { | |
return file, nil, nil | |
} | |
+ | |
+ if err != nil && strings.Contains(err.Error(), "missing ',' before newline in composite literal") { | |
+ return file, nil, nil | |
+ } | |
+ | |
// If the error is that the source file didn't begin with a | |
// package line and we accept fragmented input, fall through to | |
// try as a source fragment. Stop and return on any other error. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment