-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go: Update test for aliases to print immediate RHS and underlying type
- Loading branch information
Showing
5 changed files
with
33 additions
and
38 deletions.
There are no files selected for viewing
51 changes: 14 additions & 37 deletions
51
go/ql/test/library-tests/semmle/go/Types/Aliases.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 |
---|---|---|
@@ -1,37 +1,14 @@ | ||
| DirEntry | file://:0:0:0:0 | DirEntry | | ||
| FileInfo | file://:0:0:0:0 | FileInfo | | ||
| FileMode | file://:0:0:0:0 | FileMode | | ||
| GenericSignatureAlias | generic.go:84:6:84:21 | GenericSignature | | ||
| Kind | file://:0:0:0:0 | Kind | | ||
| Kind | file://:0:0:0:0 | basic interface type | | ||
| PathError | file://:0:0:0:0 | PathError | | ||
| TypeAlias | generic.go:36:6:36:17 | GenericArray | | ||
| _type | file://:0:0:0:0 | Type | | ||
| aNameOff | file://:0:0:0:0 | NameOff | | ||
| aTextOff | file://:0:0:0:0 | TextOff | | ||
| aTypeOff | file://:0:0:0:0 | TypeOff | | ||
| any | file://:0:0:0:0 | Kind | | ||
| any | file://:0:0:0:0 | basic interface type | | ||
| arrayType | file://:0:0:0:0 | ArrayType | | ||
| arraytype | file://:0:0:0:0 | ArrayType | | ||
| chanType | file://:0:0:0:0 | ChanType | | ||
| chantype | file://:0:0:0:0 | ChanType | | ||
| funcType | file://:0:0:0:0 | FuncType | | ||
| functype | file://:0:0:0:0 | FuncType | | ||
| interfaceType | file://:0:0:0:0 | InterfaceType | | ||
| interfacetype | file://:0:0:0:0 | InterfaceType | | ||
| maptype | file://:0:0:0:0 | MapType | | ||
| name | file://:0:0:0:0 | Name | | ||
| nameOff | file://:0:0:0:0 | NameOff | | ||
| ptrType | file://:0:0:0:0 | PtrType | | ||
| ptrtype | file://:0:0:0:0 | PtrType | | ||
| sliceType | file://:0:0:0:0 | SliceType | | ||
| slicetype | file://:0:0:0:0 | SliceType | | ||
| structField | file://:0:0:0:0 | StructField | | ||
| structType | file://:0:0:0:0 | StructType | | ||
| structtype | file://:0:0:0:0 | StructType | | ||
| syscallErrorType | file://:0:0:0:0 | Errno | | ||
| textOff | file://:0:0:0:0 | TextOff | | ||
| typeOff | file://:0:0:0:0 | TypeOff | | ||
| uncommonType | file://:0:0:0:0 | UncommonType | | ||
| uncommontype | file://:0:0:0:0 | UncommonType | | ||
| github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.FirstAlias | string | string | | ||
| github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.SecondAlias | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.FirstAlias | string | | ||
| internal/reflectlite.Kind | internal/abi.Kind | uint | | ||
| internal/reflectlite.nameOff | internal/abi.NameOff | int32 | | ||
| internal/reflectlite.textOff | internal/abi.TextOff | int32 | | ||
| internal/reflectlite.typeOff | internal/abi.TypeOff | int32 | | ||
| os.FileMode | io/fs.FileMode | uint32 | | ||
| os.syscallErrorType | syscall.Errno | uintptr | | ||
| reflect.aNameOff | internal/abi.NameOff | int32 | | ||
| reflect.aTextOff | internal/abi.TextOff | int32 | | ||
| reflect.aTypeOff | internal/abi.TypeOff | int32 | | ||
| runtime.nameOff | internal/abi.NameOff | int32 | | ||
| runtime.textOff | internal/abi.TextOff | int32 | | ||
| runtime.typeOff | internal/abi.TypeOff | int32 | |
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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import go | ||
Check failure on line 1 in go/ql/test/library-tests/semmle/go/Types/Aliases.ql GitHub Actions / Test Linux (Ubuntu)
|
||
|
||
string getQualifiedNameIfExists(Type t) { | ||
if exists(t.getQualifiedName()) then result = t.getQualifiedName() else result = t.getName() | ||
} | ||
|
||
from AliasType at | ||
select at.getName(), at.getRhs() | ||
where at.hasLocationInfo(_, _, _, _, _) | ||
select getQualifiedNameIfExists(at), getQualifiedNameIfExists(at.getRhs()), | ||
getQualifiedNameIfExists(at.getUnderlyingType()) |
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
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
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 @@ | ||
package main | ||
|
||
type FirstAlias = string | ||
type SecondAlias = FirstAlias |