mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 18:00:24 +08:00
17 lines
319 B
Go
17 lines
319 B
Go
|
package spec
|
||
|
|
||
|
import "errors"
|
||
|
|
||
|
var ErrMissingService = errors.New("missing service")
|
||
|
|
||
|
// Validate validates Validate the integrity of the spec.
|
||
|
func (s *ApiSpec) Validate() error {
|
||
|
if len(s.Service.Name) == 0 {
|
||
|
return ErrMissingService
|
||
|
}
|
||
|
if len(s.Service.Groups) == 0 {
|
||
|
return ErrMissingService
|
||
|
}
|
||
|
return nil
|
||
|
}
|