Gravedigger is a small piece of software that parses your Go source code and reports unused functions. As I could not find a simple and reliable tool, I decided to write my own.
I have pre-compiled binaries for Windows, macOS and Linux. Please rename them to gravedigger
after proceeding if you do not plan on compiling them yourself.
This works on all platforms.
Run go install github.com/dejangegic/gravedigger@latest
in the terminal.
Make sure that the go bin is in your PATH.
Download binaries from "releases" on this github page and run it locally as ./gravedigger
.
Run sudo cp gravedigger /usr/local/bin/gravedigger
to install it to the path.
Run sudo cp gravedigger /usr/local/bin/gravedigger
to install it to the path.
Note: This has not been tested as I do not own a mac. But it should work
Copy the .exe
to Program Files and add them it to your PATH. If you do not know how to do this, then maybe you shouldn't run unverified binaries on your machine 🤷.
You can use it in the same directory by running it with no arguments.
gravedigger
Or use it on a specific directory by providing the path as an argument.
gravedigger /path/to/project
-
Gravedigger Should NOT be used on parent directory that consists of multiple projects. Scan one project at a time or it may not work properly. This is fine for now, and I do not plan on changing it in the future.
-
Having the option to display the number of scanned functions and lines i sa simple feature that will be added soon in the future. But I'll keep it "clean" for now.
-
The ability to pass function names to ignore, as well as certain files, and even whole directories, would be a very nice feature. As Gravedigger is a tool developed only for my personal use, I'll add it if I see that it's useful to at least a couple of developers besides myself.