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:
Adnan Maolood
2021-02-24 00:13:44 -05:00
parent 526d232ab0
commit 3660698a4b
5 changed files with 92 additions and 65 deletions

View File

@@ -8,7 +8,7 @@ import (
type nopHandler struct{}
func (*nopHandler) ServeGemini(context.Context, *ResponseWriter, *Request) {}
func (*nopHandler) ServeGemini(context.Context, ResponseWriter, *Request) {}
func TestServeMuxMatch(t *testing.T) {
type Match struct {