@@ -123,6 +123,12 @@ func TestFormat(t *testing.T) {
123123 args : []any {},
124124 expected : "func afterHandle(respWriter *http.ResponseWriter, statusCode int, data interface{}) {" ,
125125 },
126+
127+ "close bracket at the end of line of go line with {} inside" : {
128+ template : "func afterHandle(respWriter *http.ResponseWriter, statusCode int, data interface{}) }" ,
129+ args : []any {},
130+ expected : "func afterHandle(respWriter *http.ResponseWriter, statusCode int, data interface{}) }" ,
131+ },
126132 } {
127133 t .Run (name , func (t * testing.T ) {
128134 assert .Equal (t , test .expected , stringFormatter .Format (test .template , test .args ... ))
@@ -207,6 +213,17 @@ func TestFormatComplex(t *testing.T) {
207213 args : map [string ]any {},
208214 expected : " \" server\" : {" ,
209215 },
216+ "open bracket at the end of line of go line with {} inside" : {
217+ template : "func afterHandle(respWriter *http.ResponseWriter, statusCode int, data interface{}) {" ,
218+ args : map [string ]any {},
219+ expected : "func afterHandle(respWriter *http.ResponseWriter, statusCode int, data interface{}) {" ,
220+ },
221+
222+ "close bracket at the end of line of go line with {} inside" : {
223+ template : "func afterHandle(respWriter *http.ResponseWriter, statusCode int, data interface{}) }" ,
224+ args : map [string ]any {},
225+ expected : "func afterHandle(respWriter *http.ResponseWriter, statusCode int, data interface{}) }" ,
226+ },
210227 } {
211228 t .Run (name , func (t * testing.T ) {
212229 assert .Equal (t , test .expected , stringFormatter .FormatComplex (test .template , test .args ))
0 commit comments