tbl, err := table.FromMeta(ctx, s.dom.InfoSchema(), db.Name, table.Name) if err != nil { return nil, errors.Trace(err) } columns := tbl.Cols()
tbl, err := table.FromMeta(ctx, s.dom.InfoSchema(), db.Name, table.Name) if err != nil { return nil, errors.Trace(err) } for _, index := range tbl.Indices() { idxColumns := index.Columns() }This code retrieves the table meta using the FromMeta method, then iterates over the indices for the table and obtains the columns for each index. Overall, the github.com/pingcap/tidb/table package provides a convenient way to obtain metadata for tables in Go.