@@ -103,7 +103,9 @@ func test() {
103103 {
104104 Name : "test" ,
105105 ReturnType : phpVoid ,
106- GoFunction : "func test() {\n \t // simple function\n }" ,
106+ GoFunction : `func test() {
107+ // simple function
108+ }` ,
107109 },
108110 },
109111 contains : []string {
@@ -213,7 +215,9 @@ func TestGoFileGenerator_PackageNameSanitization(t *testing.T) {
213215
214216 for _ , tt := range tests {
215217 t .Run (tt .baseName , func (t * testing.T ) {
216- sourceFile := createTempSourceFile (t , "package main\n //export_php: test(): void\n func test() {}" )
218+ sourceFile := createTempSourceFile (t , `package main
219+ //export_php: test(): void
220+ func test() {}` )
217221
218222 generator := & Generator {
219223 BaseName : tt .baseName ,
@@ -251,7 +255,8 @@ func TestGoFileGenerator_ErrorHandling(t *testing.T) {
251255 },
252256 {
253257 name : "valid file" ,
254- sourceFile : createTempSourceFile (t , "package main\n func test() {}" ),
258+ sourceFile : createTempSourceFile (t , `package main
259+ func test() {}` ),
255260 expectErr : false ,
256261 },
257262 }
@@ -756,7 +761,9 @@ func simpleFunc() {
756761 {
757762 Name : "simpleFunc" ,
758763 ReturnType : phpVoid ,
759- GoFunction : "func simpleFunc() {\n \t // simple function\n }" ,
764+ GoFunction : `func simpleFunc() {
765+ // simple function
766+ }` ,
760767 },
761768 },
762769 classes : nil ,
@@ -790,7 +797,9 @@ func (ts *TestStruct) GetName() string {
790797 Signature : "getName(): string" ,
791798 ReturnType : phpString ,
792799 Params : []phpParameter {},
793- GoFunction : "func (ts *TestStruct) GetName() string {\n \t return ts.name\n }" ,
800+ GoFunction : `func (ts *TestStruct) GetName() string {
801+ return ts.name
802+ }` ,
794803 },
795804 },
796805 },
@@ -821,7 +830,9 @@ func (ms *MixedStruct) GetValue() int {
821830 {
822831 Name : "utilFunc" ,
823832 ReturnType : phpString ,
824- GoFunction : "func utilFunc() string {\n \t return \" utility\" \n }" ,
833+ GoFunction : `func utilFunc() string {
834+ return "utility"
835+ }` ,
825836 },
826837 },
827838 classes : []phpClass {
@@ -836,7 +847,9 @@ func (ms *MixedStruct) GetValue() int {
836847 Signature : "getValue(): int" ,
837848 ReturnType : phpInt ,
838849 Params : []phpParameter {},
839- GoFunction : "func (ms *MixedStruct) GetValue() int {\n \t return ms.value\n }" ,
850+ GoFunction : `func (ms *MixedStruct) GetValue() int {
851+ return ms.value
852+ }` ,
840853 },
841854 },
842855 },
0 commit comments