File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,16 @@ func (r *ServiceRegistry) Register(services ...*Service) error {
222222 return nil
223223}
224224
225+ // Register one or more service.
226+ // Panics if duplicate operations were registered with the same name or when trying to register a service with no name.
227+ //
228+ // Can be called multiple times and is not thread safe.
229+ func (r * ServiceRegistry ) MustRegister (services ... * Service ) {
230+ if err := r .Register (services ... ); err != nil {
231+ panic (err )
232+ }
233+ }
234+
225235// Use registers one or more middleware to be applied to all operation method invocations across all registered
226236// services. Middleware is applied in registration order. If called multiple times, newly registered middleware will be
227237// applied after any previously registered ones.
You can’t perform that action at this time.
0 commit comments