MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / HasColumns

Method HasColumns

pkg/tabular/tabular.go:95–106  ·  view source on GitHub ↗

HasColumns reports whether every named column is present in the header.

(cols ...string)

Source from the content-addressed store, hash-verified

93
94// HasColumns reports whether every named column is present in the header.
95func (t *Table) HasColumns(cols ...string) bool {
96 set := make(map[string]struct{}, len(t.Header))
97 for _, h := range t.Header {
98 set[strings.TrimSpace(h)] = struct{}{}
99 }
100 for _, c := range cols {
101 if _, ok := set[strings.TrimSpace(c)]; !ok {
102 return false
103 }
104 }
105 return true
106}
107
108// Column returns the values of the column whose header matches name
109// case-insensitively (trimming surrounding whitespace), with empty and

Callers 2

CraftMethod · 0.80
TestHasColumnsFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestHasColumnsFunction · 0.64