code: func (pa *AuthorityImpl) SetHostnamePolicyFile(f string) error {
  	var loadHandler func([]byte) error
  	if strings.HasSuffix(f, ".json") {
  		loadHandler = pa.loadHostnamePolicy(json.Unmarshal)
  	} else if strings.HasSuffix(f, ".yml") || strings.HasSuffix(f, ".yaml") {
  		loadHandler = pa.loadHostnamePolicy(yaml.Unmarshal)
  	} else {
  		return fmt.Errorf(
  			"Hostname policy file %q has unknown extension. Supported: .yml,.yaml,.json",
  			f)
  	}
  	if _, err := reloader.New(f, loadHandler, pa.hostnamePolicyLoadError); err != nil {
  		return err
  	}
  	return nil
  }
docs: // SetHostnamePolicyFile will load the given policy file, returning error if it
  // fails. It will also start a reloader in case the file changes. It supports
  // YAML and JSON serialization formats and chooses the correct unserialization
  // method based on the file extension which must be ".yaml", ".yml", or ".json".