mirror of https://github.com/docker/docs.git
Refactor a little to reduce indentation
Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
parent
8fd8916b15
commit
b78823e5c3
|
|
@ -23,14 +23,14 @@ import (
|
|||
|
||||
// MainHandler is the default handler for the server
|
||||
func MainHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
|
||||
if r.Method == "GET" {
|
||||
_, err := w.Write([]byte("{}"))
|
||||
if err != nil {
|
||||
return errors.ErrUnknown.WithDetail(err)
|
||||
}
|
||||
} else {
|
||||
// For now it only supports `GET`
|
||||
if r.Method != "GET" {
|
||||
return errors.ErrGenericNotFound.WithDetail(nil)
|
||||
}
|
||||
|
||||
if _, err := w.Write([]byte("{}")); err != nil {
|
||||
return errors.ErrUnknown.WithDetail(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue