Diego
Diego

Reputation: 9

/tools/cmd/deadcode false positive functions call in test files

I'm using the command deadcode https://pkg.go.dev/golang.org/x/[email protected]/cmd/deadcode for finding deadcode in my code base but I have some issues with the test files.

I'm using this command deadcode -test ./services/core/...

and as output I have the list of all unused functions. The problem is that some of the unused functions are actually used and called by some test in _test.go files, so are not unused.

I have also tried to use the -filter flag deadcode -test -filter=./services/... ./services/core/...

but it does not produce any output

Do someone know how to solve this issue? Ty so much

Upvotes: 0

Views: 40

Answers (0)

Related Questions