diff options
| author | hhvn <dev@hhvn.uk> | 2023-11-19 14:50:51 +0000 |
|---|---|---|
| committer | hhvn <dev@hhvn.uk> | 2023-11-19 14:50:51 +0000 |
| commit | 3776ecd92be2886b2b9d41c2b78cc2adf46e14e6 (patch) | |
| tree | ef53828da24fe5a571d84ab4a80c7a652bf20027 | |
| parent | f5e80f5bdcf43b7974064168c3eb0d4e993528df (diff) | |
Prevent common.FileAsLines creating a phantom line
| -rw-r--r-- | common/common.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |