From a9c81d38f929248bda23e6d558ffefce2e3e29f9 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 15 Mar 2016 23:52:44 -0400 Subject: [PATCH] Allow comments to appear anywhere on a line in the auth file --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 4846e6b..05171a8 100644 --- a/main.go +++ b/main.go @@ -43,8 +43,8 @@ func main() { lines := strings.Split(string(data[:size]), "\n") for _, line := range lines { - if strings.HasPrefix(line, "#") { - continue + if i := strings.IndexRune(line, '#'); i > -1 { + line = line[:i] } fields := strings.Fields(line)