libflexkube icon indicating copy to clipboard operation
libflexkube copied to clipboard

Remove type casting from code

Open invidian opened this issue 4 years ago • 0 comments

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 {

invidian avatar Mar 04 '21 10:03 invidian