MCPcopy
hub / github.com/etcd-io/etcd / Validate

Method Validate

tools/proto-annotations/cmd/etcd_version.go:104–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102}
103
104func (a etcdVersionAnnotation) Validate() (errs []error) {
105 if a.version == nil {
106 return nil
107 }
108 if a.version.Major == 0 {
109 errs = append(errs, fmt.Errorf("%s: etcd_version major version should not be zero", a.fullName))
110 }
111 if a.version.Patch != 0 {
112 errs = append(errs, fmt.Errorf("%s: etcd_version patch version should be zero", a.fullName))
113 }
114 if a.version.PreRelease != "" {
115 errs = append(errs, fmt.Errorf("%s: etcd_version should not be prerelease", a.fullName))
116 }
117 if a.version.Metadata != "" {
118 errs = append(errs, fmt.Errorf("%s: etcd_version should not have metadata", a.fullName))
119 }
120 return errs
121}
122
123func (a etcdVersionAnnotation) PrintLine(out io.Writer) error {
124 if a.version == nil {

Callers 1

printEtcdVersionFunction · 0.45

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected