Skip to content

Commit 77667dc

Browse files
committed
Fix lint issue
1 parent e4eb8a1 commit 77667dc

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

http/codegen/websocket.go

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,15 @@ func initWebSocketData(ed *EndpointData, e *expr.HTTPEndpointExpr, sd *ServiceDa
120120
}
121121
desc = fmt.Sprintf("%s builds a %s service %s endpoint payload.", name, svc.Name, e.MethodExpr.Name)
122122
if body != expr.Empty {
123-
var (
124-
ref string
125-
svcode string
126-
)
127-
{
128-
ref = "body"
129-
if expr.IsObject(body) {
130-
ref = "&body"
131-
}
132-
if ut, ok := body.(expr.UserType); ok {
133-
if val := ut.Attribute().Validation; val != nil {
134-
httpctx := httpContext("", sd.Scope, true, true)
135-
svcode = codegen.ValidationCode(ut.Attribute(), ut, httpctx, true, expr.IsAlias(ut), false, "body")
136-
}
123+
ref := "body"
124+
if expr.IsObject(body) {
125+
ref = "&body"
126+
}
127+
var svcode string
128+
if ut, ok := body.(expr.UserType); ok {
129+
if val := ut.Attribute().Validation; val != nil {
130+
httpctx := httpContext("", sd.Scope, true, true)
131+
svcode = codegen.ValidationCode(ut.Attribute(), ut, httpctx, true, expr.IsAlias(ut), false, "body")
137132
}
138133
}
139134
serverArgs = []*InitArgData{{

0 commit comments

Comments
 (0)