Register adds a scheme setup function to the list.
(funcs ...func(*Scheme) error)
| 85 | |
| 86 | // Register adds a scheme setup function to the list. |
| 87 | func (s *Scheme) Register(funcs ...func(*Scheme) error) { |
| 88 | for _, f := range funcs { |
| 89 | err := f(s) |
| 90 | if err != nil { |
| 91 | s.registrationErrors = append(s.registrationErrors, toRegistrationError(err)) |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | func toRegistrationError(err error) *field.Error { |
| 97 | return field.InternalError(nil, fmt.Errorf("registration error: %w", err)) |
no test coverage detected