aboutsummaryrefslogtreecommitdiffstats
path: root/testdata
AgeCommit message (Collapse)Author
2023-05-20Fix panic when go statement calls non-function-literalTeddy Wing
2023-05-19Add test for local closure assigned to variableTeddy Wing
Try to catch local closures not run directly from the `go` statement, but assigned to a variable first.
2023-05-18testdata: Add missing license headersTeddy Wing
2023-05-18varDeclaration: Return all identifiers in declarationTeddy Wing
Declarations can include multiple identifiers. Return all of these from the function and rename it accordingly.
2023-05-18Add test for shadowing declarationTeddy Wing
This doesn't pass yet.
2023-05-17Add test for shadowingTeddy Wing
2023-05-17function_argument: Add a test for local function variablesTeddy Wing
2023-05-17Add test for function argumentsTeddy Wing
Don't report captured function values: $ go test --- FAIL: Test (1.26s) analysistest.go:459: ./testdata/function_argument.go:5:3: unexpected diagnostic: captured reference callback in goroutine closure
2023-05-17struct_reference.go: Test multiple diagnostics on one lineTeddy Wing
2023-05-16Add license (GNU GPLv3+)Teddy Wing
2023-05-16Report reference-type closure argumentsTeddy Wing
2023-05-16Use scope test to report captured variablesTeddy Wing
Report all variables declared in an outer scope. This does match variables defined in the closure too. Will need to fix that.
2023-05-16Add automated testTeddy Wing
Follow `golang.org/x/tools/go/analysis/passes/testinggoroutine` to write the test runner: https://github.com/golang/tools/blob/1c9fe3f82c363b929ef7239ca0ad8a5dafbbcf05/go/analysis/passes/testinggoroutine/testinggoroutine_test.go Add "want" comments to test code for validation.
2023-05-15Try getting `GenDecl`s in closureTeddy Wing
Turns out this only gets declarations like: var decl string but not: decl := "a" Is there a way to get the above one too?
2023-05-15Add test for reference argumentsTeddy Wing
These should be reported as well, because they're shared references even though they're passed as arguments. This currently reports the variable name as "aStruct", will need to look into how to correct that.
2023-05-15Add a new test for struct methodsTeddy Wing
2023-05-15Find out how to get closure argumentsTeddy Wing
2023-05-15testdata/simple.go: Add package and function callTeddy Wing
Need to refine our identifier filtering.
2023-05-15testdata/simple.go: Add a local variable in closureTeddy Wing
We want to ignore local variables.
2023-05-15testdata/simple.go: Find out what happens when var is reusedTeddy Wing
Second usage of captured reference is reported as expected. That seems correct for our needs.
2023-05-15Find variables in `go func` closuresTeddy Wing
Inspect function literals run by `go` statements, and find all variables in those function literals.
2023-05-14Find `go` statements using Go analyzerTeddy Wing
Build a basic Go analyser that finds `go` statements. Currently testing this with: $ go run ./cmd/gocapturedrefrace ./testdata/ Using the following tutorials as a guide: * https://arslan.io/2019/06/13/using-go-analysis-to-write-a-custom-linter/ * https://scribe.rip/codex/writing-custom-linter-in-go-54ef6f8080