ciao-project / ciao

Ciao - Cloud Integrated Advanced Orchestrator
Apache License 2.0
215 stars 51 forks source link

Unused code cleanup #1160

Closed rbradford closed 7 years ago

rbradford commented 7 years ago

The "unused" tool found some code that's unreachable in the tree...should investigate to find bugs or remove dead code.

rob@hercules:~/src/go/src/github.com/01org/ciao$ unused ./... | grep -v vendor | sort ciao-cli/event.go:108:2: field all is unused (U1000) ciao-cli/event.go:109:2: field tenant is unused (U1000) ciao-cli/external-ips.go:631:2: field ips is unused (U1000) ciao-cli/identity.go:204:3: field Next is unused (U1000) ciao-cli/identity.go:205:3: field Previous is unused (U1000) ciao-cli/identity.go:206:3: field Self is unused (U1000) ciao-cli/identity.go:210:3: field Description is unused (U1000) ciao-cli/identity.go:211:3: field DomainID is unused (U1000) ciao-cli/identity.go:212:3: field Enabled is unused (U1000) ciao-cli/identity.go:214:3: field Links is unused (U1000) ciao-cli/identity.go:218:3: field ParentID is unused (U1000) ciao-cli/identity.go:58:3: field Description is unused (U1000) ciao-cli/identity.go:59:3: field DomainID is unused (U1000) ciao-cli/identity.go:60:3: field Enabled is unused (U1000) ciao-cli/identity.go:62:3: field ParentID is unused (U1000) ciao-cli/identity.go:63:3: field Links is unused (U1000) ciao-cli/identity.go:70:3: field Self is unused (U1000) ciao-cli/identity.go:71:3: field Previous is unused (U1000) ciao-cli/identity.go:72:3: field Next is unused (U1000) ciao-cli/image.go:232:6: type imageDownloadCommand is unused (U1000) ciao-cli/image.go:348:6: type imageModifyCommand is unused (U1000) ciao-cli/main.go:108:2: const computeActionStart is unused (U1000) ciao-cli/main.go:109:2: const computeActionStop is unused (U1000) ciao-cli/main.go:112:6: func debugf is unused (U1000) ciao-cli/node.go:40:2: field nodeID is unused (U1000) ciao-controller/api/api_test.go:38:6: func myHostname is unused (U1000) ciao-controller/api.go:137:25: func (nodePager).filter is unused (U1000) ciao-controller/api.go:199:31: func (nodeServerPager).filter is unused (U1000) ciao-controller/api.go:72:2: const workloadFilter is unused (U1000) ciao-controller/api.go:73:2: const statusFilter is unused (U1000) ciao-controller/api.go:76:6: type pager is unused (U1000) ciao-controller/api.go:77:2: func pager.filter is unused (U1000) ciao-controller/api.go:78:2: func pager.nextPage is unused (U1000) ciao-controller/client_wrapper.go:29:2: field ctl is unused (U1000) ciao-controller/controller_test.go:1081:6: func startTestWorkload is unused (U1000) ciao-controller/controller_test.go:108:6: func addTestTenantNoCNCI is unused (U1000) ciao-controller/controller_test.go:1100:6: func testStartWorkloadLaunchCNCI is unused (U1000) ciao-controller/controller_test.go:1867:5: var testClients is unused (U1000) ciao-controller/internal/datastore/datastore.go:57:2: const userWarn is unused (U1000) ciao-controller/internal/datastore/memorydb.go:132:21: func (MemoryDB).getCNCIWorkloadID is unused (U1000) ciao-controller/internal/datastore/memorydb.go:36:2: field cnciWorkload is unused (U1000) ciao-controller/internal/datastore/memorydb.go:38:2: field tableInitPath is unused (U1000) ciao-controller/internal/quotas/quotas.go:33:2: field perImageSize is unused (U1000) ciao-controller/internal/quotas/quotas.go:74:2: field doneCh is unused (U1000) ciao-controller/main.go:78:5: var imageAPIPort is unused (U1000) ciao-controller/main.go:82:5: var tablesInitPath is unused (U1000) ciao-controller/openstack_compute.go:538:5: field Links is unused (U1000) ciao-image/datastore/datastore_test.go:27:5: var metaDsTables is unused (U1000) ciao-launcher/docker_network.go:30:6: type dockerNetworkState is unused (U1000) ciao-launcher/docker_test.go:102:28: func dockerTestStorage.cleanup is unused (U1000) ciao-launcher/instance_test.go:204:29: func (instanceTestState).cleanUpInstance is unused (U1000) ciao-launcher/instance_test.go:208:29: func (*instanceTestState).verifyStatsUpdate is unused (U1000) ciao-launcher/simulation.go:28:2: field uuid is unused (U1000) ciao-launcher/ssntp_test.go:30:2: field t is unused (U1000) ciao-scheduler/export_test.go:19:6: type SsntpSchedulerServer is unused (U1000) ciao-scheduler/export_test.go:20:6: type NodeStat is unused (U1000) ciao-scheduler/export_test.go:21:6: type WorkResources is unused (U1000) ciao-scheduler/export_test.go:33:5: var StartWorkload is unused (U1000) ciao-scheduler/scheduler_internal_test.go:118:6: func spinUpNetworkNodeSmall is unused (U1000) ciao-scheduler/scheduler_internal_test.go:85:6: func spinUpComputeNodeSmall is unused (U1000) networking/ciao-cnci-agent/client.go:97:2: field netCh is unused (U1000) networking/ciao-cnci-agent/network.go:98:8: const maxKey is unused (U1000) networking/libsnnet/tests/parallel/parallel.go:19:6: func main is unused (U1000) networking/libsnnet/tests/parallel/parallel_test.go:371:6: func dockerNetList is unused (U1000) networking/libsnnet/tests/parallel/parallel_test.go:379:6: func dockerNetInfo is unused (U1000) openstack/compute/api.go:306:2: const changesSinceFilter is unused (U1000) openstack/compute/api.go:307:2: const imageFilter is unused (U1000) openstack/compute/api.go:309:2: const nameFilter is unused (U1000) openstack/compute/api.go:310:2: const statusFilter is unused (U1000) openstack/compute/api.go:311:2: const hostFilter is unused (U1000) openstack/compute/api.go:312:2: const limit is unused (U1000) openstack/compute/api.go:313:2: const marker is unused (U1000) openstack/compute/api.go:316:6: type pager is unused (U1000) openstack/compute/api.go:317:2: func pager.filter is unused (U1000) openstack/compute/api.go:318:2: func pager.nextPage is unused (U1000) openstack/compute/api.go:432:2: const computeActionDelete is unused (U1000) openstack/compute/api_test.go:34:6: func myHostname is unused (U1000) osprepare/distro.go:126:6: func newAptSource is unused (U1000) osprepare/distro.go:151:6: func isUbuntuDockerRepoEnabled is unused (U1000) osprepare/distro.go:33:2: const aptSourcesList is unused (U1000) osprepare/distro.go:34:2: const aptSourcesListD is unused (U1000) osprepare/distro.go:41:6: type aptSourcesFile is unused (U1000) osprepare/distro.go:50:6: type aptSource is unused (U1000) osprepare/distro.go:59:6: func readAptSourcesFile is unused (U1000) osprepare/distro.go:97:6: func loadAptSources is unused (U1000) qemu/qmp.go:111:2: field data is unused (U1000) qemu/qmp_test.go:44:2: const qmpSuccess is unused (U1000) qemu/qmp_test.go:45:2: const qmpFailure is unused (U1000) qemu/qmp_test.go:493:3: const seconds is unused (U1000) qemu/qmp_test.go:494:3: const microsecondsEv1 is unused (U1000) qemu/qmp_test.go:495:3: const device is unused (U1000) qemu/qmp_test.go:496:3: const path is unused (U1000) ssntp/server.go:75:2: field roleVerify is unused (U1000) ssntp/ssntp.go:561:7: const writeTimeout is unused (U1000) ssntp/ssntp.go:944:2: const ssntpIdle is unused (U1000) ssntp/ssntp_test.go:192:2: field staTracedChannel is unused (U1000) ssntp/ssntp_test.go:193:2: field evtTracedChannel is unused (U1000) ssntp/ssntp_test.go:194:2: field errTracedChannel is unused (U1000) testutil/agent.go:37:2: field ticker is unused (U1000)

rbradford commented 7 years ago

"unused" is now run as a part of our linting by #1445