code: func ValidateAndExecuteDirectives(cdyfile Input, inst *Instance, justValidate bool) error {
  
  	// If parsing only inst will be nil, create an instance for this function call only.
  	if justValidate {
  		inst = &Instance{serverType: cdyfile.ServerType(), wg: new(sync.WaitGroup)}
  	}
  
  	stypeName := cdyfile.ServerType()
  
  	stype, err := getServerType(stypeName)
  	if err != nil {
  		return err
  	}
  
  	inst.caddyfileInput = cdyfile
  
  	sblocks, err := loadServerBlocks(stypeName, cdyfile.Path(), bytes.NewReader(cdyfile.Body()))
  	if err != nil {
  		return err
  	}
  
  	inst.context = stype.NewContext()
  	if inst.context == nil {
  		return fmt.Errorf("server type %s produced a nil Context", stypeName)
  	}
  
  	sblocks, err = inst.context.InspectServerBlocks(cdyfile.Path(), sblocks)
  	if err != nil {
  		return err
  	}
  
  	err = executeDirectives(inst, cdyfile.Path(), stype.Directives(), sblocks, justValidate)
  	if err != nil {
  		return err
  	}
  
  	return nil
  
  }
docs: // ValidateAndExecuteDirectives will load the server blocks from cdyfile
  // by parsing it, then execute the directives configured by it and store
  // the resulting server blocks into inst. If justValidate is true, parse
  // callbacks will not be executed between directives, since the purpose
  // is only to check the input for valid syntax.