Simplify code

- Removed redundant returns
- Implicitly declare httptest.Server
pull/118/head
Christian Muehlhaeuser 2019-08-08 09:16:55 +00:00 committed by mattn
parent 24cdbe8c3d
commit 20bc690d8d
2 changed files with 1 additions and 5 deletions

View File

@ -16,7 +16,6 @@ func TestGetAccount(t *testing.T) {
return
}
fmt.Fprintln(w, `{"username": "zzz"}`)
return
}))
defer ts.Close()
@ -48,7 +47,6 @@ func TestGetAccountCurrentUser(t *testing.T) {
return
}
fmt.Fprintln(w, `{"username": "zzz"}`)
return
}))
defer ts.Close()
@ -80,7 +78,6 @@ func TestAccountUpdate(t *testing.T) {
return
}
fmt.Fprintln(w, `{"username": "zzz"}`)
return
}))
defer ts.Close()

View File

@ -14,8 +14,7 @@ import (
)
func TestCmdStream(t *testing.T) {
var ts *httptest.Server
ts = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/api/v1/streaming/public/local" {
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
return