code: func (sdk *FabricSDK) loadEndpointConfig(configBackend ...core.ConfigBackend) (fab.EndpointConfig, error) {
  	endpointConfigOpt, ok := sdk.opts.endpointConfig.(*fabImpl.EndpointConfigOptions)
  
  	// if optional endpoint was nil or not all of its sub interface functions were overridden,
  	// then get default endpoint config and override the functions that were not overridden by opts
  	if sdk.opts.endpointConfig == nil || (ok && !fabImpl.IsEndpointConfigFullyOverridden(endpointConfigOpt)) {
  		defEndpointConfig, err := fabImpl.ConfigFromBackend(configBackend...)
  		if err != nil {
  			return nil, errors.WithMessage(err, "failed to initialize endpoint config from config backend")
  		}
  
  		// if opts.endpointConfig was not provided during WithEndpointConfig(opts...) call, then return default endpointConfig
  		if sdk.opts.endpointConfig == nil {
  			return defEndpointConfig, nil
  		}
  		// else fill any empty interface from opts with defEndpointConfig interface (set default function for ones not provided by WithEndpointConfig() call) and return
  		return fabImpl.UpdateMissingOptsWithDefaultConfig(endpointConfigOpt, defEndpointConfig), nil
  	}
  	// if optional endpoint config was completely overridden but !ok, then return an error
  	if !ok {
  		return nil, errors.New("failed to retrieve config endpoint from opts")
  	}
  	return endpointConfigOpt, nil
  }
docs: //loadEndpointConfig loads config from config backend when configs are not provided through opts or override missing interfaces from opts with config backend