1-- suggestedfix_fill_struct_20_15 -- 2package fillstruct 3 4type StructA struct { 5 unexportedIntField int 6 ExportedIntField int 7 MapA map[int]string 8 Array []int 9 StructB 10} 11 12type StructA2 struct { 13 B *StructB 14} 15 16type StructA3 struct { 17 B StructB 18} 19 20func fill() { 21 a := StructA{ 22 unexportedIntField: 0, 23 ExportedIntField: 0, 24 MapA: map[int]string{}, 25 Array: []int{}, 26 StructB: StructB{}, 27 } //@suggestedfix("}", "refactor.rewrite") 28 b := StructA2{} //@suggestedfix("}", "refactor.rewrite") 29 c := StructA3{} //@suggestedfix("}", "refactor.rewrite") 30 if true { 31 _ = StructA3{} //@suggestedfix("}", "refactor.rewrite") 32 } 33} 34 35-- suggestedfix_fill_struct_21_16 -- 36package fillstruct 37 38type StructA struct { 39 unexportedIntField int 40 ExportedIntField int 41 MapA map[int]string 42 Array []int 43 StructB 44} 45 46type StructA2 struct { 47 B *StructB 48} 49 50type StructA3 struct { 51 B StructB 52} 53 54func fill() { 55 a := StructA{} //@suggestedfix("}", "refactor.rewrite") 56 b := StructA2{ 57 B: &StructB{}, 58 } //@suggestedfix("}", "refactor.rewrite") 59 c := StructA3{} //@suggestedfix("}", "refactor.rewrite") 60 if true { 61 _ = StructA3{} //@suggestedfix("}", "refactor.rewrite") 62 } 63} 64 65-- suggestedfix_fill_struct_22_16 -- 66package fillstruct 67 68type StructA struct { 69 unexportedIntField int 70 ExportedIntField int 71 MapA map[int]string 72 Array []int 73 StructB 74} 75 76type StructA2 struct { 77 B *StructB 78} 79 80type StructA3 struct { 81 B StructB 82} 83 84func fill() { 85 a := StructA{} //@suggestedfix("}", "refactor.rewrite") 86 b := StructA2{} //@suggestedfix("}", "refactor.rewrite") 87 c := StructA3{ 88 B: StructB{}, 89 } //@suggestedfix("}", "refactor.rewrite") 90 if true { 91 _ = StructA3{} //@suggestedfix("}", "refactor.rewrite") 92 } 93} 94 95-- suggestedfix_fill_struct_24_16 -- 96package fillstruct 97 98type StructA struct { 99 unexportedIntField int 100 ExportedIntField int 101 MapA map[int]string 102 Array []int 103 StructB 104} 105 106type StructA2 struct { 107 B *StructB 108} 109 110type StructA3 struct { 111 B StructB 112} 113 114func fill() { 115 a := StructA{} //@suggestedfix("}", "refactor.rewrite") 116 b := StructA2{} //@suggestedfix("}", "refactor.rewrite") 117 c := StructA3{} //@suggestedfix("}", "refactor.rewrite") 118 if true { 119 _ = StructA3{ 120 B: StructB{}, 121 } //@suggestedfix("}", "refactor.rewrite") 122 } 123} 124 125