RemoveByName removes a single field by its name. This method does nothing if field with the specified name doesn't exist.
(fieldName string)
| 97 | // |
| 98 | // This method does nothing if field with the specified name doesn't exist. |
| 99 | func (l *FieldsList) RemoveByName(fieldName string) { |
| 100 | fields := *l |
| 101 | for i, field := range fields { |
| 102 | if field.GetName() == fieldName { |
| 103 | *l = append(fields[:i], fields[i+1:]...) |
| 104 | return |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | // Add adds one or more fields to the current list. |
| 110 | // |