MCPcopy
hub / github.com/inancgumus/learngo / Fields

Method Fields

logparser/v5/pipe/recordshare.go:36–47  ·  view source on GitHub ↗

Fields returns all the field names. The names can be used to query the Record.

()

Source from the content-addressed store, hash-verified

34// Fields returns all the field names.
35// The names can be used to query the Record.
36func (r Record) Fields() (fields []string) {
37 t := reflect.TypeOf(record{})
38
39 for i := 0; i < t.NumField(); i++ {
40 f := t.Field(i)
41 s := fmt.Sprintf("(%s: %s)", f.Name, f.Type.Name())
42
43 fields = append(fields, s)
44 }
45
46 return
47}
48
49// mustGet the field with the same kind or panics.
50func (r Record) mustGet(field string, kind reflect.Kind) reflect.Value {

Callers 15

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
parseFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected