MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / AddField

Method AddField

internal/utils/kvstore/table_field.go:9–23  ·  view source on GitHub ↗
(fieldName string)

Source from the content-addressed store, hash-verified

7)
8
9func (this *Table[T]) AddField(fieldName string) error {
10 if !IsValidName(fieldName) {
11 return errors.New("invalid field name '" + fieldName + "'")
12 }
13
14 // check existence
15 for _, field := range this.fieldNames {
16 if field == fieldName {
17 return nil
18 }
19 }
20
21 this.fieldNames = append(this.fieldNames, fieldName)
22 return nil
23}
24
25func (this *Table[T]) AddFields(fieldName ...string) error {
26 for _, subFieldName := range fieldName {

Callers 1

AddFieldsMethod · 0.95

Calls 1

IsValidNameFunction · 0.85

Tested by

no test coverage detected