You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
req41, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
36
-
req41=req41.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
36
+
req41=req41.WithContext(ctx)
37
37
req41=f2(req41, ctx)
38
38
39
39
newRequest:=http.NewRequest
40
40
req5, _:=newRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
41
41
cli.Do(req5)
42
42
43
43
req51, _:=newRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
44
-
req51=req51.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
44
+
req51=req51.WithContext(ctx)
45
45
cli.Do(req51)
46
46
47
47
req52, _:=newRequestPkg(http.MethodPost, url, nil) // TODO: false negative `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
@@ -55,7 +55,7 @@ func _() {
55
55
req6=f3(req6, ctx)
56
56
57
57
req61, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
58
-
req61=req61.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
58
+
req61=req61.WithContext(ctx)
59
59
req61=f3(req61, ctx)
60
60
61
61
typeMyRequest2 http.Request
@@ -67,7 +67,7 @@ func _() {
67
67
f4(&req71, ctx)
68
68
69
69
req72, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
70
-
req72=req72.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
70
+
req72=req72.WithContext(ctx)
71
71
req73:=MyRequest2(*req7)
72
72
f4(&req73, ctx)
73
73
@@ -78,7 +78,7 @@ func _() {
78
78
79
79
req82, _:=func() (*http.Request, error) {
80
80
req82, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
81
-
req82=req82.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
81
+
req82=req82.WithContext(ctx)
82
82
returnreq82, nil
83
83
}()
84
84
cli.Do(req82)
@@ -90,7 +90,7 @@ func _() {
90
90
req9, _=f5(req9, req9, ctx)
91
91
92
92
req91, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
93
-
req91=req91.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
93
+
req91=req91.WithContext(ctx)
94
94
req9, _=f5(req91, req91, ctx)
95
95
96
96
req10, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
@@ -99,7 +99,7 @@ func _() {
99
99
100
100
req101, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
101
101
req111, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
102
-
req111=req111.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
102
+
req111=req111.WithContext(ctx)
103
103
req101, req111=f5(req101, req111, ctx)
104
104
105
105
func() (*http.Request, *http.Request) {
@@ -111,14 +111,14 @@ func _() {
111
111
func() (*http.Request, *http.Request) {
112
112
req14, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
113
113
req15, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
114
-
req15=req15.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
114
+
req15=req15.WithContext(ctx)
115
115
116
116
returnreq14, req15
117
117
}()
118
118
119
119
req121, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
req121=req121.WithContext(context.WithValue(req121.Context(), struct{}{}, 0))// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
req41, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
53
-
req41=req41.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
53
+
req41=req41.WithContext(ctx)
54
54
req41=f2(req41, ctx)
55
55
56
56
newRequest:=http.NewRequest
57
57
req5, _:=newRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
58
58
cli.Do(req5)
59
59
60
60
req51, _:=newRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
61
-
req51=req51.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
61
+
req51=req51.WithContext(ctx)
62
62
cli.Do(req51)
63
63
64
64
req52, _:=newRequestPkg(http.MethodPost, url, nil) // TODO: false negative `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
@@ -72,7 +72,7 @@ func _() {
72
72
req6=f3(req6, ctx)
73
73
74
74
req61, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
75
-
req61=req61.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
75
+
req61=req61.WithContext(ctx)
76
76
req61=f3(req61, ctx)
77
77
78
78
typeMyRequest2 http.Request
@@ -84,7 +84,7 @@ func _() {
84
84
f4(&req71, ctx)
85
85
86
86
req72, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
87
-
req72=req72.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
87
+
req72=req72.WithContext(ctx)
88
88
req73:=MyRequest2(*req7)
89
89
f4(&req73, ctx)
90
90
@@ -95,7 +95,7 @@ func _() {
95
95
96
96
req82, _:=func() (*http.Request, error) {
97
97
req82, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
98
-
req82=req82.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
98
+
req82=req82.WithContext(ctx)
99
99
returnreq82, nil
100
100
}()
101
101
cli.Do(req82)
@@ -107,7 +107,7 @@ func _() {
107
107
req9, _=f5(req9, req9, ctx)
108
108
109
109
req91, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
110
-
req91=req91.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
110
+
req91=req91.WithContext(ctx)
111
111
req9, _=f5(req91, req91, ctx)
112
112
113
113
req10, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
@@ -116,7 +116,7 @@ func _() {
116
116
117
117
req101, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
118
118
req111, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
119
-
req111=req111.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
119
+
req111=req111.WithContext(ctx)
120
120
req101, req111=f5(req101, req111, ctx)
121
121
122
122
func() (*http.Request, *http.Request) {
@@ -128,14 +128,14 @@ func _() {
128
128
func() (*http.Request, *http.Request) {
129
129
req14, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
130
130
req15, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
131
-
req15=req15.WithContext(ctx)// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
131
+
req15=req15.WithContext(ctx)
132
132
133
133
returnreq14, req15
134
134
}()
135
135
136
136
req121, _:=http.NewRequest(http.MethodPost, url, nil) // want `net/http\.NewRequest must not be called. use net/http\.NewRequestWithContext`
req121=req121.WithContext(context.WithValue(req121.Context(), struct{}{}, 0))// want `\(\*net/http\.Request\)\.WithContext must not be called. use net/http\.NewRequestWithContext`
0 commit comments