@@ -12,27 +12,17 @@ class GoSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerator(sp
12
12
* Special wrapper around StringLanguageOutputWriter that catches all attempts
13
13
* to access "this.INIT_OBJ_NAME" and replaces it with "r."
14
14
*/
15
- class GoOutputWriter (out : StringLanguageOutputWriter ) extends StringLanguageOutputWriter (indentStr) {
16
- override def inc : Unit = out.inc
17
- override def dec : Unit = out.dec
18
- override def indentNow : String = out.indentNow
19
-
20
- override def add (other : StringLanguageOutputWriter ): Unit = out.add(other)
15
+ class GoOutputWriter (indentStr : String ) extends StringLanguageOutputWriter (indentStr) {
21
16
override def puts (s : String ): Unit = {
22
17
val mangled = s.replace(REPLACER , " r." ).replaceAll(" return err$" , " t.Fatal(err)" )
23
- out .puts(mangled)
18
+ super .puts(mangled)
24
19
}
25
- override def puts = out.puts
26
- override def close = out.close
27
- override def putsLines (prefix : String , lines : String , hanging : String ): Unit =
28
- out.putsLines(prefix, lines, hanging)
29
-
30
- override def result : String = out.result
31
20
}
32
21
22
+ override val out = new GoOutputWriter (indentStr)
33
23
val compiler = new GoCompiler (provider, RuntimeConfig ())
34
24
val className = GoCompiler .types2class(List (spec.id))
35
- val translator = new GoTranslator (new GoOutputWriter ( out) , provider, importList)
25
+ val translator = new GoTranslator (out, provider, importList)
36
26
37
27
override def fileName (name : String ): String = s " ${name}_test.go "
38
28
0 commit comments