Browse Source

cluster: make unreachable panic explicit

making revive 1.3.4 happy

Signed-off-by: Alejandro Mery <amery@jpi.io>
pull/26/head
Alejandro Mery 1 year ago
parent
commit
986db350b4
  1. 6
      pkg/cluster/cluster_file.go
  2. 6
      pkg/cluster/machine_file.go

6
pkg/cluster/cluster_file.go

@ -33,7 +33,11 @@ func (m *Cluster) openWriter(name string, flags int, args ...any) (io.WriteClose
return nil, err return nil, err
} }
return f.(io.WriteCloser), nil if f, ok := f.(io.WriteCloser); ok {
return f, nil
}
panic("unreachable")
} }
// ReadFile reads a file from the cluster's config directory // ReadFile reads a file from the cluster's config directory

6
pkg/cluster/machine_file.go

@ -34,7 +34,11 @@ func (m *Machine) openWriter(name string, flags int, args ...any) (io.WriteClose
return nil, err return nil, err
} }
return f.(io.WriteCloser), nil if f, ok := f.(io.WriteCloser); ok {
return f, nil
}
panic("unreachable")
} }
// RemoveFile deletes a file from the machine's config directory // RemoveFile deletes a file from the machine's config directory

Loading…
Cancel
Save