-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathblocked.go
46 lines (38 loc) · 914 Bytes
/
blocked.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//golangcitest:args -Egofactory
//golangcitest:config_path configs/go_factory_package_globs_only.yml
package gofactory
import (
"net/http"
"net/url"
)
var (
nestedGlobalRequest = http.Request{}
nestedGlobalRequestPtr = &http.Request{}
blockedGlobalURL = url.URL{} // want `Use factory for url.URL`
blockedGlobalURLPtr = &url.URL{} // want `Use factory for url.URL`
)
func Blocked() {
_ = http.Request{}
_ = &http.Request{}
_ = url.URL{} // want `Use factory for url.URL`
_ = &url.URL{} // want `Use factory for url.URL`
}
type URL struct {
Scheme string
Opaque string
User *url.Userinfo
Host string
Path string
RawPath string
OmitHost bool
ForceQuery bool
RawQuery string
Fragment string
RawFragment string
}
func Casting() {
_ = url.URL(URL{}) // want `Use factory for url.URL`
uPtr, _ := url.Parse("")
u := *uPtr
_ = URL(u)
}