如何在一个特定的处理程序中包装FileServer和HTTP api

我为http api和fileSystem定义了自己的路由器。但是这两个处理程序没有相同的类型格式,应如何将它们合并为一个特定类型?

type App struct {
    mux      customRouter
    mw       []Middleware
}

func (a *App) Handle(verb, path string, handler Handler, mw ...Middleware) {

    // First wrap handler specific middleware around this handler.
    handler = wrapMiddleware(mw, handler)

    // The function to execute for each request.
    h := func(w http.ResponseWriter, r *http.Request) {
        ...
    }

    // Add this handler for the specified verb and route.
    a.mux.MethodFunc(verb, path, h)
}

func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    a.och.ServeHTTP(w, r)
}


// the api handler type format
// type Handler func(ctx context.Context, w http.ResponseWriter, r *http.Request) error
// the filesystem handler type format
// type Handler func(ctx context.Context, root http.FileSystem) error
// want:
// app.Handle(verb, path, func(ctx context.Context, w http.ResponseWriter, r *http.Request)...)
// app.Handle(verb, path, func(ctx context.Context, root http.FileSystem)...)