func getSelectedCluster(table ui.Table) (libcarina.Cluster, bool) { var out libcarina.Cluster found := false c := table.Selected() table.Lock() d := table.Data().(*[]libcarina.Cluster) newC := *d table.Unlock() if c > -1 { out = newC[c] found = true } return out, found }