code: func loadConfig(c context.Context, cfgName string) (ret *Config, err error) {
  	configSet := cfgclient.CurrentServiceConfigSet(c)
  
  	var (
  		distCfg distributor.Config
  		meta    config.Meta
  	)
  	if err = cfgclient.Get(c, cfgclient.AsService, configSet, "distributors.cfg", textproto.Message(&distCfg), &meta); err != nil {
  		return
  	}
  
  	cfgVersion := meta.Revision
  	cfg, ok := distCfg.DistributorConfigs[cfgName]
  	if !ok {
  		err = fmt.Errorf("unknown distributor configuration: %q", cfgName)
  		return
  	}
  	if alias := cfg.GetAlias(); alias != nil {
  		cfg, ok = distCfg.DistributorConfigs[alias.OtherConfig]
  		if !ok {
  			err = fmt.Errorf("unknown distributor configuration: %q (via alias %q)", cfgName, alias.OtherConfig)
  			return
  		}
  		if cfg.GetAlias() != nil {
  			err = fmt.Errorf("too many levels of indirection for alias %q (points to alias %q)", cfgName, alias.OtherConfig)
  			return
  		}
  	}
  
  	dt := cfg.DistributorType
  	if dt == nil {
  		err = fmt.Errorf("blank or unrecognized distributor_type")
  		return
  	}
  	dVal := reflect.ValueOf(dt)
  
  	// All non-nil DistributorType's have a single field which is the actual oneof
  	// value.
  	implConfig := dVal.Elem().Field(0).Interface().(proto.Message)
  
  	ret = &Config{
  		info.DefaultVersionHostname(c),
  		cfgName,
  		cfgVersion,
  		implConfig,
  	}
  	return
  }
docs: // loadConfig loads the named distributor configuration from luci-config,
  // possibly using the in-memory or memcache version.