Skip to content

Commit

Permalink
don't check that GET response is written if type checking is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
chris124567 committed Sep 12, 2024
1 parent aa9bcae commit 158ef42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func parseServerRoute(kv *ast.KeyValueExpr, pass *analysis.Pass) (*serverRoute,
})
return false
}
if r.response == types.Typ[types.UntypedNil] {
if checkTypes && r.response == types.Typ[types.UntypedNil] {
pass.Report(analysis.Diagnostic{
Pos: call.Args[0].Pos(),
Message: fmt.Sprintf("%v routes should write a response object", r.method),
Expand Down Expand Up @@ -356,7 +356,7 @@ func parseServerRoute(kv *ast.KeyValueExpr, pass *analysis.Pass) (*serverRoute,
r.response = types.Typ[types.UntypedNil]
}

if r.method == "GET" && r.response == types.Typ[types.UntypedNil] {
if checkTypes && r.method == "GET" && r.response == types.Typ[types.UntypedNil] {
pass.Report(analysis.Diagnostic{
Pos: funcBody.Pos(),
Message: fmt.Sprintf("%v routes should write a response object", r.method),
Expand Down

0 comments on commit 158ef42

Please sign in to comment.