From 1807f374ca5017747fba981e0b7a755580bc21d9 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sun, 2 Apr 2023 09:31:07 -0600 Subject: [PATCH] Formatting, long options --- cmd/webfs/main.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/webfs/main.go b/cmd/webfs/main.go index fa0717f..be76dde 100644 --- a/cmd/webfs/main.go +++ b/cmd/webfs/main.go @@ -2,30 +2,30 @@ package main import ( "flag" - "golang.org/x/net/webdav" "log" "net/http" - "strings" + "strings" + + "golang.org/x/net/webdav" ) type Handler struct { - webdav.Handler + webdav.Handler } -func (h *Handler)ServeHTTP(w http.ResponseWriter, r *http.Request) { - switch r.Method { - case "GET", "HEAD": - if strings.HasSuffix(r.URL.Path, "/") { - r.URL.Path += "index.html" - } - } - h.Handler.ServeHTTP(w, r) +func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case "GET", "HEAD": + if strings.HasSuffix(r.URL.Path, "/") { + r.URL.Path += "index.html" + } + } + h.Handler.ServeHTTP(w, r) } - func main() { - address := flag.String("a", ":8080", "Address to listen to") - directory := flag.String("d", ".", "Directory to serve") + address := flag.String("listen", ":8080", "Address to listen to") + directory := flag.String("root", ".", "Directory to serve") flag.Parse() handler := &Handler{}