From 2a224984a5c52da83691242dce63499e4cc67d8f Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 25 Aug 2019 21:18:43 +0200 Subject: [PATCH] Add case: Line ends with hash and has no comment Signed-off-by: Knut Ahlers --- provider_hostFile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider_hostFile.go b/provider_hostFile.go index 2bcbe46..0403037 100644 --- a/provider_hostFile.go +++ b/provider_hostFile.go @@ -27,7 +27,7 @@ func (p providerHostFile) GetDomainList(d providerDefinition) ([]entry, error) { var ( entries []entry - matcher = regexp.MustCompile(`^(?:[0-9.]+|[a-z0-9:]+)\s+([^\s]+)(?:\s+#(.+))?$`) + matcher = regexp.MustCompile(`^(?:[0-9.]+|[a-z0-9:]+)\s+([^\s]+)(?:\s+#(.+)|\s+#)?$`) ) scanner := bufio.NewScanner(r)