File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
go/ql/test/library-tests/semmle/go/frameworks/GoMicro Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ pb "codeql-go-tests/frameworks/GoMicro/proto"
5
+ "context"
6
+ "fmt"
7
+ "log"
8
+
9
+ "go-micro.dev/v4"
10
+ )
11
+
12
+ func main () {
13
+ // service
14
+ service := micro .NewService ()
15
+ service .Init ()
16
+ // context
17
+ ctx := context .Background ()
18
+
19
+ greeterService := pb .NewGreeterService ("http://localhost:8000" , service .Client ())
20
+ // request
21
+ req := pb.Request {Name : "Mona" }
22
+ resp , err := greeterService .Hello (ctx , & req )
23
+
24
+ if err != nil {
25
+ log .Fatal (err )
26
+ }
27
+
28
+ fmt .Println ("Hello :: %s" , resp .Greeting )
29
+ }
Original file line number Diff line number Diff line change
1
+ serverRequests
1
2
| main.go:14:46:14:48 | definition of req |
3
+ clientRequests
4
+ | client/main.go:19:41:19:63 | "http://localhost:8000" |
Original file line number Diff line number Diff line change 1
1
import go
2
2
3
- query predicate requests ( DataFlow:: ParameterNode node ) { node instanceof GoMicro:: Request }
3
+ query predicate serverRequests ( DataFlow:: ParameterNode node ) { node instanceof GoMicro:: Request }
4
+
5
+ query predicate clientRequests ( DataFlow:: Node node ) {
6
+ node instanceof GoMicro:: ClientRequestUrlAsSink
7
+ }
You can’t perform that action at this time.
0 commit comments