Skip to content

Commit 6ed0a37

Browse files
committed
Autoformat
1 parent bf2fb2f commit 6ed0a37

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
callTargets
2-
| test.go:38:2:38:24 | call to ImplementMe | test.go:12:1:12:72 | function declaration | ImplementMe |
3-
| test.go:38:2:38:24 | call to ImplementMe | test.go:17:1:17:67 | function declaration | ImplementMe |
4-
| test.go:38:2:38:24 | call to ImplementMe | test.go:23:1:23:54 | function declaration | ImplementMe |
5-
| test.go:38:2:38:24 | call to ImplementMe | test.go:29:1:29:61 | function declaration | ImplementMe |
6-
| test.go:38:2:38:24 | call to ImplementMe | test.go:35:1:35:74 | function declaration | ImplementMe |
2+
| test.go:41:2:41:24 | call to ImplementMe | test.go:12:1:12:69 | function declaration | ImplementMe |
3+
| test.go:41:2:41:24 | call to ImplementMe | test.go:17:1:17:64 | function declaration | ImplementMe |
4+
| test.go:41:2:41:24 | call to ImplementMe | test.go:24:1:24:53 | function declaration | ImplementMe |
5+
| test.go:41:2:41:24 | call to ImplementMe | test.go:31:1:31:59 | function declaration | ImplementMe |
6+
| test.go:41:2:41:24 | call to ImplementMe | test.go:38:1:38:71 | function declaration | ImplementMe |
77
#select
88
| file://:0:0:0:0 | basic interface type | file://:0:0:0:0 | basic interface type |
99
| file://:0:0:0:0 | basic interface type | test.go:10:6:10:10 | Impl1 |
1010
| file://:0:0:0:0 | basic interface type | test.go:15:6:15:10 | Impl2 |
1111
| file://:0:0:0:0 | basic interface type | test.go:20:6:20:10 | Impl3 |
12-
| file://:0:0:0:0 | basic interface type | test.go:26:6:26:10 | Impl4 |
13-
| file://:0:0:0:0 | basic interface type | test.go:32:6:32:10 | Impl5 |
12+
| file://:0:0:0:0 | basic interface type | test.go:27:6:27:10 | Impl4 |
13+
| file://:0:0:0:0 | basic interface type | test.go:34:6:34:10 | Impl5 |

go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.go

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,39 @@ package intfs
33
type IntAlias = int
44

55
type Target = interface {
6-
ImplementMe(callable func (struct { x IntAlias }))
6+
ImplementMe(callable func(struct{ x IntAlias }))
77
}
88

99
// Simple direct implementation
10-
type Impl1 struct {}
10+
type Impl1 struct{}
1111

12-
func (recv Impl1) ImplementMe(callable func (struct { x IntAlias })) { }
12+
func (recv Impl1) ImplementMe(callable func(struct{ x IntAlias })) {}
1313

1414
// Implementation via unalising
15-
type Impl2 struct {}
15+
type Impl2 struct{}
1616

17-
func (recv Impl2) ImplementMe(callable func (struct { x int })) { }
17+
func (recv Impl2) ImplementMe(callable func(struct{ x int })) {}
1818

1919
// Implementation via top-level aliasing
20-
type Impl3 struct {}
20+
type Impl3 struct{}
2121

22-
type Impl3Alias = func (struct { x IntAlias })
23-
func (recv Impl3) ImplementMe(callable Impl3Alias) { }
22+
type Impl3Alias = func(struct{ x IntAlias })
23+
24+
func (recv Impl3) ImplementMe(callable Impl3Alias) {}
2425

2526
// Implementation via aliasing the struct
26-
type Impl4 struct {}
27+
type Impl4 struct{}
28+
29+
type Impl4Alias = struct{ x IntAlias }
2730

28-
type Impl4Alias = struct { x IntAlias }
29-
func (recv Impl4) ImplementMe(callable func (Impl4Alias)) { }
31+
func (recv Impl4) ImplementMe(callable func(Impl4Alias)) {}
3032

3133
// Implementation via aliasing the struct member
32-
type Impl5 struct {}
34+
type Impl5 struct{}
35+
36+
type Impl5Alias = IntAlias
3337

34-
type Impl5Alias = IntAlias
35-
func (recv Impl5) ImplementMe(callable func (struct { x Impl5Alias })) { }
38+
func (recv Impl5) ImplementMe(callable func(struct{ x Impl5Alias })) {}
3639

3740
func Caller(target Target) {
3841
target.ImplementMe(nil)

go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ query predicate callTargets(DataFlow::CallNode cn, FuncDef target, string target
55
}
66

77
from InterfaceType i, Type impl
8-
where i.hasMethod("ImplementMe", _)
9-
and impl.implements(i)
8+
where
9+
i.hasMethod("ImplementMe", _) and
10+
impl.implements(i)
1011
select i, impl

0 commit comments

Comments
 (0)