@@ -8,6 +8,12 @@ import go
88 * Provides classes for working with concepts from the [`clevergo.tech/[email protected] `](https://pkg.go.dev/clevergo.tech/[email protected] ) package. 99 */
1010private 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+
1117 /**
1218 * Provides models of untrusted flow sources.
1319 */
@@ -16,7 +22,7 @@ private module CleverGo {
1622 // Methods on types of package: clevergo.tech/[email protected] 1723 exists ( string receiverName , string methodName , Method mtd , FunctionOutput outp |
1824 this = outp .getExitNode ( mtd .getACall ( ) ) and
19- mtd .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , receiverName , methodName )
25+ mtd .hasQualifiedName ( packagePath ( ) , receiverName , methodName )
2026 |
2127 receiverName = "Context" and
2228 (
@@ -66,7 +72,7 @@ private module CleverGo {
6672 this = outp .getExitNode ( mtd .getACall ( ) )
6773 |
6874 // Interface: Decoder
69- mtd .implements ( package ( "clevergo.tech/clevergo" , "" ) , "Decoder" , methodName ) and
75+ mtd .implements ( packagePath ( ) , "Decoder" , methodName ) and
7076 (
7177 // Method: func (Decoder).Decode(req *net/http.Request, v interface{}) error
7278 methodName = "Decode" and
@@ -77,18 +83,16 @@ private module CleverGo {
7783 // Structs of package: clevergo.tech/[email protected] 7884 exists ( DataFlow:: Field fld |
7985 // Struct: Context
80- fld .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Context" , "Params" )
86+ fld .hasQualifiedName ( packagePath ( ) , "Context" , "Params" )
8187 or
8288 // Struct: Param
83- fld .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Param" , [ "Key" , "Value" ] )
89+ fld .hasQualifiedName ( packagePath ( ) , "Param" , [ "Key" , "Value" ] )
8490 |
8591 this = fld .getARead ( )
8692 )
8793 or
8894 // Types of package: clevergo.tech/[email protected] 89- exists ( ValueEntity v |
90- v .getType ( ) .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "Params" )
91- |
95+ exists ( ValueEntity v | v .getType ( ) .hasQualifiedName ( packagePath ( ) , "Params" ) |
9296 this = v .getARead ( )
9397 )
9498 }
@@ -103,7 +107,7 @@ private module CleverGo {
103107 // Taint-tracking models for package: clevergo.tech/[email protected] 104108 (
105109 // Function: func CleanPath(p string) string
106- this .hasQualifiedName ( package ( "clevergo.tech/clevergo" , "" ) , "CleanPath" ) and
110+ this .hasQualifiedName ( packagePath ( ) , "CleanPath" ) and
107111 inp .isParameter ( 0 ) and
108112 out .isResult ( )
109113 )
@@ -124,19 +128,19 @@ private module CleverGo {
124128 (
125129 // Receiver: Application
126130 // 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
128132 inp .isParameter ( _) and
129133 out .isResult ( 0 )
130134 or
131135 // Receiver: Decoder
132136 // 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
134138 inp .isParameter ( 0 ) and
135139 out .isParameter ( 1 )
136140 or
137141 // Receiver: Renderer
138142 // 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
140144 inp .isParameter ( 2 ) and
141145 out .isParameter ( 0 )
142146 )
0 commit comments