Skip to content

Commit ac9c5e7

Browse files
committed
Fix autotrailingslash
1 parent 6002517 commit ac9c5e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

autotrailingslash/testdata/code.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,14 @@ func EncodeMethod2Response(encoder func(context.Context, http.ResponseWriter) go
250250
// Method2 endpoint.
251251
func DecodeMethod2Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*service.Method2Payload, error) {
252252
return func(r *http.Request) (*service.Method2Payload, error) {
253+
var payload *service.Method2Payload
253254
var (
254255
param1 string
255256
256257
params = mux.Vars(r)
257258
)
258259
param1 = params["param1"]
259-
payload := NewMethod2Payload(param1)
260+
payload = NewMethod2Payload(param1)
260261
261262
return payload, nil
262263
}
@@ -275,13 +276,14 @@ func EncodeMethod3Response(encoder func(context.Context, http.ResponseWriter) go
275276
// Method3 endpoint.
276277
func DecodeMethod3Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*service.Method3Payload, error) {
277278
return func(r *http.Request) (*service.Method3Payload, error) {
279+
var payload *service.Method3Payload
278280
var (
279281
param2 string
280282
281283
params = mux.Vars(r)
282284
)
283285
param2 = params["param2"]
284-
payload := NewMethod3Payload(param2)
286+
payload = NewMethod3Payload(param2)
285287
286288
return payload, nil
287289
}

0 commit comments

Comments
 (0)