Skip to content

Commit 09015df

Browse files
committed
Format
1 parent 992b3c7 commit 09015df

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

go/ql/test/library-tests/semmle/go/aliases/DataflowFields/embedding.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ type EmbedsPkg2IntStruct = struct{ pkg2.IntStruct }
1313

1414
func FEmbedded() {
1515

16-
x := source()
17-
pkg1Struct := EmbedsPkg1IntStruct{pkg1.IntStruct{x}}
16+
x := source()
17+
pkg1Struct := EmbedsPkg1IntStruct{pkg1.IntStruct{x}}
1818

19-
GEmbedded(&pkg1Struct)
19+
GEmbedded(&pkg1Struct)
2020

2121
}
2222

2323
func GEmbedded(pkg2Struct *EmbedsPkg2IntStruct) {
2424

25-
sink(pkg2Struct.Field) // $ hasValueFlow="selection of Field"
25+
sink(pkg2Struct.Field) // $ hasValueFlow="selection of Field"
2626

2727
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
package test
22

3-
func source() int { return 0 }
4-
func sink(value int) { }
3+
func source() int { return 0 }
4+
func sink(value int) {}
55

66
type IntAlias = int
77
type IntStruct = struct{ field int }
88
type IntAliasStruct = struct{ field IntAlias }
99

1010
func F() {
1111

12-
x := source()
13-
intStruct := IntStruct{x}
12+
x := source()
13+
intStruct := IntStruct{x}
1414

15-
G(&intStruct)
15+
G(&intStruct)
1616

1717
}
1818

1919
func G(intAliasStruct *IntAliasStruct) {
2020

21-
sink(intAliasStruct.field) // $ hasValueFlow="selection of field"
21+
sink(intAliasStruct.field) // $ hasValueFlow="selection of field"
2222

2323
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
callTargets
2-
| test.go:15:70:15:83 | call to sink | test.go:10:1:10:46 | function declaration | sink |
3-
| test.go:20:65:20:78 | call to sink | test.go:10:1:10:46 | function declaration | sink |
4-
| test.go:27:54:27:67 | call to sink | test.go:10:1:10:46 | function declaration | sink |
5-
| test.go:34:60:34:73 | call to sink | test.go:10:1:10:46 | function declaration | sink |
6-
| test.go:41:72:41:85 | call to sink | test.go:10:1:10:46 | function declaration | sink |
7-
| test.go:48:70:48:83 | call to sink | test.go:10:1:10:46 | function declaration | sink |
8-
| test.go:51:14:51:21 | call to source | test.go:9:1:9:55 | function declaration | source |
2+
| test.go:15:70:15:83 | call to sink | test.go:10:1:10:45 | function declaration | sink |
3+
| test.go:20:65:20:78 | call to sink | test.go:10:1:10:45 | function declaration | sink |
4+
| test.go:27:54:27:67 | call to sink | test.go:10:1:10:45 | function declaration | sink |
5+
| test.go:34:60:34:73 | call to sink | test.go:10:1:10:45 | function declaration | sink |
6+
| test.go:41:72:41:85 | call to sink | test.go:10:1:10:45 | function declaration | sink |
7+
| test.go:48:70:48:83 | call to sink | test.go:10:1:10:45 | function declaration | sink |
8+
| test.go:51:14:51:21 | call to source | test.go:9:1:9:57 | function declaration | source |
99
| test.go:52:2:52:29 | call to ImplementMe | test.go:15:1:15:85 | function declaration | ImplementMe |
1010
| test.go:52:2:52:29 | call to ImplementMe | test.go:20:1:20:80 | function declaration | ImplementMe |
1111
| test.go:52:2:52:29 | call to ImplementMe | test.go:27:1:27:69 | function declaration | ImplementMe |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ type Target = interface {
66
ImplementMe(callable func(struct{ x IntAlias }))
77
}
88

9-
func source() func(struct{ x IntAlias }) { return nil }
10-
func sink(fptr func(struct{ x IntAlias })) { }
9+
func source() func(struct{ x IntAlias }) { return nil }
10+
func sink(fptr func(struct{ x IntAlias })) {}
1111

1212
// Simple direct implementation
1313
type Impl1 struct{}

0 commit comments

Comments
 (0)