@@ -8,6 +8,12 @@ import go
8
8
* Provides classes for working with concepts from the [`clevergo.tech/clevergo@v0.5.2`](https://pkg.go.dev/clevergo.tech/clevergo@v0.5.2) package.
9
9
*/
10
10
private module CleverGo {
11
+ /** Gets the package path. */
12
+ bindingset [ result ]
13
+ string packagePath ( ) {
14
+ result = package ( [ "clevergo.tech/clevergo" , "github.com/clevergo/clevergo" ] , "" )
15
+ }
16
+
11
17
/**
12
18
* Provides models of untrusted flow sources.
13
19
*/
@@ -16,7 +22,7 @@ private module CleverGo {
16
22
// Methods on types of package: clevergo.tech/clevergo@v0.5.2
17
23
exists ( string receiverName , string methodName , Method mtd , FunctionOutput outp |
18
24
this = outp .getExitNode ( mtd .getACall ( ) ) and
19
- mtd .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , receiverName , methodName )
25
+ mtd .hasQualifiedName ( packagePath ( ) , receiverName , methodName )
20
26
|
21
27
receiverName = "Context" and
22
28
(
@@ -66,7 +72,7 @@ private module CleverGo {
66
72
this = outp .getExitNode ( mtd .getACall ( ) )
67
73
|
68
74
// Interface: Decoder
69
- mtd .implements ( package ( "clevergo.tech/clevergo" , "" ) , "Decoder" , methodName ) and
75
+ mtd .implements ( packagePath ( ) , "Decoder" , methodName ) and
70
76
(
71
77
// Method: func (Decoder).Decode(req *net/http.Request, v interface{}) error
72
78
methodName = "Decode" and
@@ -77,18 +83,16 @@ private module CleverGo {
77
83
// Structs of package: clevergo.tech/clevergo@v0.5.2
78
84
exists ( DataFlow:: Field fld |
79
85
// Struct: Context
80
- fld .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Context" , "Params" )
86
+ fld .hasQualifiedName ( packagePath ( ) , "Context" , "Params" )
81
87
or
82
88
// Struct: Param
83
- fld .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Param" , [ "Key" , "Value" ] )
89
+ fld .hasQualifiedName ( packagePath ( ) , "Param" , [ "Key" , "Value" ] )
84
90
|
85
91
this = fld .getARead ( )
86
92
)
87
93
or
88
94
// Types of package: clevergo.tech/clevergo@v0.5.2
89
- exists ( ValueEntity v |
90
- v .getType ( ) .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Params" )
91
- |
95
+ exists ( ValueEntity v | v .getType ( ) .hasQualifiedName ( packagePath ( ) , "Params" ) |
92
96
this = v .getARead ( )
93
97
)
94
98
}
@@ -103,7 +107,7 @@ private module CleverGo {
103
107
// Taint-tracking models for package: clevergo.tech/clevergo@v0.5.2
104
108
(
105
109
// Function: func CleanPath(p string) string
106
- this .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "CleanPath" ) and
110
+ this .hasQualifiedName ( packagePath ( ) , "CleanPath" ) and
107
111
inp .isParameter ( 0 ) and
108
112
out .isResult ( )
109
113
)
@@ -124,19 +128,19 @@ private module CleverGo {
124
128
(
125
129
// Receiver: Application
126
130
// Method: func (*Application).RouteURL(name string, args ...string) (*net/url.URL, error)
127
- this .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Application" , "RouteURL" ) and
131
+ this .hasQualifiedName ( packagePath ( ) , "Application" , "RouteURL" ) and
128
132
inp .isParameter ( _) and
129
133
out .isResult ( 0 )
130
134
or
131
135
// Receiver: Decoder
132
136
// Method: func (Decoder).Decode(req *net/http.Request, v interface{}) error
133
- this .implements ( package ( "clevergo.tech/clevergo" , "" ) , "Decoder" , "Decode" ) and
137
+ this .implements ( packagePath ( ) , "Decoder" , "Decode" ) and
134
138
inp .isParameter ( 0 ) and
135
139
out .isParameter ( 1 )
136
140
or
137
141
// Receiver: Renderer
138
142
// Method: func (Renderer).Render(w io.Writer, name string, data interface{}, c *Context) error
139
- this .implements ( package ( "clevergo.tech/clevergo" , "" ) , "Renderer" , "Render" ) and
143
+ this .implements ( packagePath ( ) , "Renderer" , "Render" ) and
140
144
inp .isParameter ( 2 ) and
141
145
out .isParameter ( 0 )
142
146
)
0 commit comments