Skip to content

Commit

Permalink
Merge pull request #23 from SiaFoundation/dont-check-write
Browse files Browse the repository at this point in the history
Don't check that GET response is written if type checking is disabled
  • Loading branch information
lukechampine authored Sep 12, 2024
2 parents 8982ce1 + 158ef42 commit 9cb99e8
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 9cb99e8

Please sign in to comment.