MCPcopy Create free account
hub / github.com/cloudtty/cloudtty / Validate

Method Validate

cmd/app/options/validate.go:23–36  ·  view source on GitHub ↗

Validate checks Options and return a slice of found errs.

()

Source from the content-addressed store, hash-verified

21
22// Validate checks Options and return a slice of found errs.
23func (o *Options) Validate() field.ErrorList {
24 errs := field.ErrorList{}
25 newPath := field.NewPath("Options")
26
27 if o.CoreWorkerLimit < 0 {
28 errs = append(errs, field.Invalid(newPath.Child("CoreWorkerLimit"), o.MaxWorkerLimit, "core-worker-limit must be greater than or equals 0"))
29 }
30
31 if o.MaxWorkerLimit < 0 {
32 errs = append(errs, field.Invalid(newPath.Child("MaxWorkerLimit"), o.MaxWorkerLimit, "max-worker-limit must be greater than or equals 0"))
33 }
34
35 return errs
36}

Callers 2

ConfigMethod · 0.95
execCommandFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected