func (v *Value) UnmarshalYAML(unmarshal func(interface{}) error) error {
	var valueString string
	stringCandidate := marshal.UnmarshalCandidate{
		Unmarshal: func() error { return unmarshal(&valueString) },
		Assign:    func() { *v = Value{Value: valueString} },
	}

	type valueType Value // Use new type to avoid recursion
	var valueItem valueType
	valueCandidate := marshal.UnmarshalCandidate{
		Unmarshal: func() error { return unmarshal(&valueItem) },
		Assign:    func() { *v = Value(valueItem) },
		Validate: func() error {
			if valueItem.Value != "" && valueItem.Command != "" {
				return fmt.Errorf(
					"value (%s) and command (%s) are both defined",
					valueItem.Value, valueItem.Command,
				)
			}

			return nil
		},
	}

	return marshal.UnmarshalOneOf(stringCandidate, valueCandidate)
}
// UnmarshalYAML allows plain strings to represent a full struct. The value of
// the string is used as the Default field.
UnmarshalYAML allows plain strings to represent a full struct. The value of
the string is used as the Default field.
// UnmarshalYAML allows plain strings to represent a full struct . The value of // the string is used as the Default field .
func (v *Value) UnmarshalYAML(unmarshal func(interface{}) error) error {
	var valueString string
	stringCandidate := marshal.UnmarshalCandidate{
		Unmarshal: func() error { return unmarshal(&valueString) },
		Assign:    func() { *v = Value{Value: valueString} },
	}
	type valueType Value 
	var valueItem valueType
	valueCandidate := marshal.UnmarshalCandidate{
		Unmarshal: func() error { return unmarshal(&valueItem) },
		Assign:    func() { *v = Value(valueItem) },
		Validate: func() error {
			if valueItem.Value != "" && valueItem.Command != "" {
				return fmt.Errorf(
					"value (%s) and command (%s) are both defined",
					valueItem.Value, valueItem.Command,
				)
			}
			return nil
		},
	}
	return marshal.UnmarshalOneOf(stringCandidate, valueCandidate)
}
func ( v * Value ) UnmarshalYAML ( unmarshal func ( interface { } ) error ) error { var valueString string stringCandidate := marshal . UnmarshalCandidate { Unmarshal : func ( ) error { return unmarshal ( & valueString ) } , Assign : func ( ) { * v = Value { Value : valueString } } , } type valueType Value var valueItem valueType valueCandidate := marshal . UnmarshalCandidate { Unmarshal : func ( ) error { return unmarshal ( & valueItem ) } , Assign : func ( ) { * v = Value ( valueItem ) } , Validate : func ( ) error { if valueItem . Value != " " && valueItem . Command != " " { return fmt . Errorf ( " " , valueItem . Value , valueItem . Command , ) } return nil } , } return marshal . UnmarshalOneOf ( stringCandidate , valueCandidate ) }
UnmarshalYAML allows plain strings to represent a full struct.
UnmarshalYAML allows plain strings to represent a full struct .
// Use new type to avoid recursion