fix: Fix issue #1810 (#1811)

* Fix #1810

* Remove go embed

* Format code

* Remove useless code

Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
anqiansong
2022-04-21 15:22:43 +08:00
committed by GitHub
parent 2cdff97934
commit 305587aa81
8 changed files with 49 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
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
}