From d90994408fed47a8fb7a2d82e2f751d8da7067e4 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 4 Jun 2022 16:20:04 +0100 Subject: Generate destinations with a regular expression --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 71d40de..10e1703 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,7 @@ import ( "net/http" "os" "os/signal" + "regexp" "time" "golang.org/x/sys/unix" @@ -33,7 +34,7 @@ func main() { done := make(chan os.Signal, 1) signal.Notify(done, os.Interrupt, unix.SIGTERM) - srv := http.Server{Handler: &redirector{*from, *to, *vcs}} + srv := http.Server{Handler: &redirector{regexp.MustCompile(*from), *to, *vcs}} go func() { ln, err := listenSD() if err != nil { -- cgit v1.2.3-70-g09d2