Skip to content

Commit

Permalink
test: add more status code cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamelentyev committed Aug 26, 2022
1 parent 2249028 commit ea97191
Show file tree
Hide file tree
Showing 2 changed files with 760 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/analyzer/internal/template/test-httpstatuscode.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ func _() {
}
{{ end -}}

{{ range $key, $value := .Mapping }}
func _() {
_ = http.Response{
StatusCode: {{ $key }}, // want `"{{ quoteMeta $key }}" can be replaced by {{ quoteMeta $value }}`
}
}
{{ end -}}

{{ range $key, $value := .Mapping }}
func _() {
_ = http.Response{
StatusCode: {{ $value }},
}
}
{{ end -}}

{{ range $key, $value := .Mapping }}
func _() error {
resp, err := http.DefaultClient.Do(&http.Request{})
Expand Down
Loading

0 comments on commit ea97191

Please sign in to comment.