mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-14 11:03:09 +02:00
d6916e8953
* Add entryPointPath option
* Integration tests for golangBuild
* Revert "Add entryPointPath option"
This reverts commit b541e64a4f
.
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
21 lines
293 B
Go
21 lines
293 B
Go
package middlewares
|
|
|
|
import "net/http"
|
|
|
|
type Middleware func(http.HandlerFunc) http.HandlerFunc
|
|
|
|
func MultipleMiddleware(h http.HandlerFunc, m ...Middleware) http.HandlerFunc {
|
|
|
|
if len(m) < 1 {
|
|
return h
|
|
}
|
|
|
|
wrapped := h
|
|
|
|
for i := range m {
|
|
wrapped = m[i](wrapped)
|
|
}
|
|
|
|
return wrapped
|
|
}
|