code: func (b *Builder) BuildChain(ctx context.Context, middlewares []string) *alice.Chain {
  	chain := alice.New()
  	for _, name := range middlewares {
  		middlewareName := internal.GetQualifiedName(ctx, name)
  
  		chain = chain.Append(func(next http.Handler) (http.Handler, error) {
  			constructorContext := internal.AddProviderInContext(ctx, middlewareName)
  			if _, ok := b.configs[middlewareName]; !ok {
  				return nil, fmt.Errorf("middleware %q does not exist", middlewareName)
  			}
  
  			var err error
  			if constructorContext, err = checkRecursion(constructorContext, middlewareName); err != nil {
  				return nil, err
  			}
  
  			constructor, err := b.buildConstructor(constructorContext, middlewareName, *b.configs[middlewareName])
  			if err != nil {
  				return nil, fmt.Errorf("error during instanciation of %s: %v", middlewareName, err)
  			}
  			return constructor(next)
  		})
  	}
  	return &chain
  }
docs: // BuildChain creates a middleware chain