github.com/xmidt-org/webpa-common@v1.11.9/xhttp/nilConstructor.go (about)

     1  package xhttp
     2  
     3  import "net/http"
     4  
     5  // NilConstructor is an Alice-style decorator for http.Handler instances that does no decoration,
     6  // i.e. it simply returns its next handler unmodified.  This is useful in cases where returning nil
     7  // from configuration is undesireable.  Configuration code can always return a non-nil constructor,
     8  // using this function in cases where no decoration has been configured.
     9  func NilConstructor(next http.Handler) http.Handler {
    10  	return next
    11  }