Make ResponseWriter an interface
Make ResponseWriter an interface with an unexported method. Implementors must embed a ResponseWriter from elsewhere. This gives us the flexibility of an interface while allowing us to add new methods in the future.
This commit is contained in:
parent
526d232ab0
commit
3660698a4b
12
fs.go
12
fs.go
@ -33,7 +33,7 @@ type fileServer struct {
|
|||||||
fs.FS
|
fs.FS
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fs fileServer) ServeGemini(ctx context.Context, w *ResponseWriter, r *Request) {
|
func (fs fileServer) ServeGemini(ctx context.Context, w ResponseWriter, r *Request) {
|
||||||
serveFile(w, r, fs, path.Clean(r.URL.Path), true)
|
serveFile(w, r, fs, path.Clean(r.URL.Path), true)
|
||||||
}
|
}
|
||||||
|
|
||||||