libflexkube
libflexkube copied to clipboard
Remove type casting from code
Those are typically code smells:
$ git grep '\.('
pkg/container/container_integration_test.go: originalCIID := ci.(*containerInstance).status.ID
pkg/container/container_integration_test.go: ci.(*containerInstance).status.ID = ""
pkg/container/container_integration_test.go: ci.(*containerInstance).status.ID = originalCIID
pkg/container/containers.go: previousState: previousState.(containersState),
pkg/container/containers.go: desiredState: desiredState.(containersState),
pkg/container/containersstate.go: hcc, ok := m.(*hostConfiguredContainer)
pkg/container/containersstate.go: Docker: m.container.RuntimeConfig().(*docker.Config),
pkg/container/hostconfiguredcontainer_integration_test.go: s := hcc.(*hostConfiguredContainer).container.Status().Status
pkg/container/runtime/docker/docker_integration_test.go: return r, (r.(*docker))
pkg/container/runtime/docker/docker_test.go: if d.(*docker).cli == nil {
pkg/host/transport/ssh/ssh_test.go: if len(s.(*ssh).auth) != authMethods {
pkg/host/transport/ssh/ssh_test.go: if len(s.(*ssh).auth) != authMethods {
pkg/host/transport/ssh/ssh_test.go: c, ok := newConnected("localhost:80", nil).(*sshConnected)
pkg/host/transport/ssh/ssh_test.go: ss, ok := s.(*ssh)
pkg/host/transport/ssh/ssh_test.go: ss, ok := s.(*ssh)
pkg/pki/pki.go: if err := c.persistPublicKey(k.Public().(*rsa.PublicKey)); err != nil {