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

Method JSON

pkg/tabular/tabular.go:87–92  ·  view source on GitHub ↗

JSON marshals the table rows as a JSON array. A header-only table marshals to "[]".

()

Source from the content-addressed store, hash-verified

85// JSON marshals the table rows as a JSON array. A header-only table marshals
86// to "[]".
87func (t *Table) JSON() ([]byte, error) {
88 if t.Rows == nil {
89 return []byte("[]"), nil
90 }
91 return json.Marshal(t.Rows)
92}
93
94// HasColumns reports whether every named column is present in the header.
95func (t *Table) HasColumns(cols ...string) bool {

Callers 7

TestTableJSONFunction · 0.45
FieldsMethod · 0.45
FieldsMethod · 0.45
FieldsMethod · 0.45
FieldsMethod · 0.45
FieldsMethod · 0.45

Calls

no outgoing calls

Tested by 2

TestTableJSONFunction · 0.36