Adjust the import package order and use http library variables (#9587)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
This commit is contained in:
parent
fbdbc24a42
commit
1cdd61fb94
6 changed files with 7 additions and 7 deletions
|
|
@ -122,7 +122,7 @@ func TestNginxCheck(t *testing.T) {
|
|||
}
|
||||
|
||||
func callHealthz(expErr bool, healthzPath string, mux *http.ServeMux) error {
|
||||
req, err := http.NewRequest("GET", healthzPath, nil)
|
||||
req, err := http.NewRequest(http.MethodGet, healthzPath, nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("healthz error: %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ func TestConfigureDynamically(t *testing.T) {
|
|||
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
|
||||
if r.Method != "POST" {
|
||||
if r.Method != http.MethodPost {
|
||||
t.Errorf("expected a 'POST' request, got '%s'", r.Method)
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ func TestConfigureCertificates(t *testing.T) {
|
|||
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
|
||||
if r.Method != "POST" {
|
||||
if r.Method != http.MethodPost {
|
||||
t.Errorf("expected a 'POST' request, got '%s'", r.Method)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue