Find unused methods in Go structs.
go install github.com/SIVIRA/dead-method-checker@latestImportant: Run this command from the top directory of your target project (where go.mod is located).
dead-method-checker --pkg <package-path> --struct <struct-name>--pkg(required): Path of the package to check for unused methods--struct(required): Name of the struct to check for unused methods--ignore: Methods to ignore check (comma-separated)--fail: Exit with non-zero status if unused methods are found
Check for unused methods in a struct:
dead-method-checker --pkg github.com/example/mypackage --struct MyStructIgnore specific methods:
dead-method-checker --pkg github.com/example/mypackage --struct MyStruct --ignore String,GoStringExit with error code if unused methods are found:
dead-method-checker --pkg github.com/example/mypackage --struct MyStruct --fail