This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56f295f
commit 97fb967
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
ql/test/library-tests/semmle/go/Function/getParameter.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
| main.go:7:6:7:7 | f1 | 0 | main.go:7:9:7:9 | x | | ||
| main.go:9:12:9:13 | f2 | 0 | main.go:9:15:9:15 | x | | ||
| main.go:9:12:9:13 | f2 | 1 | main.go:9:18:9:18 | y | | ||
| main.go:9:12:9:13 | f2 | -1 | main.go:9:7:9:7 | t | | ||
| main.go:11:12:11:13 | f3 | 0 | main.go:11:15:11:15 | x | | ||
| main.go:11:12:11:13 | f3 | 1 | main.go:11:22:11:22 | y | | ||
| main.go:11:12:11:13 | f3 | -1 | main.go:11:7:11:7 | _ | | ||
| main.go:13:6:13:7 | f4 | 0 | main.go:13:9:13:9 | x | | ||
| main.go:13:6:13:7 | f4 | 1 | main.go:13:16:13:16 | y | | ||
| main.go:15:6:15:7 | f5 | 0 | main.go:15:9:15:9 | x | | ||
| main.go:17:6:17:7 | f6 | 0 | main.go:17:9:17:9 | x | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import go | ||
|
||
from Function f, int i | ||
select f, i, f.getParameter(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
| main.go:17:6:17:7 | f6 | 0 | main.go:17:17:17:17 | y | | ||
| main.go:19:6:19:7 | f7 | 0 | main.go:19:12:19:12 | x | | ||
| main.go:19:6:19:7 | f7 | 1 | main.go:19:15:19:15 | y | | ||
| main.go:21:6:21:7 | f8 | 0 | main.go:21:12:21:12 | x | | ||
| main.go:21:6:21:7 | f8 | 1 | main.go:21:19:21:19 | _ | | ||
| main.go:23:6:23:7 | f9 | 0 | main.go:23:12:23:12 | _ | | ||
| main.go:23:6:23:7 | f9 | 1 | main.go:23:19:23:19 | y | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import go | ||
|
||
from Function f, int i | ||
select f, i, f.getResult(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
type t int | ||
|
||
func main() {} | ||
|
||
func f1(x int) {} | ||
|
||
func (t t) f2(x, y int) {} | ||
|
||
func (_ t) f3(x int, y string) {} | ||
|
||
func f4(x int, y ...string) {} | ||
|
||
func f5(x int) int { return 0 } | ||
|
||
func f6(x int) (y int) { return 0 } | ||
|
||
func f7() (x, y int) { return 0, 0 } | ||
|
||
func f8() (x int, _ string) { return 0, "" } | ||
|
||
func f9() (_ int, y string) { return 0, "" } |