code: func callValidationHooks(validationHooks []ServiceValidationHookHandler,
  	template *gocf.Template,
  	ctx *workflowContext) error {
  
  	var marshaledTemplate []byte
  	if len(validationHooks) != 0 {
  		jsonBytes, jsonBytesErr := json.Marshal(template)
  		if jsonBytesErr != nil {
  			return errors.Wrapf(jsonBytesErr, "Failed to marshal template for validation")
  		}
  		marshaledTemplate = jsonBytes
  	}
  
  	for _, eachHook := range validationHooks {
  		// Run the hook
  		ctx.logger.WithFields(logrus.Fields{
  			"Phase":                 "Validation",
  			"ValidationHookContext": ctx.context.workflowHooksContext,
  		}).Info("Calling WorkflowHook")
  
  		var loopTemplate gocf.Template
  		unmarshalErr := json.Unmarshal(marshaledTemplate, &loopTemplate)
  		if unmarshalErr != nil {
  			return errors.Wrapf(unmarshalErr,
  				"Failed to unmarshal read-only copy of template for Validation")
  		}
  
  		hookErr := eachHook.ValidateService(ctx.context.workflowHooksContext,
  			ctx.userdata.serviceName,
  			&loopTemplate,
  			ctx.userdata.s3Bucket,
  			codeZipKey(ctx.context.s3CodeZipURL),
  			ctx.userdata.buildID,
  			ctx.context.awsSession,
  			ctx.userdata.noop,
  			ctx.logger)
  		if hookErr != nil {
  			return errors.Wrapf(hookErr, "Service failed to pass validation")
  		}
  	}
  	return nil
  }
docs: // Encapsulate calling the validation hooks