// Validate ensures that the origin is correct.
Validate ensures that the origin is correct.
// Validate ensures that the origin is correct .
func (o Origin) Validate() error {
	if _, ok := origins[o]; !ok {
		return errors.NewNotValid(nil, "unknown origin")
	}
	return nil
}
func ( o Origin ) Validate ( ) error { if _ , ok := origins [ o ] ; ! ok { return errors . NewNotValid ( nil , " " ) } return nil }
Validate ensures that the origin is correct.
Validate ensures that the origin is correct .
// Ideally, only the (unavoidable) zero value would be invalid. // However, typedef'ing int means that the use of int literals // could result in invalid Type values other than the zero value.