package auth import ( "net/http" "net/url" "strings" "testing" ) type handlerStruct struct{} func (hs *handlerStruct) ServeHTTP(w http.ResponseWriter, req *http.Request) { req.ParseForm() // Router does this in non-tests if strings.HasPrefix(req.URL.Path, "/auth") { Handler.Handle("/auth", w, req, nil) return } } func TestHandler(t *testing.T) { auther := testAuther{FullName: "Test"} Register(&auther) form := url.Values{} form.Set("username", "Test") form.Set("password", "stuff'nthings") t.Run("Register", func(t *testing.T) { }) }