MCPcopy Create free account
hub / github.com/cogentcore/core / SortColumnName

Method SortColumnName

tensor/table/indexview.go:136–144  ·  view source on GitHub ↗

SortColumnName sorts the indexes into our Table according to values in given column name, using either ascending or descending order. Only valid for 1-dimensional columns. Returns error if column name not found.

(column string, ascending bool)

Source from the content-addressed store, hash-verified

134// Only valid for 1-dimensional columns.
135// Returns error if column name not found.
136func (ix *IndexView) SortColumnName(column string, ascending bool) error { //types:add
137 ci, err := ix.Table.ColumnIndexTry(column)
138 if err != nil {
139 log.Println(err)
140 return err
141 }
142 ix.SortColumn(ci, ascending)
143 return nil
144}
145
146// SortColumn sorts the indexes into our Table according to values in
147// given column index, using either ascending or descending order.

Callers

nothing calls this directly

Calls 3

SortColumnMethod · 0.95
ColumnIndexTryMethod · 0.80
PrintlnMethod · 0.80

Tested by

no test coverage detected