// substitute updates the value of field from ext if ext contains a substitution that
// depends on a setter whose name matches s.Name.
substitute updates the value of field from ext if ext contains a substitution that
depends on a setter whose name matches s.Name.
// substitute updates the value of field from ext if ext contains a substitution that // depends on a setter whose name matches s . Name .
func (s *Set) substitute(field *yaml.RNode, ext *CliExtension) (bool, error) {
	if ext.Substitution == nil {
		return false, nil
	}
	visited := sets.String{}
	nameMatch := false
	res, err := s.substituteUtil(ext, visited, &nameMatch)
	if err != nil {
		return false, err
	}
	if !nameMatch {
		return false, nil
	}
	field.YNode().Value = res
	s are always strings
	field.YNode().Tag = yaml.NodeTagString
	return true, nil
}
func ( s * Set ) substitute ( field * yaml . RNode , ext * CliExtension ) ( bool , error ) { if ext . Substitution == nil { return false , nil } visited := sets . String { } nameMatch := false res , err := s . substituteUtil ( ext , visited , & nameMatch ) if err != nil { return false , err } if ! nameMatch { return false , nil } field . YNode ( ) . Value = res field . YNode ( ) . Tag = yaml . NodeTagString return true , nil }
substitute updates the value of field from ext if ext contains a substitution that
depends on a setter whose name matches s.Name.
substitute updates the value of field from ext if ext contains a substitution that depends on a setter whose name matches s . Name .
// check partial setters to see if they contain the setter as part of a // substitution // track the visited nodes to detect cycles in nested substitutions // nameMatch indicates if the input substitution depends on the specified setter, // the substitution in ext is parsed recursively and if the setter in Set is hit while // parsing, it indicates the match // doesn't depend on the setter, don't modify its value // substitutions are always strings