From 3776ecd92be2886b2b9d41c2b78cc2adf46e14e6 Mon Sep 17 00:00:00 2001 From: hhvn Date: Sun, 19 Nov 2023 14:50:51 +0000 Subject: Prevent common.FileAsLines creating a phantom line --- common/common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/common.go b/common/common.go index 1156ee8..4f7d91a 100644 --- a/common/common.go +++ b/common/common.go @@ -29,7 +29,7 @@ func FileAsLines(file string) ([]string, error) { content, err := io.ReadAll(f) if err != nil { return nil, err } - lines := strings.Split(string(content), "\n") + lines := strings.Split(strings.TrimSuffix(string(content), "\n"), "\n") return lines, nil } -- cgit v1.2.3