Refactors godoc command to improve test coverage