Skip to content

Commit e9dd953

Browse files
committed
Fixed another occurrence of NewFileInputStream.
1 parent fc8b14b commit e9dd953

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ protected void writeParserTestFile(String parserName, String lexerName,
674674
"import (\n"
675675
+" \"github.com/antlr/antlr4/runtime/Go/antlr\"\n"
676676
+" \"./parser\"\n"
677+
+" \"fmt\"\n"
677678
+" \"os\"\n"
678679
+")\n"
679680
+ "\n"
@@ -738,7 +739,11 @@ protected void writeLexerTestFile(String lexerName, boolean showDFA) {
738739
+ ")\n"
739740
+ "\n"
740741
+ "func main() {\n"
741-
+ " input := antlr.NewFileStream(os.Args[1])\n"
742+
+ " input, err := antlr.NewFileStream(os.Args[1])\n"
743+
+ " if err != nil {\n"
744+
+ " fmt.Printf(\"Failed to find file: %v\", err)\n"
745+
+ " return\n"
746+
+ " }\n"
742747
+ " lexer := parser.New<lexerName>(input)\n"
743748
+ " stream := antlr.NewCommonTokenStream(lexer,0)\n"
744749
+ " stream.Fill()\n"

0 commit comments

Comments
 (0)