Skip to content

Commit 201e60b

Browse files
test: add HTTP status code happy cases (#38)
1 parent 8541da4 commit 201e60b

File tree

2 files changed

+697
-0
lines changed

2 files changed

+697
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ func _() {
2222
}
2323
{{ end -}}
2424

25+
{{ range $key, $value := .Mapping }}
26+
func _() {
27+
var w http.ResponseWriter
28+
w.WriteHeader({{ $value }})
29+
}
30+
{{ end -}}
31+
2532
{{ range $key, $value := .Mapping }}
2633
func _() {
2734
_ = &http.Response{
@@ -30,6 +37,14 @@ func _() {
3037
}
3138
{{ end -}}
3239

40+
{{ range $key, $value := .Mapping }}
41+
func _() {
42+
_ = &http.Response{
43+
StatusCode: {{ $value }},
44+
}
45+
}
46+
{{ end -}}
47+
3348
{{ range $key, $value := .Mapping }}
3449
func _() error {
3550
resp, err := http.DefaultClient.Do(&http.Request{})

0 commit comments

Comments
 (0)