Skip to content

Commit 54524e1

Browse files
committed
Go: fix _index in repeat: eos to start from 0 (not 1)
Fixes the following tests for Go: * ValidFailRepeatAnyofInt * ValidFailRepeatContents * ValidFailRepeatEqInt * ValidFailRepeatExpr * ValidFailRepeatInst * ValidFailRepeatMaxInt * ValidFailRepeatMinInt
1 parent 7154301 commit 54524e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared/src/main/scala/io/kaitai/struct/languages/GoCompiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class GoCompiler(typeProvider: ClassTypeProvider, config: RuntimeConfig)
301301
}
302302

303303
override def condRepeatEosHeader(id: Identifier, io: String, dataType: DataType): Unit = {
304-
out.puts(s"for i := 1;; i++ {")
304+
out.puts(s"for i := 0;; i++ {")
305305
out.inc
306306

307307
val eofVar = translator.allocateLocalVar()

0 commit comments

Comments
 (0)