diff --git a/pkg/cluster/cluster_file.go b/pkg/cluster/cluster_file.go index 306b3f2..e1deb11 100644 --- a/pkg/cluster/cluster_file.go +++ b/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 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 diff --git a/pkg/cluster/machine_file.go b/pkg/cluster/machine_file.go index a6e90eb..40dde3a 100644 --- a/pkg/cluster/machine_file.go +++ b/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 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