Skip to content

Commit ea97191

Browse files
test: add more status code cases
1 parent 2249028 commit ea97191

File tree

2 files changed

+760
-0
lines changed

2 files changed

+760
-0
lines changed

pkg/analyzer/internal/template/test-httpstatuscode.go.tmpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ func _() {
4545
}
4646
{{ end -}}
4747

48+
{{ range $key, $value := .Mapping }}
49+
func _() {
50+
_ = http.Response{
51+
StatusCode: {{ $key }}, // want `"{{ quoteMeta $key }}" can be replaced by {{ quoteMeta $value }}`
52+
}
53+
}
54+
{{ end -}}
55+
56+
{{ range $key, $value := .Mapping }}
57+
func _() {
58+
_ = http.Response{
59+
StatusCode: {{ $value }},
60+
}
61+
}
62+
{{ end -}}
63+
4864
{{ range $key, $value := .Mapping }}
4965
func _() error {
5066
resp, err := http.DefaultClient.Do(&http.Request{})

0 commit comments

Comments
 (0)