From 2347bcfd2f6c84779cc6d84c4ee0f597e75cd209 Mon Sep 17 00:00:00 2001 From: Kwonunn Date: Sat, 15 Jun 2024 22:07:24 +0200 Subject: [PATCH] Make go generate work on Windows --- build/go-generate/updateProtectedUrls.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/go-generate/updateProtectedUrls.go b/build/go-generate/updateProtectedUrls.go index c446f0f..da74cfe 100644 --- a/build/go-generate/updateProtectedUrls.go +++ b/build/go-generate/updateProtectedUrls.go @@ -4,10 +4,11 @@ package main import ( "fmt" - "golang.org/x/exp/slices" "os" "regexp" "strings" + + "golang.org/x/exp/slices" ) const fileSetup = "../../internal/webserver/Webserver.go" @@ -95,7 +96,7 @@ func writeDocumentationFile(urls []string) { for _, url := range urls { output = output + "- ``" + url + "``\n" } - regex := regexp.MustCompile(`proxy:\n+((?:- ` + "``" + `\/\w+` + "``" + `\n)+)`) + regex := regexp.MustCompile(`proxy:(?:\r?\n)+((?:- ` + "``" + `\/\w+` + "``" + `\r?\n)+)`) matches := regex.FindAllIndex(documentationContent, -1) if len(matches) != 1 { fmt.Println("ERROR: Not one match found exactly for documentation")